Skip to content

Instantly share code, notes, and snippets.

@greenmang0
Forked from mkfares/zsh-keyboard-shortucts.md
Last active May 1, 2023 08:52
Show Gist options
  • Save greenmang0/852aba8d70b3eed74bb8a975ff2f1ac0 to your computer and use it in GitHub Desktop.
Save greenmang0/852aba8d70b3eed74bb8a975ff2f1ac0 to your computer and use it in GitHub Desktop.
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

Deletion

CTRL + U : Delete the current line
CTRL + K : Delete from the cursor to the end of the line
ESC + Backspace : Delete one word backward
CTRL + W : Delete one word backward
CTRL + D : Delete one character forward
Fn + Backspace : Delete one character forward
Backspace : Delete one character backward

CTRL + Y : Paste the deleted text from the above actions

CTRL + L : Clear the screen

Undo

CTRL + / OR CTRL + _ : Undo the last change

Process and Shell

CTRL + C : Terminate the running foreground process
CTRL + Z : Suspend the running foreground process
CTRL + D : Exit current shell

History

Up Arrow : Recall the previous command in history
Down Arrow : Recall the next command in history
CTRL + R : Search the command history
CTRL + G : Escape from command search mode
!! : Execute the last typed command
!pw : Execute the last command in history that begins with pw

Auto-completion

TAB : Auto-complete the typed command
TAB TAB : Show list of commands
TAB TAB TAB ... : Cycle through matched commands

List all Keyboard Shortcuts

% bindkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment