List of zsh bindkey commands

82.9k Views Asked by At

Where can I find a list of zsh commands that I can use with bindkey, with descriptions?

Each time that I look for name of some standard action (e.g., end-of-line), I need to google and guess that the command found is what I look for.

Related:

6

There are 6 best solutions below

3
On BEST ANSWER

Commands available for use in the line editor are referred to as widgets. The standard widgets are listed in the zshzle manpage in the STANDARD WIDGETS section. That manpage is also available from the zsh website

2
On
  1. Zsh Line Editor Doc: https://web.cs.elte.hu/local/texinfo/zsh/zsh_10.html
  2. Look up system current bindkey setting: $ bindkey, eg($ bindkey|grep case, looking for down-case);
  3. $ zle -al used for list all registered zle commands;
  4. Bind your personal key for zsh command , $ vim ~/.zshrc, add
# bindkey
bindkey "^U"    backward-kill-line
bindkey "^u"    backward-kill-line
bindkey "^[l"   down-case-word
bindkey "^[L"   down-case-word

# alt+<- | alt+->
bindkey "^[f" forward-word
bindkey "^[b" backward-word

# ctrl+<- | ctrl+->
bindkey "^[[1;5D" backward-word
bindkey "^[[1;5C" forward-word
  1. See other things: oh-my-zsh down-case-word bug: https://github.com/robbyrussell/oh-my-zsh/commit/55a9d685fd960390a4f400ac461d901049a78beb
4
On
  • bindkey -l will give you a list of existing keymap names.

  • bindkey -M <keymap> will list all the bindings in a given keymap.

  • If you use the zsh command line in emacs mode, then the emacs keymap is likely to be most important for you.

  • If you use it in vi mode, then you’d be interested in viins and vicmd.

(See the zshzle(1) man page for more details.)

Once you have a list of keybindings, you can search the official ZLE documentation for the name of the action (or “widget” in zsh parlance).

Edit: Elsewhere in this thread, Dave Lee answers the original question more accurately than I do here!

1
On

I'm on zsh via putty. For me the bindings were different. You can find this out with CTRL+V followed by for example the left arrow. It will display the used character sequence. So for me it was:

bindkey "^[[D" backward-word
bindkey "^[[C" forward-word
bindkey "^H" backward-kill-word
0
On

After installing oh-my-zsh, I typed bindkey 'anything' then press tab, then say yes. The list of available bindkeys will be flushed out

2
On
zle -al

lists all registered zle commands