Isn't it just...
[Esc] :wq
...or...
[Esc] :q!
...depending if you want to save the current document or not?
Isn't it just...
[Esc] :wq
...or...
[Esc] :q!
...depending if you want to save the current document or not?
[EDIT] also, a typical mid-level computer user's tendency to slap "ESC" when panicked. Ha!
If there is such a thing as user hostile in the world of CLI tools, then dropping the user unannounced into vi with some open buffer most definitely counts as user hostile.
git rebase -i
For example
Then, the program tells them "Type :quit<Enter> to exit Vim"
And if the user is capable of reading, they shouldn't have any problem.
If they don't know about ctrl-c, they shouldn't be using a terminal editor.
But if you've typed anything, this won't quite work. <ctrl> c will take you out of insert mode, but won't offer any prompt. <ctrl> c again will bring up the quit prompt, but that's not intuitive the way doing it the first time is. And if you type the wrong thing after the first <ctrl> c, you'll break back into insert mode and have to take another run at it.
I remember getting stuck in vim because git bash uses it as a default editor. It happened when I forgot to enter a commit message, which meant that I started typing a commit message and thereby lost the useful prompt when I went to quit.
edit: per another thread, this gets far worse if you don't realize the ':' is active and not a prompt to "type: quit". That error sets off a maze that will never show you the prompt again to find your mistake.
If you try to <ctrl>-c, the program even tells you to use :q
It's just become a meme at this point.
Edit: ah quit foreground process, ignore me
<ctrl>-c is how you kill the foreground process in bash, zsh, sh, windows command line, etc...
If you don't know about <ctrl>-c you shouldn't be attempting to use a terminal based editor to begin with. Vim can't be blamed for people not knowing how to use a terminal.
And then you do and it helpfully adds ":q" to the buffer.
You're still in vim.
I don't blame people for being confused though.. I remember getting stuck in vim all the time back in the day because of a default $EDITOR value.
I love vim and I've used all of those at some point. I'd never pretend there's no learning curve, just that the learning curve is worth it.
[Esc] :x
to save and exit.