]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/plugins/editor.lua
nvim: add mini.hipatterns to highlight hex colours and any strings
[dotfiles.git] / nvim / lua / plugins / editor.lua
index 5dcdccf8deb853e82422a3bacda784b25a1734bf..1e94ab0bc0a7b6e0362f71a349e54fc82e045d7c 100644 (file)
@@ -73,7 +73,7 @@ return {
     -- Finds and lists all of the TODO, HACK, BUG, etc comment
     -- in your project and loads them into a browsable list.
     cmd = { "TodoTrouble"},
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     -- stylua: ignore
     keys = {
       { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
@@ -83,6 +83,17 @@ return {
     },
     opts = {}
   },
+  { "echasnovski/mini.hipatterns",  -- highlight hex colours and other matched words
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
+    opts = function()
+      local hi = require("mini.hipatterns")
+      return {
+        highlighters = {
+          hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }),
+        },
+      }
+    end,
+  },
   { "folke/flash.nvim",
     -- Flash enhances the built-in search functionality by showing labels
     -- at the end of each match, letting you quickly jump to a specific
@@ -104,7 +115,7 @@ return {
     -- git signs highlights text that has changed since the list
     -- git commit, and also lets you interactively stage & unstage
     -- hunks in a commit.
-    event = "LazyFile",
+    event = { "BufReadPost", "BufNewFile", "BufWritePre" },
     opts = {
       signs = {
         add = { text = "▎" },
@@ -192,4 +203,7 @@ return {
       },
     },
   },
+  { "aymericbeaumet/vim-symlink",
+    dependencies = { "moll/vim-bbye" }, -- NOTE: Snacks.buddelete also provides this
+  },
 }