Access to the palette when defining overrides for highlight groups? #27
-
|
Is there a way to access the current palette when I specify my highlight overrides? In most themes I use, usually require("oasis").setup({
highlight_overrides = function(c)
return {
Comment = { fg = c.fg.dim }
}
end
})Looking at the code quickly, this would be a trivial trivial change to -- Apply user highlight overrides last (they take precedence)
local overrides = Config.highlight_overrides
overrides = type(overrides) == 'function' and overrides(c) or overrides
for name, attrs in pairs(overrides or {}) do
if type(attrs) == "table" then
vim.api.nvim_set_hl(0, name, apply_styles(attrs))
else
vim.api.nvim_set_hl(0, name, { link = attrs })
end
endThoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
|
I think this is a great idea! Your implementation suggestion would work, and you're right, it would be a trivial update to pass the current palette to the user. But... I also see some existing user experience issues around this area that should probably be addressed for the best experience. The main issues I see are:
What I am going to do is make an issue that contains all of these requirements. I will reference this discussion in that issue. I may have some time this weekend or Monday to tackle this request. |
Beta Was this translation helpful? Give feedback.
Happy to hear that! Do you have a favorite variant yet? I am also curious what support
mini.nvimneeds. I haven't really played around with mini yet.This was a very fun project for me; I still do some tweaks now and then. Don't forget to check out the Extras if you haven't already.
I just finished this update as well and closed #28. Can you update the plugin and let me know if it works on your end?
The config examples in the README have been updated for "Changing Palette Colors" and "Changing Colors for Highlight Groups". It's a little complex; there are many options to play with. You can pass a table or function to
palette_overridesorhighlight_overrides.For example:
highlight_overrides