Add upstream oh_my_zsh repo

This commit is contained in:
2020-10-16 10:09:40 +05:00
parent 9fcc978a55
commit 1335bbb251
440 changed files with 14454 additions and 8085 deletions

View File

@@ -0,0 +1,17 @@
## Magic Enter plugin
This plugin makes your enter key magical, by binding commonly used commands to it.
To use it, add `magic-enter` to the plugins array in your zshrc file. You can set the
commands to be run in your .zshrc, before the line containing plugins. If no command
is specified in a git directory, `git status` is executed; in other directories, `ls`.
```zsh
# defaults
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
plugins=(... magic-enter)
```
**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)

View File

@@ -1,14 +0,0 @@
## Magic Enter
**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)
Makes your enter key magical, by binding commonly used commands to it.
You can set the commands to be run in your .zshrc, before the line containing plugins!
```bash
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
plugins=(magic-enter)
```

View File

@@ -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