E185: Cannot find color scheme solarized
Asked Answered
A

10

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?

Algorithm answered 10/1, 2012 at 14:23 Comment(0)
K
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

Khaki answered 10/1, 2012 at 15:44 Comment(1)
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.Algorithm
U
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!

Unconditioned answered 13/2, 2012 at 17:22 Comment(3)
In my case "call pathogen#infect()" had been commented out when I pasted it into my .vimrc I uncommented it and now everything works.Hutchens
for those using janus + pathogen, insert settings after call janus#load_pathogenHalftone
Same for Vundle: insert the call vundle#end() line immediately after the Plugin [...] lines and before the settings (i.e. colorscheme solarized).Steffaniesteffen
K
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

Khaki answered 10/1, 2012 at 15:44 Comment(1)
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.Algorithm
S
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/.

Sacrament answered 10/1, 2012 at 14:41 Comment(3)
But then I won't be able to manage it with pathogen right? According to the Solarized website, not only should it work with solarized in the bundle directory, it is the recommended approach.Algorithm
Maybe pathogen is not loaded properly. You should check :set rtp?.Sacrament
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/afterAlgorithm
S
7

This is what I did;

cp ~/.vim/bundle/vim-colors-solarized/colors/solarized.vim ~/.vim/colors/
Sculpturesque answered 13/6, 2016 at 4:53 Comment(0)
C
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.

Cappadocia answered 8/7, 2012 at 17:24 Comment(0)
V
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

Vanhook answered 26/1, 2012 at 18:45 Comment(0)
T
1

I was getting this problem and I fixed it by issuing

cd ~/.yadr
git pull
rake update
Triptych answered 28/4, 2013 at 16:52 Comment(0)
C
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/
Composer answered 22/10, 2017 at 9:38 Comment(1)
This requires manual updating, which is really overkill when there's an actual solution to it in the same issue, which was posted 2 years before you posted the answerFermi
I
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!

Irita answered 11/5, 2022 at 11:25 Comment(0)
A
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
Adjoining answered 16/12, 2022 at 9:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.