snippetbashTip
bindkey — Add hotkeys to Z shell. See also: `zle`. More information: <https://zsh.sourceforge.io/Doc/Release/Z
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:
bindkeyBind 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 -lList all hotkeys in a key[M]ap:
bindkey -M {{main}}Enable [v]i mode:
bindkey -vEnable [e]macs mode (default mode):
bindkey -eCheck which mode is active (vi or emacs):
bindkey -lL main | grep -Eo 'viins|emacs'Code Snippets
List all existing hotkeys
bindkeyBind 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 -lList all hotkeys in a key[M]ap
bindkey -M {{main}}Context
tldr-pages: common/bindkey
Revisions (0)
No revisions yet.