Skip to main content

Mini Hipatterns

info

You can enable the extra with the :LazyExtras command. Plugins marked as optional will only be configured if they are installed.

Alternatively, you can add it to your lazy.nvim imports
lua/config/lazy.lua
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
{ import = "plugins" },
},
})

Below you can find a list of included plugins and their default settings.

caution

You don't need to copy the default settings to your config. They are only shown here for reference.

mini.hipatterns

opts = function()
local hi = require("mini.hipatterns")
return {
-- custom LazyVim option to enable the tailwind integration
tailwind = {
enabled = true,
ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" },
-- full: the whole css class will be highlighted
-- compact: only the color will be highlighted
style = "full",
},
highlighters = {
hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }),
shorthand = {
pattern = "()#%x%x%x()%f[^%x%w]",
group = function(_, _, data)
---@type string
local match = data.full_match
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
local hex_color = "#" .. r .. r .. g .. g .. b .. b

return MiniHipatterns.compute_hex_color_group(hex_color, "bg")
end,
extmark_opts = { priority = 2000 },
},
},
}
end