mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-26 02:38:45 +02:00
Updated 7. Example Custom Plugins (markdown)
parent
e7987ca57f
commit
42c7a73310
1 changed files with 6 additions and 7 deletions
|
@ -3143,11 +3143,12 @@ return {
|
|||
```lua
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
enabled = pcode.disable_null_ls or false,
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = function()
|
||||
opts = function(_, opts)
|
||||
local mason_reg = require("mason-registry")
|
||||
|
||||
local linters_by_ft = {}
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
|
||||
-- add diff langue vs filetype
|
||||
local keymap = {
|
||||
|
@ -3221,18 +3222,16 @@ return {
|
|||
if name_map[pkg.spec.name] ~= nil then
|
||||
pkg.spec.name = name_map[pkg.spec.name]
|
||||
end
|
||||
linters_by_ft[ftl] = linters_by_ft[ftl] or {}
|
||||
table.insert(linters_by_ft[ftl], pkg.spec.name)
|
||||
opts.linters_by_ft[ftl] = opts.linters_by_ft[ftl] or {}
|
||||
table.insert(opts.linters_by_ft[ftl], pkg.spec.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return linters_by_ft
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("lint").linters_by_ft = opts
|
||||
require("lint").linters_by_ft = opts.linters_by_ft
|
||||
end,
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue