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

308

u/k-selectride May 23 '17

I wonder how many people need help after hitting Ctrl-s

44

u/[deleted] May 23 '17

Oh my god, this is probably the most irritating thing about working in the terminal for me. I enable ctrl-S so I can do a forwards i-search in bash, but I occasionally​ hit it in vim when aiming for ctrl-D, and it totally baffles me every time.

40

u/Works_of_memercy May 23 '17 edited May 23 '17

Put

"\e[A": history-search-backward
"\e[B": history-search-forward

in your .inputrc and join the path of glory. Then up/down arrows cycle through history commands starting with the current command prefix (which by the way is strictly better than how ctrl-R works).

Then you can disable ctrl-S (stty ixany ixoff -ixon in .bashrc, probably guarded by if [[ "$-" == *i* ]]; then to only do that in interactive mode) and use ctrl-Z, whatever, fg if you want to pause some program and look at its recent output.

5

u/Godd2 May 23 '17

Also tab and shift-tab for autocompletion

# Autocompletion
#
# press tab to cycle autocomplete
"\t":menu-complete
# shift-tab to cycle backwards
"\e[Z":menu-complete-backward

menu-complete-backward was added in bash v4.0.0

→ More replies (4)