LunarVim/lua/core/linter.lua

34 lines
583 B
Lua
Raw Normal View History

2021-07-17 00:30:38 +02:00
local M = {}
M.setup = function()
if O.lint_on_save then
require("lv-utils").define_augroups {
autolint = {
{
"BufWritePost",
"<buffer>",
":silent lua require('lint').try_lint()",
},
{
"BufEnter",
"<buffer>",
":silent lua require('lint').try_lint()",
},
},
}
end
end
2021-07-19 18:12:59 +02:00
local status_ok, _ = pcall(require, "lint")
2021-07-17 00:30:38 +02:00
if not status_ok then
return
end
if not O.lint_on_save then
vim.cmd [[if exists('#autolint#BufWritePost')
:autocmd! autolint
endif]]
end
return M