How do I exit Vim?
stackoverflow.com
stackoverflow.com
Player A suggests a sequence of keystrokes that supposedly works.
Player B explains why that sequence doesn't work. For example, if A says "esc colon q ! enter", B can counter with "your friend was in insert mode and had pressed ^V".
I thought the shortest winning sequence had seven keystrokes but it turns out it wasn't enough.
^Zkillall vim<Return> ^Zkillall vimThis is the shortest I can think of right now, 3 esc to exit Ctrl-v, Ctrl-r and insert mode, then :qa! to quit even if there are splits or modified background buffers.
If ^C is considered one keystroke I'd replace all esc by ^C to prevent vim from hanging forever in the following starting situation: 999999999asometext^R^V<exit sequence>
With esc it would try to insert a lot of text after the last esc, which will make vim unresponsive for days at least.
Not sure if you want to count this one: alt+sysrq+k (1 stroke or 3 strokes depending on how you count)
Yes, that seems quite complete against any preceding keystrokes I can think of, and agreed, it's better to use ^C instead of ESC.
However, your friend's environment variables caused vim to be invoked with the -y flag (vim is famously difficult so they want to always use it in "easy mode").
esc esc esc ZZ
Including another copy of vim. Or emacs. Or both!
Apt command not found in path.