aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/kickstart/plugins/lint.lua55
-rw-r--r--lua/kickstart/plugins/lspconfig.lua2
-rw-r--r--lua/lazy-plugins.lua1
3 files changed, 57 insertions, 1 deletions
diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua
new file mode 100644
index 0000000..7f0dc42
--- /dev/null
+++ b/lua/kickstart/plugins/lint.lua
@@ -0,0 +1,55 @@
+return {
+
+ { -- Linting
+ 'mfussenegger/nvim-lint',
+ event = { 'BufReadPre', 'BufNewFile' },
+ config = function()
+ local lint = require 'lint'
+ lint.linters_by_ft = {
+ markdown = { 'markdownlint' },
+ }
+
+ -- 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()
+ require('lint').try_lint()
+ end,
+ })
+ end,
+ },
+}
diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua
index 2783c69..9d0e369 100644
--- a/lua/kickstart/plugins/lspconfig.lua
+++ b/lua/kickstart/plugins/lspconfig.lua
@@ -151,7 +151,7 @@ return {
lua_ls = {
-- cmd = {...},
- -- filetypes { ...},
+ -- filetypes = { ...},
-- capabilities = {},
settings = {
Lua = {
diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua
index a321594..7005325 100644
--- a/lua/lazy-plugins.lua
+++ b/lua/lazy-plugins.lua
@@ -59,6 +59,7 @@ require('lazy').setup({
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
+ -- require 'kickstart.plugins.lint',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.