Closed wanaiqing closed 1 year ago
Certainly. The screenshot is generated from the stuff committed on the assets
branch. The colorscheme is lucius
, specifically the version committed on that branch.
You don’t need to switch colorschemes over just this btw.
The way the whole highlighting mechanism works in Vim is that syntaxes and plugins define names for things of some particular identity (like javascriptString
or whatever), then link this name to one of the common names used in the builtin Vim colorschemes like String
or Comment
, which you can browse by doing :help highlight-groups
. The colorscheme then actually defines specific colors for these generic names. (And maybe for plugin- and/or syntax-specific names!)
Buftabline defines a number of custom names, which are documented in :help buftabline-colors
.
Now if you look at the default group names, you will find that Buftabline has a problem, because the default tabline only has two different states to highlight – either a tab is active or it’s not – so there are only two color names defined for tabs. But Buftabline has three states to show: a buffer can be in the focused window, or some other window, or not in any window. So two are covered, but I had to pick something entirely different for the third state. For that I settled on PmenuSel
, which is the color of the selection within an in-window textual popup menu, which seemed like it was most likely to work well in most colorschemes, by the nature of what the name is for.
But apparently gruvbox makes that the same color as TabLine
. Womp womp…
So the bottom line is, you browse :help highlight-group
(where the name of each highlight group is helpfully highlighted by itself), pick one that makes sense, and put hi link BufTabLineActive ThatOtherGroup
in your vimrc.
Does that cover all questions?
Certainly. The screenshot is generated from the stuff committed on the
assets
branch. The colorscheme islucius
, specifically the version committed on that branch.You don’t need to switch colorschemes over just this btw.
The way the whole highlighting mechanism works in Vim is that syntaxes and plugins define names for things of some particular identity (like
javascriptString
or whatever), then link this name to one of the common names used in the builtin Vim colorschemes likeString
orComment
, which you can browse by doing:help highlight-groups
. The colorscheme then actually defines specific colors for these generic names. (And maybe for plugin- and/or syntax-specific names!)Buftabline defines a number of custom names, which are documented in
:help buftabline-colors
.Now if you look at the default group names, you will find that Buftabline has a problem, because the default tabline only has two different states to highlight – either a tab is active or it’s not – so there are only two color names defined for tabs. But Buftabline has three states to show: a buffer can be in the focused window, or some other window, or not in any window. So two are covered, but I had to pick something entirely different for the third state. For that I settled on
PmenuSel
, which is the color of the selection within an in-window textual popup menu, which seemed like it was most likely to work well in most colorschemes, by the nature of what the name is for.But apparently gruvbox makes that the same color as
TabLine
. Womp womp…So the bottom line is, you browse
:help highlight-group
(where the name of each highlight group is helpfully highlighted by itself), pick one that makes sense, and puthi link BufTabLineActive ThatOtherGroup
in your vimrc.Does that cover all questions?
Colors are great in your featured lucius theme, thanks.
@ap find out that gruvbox specifically set highlight groups for buftabline
Nice! That’s one of the reasons I defined these custom names, so that colorschemes can directly target Buftabline specifically if they wish. It’s nice to see a colorscheme taking advantage of that. Looking at the code, it seems to use distinct colors for the three states as it should, so it should have worked for you… but it didn’t. Strange!
It seems that I can't get the same effect in vim with gruvbox. This is mine.
This is yours(what I want).
![yours](https://github.com/ap/vim-buftabline/assets/20230818/4357f5ff-2c91-44f9-aa82-ce2d55911910)
Can you please share it?