Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #1036 - Change the color scheme

Created: November 1, 2005 8:19 Complexity: basic Author: vineeth Version: 6.0 Karma: 159/132 Imported from: Tip#1036

In gvim , sometimes we change the default color scheme (say to morning) , but the next time we start gvim, this setting will be lost.

One way to retain this is by adding the following line in one of the vim scripts under the plugin directory >>

colorscheme <scheme_name>

for example:

colorscheme morning " for morning color scheme when gvim is started.

Comments

Customizations, such as presented in this tip, go (not in the plugin directory but) in the vimrc file (.vimrc or _vimrc). See :help vimrc


anon , November 1, 2005 9:10


.gvimrc / _gvimrc works for GVim specific customizations

Anonymous , November 1, 2005 10:49


What is the VIMRC option syntax? It is not easly found in the documentation, that could be better done.

Anonymous , March 3, 2006 5:47


VIMRC option syntax: colorscheme darkblue


Anonymous , March 11, 2006 2:59


On Windows, the only place that appears to work is by creating a vim file in the plugin directory. None of the other standard locations that I can find will properly set the color at startup. This includes .vimrc and _vimrc.

Anonymous , June 23, 2006 17:30


This works for me on Windows. Make sure your "HOME" environment variable exists and is set to where your .vimrc file is located.

Anonymous , June 26, 2006 8:58


It would help if this website bothered to mention where $HOME could be set in the Windows environment instead of just referring to it.

totman--AT--gmail.com , August 15, 2006 9:16


On Windows, the $HOME environment variable can be set by going to your desktop, right click on "My Computer", click the "Advanced" tab, select "Environment Variables". If HOME is not in the list of variables, create a new variable named HOME and point it to the location of your vimrc.

On Unix/Linux/MacOSX this should be set automatically and can be easily seen by going to a command propt/Terminal window and typing "echo $HOME".

mdrisser--AT--gmail.com , September 8, 2006 12:40


Noticed one thing about colorscheme <colorscheme> not working, if you have a gvimrc file and are having trouble getting your colorscheme to load properly on startup, edit your gvimrc file and comment out or remove (at your own risk :^) ) the lines containing highlight ...

Save your changes and restart vim, your colorscheme should now load.

anon , September 8, 2006 13:02


You can set your prefered color scheme in gvim for windows by editing the file _vimrc. This file you can find in "C:\Program Files\Vim" or any other location where u have installed your Vim. Then just open the _vimrc file in some editor and add a line like colors <your favourite color scheme> as the last line.

for eg: colors koehler or colors blue

then save the file and start your gvim you can see your favourite color scheme in starting itself.

Ansar , January 3, 2007 22:35


You can set your prefered color scheme in gvim for windows by editing the file _vimrc. This file you can find in "C:\Program Files\Vim" or any other location where u have installed your Vim. Then just open the _vimrc file in some editor and add a line like colors <your favourite color scheme> as the last line.

for eg: colors koehler or colors blue

then save the file and start your gvim you can see your favourite color scheme in starting itself.

ansarmk--AT--yahoo.com , January 3, 2007 22:42


Advertisement