nvim config

This commit is contained in:
Felipe M 2024-01-31 11:26:31 +01:00
parent cdfac4d089
commit 9051320319
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
13 changed files with 399 additions and 0 deletions

View 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}