mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-26 10:48:40 +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
|
```lua
|
||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
|
enabled = pcode.disable_null_ls or false,
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
opts = function()
|
opts = function(_, opts)
|
||||||
local mason_reg = require("mason-registry")
|
local mason_reg = require("mason-registry")
|
||||||
|
|
||||||
local linters_by_ft = {}
|
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||||
|
|
||||||
-- add diff langue vs filetype
|
-- add diff langue vs filetype
|
||||||
local keymap = {
|
local keymap = {
|
||||||
|
@ -3221,18 +3222,16 @@ return {
|
||||||
if name_map[pkg.spec.name] ~= nil then
|
if name_map[pkg.spec.name] ~= nil then
|
||||||
pkg.spec.name = name_map[pkg.spec.name]
|
pkg.spec.name = name_map[pkg.spec.name]
|
||||||
end
|
end
|
||||||
linters_by_ft[ftl] = linters_by_ft[ftl] or {}
|
opts.linters_by_ft[ftl] = opts.linters_by_ft[ftl] or {}
|
||||||
table.insert(linters_by_ft[ftl], pkg.spec.name)
|
table.insert(opts.linters_by_ft[ftl], pkg.spec.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return linters_by_ft
|
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("lint").linters_by_ft = opts
|
require("lint").linters_by_ft = opts.linters_by_ft
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
Add table
Add a link
Reference in a new issue