mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
NVIM
- Plugin file names changed - Plugins reorged into files more logically
This commit is contained in:
36
common/.config/nvim/lua/plugins/code-lint.lua
Normal file
36
common/.config/nvim/lua/plugins/code-lint.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
lazy = true,
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
-- Linters are only required for dynamically typed languages
|
||||
lint.linters_by_ft = {
|
||||
python = { "pylint", "codespell" },
|
||||
markdown = { "markdownlint", "codespell" },
|
||||
yaml = { "yamllint" },
|
||||
lua = { "codespell" },
|
||||
bash = { "codespell" },
|
||||
sh = { "codespell" },
|
||||
zsh = { "codespell" },
|
||||
typescript = { "codespell" },
|
||||
javascript = { "codespell" },
|
||||
typescriptreact = { "codespell" },
|
||||
javascriptreact = { "codespell" },
|
||||
html = { "codespell" },
|
||||
["*"] = { "codespell" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user