2023-04-10 01:05:25 +02:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2023-05-28 18:23:25 +02:00
|
|
|
-- disable (c)spell initially
|
2023-04-10 01:05:25 +02:00
|
|
|
null_ls.disable("cspell")
|
2023-05-28 18:23:25 +02:00
|
|
|
null_ls.disable("spell")
|
2023-04-10 01:05:25 +02:00
|
|
|
|
|
|
|
-- make sources toggle able
|
|
|
|
require("which-key").register({
|
|
|
|
n = {
|
|
|
|
name = "null-ls",
|
|
|
|
s = {
|
|
|
|
function()
|
2023-05-28 18:23:25 +02:00
|
|
|
null_ls.toggle("spell")
|
2023-04-10 01:05:25 +02:00
|
|
|
end,
|
2023-05-28 18:23:25 +02:00
|
|
|
"spell",
|
2023-04-10 01:05:25 +02:00
|
|
|
},
|
|
|
|
S = {
|
|
|
|
function()
|
2023-05-28 18:23:25 +02:00
|
|
|
null_ls.toggle("cspell")
|
2023-04-10 01:05:25 +02:00
|
|
|
end,
|
2023-05-28 18:23:25 +02:00
|
|
|
"cspell",
|
2023-04-10 01:05:25 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}, { prefix = "<leader>t" })
|