NvChad / NvChad

Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.

Home Page:https://nvchad.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specific Custom Highlight Groups

namack opened this issue · comments

Describe the bug
I am trying to control the theming overrides for a treesitter capture group. For example, I'd like to override @keyword.coroutine color. I am able to update the @keyword highlight groups using the information provided in the theming docs, but more specific highlight groups are not applied.

To Reproduce

  1. Find capture group info by running :Inspect
image
  1. Update theme overrides using the capture group
M.ui = {
  theme = "radium",
  hl_override = {
    --  This capture group works
    ["@keyword"] = { italic = true, fg = "blue" },

    -- This capture group does not work
    ["@keyword.coroutine"] = { fg = "red" },
  }
}
  1. Restart nvim
  2. Syntax highlighting works for @keyword but does not work for @keyword.coroutine

Expected behavior
Theme overrides should also apply to more specific capture groups.
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Operating System
    • macOS Sonoma 14.4.1
  • Terminal
    • iTerm 2 Build 3.4.23
  • Version of Neovim
    • v0.9.5

Additional context
There's a good chance I'm barking up the wrong tree. Is it possible to override more specific highlight groups? Or are we limited to the top level link (in this case @keyword)?

use hl_add cuz your hlgroups are new and not defined in nvchad

Ah perfect, thank you so much! Love NVChad btw, it's great.