diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-05-09 12:27:56 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2020-05-09 12:27:56 +0200 |
commit | 08cc808d717c3cf61118dd47ba451e22c984d3cf (patch) | |
tree | f0048777efcc1e168d76a7677383b4f4fda37a04 /plugins/magic-enter | |
parent | b876198575cbf23d589ddc8da6b22254d3d5358b (diff) | |
download | zsh-08cc808d717c3cf61118dd47ba451e22c984d3cf.tar.gz zsh-08cc808d717c3cf61118dd47ba451e22c984d3cf.tar.bz2 zsh-08cc808d717c3cf61118dd47ba451e22c984d3cf.zip |
magic-enter: define bindkey for vi mode as well
Closes #8906
Diffstat (limited to 'plugins/magic-enter')
-rw-r--r-- | plugins/magic-enter/magic-enter.plugin.zsh | 7 |
1 files 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 |