Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override colors for tree-sitter highlight groups #281

Closed
nettrino opened this issue Jul 11, 2023 · 1 comment
Closed

Override colors for tree-sitter highlight groups #281

nettrino opened this issue Jul 11, 2023 · 1 comment
Assignees

Comments

@nettrino
Copy link

I would want to be able to override the default colors for tree-sitter groups as defined in treesitter.lua. Is there an option to do this somehow?

@ful1e5
Copy link
Member

ful1e5 commented Jul 17, 2023

@nettrino You can use the groups table to override all highlight groups. To override a specific theme variant, create a sub-table with the same name as the colorscheme. Otherwise, use the all sub-table.

require('github-theme').setup({
  -- ...

  groups = {
    -- override for all variants
    all = {
      ['@variable'] = { fg = 'palette.red' },
    },

    -- or override for a specific variant
    -- github_dark = { ... }
  },
})

vim.cmd('colorscheme github_dark')

@ful1e5 ful1e5 self-assigned this Jul 19, 2023
@ful1e5 ful1e5 closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants