vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.65k stars 5.46k forks source link

Add a highlight group that preservers all the original highlights and changes the opacity #16033

Open jclsn opened 3 days ago

jclsn commented 3 days ago

Is your feature request about something that is currently impossible or hard to do? Please describe the problem. In IDEs like VSCode code sections that arent't active are rendered as less opaque, but all the syntax highlighting is preserved. Currently, this is not possible in Vim, as you can only create a new highlight group with a certaing foreground and background RGB value.

Describe the solution you'd like It would be nice to have a hightlight group that just changes the opacity and preserves the colors of all other highlight groups. Not sure if this is possible.

chrisbra commented 2 days ago

I don't think this will be easily possible considering different environments where Vim runs. At least not in a terminal. For the GUI this might be something different, we would need to have a new argument, specifying the opacity. But this will be a bit of work to make it work in the different UIs.

jclsn commented 1 day ago

I was thinking of something like a special pseudo-highlight that actually just adds a filter on the other other highlights. Not sure how easily this could be achieved in the code base, but technically it should be trivial.

Just had a look at the code btw and omg Bram did have a weird taste in formatting...