Zsh Keyboard Shortcuts

Complete Zsh keyboard shortcuts reference — 20 shortcuts across 3 categories. Quick reference cheat sheet for Windows & Mac.

Cursor Movement (6)

ShortcutAction
Ctrl + AStart of line
Ctrl + EEnd of line
Alt + FForward one word
Alt + BBack one word
Ctrl + FForward one char
Ctrl + BBack one char

Editing (7)

ShortcutAction
Ctrl + UKill whole line
Ctrl + KKill to end
Ctrl + WDelete word before
Alt + DDelete word after
Ctrl + YYank
Ctrl + _Undo
Alt + QPush line

History & Completion (7)

ShortcutAction
Ctrl + RSearch history
Ctrl + PPrevious command
Ctrl + NNext command
Alt + .Insert last argument
TabComplete
Ctrl + LClear screen
Ctrl + DExit / delete char
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

Bash / Shell Fish Shell Starship Prompt tmux fzf Vim

Search 13,500+ shortcuts across 269 platforms

Explore All Platforms Practice Shortcuts
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

You are editing with Emacs bindings

Zsh's line editor (ZLE) starts in Emacs keymap for most setups, which is why these keys look familiar to Bash users: Ctrl + A and Ctrl + E jump to the ends of the line, Alt + F / Alt + B step by words, Ctrl + F / Ctrl + B by characters. The deletion keys are kills, not deletes: Ctrl + U kills the whole line, Ctrl + K to the end, Ctrl + W the word behind, Alt + D the word ahead — and everything killed lands in a ring that Ctrl + Y yanks back. Cut-and-paste on the command line, no mouse involved. Ctrl + _ undoes edits.

History is the other half: Ctrl + R opens incremental search, Ctrl + P / Ctrl + N walk previous and next commands, and Alt + . inserts the last argument of the previous command — press it repeatedly to reach earlier commands' arguments. Tab completes, Ctrl + L clears the screen without losing your input.

The two keys people underuse

Alt + Q (push-line) stashes whatever you are typing, gives you a fresh prompt to run something else — check a path, read a man page — and restores your original line afterwards, untouched. It removes the classic dilemma of abandoning a half-written command. And know Ctrl + D's double life: with text on the line it deletes the character under the cursor; on an empty line it sends end-of-file and exits the shell — the source of many accidentally closed terminals.

Frequently asked questions

These bindings don't work in my zsh. Why?

You are probably in the Vi keymap — zsh selects it automatically when your EDITOR variable points at vi/vim. Run bindkey -e to switch to Emacs bindings (add it to ~/.zshrc to make it stick), or embrace bindkey -v and use Vi-style editing instead.

What is the difference between killing and deleting?

Killed text (Ctrl + U, Ctrl + K, Ctrl + W, Alt + D) is saved to the kill ring and can be reinserted with Ctrl + Y — it is cut, not destroyed. Plain character deletion is gone for good (though Ctrl + _ can undo the edit).

Alt shortcuts do nothing on my Mac. How do I fix it?

macOS terminals type accented characters on Option by default. In Terminal.app or iTerm2, enable the profile setting that uses Option as Meta (Esc+), and Alt + F, Alt + B, Alt + . start working immediately.

When would I actually use Alt + Q?

Mid-command realisations: you are halfway through a long command and need to check a filename or free disk space first. Alt + Q stashes the line, you run the check, and the stashed command reappears at the next prompt ready to finish — no copy-paste, nothing lost.

Ctrl + D just closed my terminal. Can I prevent that?

On an empty line Ctrl + D means end-of-file, which ends the shell. Add setopt IGNORE_EOF to ~/.zshrc and zsh will ignore it (asking you to type exit instead), while keeping the delete-character behaviour when the line has content.

🤖 Ask AI about Zsh shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok