From 52739493c4fe31347488c8b56228dce721fadf91 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 10 Apr 2023 19:34:22 +0100 Subject: Adapts LSP so it is less reliant on Mason --- nvim/after/plugin/lsp.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index c54e03b..8005ccc 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -65,3 +65,30 @@ vim.diagnostic.config({ virtual_text = true }) +-- rnix config + +local lspconfig = require'lspconfig' +lspconfig.nil_ls.setup{ + autostart = true, + capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), + cmd = vim.env.NIL_LSP_PATH, + settings = { + rootMarkers = {".git/"}, + languages = { + nix = { + formatters = { + { + exe = "nixpkgs-fmt", + args = {} + } + }, + linters = { + { + exe = "nil_lsp", + args = {} + } + } + } + } + } +} -- cgit v1.2.3