I've looked through a bunch of questions here, and I'm pretty experienced with Vim, but for some reason my .vimrc isn't setting the colorscheme any more.

I don't know when this started, but I just moved to a new machine and it's rather baffling to me. The oddest part is I'm able to set it manually :colorscheme vividchalk, it just won't work when I have colorscheme vividchalk in .vimrc. I tried commenting out absolutely everything else in my .vimrc, still no luck. Tried commenting out everything but syntax on and set t_Co=256, still no luck (and same behavior of manual settings working).

Any ideas? My setup is ssh-ing into my Ubuntu computer from Chrome OS.

11 Answers 11


[Answer completely revised for others.]

Since the ":colorscheme" command works manually it proves you have the colorscheme installed. This means you somehow have something coming after it in your initialization scripts that is overriding your preferred scheme. You can track this down by typing ":scriptnames" and reading through it for another colorscheme being loaded. Once you find it, you can remove or comment out that line in whatever initialization script it is being called from.

  • 1
    No, unfortunately it's listed there. I have vividchalk.vim in my ~/.vim/colors directory, and as I mentioned it loads perfectly fine as long as I type :colorscheme vividchalk in a vim session. It's just like something else overrides it, but nothing else is loaded. Dec 1, 2013 at 4:37
  • 1
    And here I thought I had correctly read your question. I apologize. What does the output of ":scriptnames" show?
    – Heptite
    Dec 1, 2013 at 8:23
  • No worries; thanks for taking the time to reply at all! Ah yes, and I think this is where the problem lies...so it has a bunchhh of things in there, but it's too long for this comment so I'll post it separately. On top of that, before I commented out some color thing in the synload.vim (from line 4 above), it had some error about not being able to find a colorscheme called "ansi_blows" when running :so $MYVIMRC. Any ideas which file I should investigate further? Dec 1, 2013 at 9:40
  • 1
    @Heptite There are a lot of things that are run before and after my ~/.vimrc it seems. Is there a way to just instruct that my ~/.vimrc is run last, so that that it'll overwrite whatever has happened before that?
    – dreamer
    Sep 13, 2017 at 14:05
  • 2
    In my case, my mistake was putting colorscheme ... before set t_Co=256 and causing the problem.
    – nima
    Apr 29, 2019 at 8:22

set background=dark should be before syntax enable and colorscheme whatever in your .vimrc

  • vim visual select mode kills easy use. Solution is set mouse-=a into your ~/. vimrc file but after that syntax coloring was gone. Both are necessary to turn back to the good old vim.
    – edib
    May 21, 2021 at 7:30

For others like me stumbling in:

If you are using vim or nvim inside a terminal emulator, make sure that the colors settings for your profile are right. For gnome-terminal, I had to disable "use colors from system theme" in my Preferences/Profile/Color settings before I could get my colorscheme to properly work:

enter image description here

Also, as of recently nvim has deprecated NVIM_TUI_ENABLE_TRUE_COLOR in favor of set termguicolors (see this).


I had same problem on Debian stretch, also with some other commands (color and set background work manually but not in .vimrc). But I didn't want to look through every file in scriptnames.

Solution is to add

source $VIMRUNTIME/defaults.vim

to .vimrc

This line can be found in /usr/share/vim/vimXX/vimrc_example.vim for reference (XX is vim version, in my case 80).

I suppose defaults.vim does some configuration stuff necessary for changing the color. But defaults.vim is not loaded if the user has a ~/.vimrc, according to /usr/share/vim/vimrc

" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.

In my case I use color schemes from plugins (external repositories). So I have to load plugins before applying colorscheme command.



When using gvim, it may be necessary to put colorscheme vividchalk also in the .gvimrc file, despite this already being present in .vimrc

:scriptnames may reveal when a default colorscheme like /usr/share/vim/vim80/colors/ron.vim is being loaded.


In my case, I just duplicated an existing theme, delek.vim, and renamed it to mydelek.vim and changed a few colors. However, colorscheme mydelek in .vimrc would still load delek.vim.

Then I figured out I also need to change this line inside mydelek.vim:

let g:colors_name = "delek"


let g:colors_name = "mydelek"

After that mydelek was properly loaded instead of delek. Hope this helps somebody who is also just tweaking an existing theme.


Had the same issue and my problem was putting the

   call plug#end()

at the end of the .vimrc file instead of right after the plugin list. Posting it here, so it may help someone finding this thread via search engine.


I think there is some issue with your system first you need to check the Use colour from system

For that go to Preferences and Colors section you will get this option (by default it is uncheck in some system)

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 26, 2022 at 16:35
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.

let g:skip_defaults_vim = 1


I need to reload ~/.vimrc everytime I open the vim so that the colorscheme would work.

Add this remap into .vimrc:

nnoremap <leader>v :source ~/.vimrc<CR>


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .