Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
662 views
in Technique[技术] by (71.8m points)

colors - Customising the colours of vim's tab bar

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?

question from:https://stackoverflow.com/questions/7238113/customising-the-colours-of-vims-tab-bar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...