HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

bindkey — Add hotkeys to Z shell. See also: `zle`. More information: <https://zsh.sourceforge.io/Doc/Release/Z

Submitted by: @import:tldr-pages··
0
Viewed 0 times
shellcommandbindkeyhotkeyscliaddseealso

Problem

How to use the bindkey command: Add hotkeys to Z shell. See also: zle. More information: <https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins>.

Solution

bindkey — Add hotkeys to Z shell. See also: zle. More information: <https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins>.

List all existing hotkeys:
bindkey


Bind a hotkey to a specific command:
bindkey "{{^k}}" {{kill-line}}


Bind a hotkey to a specific key [s]equence:
bindkey -s '^o' 'cd ..\n'


[l]ist keymaps:
bindkey -l


List all hotkeys in a key[M]ap:
bindkey -M {{main}}


Enable [v]i mode:
bindkey -v


Enable [e]macs mode (default mode):
bindkey -e


Check which mode is active (vi or emacs):
bindkey -lL main | grep -Eo 'viins|emacs'

Code Snippets

List all existing hotkeys

bindkey

Bind a hotkey to a specific command

bindkey "{{^k}}" {{kill-line}}

Bind a hotkey to a specific key [s]equence

bindkey -s '^o' 'cd ..\n'

[l]ist keymaps

bindkey -l

List all hotkeys in a key[M]ap

bindkey -M {{main}}

Context

tldr-pages: common/bindkey

Revisions (0)

No revisions yet.