Skip to content

Instantly share code, notes, and snippets.

@travisjupp
Last active August 30, 2025 11:58
Show Gist options
  • Save travisjupp/4f43b793f47c36333ec32717b5d75893 to your computer and use it in GitHub Desktop.
Save travisjupp/4f43b793f47c36333ec32717b5d75893 to your computer and use it in GitHub Desktop.
Short summary of all standard ZLE widgets with keybindings

Zsh ZLE Standard Widgets — Default Key Bindings (Zsh 5.9) and Bash Readline Equivalents

This list gives all standard widgets (including those with and without default keybindings), a short summary, and the default key(s) for each, as found in Zsh 5.9 (emacs and vi modes).
Where available, the equivalent Bash Readline function and default keybinding are shown as Ctrl-X (Bash Readline).
Widgets with no default keybinding are listed without a key.
Third-party/community/user widgets (e.g. fzf, npm, z4h, bash*) are also listed when requested, but are not present in default zsh.


  • accept-and-hold
    Accepts the current line but keeps it in the editor for further editing. Alt-A

  • accept-and-infer-next-history
    Accepts the line and fetches the next history line matching the input.

  • accept-and-menu-complete
    Accepts line and completes using menu completion if ambiguous.

  • accept-line
    Accept and execute the current command line.
    Enter (Emacs/vi-insert), : (vi-cmd)
    Enter (Bash Readline, accept-line)

  • accept-line-and-down-history
    Accepts the line and moves down in history, useful for multi-line editing. Ctrl-O

  • accept-search
    Accepts the result of an incremental search.

  • argument-base
    Sets the base for numeric arguments.

  • auto-suffix-remove
    Remove the automatically added suffix (e.g., a space after completion).

  • auto-suffix-retain
    Retain the automatically added suffix.

  • backward-char
    Move cursor one character left.
    Ctrl-B (Emacs), h (vi-cmd)
    Ctrl-B (Bash Readline, backward-char)

  • backward-delete-char
    Delete the character to the left of the cursor.
    Backspace (Emacs), X (vi-cmd)
    Backspace/Ctrl-H (Bash Readline, backward-delete-char)

  • backward-delete-word
    Deletes the word before the cursor.
    Ctrl-W (Bash Readline, unix-word-rubout)

  • backward-kill-line
    Delete from cursor to start of line.
    Ctrl-U (Emacs), d0 (vi-cmd)
    Ctrl-U (Bash Readline, unix-line-discard)

  • backward-kill-word
    Delete word before cursor.
    Ctrl-W (Emacs), db (vi-cmd)
    Ctrl-W (Bash Readline, unix-word-rubout)

  • backward-word
    Move cursor one word left.
    Alt-B (Emacs), b (vi-cmd)
    Alt-B (Bash Readline, backward-word)

  • beep
    Audible bell/beep.

  • beginning-of-buffer-or-history
    Move to the beginning of the buffer or first history entry. Alt-<

  • beginning-of-history
    Move to the first entry in the history list.

  • beginning-of-line
    Move cursor to start of line.
    Ctrl-A (Emacs), 0 (vi-cmd)
    Ctrl-A (Bash Readline, beginning-of-line)

  • beginning-of-line-hist
    Goes to the beginning of the line or previous history line if already at beginning.

  • bracketed-paste
    Handles bracketed paste mode (for terminals that support it). Ctrl-Shift-V (Linux), Cmd-V (macOS), Shift-Insert (General) Notes for Bash: To check if enabled: bind -v | grep bracketed To enable: bind 'set enable-bracketed-paste on'

  • capitalize-word
    Capitalize word after cursor.
    Alt-C (Emacs), ~ (vi-cmd)
    Alt-C (Bash Readline, capitalize-word)

  • clear-screen
    Clear screen and redraw line.
    Ctrl-L (Emacs/vi-insert/vi-cmd)
    Ctrl-L (Bash Readline, clear-screen)

  • complete-word
    Attempt to complete word at cursor.
    Tab (Emacs/vi-insert/vi-cmd)
    Tab (Bash Readline, complete)

  • copy-prev-shell-word
    Copies the previous shell word to the cursor position. Alt-Shift-_ or Alt-m

  • copy-prev-word
    Copies the previous word to the cursor position. Ctrl-Alt-_

  • copy-region-as-kill
    Copy text between cursor and mark.
    Alt-W (Emacs), y (vi visual mode)
    Alt-W (Bash Readline, copy-region-as-kill)

  • deactivate-region
    Deactivate the currently active region (selection).

  • delete-char
    Delete character under cursor.
    Del Ctrl-D (Bash Readline, delete-char)

  • delete-char-or-list
    Delete character under cursor or list completions if at end of line. Ctrl-D (Emacs), x (vi-cmd)

  • delete-word
    Delete word after cursor.
    Alt-D (Bash Readline, kill-word)

  • describe-key-briefly
    Prompt for a key sequence and display the widget bound to it.
    Ctrl-X ? (Emacs)
    Ctrl-X ? (Bash Readline, describe-key-briefly)

  • digit-argument
    Start entering a numeric argument for the next command.
    Alt-0...Alt-9 (Emacs/vi-insert)
    Meta-0...Meta-9 (Bash Readline, digit-argument)

  • down-case-word
    Lowercase word after cursor.
    Alt-L (Emacs), guw (vi-cmd)
    Alt-L (Bash Readline, downcase-word)

  • down-history
    Next history entry.
    Down Arrow/Ctrl-N (Emacs), j (vi-cmd)
    Down Arrow/Ctrl-N (Bash Readline, next-history)

  • down-line
    Move cursor down one display line.

  • down-line-or-beginning-search
    Down in history to line beginning with the current input, or down a line. Down Arrow

  • down-line-or-history
    Moves the cursor down a line, or to the next history entry. Page Down/Ctrl-N (Emacs)

  • down-line-or-search
    Down in history to the next line matching the current input, or down a line.

  • edit-command-line
    Edits the current command line in an external editor. Ctrl-X Ctrl-E (Emacs), v (vi-cmd)

  • emacs-backward-word
    Moves the cursor one word left (emacs style).

  • emacs-forward-word
    Moves the cursor one word right (emacs style).

  • end-of-buffer-or-history
    Move to the end of buffer or last history entry. Alt-> (Emacs)

  • end-of-history
    Move to the last entry in the history list.

  • end-of-line
    Move cursor to end of line.
    Ctrl-E (Emacs), $ (vi-cmd)
    Ctrl-E (Bash Readline, end-of-line)

  • end-of-line-hist
    Goes to the end of the line or next history line if already at end.

  • end-of-list
    Move to the end of the completion list.

  • exchange-point-and-mark
    Swap cursor and mark.
    Ctrl-X Ctrl-X (Emacs)
    Ctrl-X Ctrl-X (Bash Readline, exchange-point-and-mark)

  • execute-last-named-cmd
    Execute the last named command. Alt-Z (Emacs)

  • execute-named-cmd / execute-named-command
    Prompt for the name of a ZLE widget and execute it.
    Alt-X (Emacs)
    Meta-x (Bash Readline, execute-named-command)

  • expand-cmd-path
    Expands the command path at the cursor.

  • expand-history
    Expands history references in the command line.
    Alt-^/Alt-Space/Alt-! (Emacs)
    Alt-^ (Bash Readline, history-expand-line) Replaces expansions (!!, !n, !word, ^old^new^) with versions from history e.g., your history contains apachectl start typing ^start^stop then Alt-Space prints apachectl stop to cli

  • expand-or-complete
    Expand or complete the word at the cursor.

  • expand-or-complete-prefix
    Expand or complete from the beginning of the word.

  • expand-or-complete-with-dots
    Expand or complete and show possible completions with dots.

  • expand-word
    Expands the current word e.g., (uses globbing) Typing ls *.md will print ls someFileA.md someFileB.md if they exist.

    Ctrl-X*/Meta-* (Emacs)

  • forward-char
    Move cursor one character right.
    Ctrl-F (Emacs), l (vi-cmd)
    Ctrl-F (Bash Readline, forward-char)

  • forward-word
    Move cursor one word right.
    Alt-F (Emacs), w (vi-cmd)
    Alt-F (Bash Readline, forward-word)

  • fzf-cd-widget
    (Third-party) Fuzzy-find and cd into a directory using fzf. Alt-C (Emacs)

  • fzf-completion
    (Third-party) Fuzzy completion using fzf. Ctrl-I / Tab (Emacs)

  • fzf-file-widget
    (Third-party) Fuzzy-find and insert file name using fzf. Ctrl-T (Emacs)

  • fzf-history-widget
    (Third-party) Fuzzy-find history using fzf. Ctrl-R (Emacs)

  • get-line
    Gets the current line for editing (used in recursive-edit). Alt-G (Emacs)

  • gosmacs-transpose-chars
    Transposes the two characters before the cursor (gosmacs style).

  • history-beginning-search-backward
    Searches backward for a history entry beginning with the current line.

  • history-beginning-search-forward
    Searches forward for a history entry beginning with the current line.

  • history-incremental-pattern-search-backward
    Incrementally searches backward through history using a pattern.

  • history-incremental-pattern-search-forward
    Incrementally searches forward through history using a pattern.

  • history-incremental-search-backward
    Incremental history search backward.
    Ctrl-R (Emacs), / (vi-cmd)
    Ctrl-R (Bash Readline, reverse-search-history)

  • history-incremental-search-forward
    Incremental history search forward.
    Ctrl-S (Emacs), ? (vi-cmd)
    Ctrl-S (Bash Readline, forward-search-history) (may require stty fix)

  • history-search-backward
    Search backward for line matching current input.
    Alt-P (Emacs), K (vi-cmd)
    Alt-P (Bash Readline, history-search-backward)

  • history-search-forward
    Search forward for line matching current input.
    Alt-N (Emacs), J (vi-cmd)
    Alt-N (Bash Readline, history-search-forward)

  • infer-next-history
    Fetch the next history line matching the inputa Ctrl-X Ctrl-N

  • insert-last-word
    Inserts the last word from the previous command. Alt-Shift-_ Alt-. (Bash Readline, yank-last-arg)

  • kill-buffer
    Deletes the entire contents of the edit buffer. Ctrl-X Ctrl-K (Emacs)

  • kill-line
    Delete from cursor to end of line.
    Ctrl-K (Emacs), D (vi-cmd)
    Ctrl-K (Bash Readline, kill-line)

  • kill-region
    Kill text between cursor and mark.
    Ctrl-W (Emacs), d (vi visual mode)
    Ctrl-W (Bash Readline, kill-region)

  • kill-whole-line
    Deletes the entire line regardless of cursor position. Ctrl-U (Emacs)

  • kill-word
    Delete word after cursor.
    Alt-D (Emacs), dw (vi-cmd)
    Alt-D (Bash Readline, kill-word)

  • list-choices
    List possible completions at the cursor.
    Ctrl-D (Emacs/vi-insert/vi-cmd)
    Ctrl-D (Bash Readline, list-choices)

  • list-expand
    Expands the current word and lists possible expansions. Ctrl-XG

  • magic-space
    Expand history then insert space.
    Alt-Space (Emacs)

  • menu-complete
    Complete the word using menu-style completion.

  • menu-expand-or-complete
    Expand or complete using menu.

  • menu-select
    Select from a completion menu.

  • neg-argument
    Begins a negative numeric argument for the next command.
    Alt--/Esc-- (Emacs) (Hold Alt and press -) or (Press Esc then -) E.g., type mad*capone (cursor position is *) type Alt-- or Esc-- then Alt-3 or Esc-3 then Ctrl-H should leave madone on the line, deleting the 3 cap characters in a forward direction, which is the opposite direction of Ctrl-H (backspace)

  • npm_toggle_install_uninstall
    (Third-party) Toggle npm install/uninstall.
    F2 F2 (F2 twice) if you previously ran npm install lodash
    this will print npm uninstall lodash also works for short forms npm i ... and npm un ...

  • overwrite-mode
    Toggle overwrite/insert mode.
    Insert (Emacs/vi-insert/vi-cmd)
    Insert (Bash Readline, overwrite-mode)

  • pound-insert
    Insert a # at the beginning of the line.

  • push-input
    Push current input onto the buffer stack.

  • push-line
    Push the current line onto the buffer stack.

  • push-line-or-edit
    Push the line or edit it in a new buffer.

  • put-replace-selection
    Paste and replace the current selection.

  • quote-line
    Quotes the entire command line. Alt-'

  • quote-region
    Quotes the region between the cursor and the mark. Alt-Shift-"

  • quoted-insert
    Insert next character literally.
    Ctrl-V (Emacs), Ctrl-V (vi-insert)
    Ctrl-V (Bash Readline, quoted-insert)

  • read-command
    Reads a command (used in execute-named-command).

  • recursive-edit
    Start a recursive ZLE editing session.

  • redisplay
    Redisplays the current editing buffer.
    Ctrl-L (Bash Readline, redisplay)

  • redo
    Redo last undone change.
    Ctrl-R (Emacs), Ctrl-R (vi-cmd)
    Ctrl-X Ctrl-R (Bash Readline, redo if available)

  • reset-prompt
    Re-expand and redraw the prompt.

  • reverse-menu-complete
    Cycles backward through menu completions.

  • run-help
    Push current buffer and run help on the command at cursor.
    Alt-H (Emacs)

  • select-a-blank-word
    Select a blank-delimited word.

  • select-a-shell-word
    Select a shell word.

  • select-a-word
    Select a word.

  • select-in-blank-word
    Select inside a blank-delimited word.

  • select-in-shell-word
    Select inside a shell word.

  • select-in-word
    Select inside a word.

  • self-insert
    Insert typed character.
    Any printable character
    Any printable character (Bash Readline, self-insert)

  • self-insert-unmeta
    Insert the character, removing meta modifier.

  • send-break
    Sends a break signal (e.g., Ctrl+C).
    Ctrl-G (Bash Readline, abort)

  • set-local-history
    Set the local history context.

  • set-mark-command
    Set the mark for selection.
    Ctrl-@ (Emacs)
    Ctrl-@ (Bash Readline, set-mark)

  • spell-word
    Correct spelling on current word.
    Esc-$ (Emacs/vi-insert)

  • split-undo
    Separate the undo history at this point.

  • transpose-chars
    Swap character before and at cursor.
    Ctrl-T (Emacs), xp (vi-cmd)
    Ctrl-T (Bash Readline, transpose-chars)

  • transpose-words
    Swap the current word with the previous word.
    Alt-T (Emacs)
    Alt-T (Bash Readline, transpose-words)

  • undefined-key
    Called for undefined keybindings.

  • undo
    Undo the last edit.
    Ctrl-_/Ctrl-X u/Ctrl-X Ctrl-U (Emacs), u (vi-cmd)
    Ctrl-_/Ctrl-X Ctrl-U (Bash Readline, undo)

  • universal-argument
    Start a universal argument (for passing to other widgets).

  • up-case-word
    Uppercase word after cursor.
    Alt-U (Emacs), gUw (vi-cmd)
    Alt-U (Bash Readline, upcase-word)

  • up-history
    Previous history entry.
    Up Arrow/Ctrl-P (Emacs), k (vi-cmd)
    Up Arrow/Ctrl-P (Bash Readline, previous-history)

  • up-line
    Move cursor up one display line.

  • up-line-or-beginning-search
    Up in history to line beginning with the current input, or up a line. Up Arrow

  • up-line-or-history
    Moves the cursor up a line, or to the previous history entry. Ctrl-P (Emacs)

  • up-line-or-search
    Up in history to the previous line matching the current input, or up a line.

  • vi-add-eol
    Enter insert mode at end of line.
    A (vi-cmd)

  • vi-add-next
    Enter insert mode after cursor.
    a (vi-cmd)

  • vi-backward-blank-word
    Moves left to the start of the previous blank-delimited word (vi mode).

  • vi-backward-blank-word-end
    Moves left to the end of the previous blank-delimited word (vi mode).

  • vi-backward-char
    Move cursor left.
    h (vi-cmd)

  • vi-backward-delete-char
    Deletes the character before the cursor (vi mode).

  • vi-backward-kill-word
    Deletes the word before the cursor (vi mode).

  • vi-backward-word
    Move cursor left to start of previous word.
    b (vi-cmd)

  • vi-backward-word-end
    Move left to the end of the previous word.

  • vi-beginning-of-line
    Move to the beginning of the line (vi mode).
    0 (vi-cmd)

  • vi-caps-lock-panic
    Widget to recover from caps lock mistakes in vi mode.

  • vi-change
    Start a change operation (like c, cw, cc).
    c (vi-cmd)

  • vi-change-eol
    Change to end of line.
    C (vi-cmd)

  • vi-change-whole-line
    Change the whole line.
    S (vi-cmd)

  • vi-cmd-mode
    Switch to vi command mode.
    Ctrl-X Ctrl-V (Emacs), Esc (vi-insert)

  • vi-delete
    Start a delete operation (like d, dw, dd).
    d (vi-cmd)

  • vi-delete-char
    Delete the character under the cursor.
    x (vi-cmd)

  • vi-digit-or-beginning-of-line
    Digit argument or beginning of line.
    0 (vi-cmd)

  • vi-down-case
    Converts the selected text to lowercase (vi mode).
    gu (vi-cmd)

  • vi-down-line-or-history
    Down in history (vi mode).
    j (vi-cmd)

  • vi-end-of-line
    Move to end of line (vi mode).
    $ (vi-cmd)

  • vi-fetch-history
    Fetch history entry (vi mode).

  • vi-find-next-char
    Find next character on line (vi mode).
    f (vi-cmd)

  • vi-find-next-char-skip
    Find next character, cursor after it (vi mode).
    t (vi-cmd)

  • vi-find-prev-char
    Find previous character on line (vi mode).
    F (vi-cmd)

  • vi-find-prev-char-skip
    Find previous character, cursor after it (vi mode).
    T (vi-cmd)

  • vi-first-non-blank
    Go to first non-blank character of line.
    ^ (vi-cmd)

  • vi-forward-blank-word
    Moves right to the next blank-delimited word (vi mode).

  • vi-forward-blank-word-end
    Moves right to the end of the next blank-delimited word (vi mode).

  • vi-forward-char
    Move cursor right.
    l (vi-cmd)

  • vi-forward-word
    Move cursor right to start of next word.
    w (vi-cmd)

  • vi-forward-word-end
    Move right to the end of the next word.

  • vi-goto-column
    Go to specified column in line.

  • vi-goto-mark
    Go to a previously set mark.

  • vi-goto-mark-line
    Go to line of a previously set mark.

  • vi-history-search-backward
    Search history backward (vi mode).

  • vi-history-search-forward
    Search history forward (vi mode).

  • vi-indent
    Indent line (vi mode).

  • vi-insert
    Switch to vi insert mode.
    i (vi-cmd)

  • vi-insert-bol
    Insert at beginning of line.
    I (vi-cmd)

  • vi-join
    Join this and next line.
    Ctrl-X Ctrl-J (Emacs), J (vi-cmd)

  • vi-kill-eol
    Deletes from the cursor to the end of the line (vi mode).

  • vi-kill-line
    Deletes the entire line (vi mode).
    dd (vi-cmd)

  • vi-match-bracket
    Find matching bracket. Ctrl-X Ctrl-B (Emacs), % (vi-cmd)

  • vi-open-line-above
    Open new line above and insert.
    O (vi-cmd)

  • vi-open-line-below
    Open new line below and insert.
    o (vi-cmd)

  • vi-oper-swap-case
    Swap case in operator-pending mode.

  • vi-pound-insert
    Insert # at beginning of line (vi mode).

  • vi-put-after
    Paste yanked text after cursor.
    p (vi-cmd)

  • vi-put-before
    Paste yanked text before cursor.
    P (vi-cmd)

  • vi-quoted-insert
    Insert next character literally (vi mode).

  • vi-repeat-change
    Repeat the last change command.
    . (vi-cmd)

  • vi-repeat-find
    Repeat the last character search.
    ; (vi-cmd)

  • vi-repeat-search
    Repeat the last search.

  • vi-replace
    Replace character under cursor.
    r (vi-cmd)

  • vi-replace-chars
    Replace characters (vi mode).
    R (vi-cmd)

  • vi-rev-repeat-find
    Repeat last character search in reverse.
    , (vi-cmd)

  • vi-rev-repeat-search
    Repeat last search in reverse.

  • vi-set-buffer
    Use a named buffer for next change/yank.

  • vi-set-mark
    Set a mark at cursor position.

  • vi-substitute
    Substitute character under cursor.
    s (vi-cmd)

  • vi-swap-case
    Swap case of character at cursor.
    ~ (vi-cmd)

  • vi-undo-change
    Undo the last change (vi mode).

  • vi-unindent
    Unindent line (vi mode).

  • vi-up-case
    Converts the selected text to uppercase (vi mode).
    gU (vi-cmd)

  • vi-up-line-or-history
    Up in history (vi mode).
    k (vi-cmd)

  • vi-yank
    Yank (copy) text.
    y (vi-cmd)

  • vi-yank-eol
    Yank to end of line.
    Y (vi-cmd)

  • vi-yank-whole-line
    Yank the whole line.
    yy (vi-cmd)

  • visual-line-mode
    Start visual line selection mode.

  • visual-mode
    Start visual selection mode.

  • what-cursor-position
    Display info about the cursor. Ctrl-X = (Emacs)

  • where-is
    Prompt for a ZLE widget name and show its key bindings. Ctrl-X Ctrl-W (Emacs)
    Ctrl-X Ctrl-W (Bash Readline, where-is)

  • which-command
    Show the name of the widget bound to a key sequence. Alt-? (Emacs)

  • yank
    Paste the most recently killed text at the cursor.
    Ctrl-Y (Emacs), p (vi-cmd)
    Ctrl-Y (Bash Readline, yank)

  • yank-pop
    Replace yanked text with earlier entries from the kill ring.
    Alt-Y (Emacs)
    Alt-Y (Bash Readline, yank-pop)

  • z4h-clear-screen-hard-top
    (Third-party) Z4H: clear screen, cursor at top.

  • z4h-clear-screen-soft-top
    (Third-party) Z4H: clear screen, prompt at top.

  • zle-isearch-update
    Update incremental search display.

  • zle-keymap-select
    Special widget for reacting to keymap changes.


References and More Info:

Note:
Some keybindings may vary depending on your terminal or personal configuration. For a complete and up-to-date list, use the reference commands above.

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