Tuesday, March 25, 2008

Vim: Weird OS X (10.5) Problem

I went to check something into Subversion using Vi (i.e. Vim) as my EDITOR, and I got the following:
$ svn ci
svn: Commit failed (details follow):
svn: system('vi svn-commit.tmp') returned 256
Sure enough, even entering Vim and immediately exiting would return a non-zero exit status:
$ vi
$ echo $?
1
I read somewhere that this might be because of a bad plugin. Sure enough, the following fixed it:
cd ~/.vim
mv doc/rails.txt plugin/rails.vim ~/.Trash
Weird.

8 comments:

Anonymous said...

Are you sure about the EDITOR?

$ env | grep EDITOR
EDITOR=vim

$ which vim
/opt/local/bin/vim

Shannon -jj Behrens said...

$ echo $EDITOR
vi
$ which vim
/usr/bin/vim

Shannon -jj Behrens said...

(And of course, /usr/bin/vi is just a symlink to /usr/bin/vim.)

Martin Wood said...

Thanks, Shannon - had the same problem and removing the rails plugin solved it.

Quite why the rails plugin would affect this is another matter...I initially put it down to a problem with the Leopard vim build as everything was hunky-dory under 10.4.

Now I can go back to doing SVN commits without using the "-m" option :-)

Aditya said...

Why not just export SVN_EDITOR="vim --noplugin" instead of removing your plugins?

Shannon -jj Behrens said...

> Why not just export SVN_EDITOR="vim --noplugin" instead of removing your plugins?

Nice idea, although I still think Vim shouldn't be exiting with a non-zero status.

Augur said...

You can also have this issue if your ~/.vim or ~/.vimrc directories are symlinks. I found this to be true using Vim 7.2

Shannon -jj Behrens said...

Interesting. I have a fuzzy memory of creating a symlink for something like .vimoutliner so that the actual files would exist inside the .vim directory.