How to set background in Vim

The background setting in Vim is used to determine what colors to use for rendering the various elements of the editor. The setting takes one of only two values: dark or light.

By default, light background is used for GVim. For terminal Vim, the default background value is set based on the terminal. So, sometimes you may be using a dark terminal, but Vim might still use the light background. This results in weird colors that make Vim hard to use.

To control the background yourself, set it in your vimrc. For example, I like to set light background for GVim and dark background for all terminals:

Tried with: Vim 7.3 and Ubuntu 12.04 LTS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.