dotfiles/dot-config/nvim/lua/configs/lspconfig.lua

30 lines
689 B
Lua
Raw Normal View History

2024-10-25 11:48:49 +00:00
-- EXAMPLE
local on_attach = require("nvchad.configs.lspconfig").on_attach
local on_init = require("nvchad.configs.lspconfig").on_init
local capabilities = require("nvchad.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "gopls" }
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
end
-- typescript
lspconfig.ts_ls.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
lspconfig.pyright.setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"python"},
})