f4z3r / gruvbox-material.nvim

Material Gruvbox colorscheme for Neovim written in Lua
MIT License
32 stars 4 forks source link

Option to override highlight. #27

Closed dot-1q closed 2 months ago

dot-1q commented 2 months ago

Hi! I was going to try to open a PR to enable this functionality, but i have 0 Lua experience and couldn't get the job done. The option to be able to override some highlights is really nice, and the way other plugins achieve it seem pretty simple, although I do not really know how to approach this problem.

Note: While on this topic of overriding, this came about because of the usage of the color blue for the variables and text. This does not seem like the intended behavior, and while investigating WIttyJudge's highlight definitions, I see that with the old Treesitter's highlight groups, he linked TSVariable = { link = 'Fg' }. With the new groups, becomes: TSVariable -> ["@variable"], and this colorscheme defines: ["@variable"] = { link = "Blue" }. Isn't this an error?

f4z3r commented 2 months ago

Hi @dot-1q , I wanted to offer such functionality for a while now. That was one of the reasons I did the refactor this week. It should make it quite trivial to add such an override. I will implement a way to do this in the coming days.

There are a few things to consider though. Since the highlight groups link to one another, changing individual groups can have an effect on quite a few things. I will try to think of a way to ensure such overrides affect as little as possible other values.

Regarding the link from WittyJudge, it is true that it used to link to Fg, but it seems there was a bug somewhere, because the colour scheme stayed quite stable since before I took over, so there was equal amounts of blue before already (at least if I remember properly).

Anyways, long story short: I will add such an option over the course of next week. I might mark it as experimental though, as I am guessing such overrides might break parts of the highlighting.

f4z3r commented 2 months ago

Hi @dot-1q I implemented something that should provide you with the desired features to customize the theme to your liking. I currently have it on the feat/custom branch. Do you want to try it out?

I will not merge this very soon, because I might first also want to test this myself a little, and potentially clean up the group linking (I will have to look at this in detail and decide if it makes sense). This might take me some time though, as I don't want to break anything. So if you want to use the feat/custom branch in the meantime, you could test if it works for you.

dot-1q commented 2 months ago

That is perfect! I've tested here with the new feat/custom branch and I'm able to override the highlights groups to my liking. I'll continue to use this feature and let you in this thread if I find anything that doesnt work as planned. Thank you for this feature!