feat(nvim): add null ls
This commit is contained in:
parent
e154f827fd
commit
7b9674969a
2 changed files with 61 additions and 0 deletions
58
modules/programs/nvim/plugins/null-ls-nvim.lua
Normal file
58
modules/programs/nvim/plugins/null-ls-nvim.lua
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue