by soraminazuki · 6y ago · 0 comments
type :q<Enter> to exitIronically you might have learned about it sooner by using Emacs more, because then you'd be more likely to use the ctrl-v Emacs hotkey for scrolling down fast (which also works in less) and mispress it.
*core.editor*
*By default, Git uses whatever you’ve set as your default text editor via
one of the shell environment variables VISUAL or EDITOR, or else falls back
to the vi editor to create and edit your commit and tag messages*
https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
It seems that many people leave their default editor undefined so git opens vi for commit messages by default. vi tends to be symlinked to vim on many systems so that means they end up in vim (not that it makes a difference, I'm just being pedantic :).Some say vim was created to give us an excuse to hit <Esc> over and over again.
Or they might have been working on a file for hours before they want to quit it, so might not remember.
Or, they might not know how to enter :q. Entering it requires them to be in the right mode.
(I say this as someone who's used Vim for a number of years).
I doubt Vim killer save the file for you either.
Its 'ZZ', kid. Or ":q!" if you don't wanna save your mods ..