I got hit by this so often and never knew the reason. At least I know who's to blame now.
explicitly using vim (rather than the vi alias) is supposed to give the return code behavior you prefer.
explicitly using vim (rather than the vi alias) is supposed to give the return code behavior you prefer.