Shell Keybindings

July 6, 2024 ยท View on GitHub

KeybindingAction
Alt + f/bMove cursor to previous/next word
Ctrl + a/eMove cursor to beginning/end of command
Ctrl + xxToggle between the start of line and current cursor position

Editing โœ๏ธ

KeybindingAction
Alt + . or !$Previous commands last argument
Alt + cCapitalize word
Alt + dDelete next word
Alt + DelDelete previous word
Alt + l/uLowercase/Uppercase word
Alt + rCancel the changes, revert
Alt + tSwap current word with previous
Alt + wDelete until beginning (zsh)
Ctrl + _Undo
Ctrl + kCut till end
Ctrl + tSwap the last two characters before the cursor
Ctrl + uDelete whole line (zsh)/ cut until beginning (bash)
Ctrl + wCut previous word
Ctrl + x,eOpen command in editor
Ctrl + yPaste
Esc + tSwap the last two words before the cursor
!*All arguments of previous command

Process ๐Ÿ“Š

KeybindingAction
Ctrl + cInterrupt/Kill
Ctrl + dClose current shell
Ctrl + lClear screen
Ctrl + zBackground/Foreground job

History โณ

KeybindingAction
Ctrl + rHistory search
Ctrl + sGo back to the next most recent command
^abc^defRun previous command, replacing abc with def

Modes ๐Ÿ•น๏ธ

KeybindingAction
Ctrl + x,vvi mode (zsh)
bindkey -eEmacs mode
set -o vi / bindkey -vVi mode

GitHub gist here.