diff --git a/home/editor/neovim/plugins.lua b/home/editor/neovim/plugins.lua index dfbe7e5..0bfc100 100644 --- a/home/editor/neovim/plugins.lua +++ b/home/editor/neovim/plugins.lua @@ -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({