mini.hipatterns how to enable hex color coding #600
Answered
by
NotAShelf
cronyakatsuki
asked this question in
Q&A
-
Hello, been trying to enable mini.hipatterns to colorize hex colors but haven't been able to achieve it. The lua look like this on the official readme https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md local hipatterns = require('mini.hipatterns')
hipatterns.setup({
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' },
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' },
-- Highlight hex color strings (`#rrggbb`) using that color
hex_color = hipatterns.gen_highlighter.hex_color(),
},
}) I tried to do it like this in nvf, but it doesn't colorize the colors: hipatterns = {
enable = true;
setupOpts = {
highlighters = {
hex_color = "require('mini.hipatterns').gen_highlighter.hex_color()";
};
};
}; |
Beta Was this translation helpful? Give feedback.
Answered by
NotAShelf
Feb 4, 2025
Replies: 1 comment 2 replies
-
- hex_color = "require('mini.hipatterns').gen_highlighter.hex_color()";
+ hex_color = lib.generators.mkLuaInline "require('mini.hipatterns').gen_highlighter.hex_color()"; Could you try this? By default " ... " will be converted to a string literal, which will not act as the Lua function you expect it to act as. Edit:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
cronyakatsuki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you try this? By default " ... " will be converted to a string literal, which will not act as the Lua function you expect it to act as.
Edit:
lib.mkLuaInline
->lib.generators.mkLuaInline