08cc808d717c3cf61118dd47ba451e22c984d3cf

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

magic-enter: define bindkey for vi mode as well

Closes #8906

Diff

 1diff --git a/plugins/magic-enter/magic-enter.plugin.zsh b/plugins/magic-enter/magic-enter.plugin.zsh
 2index 8e1859678b194711ef480cc39f107df7bbf0e7d8..2d4d578b6da42296fc8fc01d0aef7cae772a8431 100644
 3--- a/plugins/magic-enter/magic-enter.plugin.zsh
 4+++ b/plugins/magic-enter/magic-enter.plugin.zsh
 5@@ -3,7 +3,6 @@
 6 # Pressing enter in a git directory runs `git status`
 7 # in other directories `ls`
 8 magic-enter () {
 9-
10   # If commands are not already set, use the defaults
11   [ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ."
12   [ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ."
13@@ -20,5 +19,9 @@ magic-enter () {
14     zle accept-line
15   fi
16 }
17+
18 zle -N magic-enter
19-bindkey "^M" magic-enter
20+
21+bindkey -M emacs "^M" magic-enter
22+bindkey -M vicmd "^M" magic-enter
23+bindkey -M viins "^M" magic-enter