3 ms·
Here's a fun game. The backstory: your friend has started vim because of some unfortunate environment variable settings, has typed some keystrokes and now needs
by jks 4y ago
Here's a fun game. The backstory: your friend has started vim because of some unfortunate environment variable settings, has typed some keystrokes and now needs your help to exit vim.
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.
- iamevn 4y agohow about ^Zkillall vim<Return>
- jks 4y agoThe ^V your friend had entered in insert mode will escape the ^Z so your friend just typed the line ^Zkillall vim
- oddlama 4y agoesc esc esc :qa!<cr> (8 strokes) This 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)
- jks 4y ago> esc esc esc :qa!<cr> (8 strokes) 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").
- krallja 4y agoThis game isn’t winnable, because they could have run anything at all, via `!` Including another copy of vim. Or emacs. Or both!
- hulitu 4y agoAlt + SysRQ + b