Terminal control sequences

Using many control keys during the day, such as Ctrl-f to page down in Vim and Ctrl-c to kill a process in terminal, and assigning some of my own to tmux, I’ve began wondering whether all the letters of the alphabet were accounted for. The answer is: yes, they are; plus even some extra characters.

Most key bindings differ depending on the context, except ones in the “term” column that always keep the same function. The layers that I’m most interested in are:

I have compiled a comprehensive overview of all control key bindings in different contexts and highlighted the features that matter to me the most:

term shell prompt process Vim normal
C-A start of line increment number
C-B move back a char page up
C-D delete char send EOF half page down
C-E end of line scroll up
C-F move forward a char page down
C-G abort line file/position info
C-H <Bsp>
C-I <Tab> jump forward
C-J <LF>
C-K kill text to end of line
C-L clear screen
C-M <CR>
C-N next history move cursor down
C-O operate-and-get-next jump back
C-P previous history move cursor up
C-Q zsh: clear line
C-R backward inc. search redo
C-S forward inc. search*
C-T transpose chars SIGINFO undo tag jump
C-U clear line half page up
C-V insert next char literally visual block mode
C-W delete word window prefix
C-X prefix, e.g. C-x,C-e decrement number
C-Y yank (delayed suspend) scroll down
C-Z SIGTSTP (suspend)
C-[ <Esc> exit insert mode
C-] jump to tag
C-^ alternate buffer

In the shell, these are indispensable:

*For bash, C-s doesn’t work by default. Here’s how to enable it:

# Allow <C-s> to pass through to shell and programs
stty -ixon -ixoff

For process control:

In Vim:

To learn more about navigating tags and jumps in Vim, see Vim: Revisited.