Skip to main content
ForgeCode ranks #1 on TermBench with 78.4% accuracy.Learn more →

Shortcuts

These shortcuts are built into ZSH — ForgeCode doesn't add or modify them. They work in any ZSH session, not just when using ForgeCode.

ZSH uses Emacs keybindings by default. If you prefer Vi mode, add bindkey -v to your ~/.zshrc.

Run forge zsh keyboard at any time to print this reference in your terminal. For the full reference, see the official ZSH Line Editor documentation.

ShortcutAction
Ctrl+AMove to beginning of line
Ctrl+EMove to end of line
Option+FMove forward one word
Option+BMove backward one word

Editing

ShortcutAction
Ctrl+UKill line before cursor
Ctrl+KKill line after cursor
Ctrl+WKill word before cursor
Option+DKill word after cursor
Ctrl+YYank (paste) killed text
Ctrl+_Undo last edit

History

ShortcutAction
Ctrl+RSearch command history backward
Ctrl+SSearch command history forward
Ctrl+P / Previous command
Ctrl+N / Next command
Option+<Move to first history entry
Option+>Move to last history entry

Other

ShortcutAction
Ctrl+LClear screen
Ctrl+CCancel current command
Ctrl+ZSuspend current command
TabComplete command/path

If Option key shortcuts aren't working, run forge zsh doctor — the most common cause is a terminal that isn't passing the Option key through correctly.

Reference

ZSH exposes the full set of bindings and editor actions directly from the shell.

List all current key bindings:

bindkey

List all available editor actions:

zle -al

List bindings for a specific keymap (e.g. Emacs):

bindkey -M emacs