Closed linrongbin16 closed 1 month ago
You'd need to check the documentation for nvim-web-devicons
, we use the colors they export directly.
hi @romgrk,
actually I want to define the BufferCurrentDefault
highlight group.
I found the set_default_link
API is using default
option: https://github.com/romgrk/barbar.nvim/blob/5880baa3bf6b262ee3c465519fce3e71a6045dec/lua/barbar/utils/highlight.lua#L188
which means if I define BufferCurrentDefault
before loading this plugin, then I could override this color.
[nvim_set_hl()](https://neovim.io/doc/user/api.html#nvim_set_hl())
My bad, thought you wanted to fix the icon color.
The *Default
highlights are not meant to be overridden— those are just the defaults. I would suggest something like this:
-- run `callback` after a colorscheme is loaded
vim.api.nvim_create_autocmd('ColorScheme', {
pattern = 'apprentice', -- after apprentice loads specifically
callback = function()
vim.api.nvim_set_hl(0,
'BufferCurrent', -- or any other hl group
{ --[[ the definition of the group here ]] }
)
-- vim.api.nvim_set_hl(…)
end,
})
The
*Default
highlights are not meant to be overridden— those are just the defaults. I would suggest something like this:-- run `callback` after a colorscheme is loaded vim.api.nvim_create_autocmd('ColorScheme', { pattern = 'apprentice', -- after apprentice loads specifically callback = function() vim.api.nvim_set_hl(0, 'BufferCurrent', -- or any other hl group { --[[ the definition of the group here ]] } ) -- vim.api.nvim_set_hl(…) end, })
thank you, I will try
Hi, I'm using 'apprentice' colorscheme (actually I use a lot of colorschemes, switch from one to another), with barbar it looks like:
You can see, the
lua
file type icon color (blue) and the buffer index in the active/current buffer don't have a good contrast with background color.I think I need to customize/override the default color for the background color, which should be
BufferCurrent
orBufferDefaultCurrent
.