I seemed to have an issue running the bundled vim (/usr/bin/vim), for
example:
$ /usr/bin/vim
...
:w foo.txt
:q
$ echo $?
1
But if I use vim built by myself:
$ /Applications/Vim.app/Contents/MacOS/Vim
...
:w bar.txt
:q
$ echo $?
0
This will cause a problem when I use EDITOR=vim for most VCS,
because they use exit code of editor to determinate whether a commit
message is successfully written.
Do some one else occur to have the same problem?
- Jiang
> I seemed to have an issue running the bundled vim (/usr/bin/vim), for
> example:
This is on Leopard? Then I had the same (or a similar problem). I
solved the problem by updating the a.vim plugin to the latest version.
I basically did a binary search by deleting my .vimrc and files in
.vim to find which plugin/configuration filed caused the problem.
Rainer
I set EDITOR to vim and kept the fixes that made that work.
George
Vim returns a non-zero exit code when there was any error while editing.
This is because of Posix compatibility. However, this should only
happen when in Ex mode, thus using "vim -e" or after "Q". It's unclear
why it would happen when starting vim and using ":q" from Normal mode.
I can't reproduce it.
--
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This happens to me on 10.5.6 (vim 7.2.22).
Running "vim", searching for a non-existent string "/asdf<CR>", then
quitting ":q<CR>" will produce an exit code of 1.
For some reason this only happens when I run "vim", and not "/usr/bin/
vim".
Here's a shell log of me doing the above steps with the two different
process names:
octopus:~ jrray$ vim || echo failed
failed
octopus:~ jrray$ /usr/bin/vim || echo failed
octopus:~ jrray$ which vim
/usr/bin/vim
This continues to happen after I move my ~/.vim dir and ~/.vimrc file
out of the way.
Interesting. Thanks for find that out. Now I see why my "svn commit"
always has this strange failure. It seems I can at least use "export
EDITOR=/usr/bin/vim" as a workaround, before the root cause is
identified.
--
Wu Yongwei
URL: http://wyw.dcweb.cn/