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

Can't override *light_grey* highlight on barbar's gitsigns #167

Open
pabloqpacin opened this issue May 29, 2023 · 1 comment
Open

Can't override *light_grey* highlight on barbar's gitsigns #167

pabloqpacin opened this issue May 29, 2023 · 1 comment

Comments

@pabloqpacin
Copy link

I have recently started using barbar and I find its integration with gitsigns pretty awesome:

require'barbar'.setup {
    icons = { gitsigns = {
        added = {enabled = true, icon = '+'},
        changed = {enabled = true, icon = '~'},
        deleted = {enabled = true, icon = '-'},
    }}
}

The issue is that the current buffer now displays a light_grey highlight pretty hard to deal with.

barbar--issue

I reported the issue in barbar's #504 since I thought the issue was the plugin but it seems there's something about how this colorscheme handles highlighting, as other colorschemes don't have this inconvenience.

Now they suggested me to override some of onedark's highlights as that actually worked for other users in the past. You can see my tweaks in the screenshot above (as well as links to related issues and such). The color I'd expect to see is #4E4E4E instead of the light_grey but still, I tried with green and red for testing all the hl.plugins.barbar settings in onedark.

I might be overlooking something or perhaps it's a bug with gitsigns. Also other "onedark"-related colorschemes have the same issue as I could test this morning. Please let me know if I should provide the actual lua code for my onedark config or the screenshot may be enough. Thank you.

@pabloqpacin
Copy link
Author

As now pointed out in the barbar issue, the problem can actually be solved invoking this config before the require('onedark').load() call:

vim.api.nvim_create_autocmd('Colorscheme', {
    group = vim.api.nvim_create_augroup('config_custom_highlights', {}),
    callback = function()
      -- Override colorscheme highlighting before its `load()` call
      vim.api.nvim_set_hl(0, 'BufferCurrentADDED',   {bg = '#020508', fg = '#7EA662'})
      vim.api.nvim_set_hl(0, 'BufferCurrentCHANGED', {bg = '#020508', fg = '#4FA6ED'})
      vim.api.nvim_set_hl(0, 'BufferCurrentDELETED', {bg = '#020508', fg = '#E55561'})
    end,
})

This issue here can be closed but perhaps a permanent solution could be implemented in the plugin codebase. Thanks anyway for this awesome colorscheme.

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

1 participant