feat(nvim): add terraform and bash language servers

This commit is contained in:
mandlm 2022-06-22 22:09:56 +02:00
parent 8d1dea31b2
commit 6bd007ed86
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
3 changed files with 13 additions and 4 deletions

View File

@ -28,6 +28,9 @@
# LSP # LSP
sumneko-lua-language-server sumneko-lua-language-server
rnix-lsp rnix-lsp
terraform-ls
tflint
nodePackages.bash-language-server
]; ];
stateVersion = "22.05"; stateVersion = "22.05";

View File

@ -45,6 +45,7 @@ local capabilities = vim.tbl_extend("keep", vim.lsp.protocol.make_client_capabil
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
local servers = { local servers = {
["bashls"] = {},
["sumneko_lua"] = { ["sumneko_lua"] = {
Lua = { Lua = {
diagnostics = { diagnostics = {
@ -56,6 +57,8 @@ local servers = {
}, },
}, },
["rnix"] = {}, ["rnix"] = {},
["terraformls"] = {},
["tflint"] = {},
} }
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")

View File

@ -11,13 +11,16 @@ local luasnip = require("luasnip")
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) luasnip.lsp_expand(args.body)
end end
}, },
sources = require("cmp").config.sources({ sources = require("cmp").config.sources({
{ name = "nvim_lsp" }, { name = "luasnip" }, { name = "path" }, { name = "nvim_lsp" },
{ name = "buffer" }, { name = "git" }, { name = "nvim-lua" }, { name = "luasnip" },
{ name = "calc" } { name = "path" },
{ name = "buffer" },
{ name = "nvim-lua" },
{ name = "calc" },
}), }),
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),