浏览代码

magic-enter: define bindkey for vi mode as well

Closes #8906
Marc Cornellà 5 年之前
父节点
当前提交
08cc808d71
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      plugins/magic-enter/magic-enter.plugin.zsh

+ 5 - 2
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