]> git.rmz.io Git - dotfiles.git/commitdiff
nvim: add mini.hipatterns to highlight hex colours and any strings
authorSamir Benmendil <me@rmz.io>
Tue, 25 Feb 2025 23:48:42 +0000 (23:48 +0000)
committerSamir Benmendil <me@rmz.io>
Sun, 2 Mar 2025 16:17:50 +0000 (16:17 +0000)
nvim/lua/plugins/editor.lua

index cb18528f7f5e97106c4f9ce2a74486eb4dc79b3c..1e94ab0bc0a7b6e0362f71a349e54fc82e045d7c 100644 (file)
@@ -83,6 +83,17 @@ return {
     },
     opts = {}
   },
     },
     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
   { "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