Vim-pathogen: Cannot find color scheme when git commit fires up vim

Created on 31 Jul 2012  路  4Comments  路  Source: tpope/vim-pathogen

I don't know if this is a problem with solarized, or with pathogen, or with something git is doing that I'm not aware of.

I set up my vimrc to do pathogen based vim configs, and I added the solarized colorset as described here: http://ethanschoonover.com/solarized/vim-colors-solarized

now whenever git throws up vim to commit stuff:

$ git commit -a
Error detected while processing /home/dkowis/.vimrc:
line   25:
E185: Cannot find color scheme solarized
Press ENTER or type command to continue

my ~/.vimrc

$ cat ~/.vimrc 
call pathogen#infect()
syntax on
filetype plugin indent on

set modeline

set ts=2
set sw=2
set smarttab
set expandtab
set cindent
set autoindent

" enable showing of matching braces
set showmatch
set mat=5
"set list

"Solarized colors!
set background=dark
if ! has('gui_running')
  let g:solarized_termcolors=256
  set t_Co=256
endif
colorscheme solarized

Did I do something incorrect regarding my pathogen setup, or perhaps git's firing off of vim and solarized color schemes don't get along? Thanks for the help. (google wasn't particularly useful :( )

Most helpful comment

Somewhat disappointing:

dkowis    5491  0.0  0.0 116476  1812 pts/5    S+   18:28   0:00 git commit -a
dkowis    5492  0.0  0.0 118220  1484 pts/5    S+   18:28   0:00 vi .git/COMMIT_EDITMSG

I always type in vi when I edit a file, rarely ever vim so I don't think that's the problem..... Actually....
That does seem to be the problem I entered vi /tmp/foobar:

dkowis    5760  0.5  0.0 154576  3672 pts/7    S+   18:29   0:00 vim /tmp/foobar

So somehow, git doesn't know about my alias. HRM. I shall export EDITOR=vim and see if that rectifies the situation. Yep, that did it. Aliases that git was ignoring caused my problem and EDITOR was unset, so it just happily used vi.

Problem solved! Thanks :D

All 4 comments

This happens on firing of git commit, but not when running vim?

That's correct. Everything works just fine when using vim or gvim

Sounds like Git is invoking Vim weird, maybe? Check ps aux while it's running and see if you can find exactly how vim was invoked.

Somewhat disappointing:

dkowis    5491  0.0  0.0 116476  1812 pts/5    S+   18:28   0:00 git commit -a
dkowis    5492  0.0  0.0 118220  1484 pts/5    S+   18:28   0:00 vi .git/COMMIT_EDITMSG

I always type in vi when I edit a file, rarely ever vim so I don't think that's the problem..... Actually....
That does seem to be the problem I entered vi /tmp/foobar:

dkowis    5760  0.5  0.0 154576  3672 pts/7    S+   18:29   0:00 vim /tmp/foobar

So somehow, git doesn't know about my alias. HRM. I shall export EDITOR=vim and see if that rectifies the situation. Yep, that did it. Aliases that git was ignoring caused my problem and EDITOR was unset, so it just happily used vi.

Problem solved! Thanks :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreasmischke picture andreasmischke  路  25Comments

FigmentEngine picture FigmentEngine  路  30Comments

zerobatu picture zerobatu  路  3Comments

codepushr picture codepushr  路  3Comments

bitc picture bitc  路  3Comments