projekt0n / github-nvim-theme

Github's Neovim themes
MIT License
2.02k stars 105 forks source link

Override colors for tree-sitter highlight groups #281

Closed nettrino closed 12 months ago

nettrino commented 1 year ago

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 commented 1 year ago

@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')