Sometimes I have to use a Mac, and various things drive me nuts about it. The worst is git commit
aborting because I typoed the writeout command after having written the best commit log ever. Here’s a google crumb for others experiencing this, and ideally for someone who wants to track down and fix the problem upstream.
Synopsis: do the below, and type the following once vim starts up: :Wq[enter]:q[enter]
$ vi || echo broken broken $ vim || echo broken $ vim --version VIM - Vi IMproved 7.4 (2010 Aug 15, compiled Jul 9 2015 23:58:42) Compiled by root@apple.com [...]
/usr/bin/vi
is of course a symlink to /usr/bin/vim
that makes it act worse. Now, there are some folks who have various theories about why vi is different in this respect, or what vimrc stuff might cause vi to exit with an error if some error happened once upon a time in the editing session, but honestly I can’t find myself caring. Instead I just set my $EDITOR to pretend vi doesn’t exist anymore.