Closed savchenko closed 4 months ago
In the code, I assume you can use it by
format = function(entry, item)
-- ...custom config
return require("nvim-highlight-colors").format(entry, item)
end
Or assuming you have to modify the icon or other things since the function returns item table, idk haven't tried it yet.
format = function(entry, item)
item = require("nvim-highlight-colors").format(entry, item)
-- item.abbr = ...
return item
end
edit: after I tweak my config I ended up with this
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, item)
item = require("nvim-highlight-colors").format(entry, item)
-- the item.abbr returns the user's virtual object eg. the square when it's Color entry
if item.abbr == "" then
-- I have kind_icons table looks like kind_icons = { Text = "Tt (this is icon)", ...more icons }
item.kind = string.format("%s", kind_icons[item.menu])
else
item.kind = item.abbr
end
item.abbr = item.word
item.kind_hl_group = item.abbr_hl_group or nil
item.abbr_hl_group = nil
return item
end,
}
The problem I found is the highlight group (nvim-highlight-000000, ...) doesn't link the bg highlight to the current theme highlight (maybe using the Normal group) and another one is when I have a custom tailwind variable, it doesn't apply eg text-primary
This is the result, some work when you first see it (type the text and it shows) then when scrolling down and scrolling back, the background color turns to the highlight color group instead
before select item
after select item
my config with a custom icon
An example in the readme assumes that format isn't being already used. However, it is often declared as a function, e.g.
format = function(_, item) -- many customisations... return item end
How do I correctly hook
nvim-highlight-colours
there?
Hey o/
I've updated the readme. Please check it out :)
An example in the readme assumes that format isn't being already used. However, it is often declared as a function, e.g.
How do I correctly hook
nvim-highlight-colours
there?