summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/alias-finder/README.md46
-rw-r--r--plugins/alias-finder/alias-finder.plugin.zsh46
-rw-r--r--plugins/bwana/README.md12
-rw-r--r--plugins/bwana/bwana.plugin.zsh13
-rw-r--r--plugins/colored-man-pages/README.md15
-rw-r--r--plugins/colored-man-pages/colored-man-pages.plugin.zsh8
-rw-r--r--plugins/common-aliases/README.md121
-rw-r--r--plugins/fabric/_fab2
-rw-r--r--plugins/frontend-search/README.md4
-rw-r--r--plugins/frontend-search/frontend-search.plugin.zsh31
-rw-r--r--plugins/git-auto-fetch/git-auto-fetch.plugin.zsh20
-rw-r--r--plugins/git-escape-magic/README.md17
-rw-r--r--plugins/git-escape-magic/git-escape-magic135
-rw-r--r--plugins/git-escape-magic/git-escape-magic.plugin.zsh9
-rw-r--r--plugins/git/README.md4
-rw-r--r--plugins/git/git.plugin.zsh4
-rw-r--r--plugins/n98-magerun/n98-magerun.plugin.zsh14
-rw-r--r--plugins/sudo/sudo.plugin.zsh4
-rw-r--r--plugins/thefuck/thefuck.plugin.zsh4
19 files changed, 460 insertions, 49 deletions
diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md
new file mode 100644
index 000000000..409f4b653
--- /dev/null
+++ b/plugins/alias-finder/README.md
@@ -0,0 +1,46 @@
+# alias-finder plugin
+
+This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier.
+
+To use it, add `alias-finder` to the `plugins` array of your zshrc file:
+```
+plugins=(... alias-finder)
+```
+
+## Usage
+To see if there is an alias defined for the command, pass it as an argument to `alias-finder`. This can also run automatically before each command you input - add `ZSH_ALIAS_FINDER_AUTOMATIC=true` to your zshrc if you want this.
+
+## Options
+
+- Use `--longer` or `-l` to allow the aliases to be longer than the input (match aliases if they contain the input).
+- Use `--exact` or `-e` to avoid matching aliases that are shorter than the input.
+
+## Examples
+```
+$ alias-finder "git pull"
+gl='git pull'
+g=git
+```
+```
+$ alias-finder "web_search google oh my zsh"
+google='web_search google'
+```
+```
+$ alias-finder "git commit -v"
+gc="git commit -v"
+g=git
+```
+```
+$ alias-finder -e "git commit -v"
+gc='git commit -v'
+```
+```
+$ alias-finder -l "git commit -v"
+gc='git commit -v'
+'gc!'='git commit -v --amend'
+gca='git commit -v -a'
+'gca!'='git commit -v -a --amend'
+'gcan!'='git commit -v -a --no-edit --amend'
+'gcans!'='git commit -v -a -s --no-edit --amend'
+'gcn!'='git commit -v --no-edit --amend'
+```
diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh
new file mode 100644
index 000000000..2bfaad597
--- /dev/null
+++ b/plugins/alias-finder/alias-finder.plugin.zsh
@@ -0,0 +1,46 @@
+alias-finder() {
+ local cmd="" exact="" longer="" wordStart="" wordEnd="" multiWordEnd=""
+ for i in $@; do
+ case $i in
+ -e|--exact) exact=true;;
+ -l|--longer) longer=true;;
+ *)
+ if [[ -z $cmd ]]; then
+ cmd=$i
+ else
+ cmd="$cmd $i"
+ fi
+ ;;
+ esac
+ done
+ cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep
+ if [[ $(wc -l <<< $cmd) == 1 ]]; then
+ while [[ $cmd != "" ]]; do
+ if [[ $longer = true ]]; then
+ wordStart="'{0,1}"
+ else
+ wordEnd="$"
+ multiWordEnd="'$"
+ fi
+ if [[ $cmd == *" "* ]]; then
+ local finder="'$cmd$multiWordEnd"
+ else
+ local finder=$wordStart$cmd$wordEnd
+ fi
+ alias | grep -E "=$finder"
+ if [[ $exact = true || $longer = true ]]; then
+ break
+ else
+ cmd=$(sed -E 's/ {0,1}[^ ]*$//' <<< $cmd) # removes last word
+ fi
+ done
+ fi
+}
+
+preexec_alias-finder() {
+ if [[ $ZSH_ALIAS_FINDER_AUTOMATIC = true ]]; then
+ alias-finder $1
+ fi
+}
+
+preexec_functions+=(preexec_alias-finder)
diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md
deleted file mode 100644
index dd4fe9f9c..000000000
--- a/plugins/bwana/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Bwana
-
-This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
-
-To use it add bwana to the plugins array in your zshrc file.
-
-```bash
-plugins=(... bwana)
-```
-
-The `bwana` function opens the man page of the passed argument in the Bwana app.
-For example: `bwana ln` opens the man page for `ln` in Bwana.
diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh
deleted file mode 100644
index 71c9eb18d..000000000
--- a/plugins/bwana/bwana.plugin.zsh
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Requires https://www.bruji.com/bwana/
-#
-if [[ -e /Applications/Bwana.app ]] ||
- ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
-then
- function bwana() {
- open "man:$1"
- }
-else
- echo "Bwana lets you read man files in Safari through a man: URI scheme"
- echo "To use it within Zsh, install it from https://www.bruji.com/bwana/"
-fi
diff --git a/plugins/colored-man-pages/README.md b/plugins/colored-man-pages/README.md
new file mode 100644
index 000000000..d9f6acb2a
--- /dev/null
+++ b/plugins/colored-man-pages/README.md
@@ -0,0 +1,15 @@
+# Colored man pages plugin
+
+This plugin adds colors to man pages.
+
+To use it, add `colored-man-pages` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... colored-man-pages)
+```
+
+You can also try to color other pages by prefixing the respective command with `colored`:
+
+```zsh
+colored git help clone
+```
diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index 1bea536e0..ac6a94654 100644
--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
@@ -16,7 +16,7 @@ EOF
fi
fi
-function man() {
+function colored() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
@@ -28,5 +28,9 @@ function man() {
PAGER="${commands[less]:-$PAGER}" \
_NROFF_U=1 \
PATH="$HOME/bin:$PATH" \
- man "$@"
+ "$@"
+}
+
+function man() {
+ colored man "$@"
}
diff --git a/plugins/common-aliases/README.md b/plugins/common-aliases/README.md
new file mode 100644
index 000000000..d198a29ac
--- /dev/null
+++ b/plugins/common-aliases/README.md
@@ -0,0 +1,121 @@
+# Common Aliases Plugin
+
+This plugin creates helpful shortcut aliases for many commonly used commands.
+
+To use it add `common-aliases` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... common-aliases)
+```
+
+## Aliases
+
+### ls command
+
+| Alias | Command | Description |
+|-------|---------------|--------------------------------------------------------------------------------|
+| l | `ls -lFh` | List files as a long list, show size, type, human-readable |
+| la | `ls -lAFh` | List almost all files as a long list show size, type, human-readable |
+| lr | `ls -tRFh` | List files recursively sorted by date, show type, human-readable |
+| lt | `ls -ltFh` | List files as a long list sorted by date, show type, human-readable |
+| ll | `ls -l` | List files as a long list |
+| ldot | `ls -ld .*` | List dot files as a long list |
+| lS | `ls -1FSsh` | List files showing only size and name sorted by size |
+| lart | `ls -1Fcart` | List all files sorted in reverse of create/modification time (oldest first) |
+| lrt | `ls -1Fcrt` | List files sorted in reverse of create/modification time(oldest first) |
+
+### File handling
+
+| Alias | Command | Description |
+|-------|-----------------------|------------------------------------------------------------------------------------|
+| rm | `rm -i` | Remove a file |
+| cp | `cp -i` | Copy a file |
+| mv | `mv -i` | Move a file |
+| zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file |
+| dud | `du -d 1 -h` | Display the size of files at depth 1 in current location in human-readable form |
+| duf | `du -sh` | Display the size of files in current location in human-readable form |
+| t | `tail -f` | Shorthand for tail which outputs the last part of a file |
+
+### find and grep
+
+| Alias | Command | Description |
+|-------|-----------------------------------------------------|-----------------------------------------|
+| fd | `find . -type d -name` | Find a directory with the given name |
+| ff | `find . -type f -name` | Find a file with the given name |
+| grep | `grep --color` | Searches for a query string |
+| sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}` | Useful for searching within files |
+
+### Other Aliases
+
+| Alias | Command | Description |
+|-----------|---------------------|-------------------------------------------------------------|
+| h | `history` | Lists all recently used commands |
+| hgrep | `fc -El 0 \| grep` | Searches for a word in the list of previously used commands |
+| help | `man` | Opens up the man page for a command |
+| p | `ps -f` | Displays currently executing processes |
+| sortnr | `sort -n -r` | Used to sort the lines of a text file |
+| unexport | `unset` | Used to unset an environment variable |
+
+## Global aliases
+
+These aliases are expanded in any position in the command line, meaning you can use them even at the
+end of the command you've typed. Examples:
+
+Quickly pipe to less:
+```zsh
+$ ls -l /var/log L
+# will run
+$ ls -l /var/log | less
+```
+Silences stderr output:
+```zsh
+$ find . -type f NE
+# will run
+$ find . -type f 2>/dev/null
+```
+
+| Alias | Command | Description |
+|-------|-----------------------------|-------------------------------------------------------------|
+| H | `\| head` | Pipes output to head which outputs the first part of a file |
+| T | `\| tail` | Pipes output to tail which outputs the last part of a file |
+| G | `\| grep` | Pipes output to grep to search for some word |
+| L | `\| less` | Pipes output to less, useful for paging |
+| M | `\| most` | Pipes output to more, useful for paging |
+| LL | `2>&1 \| less` | Writes stderr to stdout and passes it to less |
+| CA | `2>&1 \| cat -A` | Writes stderr to stdout and passes it to cat |
+| NE | `2 > /dev/null` | Silences stderr |
+| NUL | `> /dev/null 2>&1` | Silences both stdout and stderr |
+| P | `2>&1\| pygmentize -l pytb` | Writes stderr to stdout and passes it to pygmentize |
+
+## File extension aliases
+
+These are special aliases that are triggered when a file name is passed as the command. For example,
+if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf`
+that file will be open with `acroread`.
+
+### Reading Docs
+
+| Alias | Command | Description |
+|-------|-------------|-------------------------------------|
+| pdf | `acroread` | Opens up a document using acroread |
+| ps | `gv` | Opens up a .ps file using gv |
+| dvi | `xdvi` | Opens up a .dvi file using xdvi |
+| chm | `xchm` | Opens up a .chm file using xchm |
+| djvu | `djview` | Opens up a .djvu file using djview |
+
+### Listing files inside a packed file
+
+| Alias | Command | Description |
+|---------|-------------|-------------------------------------|
+| zip | `unzip -l` | Lists files inside a .zip file |
+| rar | `unrar l` | Lists files inside a .rar file |
+| tar | `tar tf` | Lists files inside a .tar file |
+| tar.gz | `echo` | Lists files inside a .tar.gz file |
+| ace | `unace l` | Lists files inside a .ace file |
+
+### Some other features
+
+- Opens urls in terminal using browser specified by the variable `$BROWSER`
+- Opens C, C++, Tex and text files using editor specified by the variable `$EDITOR`
+- Opens images using image viewer specified by the variable `$XIVIEWER`
+- Opens videos and other media using mplayer
diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab
index 9628e1224..4c2e61306 100644
--- a/plugins/fabric/_fab
+++ b/plugins/fabric/_fab
@@ -5,7 +5,7 @@ local curcontext=$curcontext state line
declare -A opt_args
declare target_list
-target_list=(`fab --shortlist 2>/dev/null`)
+target_list=(`fab --shortlist 2>/dev/null || fab --complete 2>/dev/null`)
_targets() {
_describe -t commands "fabric targets" target_list
diff --git a/plugins/frontend-search/README.md b/plugins/frontend-search/README.md
index bf76902fd..ddcb3d72b 100644
--- a/plugins/frontend-search/README.md
+++ b/plugins/frontend-search/README.md
@@ -62,6 +62,10 @@ Available search contexts are:
If you want to have another context, open an Issue and tell us!
+## Fallback search behaviour
+
+The plugin will use Google as a fallback if the docs site for a search context does not have a search function. You can set the fallback search engine to DuckDuckGo by setting `FRONTEND_SEARCH_FALLBACK='duckduckgo'` in your `~/.zshrc` file before Oh My Zsh is sourced.
+
## Author
**Wilson Mendes (willmendesneto)**
diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh
index 87243be13..ed19280c4 100644
--- a/plugins/frontend-search/frontend-search.plugin.zsh
+++ b/plugins/frontend-search/frontend-search.plugin.zsh
@@ -27,6 +27,17 @@ alias typescript='frontend typescript'
alias unheap='frontend unheap'
alias vuejs='frontend vuejs'
+function _frontend_fallback() {
+ local url
+ if [[ "$FRONTEND_SEARCH_FALLBACK" == duckduckgo ]]; then
+ url="https://duckduckgo.com/?sites=$1&q="
+ else
+ url="https://google.com/search?as_sitesearch=$1&as_q="
+ fi
+
+ echo "$url"
+}
+
function frontend() {
emulate -L zsh
@@ -34,8 +45,8 @@ function frontend() {
typeset -A urls
urls=(
angular 'https://angular.io/?search='
- angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q='
- bem 'https://google.com/search?as_sitesearch=bem.info&as_q='
+ angularjs $(_frontend_fallback 'angularjs.org')
+ bem $(_frontend_fallback 'bem.info')
bootsnipp 'https://bootsnipp.com/search?q='
bundlephobia 'https://bundlephobia.com/result?p='
caniuse 'https://caniuse.com/#search='
@@ -43,24 +54,24 @@ function frontend() {
compassdoc 'http://compass-style.org/search?q='
cssflow 'http://www.cssflow.com/search?q='
dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:'
- emberjs 'https://www.google.com/search?as_sitesearch=emberjs.com/&as_q='
- flowtype 'https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q='
+ emberjs $(_frontend_fallback 'emberjs.com/')
+ flowtype $(_frontend_fallback 'flow.org/en/docs/')
fontello 'http://fontello.com/#search='
github 'https://github.com/search?q='
html5please 'https://html5please.com/#'
- jestjs 'https://www.google.com/search?as_sitesearch=jestjs.io&as_q='
+ jestjs $(_frontend_fallback 'jestjs.io')
jquery 'https://api.jquery.com/?s='
lodash 'https://devdocs.io/lodash/index#'
mdn 'https://developer.mozilla.org/search?q='
- nodejs 'https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q='
+ nodejs $(_frontend_fallback 'nodejs.org/en/docs/')
npmjs 'https://www.npmjs.com/search?q='
qunit 'https://api.qunitjs.com/?s='
- reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q='
- smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q='
+ reactjs $(_frontend_fallback 'reactjs.org/')
+ smacss $(_frontend_fallback 'smacss.com')
stackoverflow 'https://stackoverflow.com/search?q='
- typescript 'https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q='
+ typescript $(_frontend_fallback 'www.typescriptlang.org/docs')
unheap 'http://www.unheap.com/?s='
- vuejs 'https://www.google.com/search?as_sitesearch=vuejs.org&as_q='
+ vuejs $(_frontend_fallback 'vuejs.org')
)
# show help for command list
diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
index 745c669b5..56ab86dbe 100644
--- a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
+++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
@@ -18,10 +18,18 @@ function git-auto-fetch {
echo "${fg_bold[red]}disabled${reset_color}")
}
-eval "override-git-auto-fetch-$(declare -f zle-line-init)"
-
-function zle-line-init () {
- git-fetch-all
- override-git-auto-fetch-zle-line-init
-}
+# Override zle-line-init if it exists
+if (( $+functions[zle-line-init] )); then
+ eval "override-git-auto-fetch-$(declare -f zle-line-init)"
+
+ function zle-line-init () {
+ git-fetch-all
+ override-git-auto-fetch-zle-line-init
+ }
+else
+ function zle-line-init () {
+ git-fetch-all
+ }
+fi
+
zle -N zle-line-init
diff --git a/plugins/git-escape-magic/README.md b/plugins/git-escape-magic/README.md
new file mode 100644
index 000000000..a14364f22
--- /dev/null
+++ b/plugins/git-escape-magic/README.md
@@ -0,0 +1,17 @@
+# Git Escape Magic
+
+This plugin is copied from the original at
+https://github.com/knu/zsh-git-escape-magic. All credit for the
+functionality enabled by this plugin should go to @knu.
+
+An excerpt from that project's readme explains it's purpose.
+
+> It eliminates the need for manually escaping those meta-characters. The zle function it provides is context aware and recognizes the characteristics of each subcommand of git. Every time you type one of these meta-characters on a git command line, it automatically escapes the meta-character with a backslash as necessary and as appropriate.
+
+## Useage
+
+To use this plugin add it to your list of plugins in your `.zshrc` file.
+
+**NOTE**: If you use url-quote-magic it must be included before this
+plugin runs to prevent any conflicts.
+
diff --git a/plugins/git-escape-magic/git-escape-magic b/plugins/git-escape-magic/git-escape-magic
new file mode 100644
index 000000000..94a8d7b0f
--- /dev/null
+++ b/plugins/git-escape-magic/git-escape-magic
@@ -0,0 +1,135 @@
+# -*- mode: sh -*-
+#
+# git-escape-magic - zle tweak for git command line arguments
+#
+# Copyright (c) 2011, 2012, 2014 Akinori MUSHA
+# Licensed under the 2-clause BSD license.
+#
+# This tweak eliminates the need for manually escaping shell
+# meta-characters such as [~^{}] that are used for specifying a git
+# object (commit or tree). Every time you type one of these
+# characters on a git command line, it is automatically escaped with a
+# backslash as necessary and as appropriate.
+#
+# If you want to use this with url-quote-magic, make sure to enable it
+# first.
+#
+# Usage:
+# autoload -Uz git-escape-magic
+# git-escape-magic
+#
+
+git-escape-magic.self-insert() {
+ emulate -L zsh
+ setopt extendedglob
+ local self_insert_function
+ zstyle -s ':git-escape-magic' self-insert-function self_insert_function
+
+ if [[ "$KEYS" == [{}~^]* ]] && {
+ local qkey="${(q)KEYS}"
+ [[ "$KEYS" != "$qkey" ]]
+ } && {
+ local lbuf="$LBUFFER$qkey"
+ [[ "${(Q)LBUFFER}$KEYS" == "${(Q)lbuf}" ]]
+ } && {
+ local -a words
+ words=("${(@Q)${(z)lbuf}}")
+ [[ "$words[(i)(*/|)git(|-[^/]##)]" -le $#words ]]
+ }
+ then
+ local i
+ i="$words[(I)([;(){\&]|\&[\&\!]|\|\||[=<>]\(*)]"
+ if [[ $i -gt 0 ]]; then
+ shift $((i-1)) words
+ if [[ "$words[1]" == [\=\<\>]\(* ]]; then
+ words[1]="${words[1]#[=<>]\(}"
+ else
+ [[ "$words[1]" == \; && $words[2] == (then|else|elif|do) ]] && shift words
+ shift words
+ fi
+ fi
+ while [[ "$words[1]" == (if|while|until|\!) ]]; do
+ shift words
+ done
+ while [[ "$words[1]" == [A-Za-z_][A-Za-z0-9_]#=* ]]; do
+ shift words
+ done
+ [[ "$words[1]" == (*/|)git(|-[^/]##) ]] && {
+ local subcommand
+ subcommand="${words[1]##*/git-}"
+ if [[ -z "$subcommand" ]]; then
+ shift words
+ subcommand="$words[1]"
+ fi
+ [[ $#words -ge 2 ]]
+ } &&
+ case "$subcommand" in
+ # commands that may take pathspec but never take refspec with [{}~^]
+ (add|rm|am|apply|check-attr|checkout-index|clean|clone|config|diff-files|hash-object|help|index-pack|mailinfo|mailsplit|merge-file|merge-index|mergetool|mktag|mv|pack-objects|pack-redundant|relink|send-email|show-index|show-ref|stage|status|verify-pack)
+ false ;;
+ # commands that may take pathspec but rarely take refspec with [{}~^]
+ (for-each-ref|grep|ls-files|update-index)
+ false ;;
+ (archive|ls-tree)
+ ! [[ $#words -ge 3 &&
+ "$words[-2]" == [^-]* ]] ;;
+ (diff-tree)
+ ! [[ $#words -ge 4 &&
+ "$words[-2]" == [^-]* &&
+ "$words[-3]" == [^-]* ]] ;;
+ (*)
+ [[ $words[(i)--] -gt $#words ]] ;;
+ esac &&
+ case "${words[-1]%%"$KEYS"}" in
+ (*[@^])
+ [[ "$KEYS" == [{~^]* ]] ;;
+ (*[@^]\{[^}]##)
+ [[ "$KEYS" == \}* ]] ;;
+ (?*)
+ [[ "$KEYS" == [~^]* ]] ;;
+ (*)
+ false ;;
+ esac &&
+ LBUFFER="$LBUFFER\\"
+ fi
+
+ zle "$self_insert_function"
+}
+
+git-escape-magic.on() {
+ emulate -L zsh
+ local self_insert_function="${$(zle -lL | awk \
+ '$1=="zle"&&$2=="-N"&&$3=="self-insert"{print $4;exit}'):-.self-insert}"
+
+ [[ "$self_insert_function" == git-escape-magic.self-insert ]] &&
+ return 0
+
+ # For url-quote-magic which does not zle -N itself
+ zle -la "$self_insert_function" || zle -N "$self_insert_function"
+
+ zstyle ':git-escape-magic' self-insert-function "$self_insert_function"
+
+ zle -A git-escape-magic.self-insert self-insert
+ return 0
+}
+
+git-escape-magic.off() {
+ emulate -L zsh
+ local self_insert_function
+ zstyle -s ':git-escape-magic' self-insert-function self_insert_function
+
+ [[ -n "$self_insert_function" ]] &&
+ zle -A "$self_insert_function" self-insert
+ return 0
+}
+
+zle -N git-escape-magic.self-insert
+zle -N git-escape-magic.on
+zle -N git-escape-magic.off
+
+git-escape-magic() {
+ git-escape-magic.on
+}
+
+[[ -o kshautoload ]] || git-escape-magic "$@"
+
diff --git a/plugins/git-escape-magic/git-escape-magic.plugin.zsh b/plugins/git-escape-magic/git-escape-magic.plugin.zsh
new file mode 100644
index 000000000..c021ea707
--- /dev/null
+++ b/plugins/git-escape-magic/git-escape-magic.plugin.zsh
@@ -0,0 +1,9 @@
+# Automatically detect and escape zsh globbing meta-characters when used with
+# git refspec characters like `[^~{}]`. NOTE: This must be loaded _after_
+# url-quote-magic.
+#
+# This trick is detailed at https://github.com/knu/zsh-git-escape-magic and is
+# what allowed this plugin to exist.
+
+autoload -Uz git-escape-magic
+git-escape-magic
diff --git a/plugins/git/README.md b/plugins/git/README.md
index fc89b27e0..3311ccf55 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -131,7 +131,9 @@ plugins=(... git)
| grmc | git rm --cached |
| grmv | git remote rename |
| grrm | git remote remove |
+| grs | git restore |
| grset | git remote set-url |
+| grss | git restore --source |
| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" |
| gru | git reset -- |
| grup | git remote update |
@@ -154,6 +156,8 @@ plugins=(... git)
| gsts | git stash show --text |
| gstall | git stash --all |
| gsu | git submodule update |
+| gsw | git switch |
+| gswc | git switch -c |
| gts | git tag -s |
| gtv | git tag \| sort -V |
| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl |
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index e0ce27fd4..9787392de 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -207,7 +207,9 @@ alias grm='git rm'
alias grmc='git rm --cached'
alias grmv='git remote rename'
alias grrm='git remote remove'
+alias grs='git restore'
alias grset='git remote set-url'
+alias grss='git restore --source'
alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
alias gru='git reset --'
alias grup='git remote update'
@@ -236,6 +238,8 @@ alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gstall='git stash --all'
alias gsu='git submodule update'
+alias gsw='git switch'
+alias gswc='git switch -c'
alias gts='git tag -s'
alias gtv='git tag | sort -V'
diff --git a/plugins/n98-magerun/n98-magerun.plugin.zsh b/plugins/n98-magerun/n98-magerun.plugin.zsh
index bfcf27b98..d79aee7eb 100644
--- a/plugins/n98-magerun/n98-magerun.plugin.zsh
+++ b/plugins/n98-magerun/n98-magerun.plugin.zsh
@@ -2,7 +2,8 @@
# FILE: n98-magerun.plugin.zsh
# DESCRIPTION: oh-my-zsh n98-magerun plugin file. Adapted from composer plugin
# AUTHOR: Andrew Dwyer (andrewrdwyer at gmail dot com)
-# VERSION: 1.0.0
+# AUTHOR: Jisse Reitsma (jisse at yireo dot com)
+# VERSION: 1.1.0
# ------------------------------------------------------------------------------
# n98-magerun basic command completion
@@ -24,11 +25,18 @@ _n98_magerun () {
compdef _n98_magerun n98-magerun.phar
compdef _n98_magerun n98-magerun
+compdef _n98_magerun n98-magerun2.phar
+compdef _n98_magerun n98-magerun2
# Aliases
alias n98='n98-magerun.phar'
alias mage='n98-magerun.phar'
-alias magefl='n98-magerun.phar cache:flush'
+alias magerun='n98-magerun.phar'
+
+alias n98-2='n98-magerun2.phar'
+alias mage2='n98-magerun2.phar'
+alias magerun2='n98-magerun2.phar'
# Install n98-magerun into the current directory
-alias mage-get='wget https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar'
+alias mage-get='wget https://files.magerun.net/n98-magerun.phar'
+alias mage2-get='wget https://files.magerun.net/n98-magerun2.phar'
diff --git a/plugins/sudo/sudo.plugin.zsh b/plugins/sudo/sudo.plugin.zsh
index 0b843822e..f405b025f 100644
--- a/plugins/sudo/sudo.plugin.zsh
+++ b/plugins/sudo/sudo.plugin.zsh
@@ -28,4 +28,6 @@ sudo-command-line() {
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
-bindkey "\e\e" sudo-command-line
+bindkey -M emacs '\e\e' sudo-command-line
+bindkey -M vicmd '\e\e' sudo-command-line
+bindkey -M viins '\e\e' sudo-command-line
diff --git a/plugins/thefuck/thefuck.plugin.zsh b/plugins/thefuck/thefuck.plugin.zsh
index ac88e67de..b8586c70d 100644
--- a/plugins/thefuck/thefuck.plugin.zsh
+++ b/plugins/thefuck/thefuck.plugin.zsh
@@ -15,4 +15,6 @@ fuck-command-line() {
}
zle -N fuck-command-line
# Defined shortcut keys: [Esc] [Esc]
-bindkey "\e\e" fuck-command-line
+bindkey -M emacs '\e\e' fuck-command-line
+bindkey -M vicmd '\e\e' fuck-command-line
+bindkey -M viins '\e\e' fuck-command-line