diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index f750758..4415ac4 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -63,6 +63,9 @@ with final.pkgs.lib; let # Formatting conform-nvim + # Linting + nvim-lint + # Treesitter nvim-treesitter-textobjects nvim-ts-autotag diff --git a/nvim/lua/plugins/linting/init.lua b/nvim/lua/plugins/linting/init.lua new file mode 100644 index 0000000..e396bd7 --- /dev/null +++ b/nvim/lua/plugins/linting/init.lua @@ -0,0 +1,5 @@ +local req = MarleyVim.local_require('plugins.linting') + +return { + req('nvim-lint'), +} diff --git a/nvim/lua/plugins/linting/nvim-lint.lua b/nvim/lua/plugins/linting/nvim-lint.lua new file mode 100644 index 0000000..b46a80e --- /dev/null +++ b/nvim/lua/plugins/linting/nvim-lint.lua @@ -0,0 +1,21 @@ +return { + 'nvim-lint', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + after = function() + local lint = require('lint') + + lint.linters_by_ft = { + fish = { 'fish' }, + } + + vim.api.nvim_create_autocmd( + { 'BufWritePost', 'BufReadPost', 'InsertLeave' }, + { + group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }), + callback = function() + require('lint').try_lint() + end, + } + ) + end, +}