From 08cc808d717c3cf61118dd47ba451e22c984d3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 9 May 2020 12:27:56 +0200 Subject: [PATCH] magic-enter: define bindkey for vi mode as well Closes #8906 --- plugins/magic-enter/magic-enter.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/magic-enter/magic-enter.plugin.zsh b/plugins/magic-enter/magic-enter.plugin.zsh index 8e1859678..2d4d578b6 100644 --- a/plugins/magic-enter/magic-enter.plugin.zsh +++ b/plugins/magic-enter/magic-enter.plugin.zsh @@ -3,7 +3,6 @@ # Pressing enter in a git directory runs `git status` # in other directories `ls` magic-enter () { - # If commands are not already set, use the defaults [ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ." [ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ." @@ -20,5 +19,9 @@ magic-enter () { zle accept-line fi } + zle -N magic-enter -bindkey "^M" magic-enter + +bindkey -M emacs "^M" magic-enter +bindkey -M vicmd "^M" magic-enter +bindkey -M viins "^M" magic-enter