From b51f1ae28924a752258e7607fbc3210f9b18eaac Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 22 Jul 2021 00:08:36 +0200 Subject: Updates based on Chris's lunarvim --- .config/nvim/lua/core/linter.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .config/nvim/lua/core/linter.lua (limited to '.config/nvim/lua/core/linter.lua') diff --git a/.config/nvim/lua/core/linter.lua b/.config/nvim/lua/core/linter.lua new file mode 100644 index 0000000..94dff93 --- /dev/null +++ b/.config/nvim/lua/core/linter.lua @@ -0,0 +1,33 @@ +local M = {} + +M.setup = function() + if O.lint_on_save then + require("utils").define_augroups { + autolint = { + { + "BufWritePost", + "", + ":silent lua require('lint').try_lint()", + }, + { + "BufEnter", + "", + ":silent lua require('lint').try_lint()", + }, + }, + } + end +end + +local status_ok, _ = pcall(require, "lint") +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 -- cgit v1.2.3-70-g09d2