mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore(nvim): simplify configuration
This commit is contained in:
@@ -6,10 +6,19 @@ return {
|
||||
"BufWritePre",
|
||||
"BufNewFile",
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>L",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
desc = "Trigger linting for current file",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
events = { "BufEnter", "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters_by_ft = {
|
||||
astro = { "eslint_d" },
|
||||
javascript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
@@ -17,18 +26,6 @@ return {
|
||||
svelte = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
}
|
||||
|
||||
local lint_augrup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augrup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>L", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user