r/programming • • May 23 '17

Stack Overflow: Helping One Million Developers Exit Vim

https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/
9.2k Upvotes

1.1k comments sorted by

View all comments

554

u/Yehosua May 23 '17

Exiting Vim is easy.

Esc, Alt-X, Ctrl-Q, Ctrl-C Ctrl-C Ctrl-C, "ARGH", Alt-Tab to another window, killall -9 vim

80

u/crixusin May 23 '17

You would think people realize that its probably badly designed if people are having trouble exiting your editor...

15

u/Elathrain May 23 '17

The problem isn't the design, it's the separation of modern users from 1970's design practices.

You know that ESC key on your keyboard? It was commonly used by basically everything as a GTFO button to cancel or quit things. Some modern programs retain that, but it's less common.

Second, remember that this is from an era where graphical interfaces didn't exist: everything was command line. So the natural thought of someone in vim is: how do I find the command line from inside a text editor? If you've read the manual (and you have) you know that the vim console is attached to the colon : and the natural command name for quit is q.

So the proper way to quit vim is to hit ESC a few times to make sure you exit any special editing mode you've gotten into by accident by hitting random buttons (or normal editing modes like insert mode) and then type :q and hit return to submit the command. If you want to save, you use the w command (for "write", as in "write to disk") and it looks like :wq.

→ More replies (7)