Question

When I do

:colorscheme vilight 

it loads the color scheme fine.

So I added

colorscheme vilight

to my .vimrc but its not loading it on start. Am I missing something?

Also in my config

set background=dark 
syntax on
colorscheme vilight 
set lines=60 columns=200
Was it helpful?

Solution

Are you using gvim? It is possible that your .gvimrc or the system's gvimrc file is overriding the colorscheme selection from your .vimrc.

OTHER TIPS

Sometimes it helps to put the colorscheme at the end of the _gvimrc .gvimrc file which is read (after SYNTAX ON). Also be sure that HOME is read. Sometimes gvim still reads from the installation path.

For Macvim, the solution would be add the following into your .vimrc:

let macvim_skip_colorscheme=1

Then it will respect your choice in .vimrc.

I have the same problem! MacVim does not load my colorscheme on start. However, vim run from the command line does. Is this a MacVim issue then?

I cleared my .vimrc and just left the colorscheme lines and it still does not work.

set background=dark
colorscheme solarized
syntax on

However, doing

:set background=dark
:colorscheme solarized

after startup works.

UPDATE: I found out that MacVim loads both .vimrc and .gvimrc and in my case, stuff in .gvimrc was the problem.

Do you have syntax on in your .vimrc?

I've had this problem too when I took a .vimrc from gVim for windows and used it with MacVim.

I noticed that the vi that comes with snow leopard complains about lines ending with ^M (aka carriage return, or "\r"). After converting the dos-style newlines to unix-style the problem was solved. (*)

MacVim does not complain about this, but apparently does have a problem loading the .vimrc when it contains dos-style newlines.

(*) - Dos/windows style new lines are composed of a carriage return and a line feed ('\r\n'), unix style newlines contain only a line feed ('\n').

Had the same problem. Commenting out set background=light in file .gvim fixed the issue for me.

Just add line "source .vimrc" in the end of .gvimrc

If you are using MacVim I had problems loading downloaded color schemes too. I found out that if you move the color schemes to:

/Applications/MacVim.app/Contents/Resources/vim/runtime/colors

Then it would work in your .gvimrc

For MacVim users, deleting the following native vimrc and gvimrc probably works.

rm /Applications/MacVim.app/Contents/Resources/vim/vimrc
rm /Applications/MacVim.app/Contents/Resources/vim/gvimrc
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top