Wed, 30 Aug 2023
WILL : Change Vim Tab Colours

What I learnt Lately no. 2 : How to change the colour Vim uses for its tabs.

The editor Vim has "tabs" similar to tabs in other applications (text editors, browsers), or at least can be made similar. I use a plugin called buftabline for my Vim tabs. Vim buffers are shown as classic-style tabs along the top of the window.

One thing I didn't like was the fact that the empty space on this tab bar was shown as white :

To change this, use the "highlight" command and apply different colours to the tab elements :

That's much better and a lot clearer to see what buffer/tab I'm looking at with a glance.

This is what I have in my .vimrc settings file :

highlight TabLineFill term=bold cterm=bold ctermbg=0
highlight TabLineSel ctermfg=0 ctermbg=LightYellow

Note that the vim plugin buftabline has its own set of colour (highlight) groups e.g. BufTabLineActive (these are linked to the built-in tab groups). See the github page.

Reference :

This page was very useful :