gruber-darker.nvim icon indicating copy to clipboard operation
gruber-darker.nvim copied to clipboard

Suggestion: easier highlight group overriding

Open raddari opened this issue 2 years ago • 4 comments
trafficstars

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 :)

raddari avatar Jul 01 '23 13:07 raddari

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!

blazkowolf avatar Jul 01 '23 17:07 blazkowolf

Hello, Could you please consider adding the override configuration?

mohiden avatar Feb 12 '24 10:02 mohiden

@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.

blazkowolf avatar Feb 12 '24 15:02 blazkowolf

Yeah sure, I am working on it, I'll make PR once finished.

mohiden avatar Feb 12 '24 15:02 mohiden