nvim-config/lua/configs/lspconfig.lua

36 lines
816 B
Lua
Raw Normal View History

2024-04-16 09:49:51 +00:00
local configs = require "nvchad.configs.lspconfig"
2024-04-08 09:26:41 +00:00
local on_attach = configs.on_attach
local on_init = configs.on_init
local capabilities = configs.capabilities
2023-08-24 11:54:45 +00:00
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
2024-04-16 09:49:51 +00:00
local servers = { "html", "cssls", "tsserver", "yamlls", "ansiblels", "bashls", "rls" }
2023-08-24 11:54:45 +00:00
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
2024-04-16 09:49:51 +00:00
on_init = on_init,
2024-04-17 09:13:05 +00:00
capabilities = {
textDocument = {
completion = {
completionItem = {
snippetSupport = false,
},
},
},
},
2023-08-24 11:54:45 +00:00
}
end
2024-04-17 09:13:05 +00:00
2024-04-17 13:37:16 +00:00
require("cmp").setup {
sources = {
{ name = "buffer" },
{ name = "path" },
{ name = "nvim_lsp" },
2024-05-05 16:47:30 +00:00
{ name = "rg", keyword_length = 4 },
2024-04-17 13:37:16 +00:00
},
}