summaryrefslogtreecommitdiff
path: root/plugins/magic-enter
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2020-05-29 11:01:03 -0600
committerTuowen Zhao <ztuowen@gmail.com>2020-05-29 11:01:03 -0600
commita3be2e4084285d7625e63bfe4b951c58143e3c9c (patch)
treea018be4daef44a51b91477f38da514867659c7d6 /plugins/magic-enter
parent191e14cc7f63c4525a0f66d571416faf9e91a185 (diff)
parent93cc3964e2d265ab0571298d69d2eed0a65d13f2 (diff)
downloadzsh-a3be2e4084285d7625e63bfe4b951c58143e3c9c.tar.gz
zsh-a3be2e4084285d7625e63bfe4b951c58143e3c9c.tar.bz2
zsh-a3be2e4084285d7625e63bfe4b951c58143e3c9c.zip
Merge branch 'master' of https://github.com/ohmyzsh/ohmyzsh
Diffstat (limited to 'plugins/magic-enter')
-rw-r--r--plugins/magic-enter/magic-enter.plugin.zsh7
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