cspell works with config cspell.json file
This commit is contained in:
parent
affc222edc
commit
40ad8e50cd
2 changed files with 20 additions and 15 deletions
|
|
@ -1 +1 @@
|
||||||
{"words":["nvim","builtins","stylua","rustfmt"],"flagWords":[],"version":"0.2","language":"en"}
|
{"flagWords":[],"words":["nvim","builtins","stylua","rustfmt"],"version":"0.2","language":"en"}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,20 @@
|
||||||
-- npm install -g cspell@latest
|
-- npm install -g cspell@latest
|
||||||
|
|
||||||
|
local output = vim.fn.system {
|
||||||
|
|
||||||
local output = vim.fn.system({
|
|
||||||
"command",
|
"command",
|
||||||
"-v",
|
"-v",
|
||||||
"cspell"
|
"cspell",
|
||||||
})
|
}
|
||||||
if output == nil or output == "" then
|
if output == nil or output == "" then
|
||||||
-- if v:shell_error != 0 then
|
-- if v:shell_error != 0 then
|
||||||
vim.fn.system({
|
vim.fn.system {
|
||||||
"npm",
|
"npm",
|
||||||
"install",
|
"install",
|
||||||
"-g",
|
"-g",
|
||||||
"cspell@latest"
|
"cspell@latest",
|
||||||
})
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
opts = function(_, config)
|
opts = function(_, config)
|
||||||
|
|
@ -33,11 +29,20 @@ return {
|
||||||
null_ls.builtins.formatting.stylua,
|
null_ls.builtins.formatting.stylua,
|
||||||
null_ls.builtins.formatting.prettier,
|
null_ls.builtins.formatting.prettier,
|
||||||
null_ls.builtins.formatting.rustfmt,
|
null_ls.builtins.formatting.rustfmt,
|
||||||
null_ls.builtins.diagnostics.cspell,
|
null_ls.builtins.code_actions.gitsigns,
|
||||||
null_ls.builtins.code_actions.cspell,
|
-- null_ls.builtins.code_actions.proselint, -- TODO looks interesting
|
||||||
|
null_ls.builtins.code_actions.cspell.with {
|
||||||
|
config = {
|
||||||
|
find_json = function() return vim.fn.findfile("cspell.json", vim.fn.environ().HOME .. "/.config/nvim/lua/user/;") end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
null_ls.builtins.diagnostics.cspell.with {
|
||||||
|
extra_args = { "--config", "~/.config/nvim/lua/user/cspell.json" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
config.update_in_insert = true;
|
config.update_in_insert = true
|
||||||
|
|
||||||
return config -- return final config table
|
return config -- return final config table
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue