sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

feat: improve tree-sitter highlights for keywords, conditional, repeat, exception #84

Closed dhruvmanila closed 3 years ago

dhruvmanila commented 3 years ago

Also, these are all already in italic if enabled: https://github.com/sainnhe/gruvbox-material/blob/82c696585d9d7a72596d34a755a6080836ae6561/colors/gruvbox-material.vim#L195-L205

sainnhe commented 3 years ago

Thanks!

sainnhe commented 3 years ago

Sorry it's my fault, I merged your PR without thinking carefully.

The syntax highlighting logic used in tree-sitter is different from it's in classic vim syntax. In tree-sitter, the keywords are not italicized, only variables are italicized.

So I reverted your commit.

dhruvmanila commented 3 years ago

I don't think that is true or I might be wrong, but I am using italic for the above mentioned groups for a long time. Terminal: kitty OS: macOS Font: JetBrains Mono

Lua: Screenshot 2021-05-17 at 09 54 08

Python: Screenshot 2021-05-17 at 09 57 37

sainnhe commented 3 years ago

You can use custom highlight groups in your vimrc

https://github.com/sainnhe/gruvbox-material/blob/d6fbcac95e100ef46347cddc6b54ae4d6563d44a/doc/gruvbox-material.txt#L588-L621

dhruvmanila commented 3 years ago

Yes, actually that's how I am using it:

highlight("TSKeyword", { force = true, link = "RedItalic" })
highlight("TSKeywordFunction", { force = true, link = "RedItalic" })
highlight("TSConditional", { force = true, link = "RedItalic" })
highlight("TSRepeat", { force = true, link = "RedItalic" })
highlight("TSException", { force = true, link = "RedItalic" })

If it's not possible, then no problem. Thanks for taking a look at it :)