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

328

u/DownvoteALot May 23 '17

"Alt-Tab" damn noobs not on a headless server.

182

u/elpfen May 23 '17

...you don't have alt-tab mapped to next buffer in tmux?

69

u/-gh0stRush- May 23 '17

screen master race

22

u/schwerpunk May 23 '17 edited Mar 02 '24

I like to travel.

→ More replies (1)
→ More replies (6)

12

u/[deleted] May 23 '17 edited May 23 '17

I keep meaning to try tmux.

One day. Muscle memory is a heckuva thing.

EDIT: "brew install tmux" locally. Added it to the list of packages my dev centos VMs get from Vagrant.

Me: https://media.giphy.com/media/rUS4Wfh2t2qdO/giphy.gif

7

u/TRiG_Ireland May 23 '17

Muscle memory is my problem with vim and git. Git always drops me into nano on my computer, but into vim on the server. I do remember how to get out of vim again, but I always hit the wrong button first.

→ More replies (4)
→ More replies (2)
→ More replies (2)

17

u/Cr3X1eUZ May 23 '17

Ctrl-Z to suspend it and kill from the shell?

6

u/aim2free May 23 '17

Doesn't work for me, I tried both

kill %1 and kill 1 "bash: kill: (1) - Operation not permitted", but it's still there. Aha, if I did

kill -9 %1    

then it worked.

3

u/towo May 24 '17

vim is suspended and can't react to the SIGTERM you sent with kill %1. You'd need to send a kill -CONT %1 after the SIGTERM so that it can be processed.

SIGKILL isn't parsed by the program itself, so it works regardless.

12

u/skztr May 23 '17

Yeah, clearly it should be ctrl+a n, ctrl+a c, killall vim, ctrl+a p, ctrl+a n, killall -9 vim, ctrl+a p, ctrl+a n, ps e | grep vim, ctrl+a p, ctrl+a :kill, ctrl+a n, man screen, man vim, man ps, restart, sudo restart, man sudo, visudo- AH FUCK

→ More replies (2)

22

u/Xynect May 23 '17

Why not just restart the PC like a normal human being?

20

u/fuzz3289 May 23 '17
 %s/vim/emacs/g

FTFY

31

u/knome May 23 '17

C-c C-c is undefined

→ More replies (1)
→ More replies (239)