diff options
Diffstat (limited to 'lua/core')
-rw-r--r-- | lua/core/linter.lua | 33 | ||||
-rw-r--r-- | lua/core/which-key.lua | 3 |
2 files changed, 35 insertions, 1 deletions
diff --git a/lua/core/linter.lua b/lua/core/linter.lua new file mode 100644 index 00000000..9c6649a8 --- /dev/null +++ b/lua/core/linter.lua @@ -0,0 +1,33 @@ +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 + +local status_ok, linter = 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 diff --git a/lua/core/which-key.lua b/lua/core/which-key.lua index 6f034e3e..ec64074b 100644 --- a/lua/core/which-key.lua +++ b/lua/core/which-key.lua @@ -127,9 +127,10 @@ M.config = function() "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic", }, + l = { "<cmd>silent lua require('lint').try_lint()<cr>", "Lint" }, q = { "<cmd>Telescope quickfix<cr>", "Quickfix" }, r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" }, - s = { "<cmd> Telescope lsp_document_symbols<cr>", "Document Symbols" }, + s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" }, S = { "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", "Workspace Symbols", |