gruber-darker.nvim
gruber-darker.nvim copied to clipboard
Suggestion: easier highlight group overriding
Hi! First of all, thank you for keeping this awesome colorscheme alive in modern Neovim, it looks fantastic!
I'm finding it a bit awkward to override highlight groups, however. For simplicity, I would like to be able to use your palette similar to other themes like tokyonight:
local c = require('gruber-darker.palette')
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria })
but your current API requires me to do this instead:
local c = require('gruber-darker.palette')
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria:to_string() })
Obviously this isn't a huge issue for overriding a few groups but it becomes quite cumbersome for setting lots of them - such as adding support for other plugins.
My current workaround looks something like this:
local c = setmetatable({}, {
__index = function(_, k)
return require('gruber-darker.palette')[k]:to_string()
end,
})
vim.api.nvim_set_hl(0, 'Cursor', { bg = c.wisteria })
which is a bit hacky, but it works fine for my purposes.
I understand that this is very minor - it definitely doesn't detract from my experience using this colorscheme! Cheers :)
Thank you for your interest and excitement for the colorscheme! I'm glad you brought this up - a dedicated method for overriding colors in the plugin configuration is definitely lacking.
I'm going out of town today, so I will be unavailable for a few days, but when I'm back I will think on this. Thanks again for your valuable insight!
Hello, Could you please consider adding the override configuration?
@mohiden I appreciate your eagerness for a good method of overriding colors. I'll try to get around to this eventually. I have been busy with work and not disciplined enough to sit down and work on this when I have other projects that are more interesting to me currently. Again, I will try to get to this, but I would greatly appreciate any PRs if you or anyone in the community gets to it before I do.
Yeah sure, I am working on it, I'll make PR once finished.