From 1f2824b912b22a687fb0f1c56f82198128bef1ca Mon Sep 17 00:00:00 2001 From: Mosder Date: Wed, 10 Jun 2026 02:24:31 +0200 Subject: added and updated a lot of configs + refactored it to be more accessible --- .../.config/nvim/lua/kickstart/plugins/lint.lua | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 common/home/mosder/.config/nvim/lua/kickstart/plugins/lint.lua (limited to 'common/home/mosder/.config/nvim/lua/kickstart/plugins/lint.lua') diff --git a/common/home/mosder/.config/nvim/lua/kickstart/plugins/lint.lua b/common/home/mosder/.config/nvim/lua/kickstart/plugins/lint.lua new file mode 100644 index 0000000..d630544 --- /dev/null +++ b/common/home/mosder/.config/nvim/lua/kickstart/plugins/lint.lua @@ -0,0 +1,53 @@ +-- Linting + +vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } + +local lint = require 'lint' +lint.linters_by_ft = { + markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm +} + +-- To allow other plugins to add linters to require('lint').linters_by_ft, +-- instead set linters_by_ft like this: +-- lint.linters_by_ft = lint.linters_by_ft or {} +-- lint.linters_by_ft['markdown'] = { 'markdownlint' } +-- +-- However, note that this will enable a set of default linters, +-- which will cause errors unless these tools are available: +-- { +-- clojure = { "clj-kondo" }, +-- dockerfile = { "hadolint" }, +-- inko = { "inko" }, +-- janet = { "janet" }, +-- json = { "jsonlint" }, +-- markdown = { "vale" }, +-- rst = { "vale" }, +-- ruby = { "ruby" }, +-- terraform = { "tflint" }, +-- text = { "vale" } +-- } +-- +-- You can disable the default linters by setting their filetypes to nil: +-- lint.linters_by_ft['clojure'] = nil +-- lint.linters_by_ft['dockerfile'] = nil +-- lint.linters_by_ft['inko'] = nil +-- lint.linters_by_ft['janet'] = nil +-- lint.linters_by_ft['json'] = nil +-- lint.linters_by_ft['markdown'] = nil +-- lint.linters_by_ft['rst'] = nil +-- lint.linters_by_ft['ruby'] = nil +-- lint.linters_by_ft['terraform'] = nil +-- lint.linters_by_ft['text'] = nil + +-- Create autocommand which carries out the actual linting +-- on the specified events. +local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) +vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { + group = lint_augroup, + callback = function() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.bo.modifiable then lint.try_lint() end + end, +}) -- cgit v1.2.3