Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customising the colours of vim's tab bar

Tags:

vim

tabs

colors

How would one go about modifying the colour of vim's tab bar?

I have tried using

:hi TabLineFill ctermbg=N 

which does change the colour of the tab bar's background to the colour that 'N' signifies, but this is all I have managed to glean from Googling. I had a look at :help cterm-colors, but I did not gain much more of an understanding from it.

Would I be able to use this highlight facility to change the colour of an active tab's foreground and background, and an inactive tab's foreground and background? If so, how would I go about doing this?

like image 690
Pádraig Avatar asked Aug 30 '11 02:08

Pádraig


1 Answers

You can do the following, for example:

:hi TabLineFill ctermfg=LightGreen ctermbg=DarkGreen :hi TabLine ctermfg=Blue ctermbg=Yellow :hi TabLineSel ctermfg=Red ctermbg=Yellow 

This line affects the window counter per tab:

:hi Title ctermfg=LightBlue ctermbg=Magenta 

Garish colours chosen to highlight what each of the items changes.

I find that looking at $VIMRUNTIME/colors/*.vim really helps when playing with highlighting.

Note that these change the colours for Vim running in a console. If you want to change the colours for GVim, you need to use guibg, guifg, et cetera. For example:

:hi TabLineFill guifg=LightGreen guibg=DarkGreen ctermfg=LightGreen ctermbg=DarkGreen 
like image 132
Johnsyweb Avatar answered Sep 23 '22 07:09

Johnsyweb