VIM Color scheme not loading by default
Solution 1
Are you using gvim? It is possible that your .gvimrc or the system's gvimrc file is overriding the colorscheme selection from your .vimrc.
Solution 2
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.
Solution 3
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.
Solution 4
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.
Solution 5
Do you have syntax on
in your .vimrc
?
kush
My work calls me a Senior Software Engineer I know Ruby, JS (vue.js, etc), Erlang/Elixir, HTML/CSS. I have built side projects in Rust, Clojure (my love), and Go. I've been using Linux and MacOS forever and know both really well (although some linux are weird). I'm technically a front-end dev but I've run my own web businesses where I did everything from design, marketing, PR, server, ets.
Updated on July 09, 2022Comments
-
kush almost 2 years
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
-
kush about 14 yearsyep syntax on colorscheme vilight
-
Benjamin Oakes about 14 yearsHrm... I just tried your config on my machine (not with
vilight
, but a colorscheme I have installed) and it works. You havevilight.vim
in$HOME/.vim/colors/
, correct? -
ericbn almost 7 yearsI had to use this when the theme was not properly setting the
g:colors_name
value properly. Fixing this in the theme solved the issue. -
Nikhil CSB over 4 yearsI'm using MacVim, but I'm facing the same issue. I could not find a .gvimrc in my home directory. Could you help me?
-
tavor999 about 4 yearsReally odd but this finally fixed issue on my mac. Didn't work:
set background=dark
Did work:set background=light
Gotta get my peachpuff colorscheme!