Skip to content

GNU Readline

Austin Kong edited this page Jan 3, 2018 · 1 revision

Keyboard shortcuts for working with readline

aka nano and emacs compatible keys

C-[key] mean CTRL + [key]

M-[key] mean ALT + [key]

Source

Another source

Movements

C-a # beginning-of-line
C-e # end-of-line
C-l # clear-screen
C-f # forward-char
M-f # forward-word
C-b # backward-char
M-b # backward-word

Line editing

C-u # unix-line-discard Clear line or clear to start of line
C-k # kill-line         Clear line from cursor to end of line
C-d # delete-char
C-h # backward-delete-char
M-d # delete to end of words
C-w # unix-word-rubout unix-filename-rubout Deletes to whitespace before cursor 
C-y # yank paste prev killed text - paste last deleted
M-y # yank/paste prev prev killed text - cycle through last deleted?
C-t # transpose-chars
M-t # transpose-words
M-/ # complete-filename    Auto-complete a name (without smart completion)
M-? # possible-completions List the possible completions of the preceeding text
M-* # insert-completions   Insert all possible completions of the preceeding text
C-g # abort

C-bksp  # ???
M-bksp  # delete to start of word #backward-kill-word http://shallowsky.com/blog/linux/bash-word-erase.html

Searching history

C-r # reverse-search-history
C-s # forward-search-history
C-g # abort search and restore the original line
C-j # accept-line end search
C-m # accept-line
C-p # previous-history
C-n # next-history

Misc

Reload input files C-x C-r

Edit current line in editor - vim/nano/emacs C-x C-e

Custom - fwd/bck words C-arrow

CTRL+S freezing terminal

C-S "freezes" terminal, C-Q will unfreeze