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

Feature request: override highlight groups #35

Closed
leoluz opened this issue Nov 19, 2021 · 2 comments
Closed

Feature request: override highlight groups #35

leoluz opened this issue Nov 19, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@leoluz
Copy link

leoluz commented Nov 19, 2021

First of all, congrats for your theme. It looks really nice with cool treesitter support.

There are a few things I'd like to customize to my taste (eg. Telescope border colors).
It would be awesome if we could customize highlight groups in the setup function. Something like what onedarkpro does:
https://github.com/olimorris/onedarkpro.nvim#configuring-highlight-groups

@leoluz
Copy link
Author

leoluz commented Nov 19, 2021

This is how I achieved the customization I wanted:

local colors = require('onedark.colors')
vim.cmd("highlight TelescopeBorder guifg="..colors.grey)
vim.cmd("highlight TelescopePromptBorder guifg="..colors.grey)
vim.cmd("highlight TelescopeResultsBorder guifg="..colors.grey)
vim.cmd("highlight TelescopePreviewBorder guifg="..colors.grey)

Its not too bad but having the support to do it directly in the setup() function would be better.

@navarasu navarasu added the enhancement New feature or request label Nov 22, 2021
@xeluxee
Copy link
Contributor

xeluxee commented Jan 8, 2022

#42 is merged: now you can use highlights section in setup option
Sample code:

require('onedark').setup {
  colors = {
    bright_orange = "#ff8800",    -- define a new color
    green = '#00ffaa',            -- redefine an existing color
  },
  highlights = {
    TSKeyword = {fg = '$green'},
    TSString = {fg = '$bright_orange', bg = '#00ff00', fmt = 'bold'},
    TSFunction = {fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic'},
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants