[zsh] Set up bindings for all three keymaps: emacs, vicmd, and viins

Fix #2694
This commit is contained in:
Junegunn Choi 2022-02-23 15:36:49 +09:00
parent 9cb7a364a3
commit 5f385d88e0
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -66,7 +66,9 @@ fzf-file-widget() {
return $ret return $ret
} }
zle -N fzf-file-widget zle -N fzf-file-widget
bindkey '^T' fzf-file-widget bindkey -M emacs '^T' fzf-file-widget
bindkey -M vicmd '^T' fzf-file-widget
bindkey -M viins '^T' fzf-file-widget
# ALT-C - cd into the selected directory # ALT-C - cd into the selected directory
fzf-cd-widget() { fzf-cd-widget() {
@ -87,7 +89,9 @@ fzf-cd-widget() {
return $ret return $ret
} }
zle -N fzf-cd-widget zle -N fzf-cd-widget
bindkey '\ec' fzf-cd-widget bindkey -M emacs '\ec' fzf-cd-widget
bindkey -M vicmd '\ec' fzf-cd-widget
bindkey -M viins '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line # CTRL-R - Paste the selected command from history into the command line
fzf-history-widget() { fzf-history-widget() {
@ -106,7 +110,9 @@ fzf-history-widget() {
return $ret return $ret
} }
zle -N fzf-history-widget zle -N fzf-history-widget
bindkey '^R' fzf-history-widget bindkey -M emacs '^R' fzf-history-widget
bindkey -M vicmd '^R' fzf-history-widget
bindkey -M viins '^R' fzf-history-widget
} always { } always {
eval $__fzf_key_bindings_options eval $__fzf_key_bindings_options