Wikia

Vim Tips Wiki

Changes: Change the color scheme

Edit

Back to page

(Change <tt> to <code>, perhaps also minor tweak.)
Line 3: Line 3:
 
|previous=1035
 
|previous=1035
 
|next=1041
 
|next=1041
|created=November 1, 2005
+
|created=2005
 
|complexity=basic
 
|complexity=basic
 
|author=vineeth
 
|author=vineeth
Line 13: Line 13:
 
In gvim, after changing the default color scheme, the next time gvim is started, the default setting is restored.
 
In gvim, after changing the default color scheme, the next time gvim is started, the default setting is restored.
   
To retain the color scheme add <tt>colorscheme ''<scheme_name>''</tt> to <tt>vimrc</tt>.
+
To retain the color scheme add <code>colorscheme ''<scheme_name>''</code> to <code>vimrc</code>.
   
 
For example:
 
For example:
Line 21: Line 21:
   
 
==Comments==
 
==Comments==
MS Windows: Make sure <tt>HOME</tt> exists and is set to where your <tt>vimrc</tt> file is located. The <tt>$HOME</tt> environment variable can be set by going to your desktop, right click on "My Computer", click the "Advanced" tab, select "Environment Variables". If <tt>HOME</tt> is not in the list of variables, create a new variable named HOME and point it to the location of your vimrc.
+
MS Windows: Make sure <code>HOME</code> exists and is set to where your <code>vimrc</code> file is located. The <code>$HOME</code> environment variable can be set by going to your desktop, right click on "My Computer", click the "Advanced" tab, select "Environment Variables". If <code>HOME</code> 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 preset and can be seen by going to a command prompt/Terminal window and typing <code>echo $HOME</code> or in vim enter <code>:echo $HOME</code>.
   
On Unix/Linux/MacOSX this should be preset and can be seen by going to a command prompt/Terminal window and typing <tt>echo&nbsp;$HOME</tt> or in vim enter <tt>:echo&nbsp;$HOME</tt>.
 
 
 
----
 
----
Sometimes if <tt>colorscheme <colorscheme></tt> is not loading properly on startup, edit your <tt>gvimrc</tt> file and comment out or remove the lines containing <tt>highlight</tt> aka <tt>hi</tt>.
+
Sometimes if <code>colorscheme <colorscheme></code> is not loading properly on startup, edit your <code>gvimrc</code> file and comment out or remove the lines containing <code>highlight</code> aka <code>hi</code>.
   
 
Save your changes and start vim.
 
Save your changes and start vim.
   
 
----
 
----
You can set your preferred color scheme in gvim for MS Windows by editing the file <tt>vimrc</tt> in <tt>C:\Program Files\Vim</tt> or the location where you installed Vim.
+
You can set your preferred color scheme in gvim for MS Windows by editing the file <code>vimrc</code> in <code>C:\Program Files\Vim</code> or the location where you installed Vim.
   
Edit <tt>vimrc</tt> and add a line like <tt>colors <your color scheme></tt> as the last line. For example:
+
Edit <code>vimrc</code> and add a line like <code>colors <your color scheme></code> as the last line. For example:
   
 
<pre>
 
<pre>
Line 42: Line 40:
   
 
----
 
----
MS Windows: (this particular example applies to any instance of gvim), {{help|gvimrc}} states that for MS Win32 if <tt>vimrc</tt> is not in <tt>$HOME</tt>, the _gvimrc in $VIM. You may display these by issuing, <tt>:echo $VIM</tt>, or <tt>:echo $VIM</tt> from within <tt>gvim</tt>.
+
MS Windows: (this particular example applies to any instance of gvim), {{help|gvimrc}} states that for MS Win32 if <code>vimrc</code> is not in <code>$HOME</code>, the _gvimrc in $VIM. You may display these by issuing, <code>:echo $VIM</code>, or <code>:echo $VIM</code> from within <code>gvim</code>.
   
 
----
 
----

Revision as of 07:20, July 13, 2012

Tip 1036 Printable Monobook Previous Next

created 2005 · complexity basic · author vineeth · version 6.0


In gvim, after changing the default color scheme, the next time gvim is started, the default setting is restored.

To retain the color scheme add colorscheme <scheme_name> to vimrc.

For example:

colorscheme morning

Comments

MS Windows: Make sure HOME exists and is set to where your vimrc file is located. 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 preset and can be seen by going to a command prompt/Terminal window and typing echo $HOME or in vim enter :echo $HOME.


Sometimes if colorscheme <colorscheme> is not loading properly on startup, edit your gvimrc file and comment out or remove the lines containing highlight aka hi.

Save your changes and start vim.


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

Edit vimrc and add a line like colors <your color scheme> as the last line. For example:

colors koehler

Save the file and start gvim you will see your color scheme.


MS Windows: (this particular example applies to any instance of gvim), :help gvimrc states that for MS Win32 if vimrc is not in $HOME, the _gvimrc in $VIM. You may display these by issuing, :echo $VIM, or :echo $VIM from within gvim.


See also Switch_color_schemes, Color highlighting on telnet, Use the console colors in gvim


DG12 18:59, December 6, 2009 (UTC)

Around Wikia's network

Random Wiki