Vim: "E185: Cannot find color scheme solarized"

Brian Dant picture Brian Dant · Mar 9, 2013 · Viewed 12.4k times · Source

Setting up a new machine and trying to get Solarized running in Vim. Getting the following error when I run vim:

E185: Cannot find color scheme solarized

Tried to follow Pathogen install instructions from the Solarized README on the official repo. Checked this similar question & answer, which solved the problem by actually having the proper files in the directory, but as you can see below, my directory is indeed full of goodies (I just cloned it).

Details

  • iTerm2
  • .vimrc is loading, and other plugins are working
  • Tried to manually install Solarized also (by moving solarized.vim into .vim/colors), but got the same error

.vimrc

32 syntax enable  
33 " colo wombat  
34  
35 """ Solarized """  
36 let g:solarized_termcolors=256  
37 set background=dark  
38 colorscheme solarized  

.vim directory

├── autoload  
│   └── pathogen.vim  
├── bundle  
│   ├── ctrlp.vim  
│   │   ├── autoload  
│   │   │   ├── ctrlp  
│   │   │   │   ├── bookmarkdir.vim  
│   │   │   │   ├── buffertag.vim  
│   │   │   │   ├── changes.vim  
│   │   │   │   ├── dir.vim  
│   │   │   │   ├── line.vim  
│   │   │   │   ├── mixed.vim  
│   │   │   │   ├── mrufiles.vim  
│   │   │   │   ├── quickfix.vim  
│   │   │   │   ├── rtscript.vim  
│   │   │   │   ├── tag.vim  
│   │   │   │   ├── undo.vim  
│   │   │   │   └── utils.vim  
│   │   │   └── ctrlp.vim  
│   │   ├── doc  
│   │   │   ├── ctrlp.txt  
│   │   │   └── tags  
│   │   ├── plugin  
│   │   │   └── ctrlp.vim  
│   │   └── readme.md  
│   ├── supertab  
│   │   ├── Makefile  
│   │   ├── README.rst  
│   │   ├── doc  
│   │   │   ├── supertab.txt  
│   │   │   └── tags  
│   │   └── plugin  
│   │       └── supertab.vim  
│   ├── vim-colors-solarized  
│   │   ├── README.mkd  
│   │   ├── autoload  
│   │   │   └── togglebg.vim  
│   │   ├── bitmaps  
│   │   │   └── togglebg.png  
│   │   ├── colors  
│   │   │   └── solarized.vim  
│   │   └── doc  
│   │       ├── solarized.txt  
│   │       └── tags  
│   ├── vim-jade  
│   └── vim-surround  
│       ├── README.markdown  
│       ├── doc  
│       │   ├── surround.txt  
│       │   └── tags  
│       └── plugin  
│           └── surround.vim  
└── colors  
    └── wombat.vim  

Answer

Tuxdude picture Tuxdude · Mar 9, 2013

I ran into the same issue with Gnome Terminal (although gvim would work fine), and these were the lines I had to add to my .vimrc:

se t_Co=16
let g:solarized_termcolors=256  
set background=dark  
colorscheme solarized

Setting se t_co=256 without let g:solarized_termcolors=256, will also show colors, but not the right one as per the colorscheme, since it reverts to fallback mode with 256 colors.

This is similar to Mike's suggestion.