49

I have Solarized installed via pathogen and it's been working fine in both terminal and MacVim on my Mac. Today, I tried setting up an Ubuntu box on Linode. I just cloned my dotfiles and symlinked to my .vim and .vimrc folders (this is the same setup as I use on my local machine.

Whenever I try to run vim on the Ubuntu box I get an error

Error detected while processing /root/.vimrc:
line   43:
E185: Cannot find color scheme solarized
Press ENTER or type command to continue

I can tell my .vimrc is being loaded because all other setting like line numbers are working.

The related lines in .vimrc are the following:

" settings needed for solarized colorscheme
syntax enable
set background=dark
let g:solarized_termcolors=256
colorscheme solarized

This is the setup of my .vim/bundle directory (incase you suspect I don't actually have solzrized in there!):

~  ls .vim/bundle 
ack                  coffeescript         liquid               snipmate             vim-colors-solarized vim-jst              zencoding
closetag             html5.vim            nerdtree             surround             vim-javascript       vim-rails

One other thing, running echo &t_Co in vim on the ubunto box gets me 256.

Any ideas?

David Tuite
  • 22,258
  • 25
  • 106
  • 176

10 Answers10

48

I was running into this problem just now, too. I had my call pathogen#infect() line in my .vimrc just fine, but was getting the

E185: Cannot find color scheme solarized

error, like you. I moved my call pathogen#infect() up to the top of my .vimrc and all is swell now. Try that if you're still having problems!

Bodhi
  • 1,437
  • 1
  • 13
  • 21
  • In my case "call pathogen#infect()" had been commented out when I pasted it into my .vimrc I uncommented it and now everything works. – oalders Feb 16 '12 at 21:31
  • 1
    for those using janus + pathogen, insert settings after `call janus#load_pathogen` – random-forest-cat Feb 16 '14 at 21:11
  • 2
    Same for Vundle: insert the `call vundle#end()` line immediately after the `Plugin [...]` lines and before the settings (i.e. `colorscheme solarized`). – Andrei Simionescu May 01 '14 at 02:27
17

I know that it is kind of obvious, but did you check the contents of ~/.vim/bundle/vim-colors-solarized? Just in case you are running in the same issue described in Vim: Pathogen not loading

Community
  • 1
  • 1
mMontu
  • 8,983
  • 4
  • 38
  • 53
  • 2
    I'm embarrassed to say that this is the correct answer. I wasn't using submodules to manage my bundles which meant that the vim bundles were not cloned when I cloned my dotfiles. The bundle directories were present but empty. – David Tuite Jan 22 '13 at 17:07
8
:colo[rscheme] {name}   Load color scheme {name}.  This searches 'runtimepath'
            for the file "colors/{name}.vim.  The first one that
            is found is loaded.

You should put solarized.vim in ~/.vim/colors/.

kev
  • 155,172
  • 47
  • 273
  • 272
  • But then I won't be able to manage it with [pathogen](http://www.vim.org/scripts/script.php?script_id=2332) right? According to the [Solarized website](https://github.com/altercation/vim-colors-solarized), not only should it work with solarized in the `bundle` directory, it is the recommended approach. – David Tuite Jan 10 '12 at 14:47
  • Maybe `pathogen` is not loaded properly. You should check `:set rtp?`. – kev Jan 10 '12 at 14:56
  • Looks ok to me? `runtimepath=~/.vim,~/.vim/bundle/ack,~/.vim/bundle/closetag,~/.vim/bundle/coffeescript,~/.vim/bundle/html5.vim,~/.vim/bundle/liquid,~/.vim/bundle/nerdtree,~/.vim/bundle/snipmate,~/.vim/bundle/su rround,~/.vim/bundle/vim-colors-solarized,~/.vim/bundle/vim-javascript,~/.vim/bundle/vim-jst,~/.vim/bundle/vim-rails,~/.vim/bundle/zencoding,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/ vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after` – David Tuite Jan 10 '12 at 15:30
7

This is what I did;

cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
Dean
  • 135
  • 2
  • 10
3

I just ran into this problem myself on a new CentOS box where 'vi' was mapped to a version of VIM without syntax support (ie. -syntax) and was giving the E185: Cannot find color scheme solarized error, while 'vim' mapped to a version with syntax support and worked fine with solarized.

Aliasing 'vi' to 'vim' resolved the issue.


For reference:

To check if the version of vim that you are running has support for syntax highlighting, run :version from within vim. -syntax means no support, +syntax means it has support.

To create the alias, append alias vi='vim' to your ~/.bashrc or ~/.bash_profile

To re-source, type source ~/.bashrc or source ~/.bash_profile, whichever is appropriate for your setup.

alanning
  • 5,198
  • 2
  • 34
  • 33
2

One step you might be missing is to add

call pathogen#infect()

to your .vimrc file.

Src: http://www.vim.org/scripts/script.php?script_id=2332

Raging
  • 21
  • 1
1

I was getting this problem and I fixed it by issuing

cd ~/.yadr
git pull
rake update
Todd Baur
  • 995
  • 8
  • 22
1

I fix it ;)

Found this bug:

https://github.com/altercation/vim-colors-solarized/issues/104

cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
Luisangonzalez
  • 129
  • 1
  • 7
  • This requires manual updating, which is really overkill when there's [an actual solution](https://github.com/altercation/vim-colors-solarized/issues/104#issuecomment-71037368) to it in the same issue, which was posted 2 years before you posted the answer – Zoe Jan 25 '19 at 12:09
0

As Ryan Ransford said:

With the new version of vundle (Vundle.vim),

it appears as though "colorscheme solarized" must

come somewhere after "call vundle#end()".

This works for me!

Vittore Marcas
  • 1,007
  • 8
  • 11
0

I have the same issue and resolve it after moving color setting after call vundle#end() in ~/.vimrc

...
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'

call vundle#end()            " required
filetype plugin indent on    " required

if has('gui_running')
  set background=dark
  colorscheme solarized
else
  colorscheme zenburn
endif
j3ffyang
  • 1,049
  • 12
  • 12