nvim config
This commit is contained in:
parent
cdfac4d089
commit
9051320319
13 changed files with 399 additions and 0 deletions
40
.dotfiles/nvchad/custom/configs/lspconfig.lua
Normal file
40
.dotfiles/nvchad/custom/configs/lspconfig.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
local on_attach = require("plugins.configs.lspconfig").on_attach
|
||||
local capabilities = require("plugins.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
local util = require "lspconfig/util"
|
||||
|
||||
-- if you just want default config for the servers then put them in a table
|
||||
local servers = { "html", "cssls", "tsserver", "clangd", "lua_ls"}
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- setup gopls manually
|
||||
lspconfig.gopls.setup {
|
||||
-- use defaults from lspconfig
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
-- server to use
|
||||
cmd = {"gopls"},
|
||||
-- files to run this server on
|
||||
filetypes = {"go", "gomod", "gowork", "gotmpl"},
|
||||
-- how to define the root directory
|
||||
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
-- settings
|
||||
settings = {
|
||||
gopls = {
|
||||
-- complete imports automatically
|
||||
completeUnimported = true,
|
||||
-- use placeholders during autocompletion
|
||||
usePlaceholders = true,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
--
|
||||
-- lspconfig.pyright.setup { blabla}
|
Loading…
Add table
Add a link
Reference in a new issue