rktjmp / lush.nvim

Create Neovim themes with real-time feedback, export anywhere.
MIT License
1.4k stars 46 forks source link

separate colors for keywords and brackets in JavaScript? #111

Closed tropical32 closed 1 year ago

tropical32 commented 1 year ago

I'm trying to set the color of curly brackets to something else than what keywords like function use.

The only field that reacts to changes is this one:

Function { fg = pink2 }

which colors both the brackets and keywords.

Is there a separate setting for these in Lush for JavaScript? It doesn't do that in other languages like Rust.

Attempt

pink

Desired

firefox

rktjmp commented 1 year ago

Lush can't actually define what/where groups are, only what colors they are if that makes sense. Nvim says for the javascript filetype, function, { and } should be coloured by the Function highlight group, where as for the rust filetype it probably marks {, } as the Symbol group or something.

You'll have to look at what highlight groups are defined for Javascript, either in whatever plugin/core-plugin is defining those groups or maybe the treesitter grammar if you're using that.

You might be able to get some more specific help on the matrix chat or subreddit.

tropical32 commented 1 year ago

Thanks, I didn't know that languages had separate highlight groups 🤦‍♂️

For anyone wondering the highlight group for javascript brackets is javaScriptBraces {}. More here.

alerque commented 1 year ago

A typical syntax plugin defines all it's own groups according to the language itself, then it links all those groups to a predefined generic default set defined by VIM itself. This allows color schemes to take offect across most syntax plugins out of the box. It is not uncommon for there to be more fine grained matches in syntax plugins where more than one type of match is linked to the same general purpose group to fit it in standard color schemes.