In vim, when you create a new tab, the tab bar appears at the top of the screen. On the left are all your tabs, on the far right is an "X" for closing the tabs. In between, there is "empty" space, that on my screen appears white.
I'll admit, I'm very picky about how my terminal looks, and this bright white bar at the top of the screen is distracting. Is it possible to change this color to black, or maybe even gray?
The ctermfg=white is used to set the foreground color to white in a terminal text editor. Finally, the ctermbg=black is used to set the background color to black in a terminal text editor.
The default Vim color scheme in a light terminal is peachpuff . If you use a dark terminal, the initial color scheme is ron .
In Vim, if your color scheme supports both a light and dark mode, you switch between by using the command: set background=dark or set background=light . In Alacritty, you can define multiple color schemes and switch between them easily in the config file alacritty.
In NORMAL mode, type /\t and hit <Enter> .
For a black tab bar (color 0
)
:hi TabLineFill term=bold cterm=bold ctermbg=0
Use vim's highlight command to set the attributes you want on the TabLineFill group.
This command will show you a list of all the current groups and their highlight attributes.
:hi
Find TabLineFill, and next to it you will see a preview of how your "tab line" will appear. Also note the attributes on this line.
In order for the color you want to be displayed, the attribute representing your terminal needs to be set to "bold". The two options are "term" and "cterm". If your using vim in a color terminal, then cterm will apply, otherwise term will apply. Set these attributes to bold like this:
:hi TabLineFill term=bold cterm=bold
The attribute "ctermbg" may or may not appear on the TabLineFill line, but it is used to define the color of the terminal background. See the list of cterm-color options by typing:
:help cterm-colors
Choose a color (for unobtrusive, I recommend 0, which is Black), then set the ctermbg attribute to the code for that color:
:hi TabLineFill ctermbg=0
This can all be combined into one single command:
:hi TabLineFill term=bold cterm=bold ctermbg=0
Try the following: (you can put that in your .vimrc)
:hi TabLineFill ctermbg=100
you can play with the colors and choose one that you like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With