🐛 fix(nvim): cspell, typos and white_space are now dynamically added
This commit is contained in:
parent
a5b271fec2
commit
fcae01ad40
3 changed files with 26 additions and 26 deletions
|
@ -1,8 +1,8 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
["_"] = { "trim_whitespace" },
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft["_"] = opts.formatters_by_ft["_"] or {}
|
||||
table.insert(opts.formatters_by_ft["_"], "trim_whitespace")
|
||||
return opts
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -8,12 +8,11 @@ return {
|
|||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
["*"] = { "cspell" },
|
||||
},
|
||||
linters = {
|
||||
cspell = {
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft["*"] = opts.linters_by_ft["*"] or {}
|
||||
table.insert(opts.linters_by_ft["*"], "cspell")
|
||||
|
||||
opts.linters.cspell = {
|
||||
condition = function(ctx)
|
||||
if vim.fs.find({ "cspell.json" }, { path = ctx.filename, upward = true })[1] then
|
||||
-- stylua: ignore
|
||||
|
@ -23,8 +22,9 @@ return {
|
|||
return false
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@ return {
|
|||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
["*"] = { "typos" },
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft["*"] = opts.linters_by_ft["*"] or {}
|
||||
table.insert(opts.linters_by_ft["*"], "typos")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue