The other day I've started having some problems with my NeoVim. Specifically, the colorscheme seemed to be wrong.
I usually use Solarized Dark wherever possible (terminal, mutt, zathura, htop, etc.), but somehow, once I would open a new tab in NeoVim, my tabline colorscheme would look just like Solarized Light's background:
See that beige line at the top? It's not supposed to look like that. Now to figure this out I've started googling all sorts of things. Vim, tabs, vim tabline colors, all that. Eventually I found a very useful StackOverflow comment that explained how you can change the colors of the TabLine.
It turns out, it's separated into three parts:
- TabLineSel - is the current active tab label.
- TabLine - are the other, non-active lables.
- TabLineFill - is the rest of the tabline. (The part that seemed to be malfunctioning)
Now with that out of the way, I had to figure out what was causing TabLineFill to receive the wrong color. After trying out regular Vim and not seeing the same issue, I found out that this has to do with some of the plugins I am using for NeoVim (I keep separate sets of plugins for Vim and NeoVim). Eventually I realized that it's lightline that's causing the problem.
After searching around the lightline's github page, I found a file called solarized_dark.vim. And in that file there was a line that said:
let s:p.tabline.middle = [ [ s:base01, s:base2 ] ]
That s:base2 part is the beige color I was getting in the tabline. After switching it to s:base02 everything went back to normal:
Well, not exactly "normal". As you can see in the screenshot above the TabLineSel blends in with the TabLineFill. Good thing lightline's author itchyny suggested a fix:
let s:p.tabline.left = [ [ s:base1, s:base00 ] ] let s:p.tabline.tabsel = [ [ s:base3, s:base0 ] ] let s:p.tabline.middle = [ [ s:base01, s:base02 ] ]
Now the tabline looks like this:
The pull request with these changes has been merged in, so you shouldn't encounter the bug anymore.