about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-06-02 16:20:40 +0900
committersefidel <contact@sefidel.net>2024-06-02 16:20:40 +0900
commit80ed1240ec6a6f26013c5484ef3661c8964beb51 (patch)
treed70215aebb3460224d5d936aabd21ea1db8c36d8
parent71cdf5f7b87b89227501946427ad75d243d65e49 (diff)
downloadnvimrc-80ed1240ec6a6f26013c5484ef3661c8964beb51.tar.gz
nvimrc-80ed1240ec6a6f26013c5484ef3661c8964beb51.zip
feat(packs): add nvim-lint
-rw-r--r--fnl/nvrc/pack.fnl1
-rw-r--r--fnl/nvrc/packs/lint.fnl11
-rw-r--r--lazy-lock.json1
3 files changed, 13 insertions, 0 deletions
diff --git a/fnl/nvrc/pack.fnl b/fnl/nvrc/pack.fnl
index fd89e91..59f3e7a 100644
--- a/fnl/nvrc/pack.fnl
+++ b/fnl/nvrc/pack.fnl
@@ -32,6 +32,7 @@
                                               (pack :rcarriga/nvim-dap-ui {:init :dapui :lazy true})
                                               (pack :nvim-neotest/nvim-nio {:lazy true})]}
                                :lazy true)
+(pack! :mfussenegger/nvim-lint {:req :lint :event [:BufReadPre :BufNewFile]})
 (pack! :gpanders/editorconfig.nvim)
 (pack! :stefandtw/quickfix-reflector.vim {:ft :qf})
 (pack! :lewis6991/gitsigns.nvim {:init :gitsigns :event :BufReadPost})
diff --git a/fnl/nvrc/packs/lint.fnl b/fnl/nvrc/packs/lint.fnl
new file mode 100644
index 0000000..304b7d8
--- /dev/null
+++ b/fnl/nvrc/packs/lint.fnl
@@ -0,0 +1,11 @@
+(import-macros {: ag!
+                : au!} :nvrc.macro.event)
+(local nvim-lint (require :lint))
+
+(tset nvim-lint :linters_by_ft {:nix [:nix]})
+
+(ag! nvim-lint
+     (au! [BufEnter BufWritePost InsertLeave TextChangedI] * (do
+          (nvim-lint.try_lint)
+          ; linters that will run on any filetype
+          (nvim-lint.try_lint [:codespell]))))
diff --git a/lazy-lock.json b/lazy-lock.json
index 97cf54a..105377f 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -21,6 +21,7 @@
   "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" },
   "nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" },
   "nvim-lspconfig": { "branch": "master", "commit": "2beb3e9cac3ed9335f8972eb6082f380a4f1f124" },
+  "nvim-lint": { "branch": "master", "commit": "1f98d6c863f91706369d74aeb2eb3f02b2e96861" },
   "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
   "nvim-treesitter": { "branch": "master", "commit": "da0efd7398713a3177da5ce8690f0e5c5415763d" },
   "nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" },