Closed jensbambauer closed 5 years ago
No, that’s just how the colorscheme you’re using looks:
init.vim
label in your first screenshot is how the selected tab looks in your colorscheme, which BufTabLine uses for the buffer in the focused windowinstall.sh
label in the second screenshot is how unselected tabs look in your colourscheme, which BufTabLine uses for hidden buffers (= not displayed in any window)init.vim
label in your second screenshot is how the completion menu selection looks in your colourscheme, which BufTabLine uses for buffers shown only in windows which aren’t focusedIn the second screenshot, none of your actual buffers has focus. The focus in that screenshot is on an unlisted buffer created by NERDTree. Compare the output of :ls
and :ls!
to see what I mean. BufTabLine doesn’t show unlisted buffers. So all visible listed buffers are highlighted like the completion menu selection, which in your colorscheme has that dark on bluish look.
As for the colorscheme definitions used by BufTabLine – plain Vim unfortunately only defines two highlight group for tabs: one for the selected tab and one for other tabs. But BufTabLine needs a third option… so I filled it in by taking one of the completion menu highlight groups. Whether that will work well with any given colorscheme is basically a crapshoot… but most of the time it seems to work well enough that nobody notices.
If you want to keep using this colorscheme and you don’t like how it looks, you can petition the author of the colorscheme to support BufTabLine explicitly – it sets up its own highlight groups for that purpose, documented under :help buftabline-colors
. Alternatively, if you don’t want to do that, or if you can’t, you can redefine the colors yourself in your vimrc
, as documented in :help :hi-link
(with available highlight groups listed in :help highlight-groups
).
Does that help?
That makes sense, thank you. I got confused because the blue background looks like this should be selected.
For now I'll add
hi default link BufTabLineActive TabLineSel
hi default link BufTabLineCurrent PmenuSel
to my vimrc. Is that a bad idea?
No, that’s almost exactly right, just without the default
keyword.
The purpose of default
is to say that this link doesn’t override an already-created link without the default
keyword, if there is one. The idea is that colorschemes and plugins etc should create default
links while the user’s configuration creates non-default
links, and that way the user’s links won’t get overridden regardless of the load order of everything. Basically you can think of default
like an equivalent to !important
in CSS, just with the opposite effect on priority (!unimportant
?).
At least, that’s the intended usage. I don’t know if that mechanism ever made all that much sense (you can put your hi link
commands after your colorscheme
command, after all), but in today’s world of bundles/packages, it seems particularly obsolete – a special one-off mechanism to work around load order just for colorscheme stuff, from an older time when you would just dump everything straight into ~/.vim/colors/
and ~/.vim/plugin
etc and hope for the best.
But… since it’s designed that way… might as well use it like that, even when it doesn’t end up mattering in practice.
Hi, cool plugin, exactly what I was looking for.
Using NerdTree the current open buffer is not highlighted when the focus is not on NerdTree but on the opened buffer. Is there a way to fix this?
Focus on the buffer:![screen shot 2018-04-12 at 19 25 23](https://user-images.githubusercontent.com/1315164/38693510-6095aaa0-3e87-11e8-84a4-5b1f6f201ac1.png)
Focus on NerdTree:![screen shot 2018-04-12 at 19 30 35](https://user-images.githubusercontent.com/1315164/38693720-125ad9f4-3e88-11e8-8ee1-256099e9d702.png)