Add lsp for .nix

This commit is contained in:
Torjus Håkestad 2024-03-05 22:33:29 +01:00
parent 89362838dc
commit 405080b22d

View File

@ -7,7 +7,19 @@ lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr})
end)
require('lspconfig').gopls.setup({
lsp_zero.format_on_save({
format_opts = {
async = false,
timeout_ms = 10000,
},
servers = {
['gopls'] = {'go'},
['nil_ls'] = {'nix'},
},
})
local lspconfig = require('lspconfig')
lspconfig.gopls.setup({
settings = {
gopls = {
analyses = {
@ -19,6 +31,17 @@ require('lspconfig').gopls.setup({
}
})
lspconfig.nil_ls.setup({
autostart = true,
settings = {
['nil'] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
})
-- Telescope
require('telescope').setup({