From 74de7af4d68e765a5f2641761bc78138e70e9725 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Tue, 10 Jan 2023 19:39:41 +0100 Subject: Add null-ls to neovim --- .config/nvim/lua/lsp.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to '.config/nvim/lua/lsp.lua') diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 9f9253a..ff46794 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -217,6 +217,29 @@ require("lspconfig").cssls.setup({ on_attach = on_attach; }) +local null_ls = require("null-ls") + +null_ls.setup({ + sources = { + null_ls.builtins.diagnostics.eslint, + null_ls.builtins.formatting.eslint, + null_ls.builtins.formatting.lua_format, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.rustfmt, + null_ls.builtins.code_actions.shellcheck, + null_ls.builtins.completion.spell, + null_ls.builtins.diagnostics.tsc, + null_ls.builtins.formatting.deno_fmt, + null_ls.builtins.code_actions.gitsigns.with({ + config = { + filter_actions = function(title) + return title:lower():match("blame") == nil -- filter out blame actions + end, + }, + }) + }, +}) + vim.diagnostic.config({ virtual_text = false; signs = true; -- cgit v1.2.3