I have a problem wherein, whenever I start VIM the colorscheme I set on my .vimrc it doesn't take effect upon first running VIM, but then whenever I execute :colorscheme 'mycolorscheme' the colorscheme is applied.

I'm a beginner in linux, so please bear with me.

I'm just thinking if there is a setting that should be set. Here are the settings I set using xterm.

  1. .Xresources

    *customization: -color
    XTerm*termName: xterm-256color
  2. .xsession

    if [ -f $HOME/.Xresources ]; then
         xrdb -merge $HOME/.Xresources

Upon running xrdb -query Here's the output:

XTerm*termName: xterm-256color
Xft.dpi:    96
Xft.antialias:  1
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:   rgb
Xft.lcdfilter:  lcddefault

Btw, only the colorscheme don't take effect whenever i want to start VIM. But all mapping and other settings work

Here's my .vimrc

"           VUNDLE SETTINGS                    "

set nocompatible " be iMproved 
filetype off    " required!

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
filetype plugin indent on " required!

"           PLUGINS                            "
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tristen/vim-sparkup'
Bundle 'tpope/vim-surround'
Bundle 'godlygeek/csapprox'

"           COLOR SCHEMES                      "

"   Distinguised
Bundle 'Lokaltog/vim-distinguished'
"   Github  
Bundle 'endel/vim-github-colorscheme'
"   VividChalk  
Bundle 'tpope/vim-vividchalk'
"   Pyte    
Bundle 'therubymug/vim-pyte'
"   Vibrantink
Bundle 'vim-scripts/vibrantink'

"           MAP LEADER                         "
let mapleader = ","

"           SYNTAX                             "
syntax enable

"           VIM SCRIPTS                        "
if has('gui_running') 
    colorscheme github
    colorscheme pyte

"           CUSTOM SETTINGS                    "
"                                              "
set hidden

" Show what mode you're currently at
set showmode

" Enable enhanced command line completion
set wildmenu

" Don't redraw while executing macros
set lazyredraw

" Indentation settings (SOFT TABS)"
set shiftwidth=4
set softtabstop=4
set smarttab
set expandtab "enable this to use spaces instead of tabs

" show line number
set nu

" hightlight as you type
set incsearch
" ignore case when searching
set ignorecase

" set statusline
set laststatus=2

"       NOTE don't map <c-s> and <c-q>         "

"           KEYMAPS                            "

"*******NORMAL MODE MAPPING********"
"map for editing .vimrc
nnoremap <leader>ev :e $MYVIMRC<cr>
"map for sourcing vimrc
nnoremap <leader>sv :so $MYVIMRC<cr>
"map for switching windows
"_ in this keymap is to jump for a line with a nonblank char
nnoremap <space> <c-w><c-w>_

"*******INSERT MODE Mapping********"
"map for escape while in insert mode
inoremap <leader>; <esc>
"map for ins-completion
inoremap <leader>x <c-x>

"*********COMMAND MODE Mappings*******
"exit out of command line mode
cnoremap <leader>; <c-c>


It doesn't work whatever terminal emulator i used. Either gnome-terminal or xterm. It seems like the colorsheme is indeed loaded. Upon first loading, Typing :colorscheme reports the correct colorscheme which i set on my .vimrc. But it doesn't take effect the first time. I have to either type on VIM

:colo 'colorschemename'

or source it again to activate the colorscheme using


But after exiting VIM, the colorscheme again doesn't take effect but it is loaded upon starting VIM.

Thanks in advance.

  • it works on gvim but not on terminal :( – chanHXC Aug 11 '13 at 16:48

Put a colorscheme directive in your ~/.vimrc file

For example

colorscheme evening


With your ~/.vimrc and installation of Vundle I reproduced your problem. Add

set t_Co=256
colorscheme evening 

at the end of your ~/.vimrc and see if this works for you.

You can see also http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal

| improve this answer | |
  • Can I see your ~/.vimrc ? – tuxar Aug 11 '13 at 13:23
  • i've edited the question. I've added my .vimrc – chanHXC Aug 11 '13 at 13:45
  • Maybe you can backup your ~/.vimrc and then put only the colorscheme evening just to ensure that the problem relates to the ~/.vimrc file. – tuxar Aug 11 '13 at 14:33
  • yes, something's wrong with my .vimrc i've only use colorscheme evening and it works – chanHXC Aug 11 '13 at 15:04
  • only the default colorschemes work upon starting VIM though all colorschemes work when executing them using :colorscheme echo $TERM "outputs xterm-256color AND set t_Co=256 i still can't make it work :( – chanHXC Aug 11 '13 at 16:07

I found the solution. I think i have to answer my own question. I'm really on despair so i went on to removing the plugins one by one through BundleClean! in Vundle to check if there's any plugin misbehaving.

It was not a problem with my .vimrc after all. It was a conflict with EasyMotion and CSApprox plugins.

I had my EasyMotion configuration before CSApprox on Vundle I followed the instructions on this one.


Here's another one that might help others with the same issues as mine.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.