Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What colorscheme settings control text background colors in Vim (terminal version)?

Tags:

bash

vim

I run vim in a full-screen bash terminal with transparency enabled. (This is a nice setup for a laptop--almost makes me not miss my multi-monitor rig when I'm away from my desk.)

The trouble I'm running into is that most color schemes, such as the otherwise excellent desert256, set some kind of highlighting color behind the text, usually black. The net effect is a mostly transparent terminal with blocks of black behind each line of code, obscuring whatever they are in front of.

Some of the default color schemes, such as elflord, do not do this. The background remains consistently transparent.

Is there a setting I can execute in my .vimrc after setting the colorscheme to remove the text background color? I use a pathogen plugin to refresh my color schemes from GitHub, so I don't want to edit my local copies.

like image 445
Josh Earl Avatar asked Jan 02 '12 00:01

Josh Earl


People also ask

How do I change the background color in vim?

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.

How do you change the color of text in vim?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.

What is vim default Colorscheme?

The default Vim color scheme in a light terminal is peachpuff . If you use a dark terminal, the initial color scheme is ron .

Where does vim look for colors?

By default, Vim looks for colorschemes in the <runtimepath>/colors/ directory.


1 Answers

Found the answer. I added this to my .vimrc after the colorscheme line:

hi Normal ctermbg=NONE
like image 84
Josh Earl Avatar answered Oct 13 '22 00:10

Josh Earl