Vim Tips Wiki
Register
No edit summary
Line 53: Line 53:
 
 
 
I had to go looking elsewhere to chase that down.
 
I had to go looking elsewhere to chase that down.
  +
  +
----
  +
  +
[[One page summary of color schemes]]

Revision as of 14:22, 1 September 2008

Tip 1036 Printable Monobook Previous Next

created November 1, 2005 · complexity basic · author vineeth · version 6.0


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

One way to retain this is by adding the following line in your vimrc :colorscheme <scheme_name>

For example:

colorscheme morning

Comments

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


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".


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 the lines containing highlight.

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


You can set your preferred color scheme in gvim for Windows by editing the file vimrc. This file you can find in "C:\Program Files\Vim" or other location where you have installed Vim.

Then just open the vimrc file and add a line like colors <your favourite color scheme> as the last line. For example:

colors koehler

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


When using Windows (this particular example applies to any instance of gvim), you will see at :help gvimrc that for Win32 if it's not in $HOME, you may file _gvimrc in $VIM. You may display these variables by issuing, ":echo $VIM", or ":echo $HOME", and you will know exactly what you are dealing with.


What this discussion fails to point out is that you should place your color scheme files in ~/.vim/colors

I had to go looking elsewhere to chase that down.


One page summary of color schemes