mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-25 15:58:57 +01:00
parent
b876198575
commit
08cc808d71
@ -3,7 +3,6 @@
|
|||||||
# Pressing enter in a git directory runs `git status`
|
# Pressing enter in a git directory runs `git status`
|
||||||
# in other directories `ls`
|
# in other directories `ls`
|
||||||
magic-enter () {
|
magic-enter () {
|
||||||
|
|
||||||
# If commands are not already set, use the defaults
|
# If commands are not already set, use the defaults
|
||||||
[ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ."
|
[ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ."
|
||||||
[ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ."
|
[ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ."
|
||||||
@ -20,5 +19,9 @@ magic-enter () {
|
|||||||
zle accept-line
|
zle accept-line
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
zle -N magic-enter
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user