feat(nvim): add null ls
parent
e154f827fd
commit
7b9674969a
|
@ -49,14 +49,17 @@ in
|
|||
extraPackages = with pkgs; [
|
||||
alejandra
|
||||
black
|
||||
deadnix
|
||||
isort
|
||||
jq
|
||||
nil
|
||||
nixpkgs-fmt
|
||||
nodePackages.bash-language-server
|
||||
nodePackages.cspell
|
||||
rustfmt
|
||||
shellcheck
|
||||
shfmt
|
||||
statix
|
||||
stylua
|
||||
sumneko-lua-language-server
|
||||
taplo
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- Code actions
|
||||
null_ls.builtins.code_actions.cspell,
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.code_actions.statix,
|
||||
-- Completion
|
||||
null_ls.builtins.completion.spell,
|
||||
-- Diagnostics
|
||||
null_ls.builtins.diagnostics.cspell,
|
||||
null_ls.builtins.diagnostics.deadnix,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
null_ls.builtins.diagnostics.statix,
|
||||
},
|
||||
})
|
||||
|
||||
-- disable cspell initially
|
||||
null_ls.disable("cspell")
|
||||
|
||||
-- make sources toggle able
|
||||
require("which-key").register({
|
||||
n = {
|
||||
name = "null-ls",
|
||||
c = {
|
||||
function()
|
||||
null_ls.toggle("cspell")
|
||||
end,
|
||||
"cspell",
|
||||
},
|
||||
g = {
|
||||
function()
|
||||
null_ls.toggle("gitsigns")
|
||||
end,
|
||||
"gitsigns",
|
||||
},
|
||||
s = {
|
||||
function()
|
||||
null_ls.toggle("shellcheck")
|
||||
end,
|
||||
"shellcheck",
|
||||
},
|
||||
S = {
|
||||
function()
|
||||
null_ls.toggle("statix")
|
||||
end,
|
||||
"statix",
|
||||
},
|
||||
d = {
|
||||
function()
|
||||
null_ls.toggle("deadnix")
|
||||
end,
|
||||
"deadnix",
|
||||
},
|
||||
},
|
||||
}, { prefix = "<leader>t" })
|
Loading…
Reference in New Issue