From c840594c6ffdcecc241c9ccb130daeb630831ef7 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Fri, 10 Apr 2015 15:07:29 +1200 Subject: [PATCH 001/488] added aliases for vagrant --- plugins/vagrant/vagrant.plugin.zsh | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/vagrant/vagrant.plugin.zsh diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh new file mode 100644 index 0000000000000..a238d9ffe3f98 --- /dev/null +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -0,0 +1,31 @@ +alias vgi="vagrant init" + +alias vup="vagrant up" +alias vd="vagrant destroy" +alias vdf="vagrant destroy -f" + +alias vssh="vagrant ssh" +alias vrdp="vagrant rdp" + +alias vh="vagrant halt" +alias vssp="vagrant suspend" +alias vst="vagrant status" +alias vre="vagrant resume" + +alias vpr="vagrant provision" +alias vr="vagrant reload" +alias vrp="vagrant reload --provision" + +alias vp="vagrant push" +alias vsh="vagrant share" + +alias vba="vagrant box add" +alias vbr="vagrant box remove" +alias vbl="vagrant box list" +alias vbo="vagrant box outdated" +alias vbu="vagrant box update" + +alias vpli="vagrant plugin install" +alias vpll="vagrant plugin list" +alias vplun="vagrant plugin uninstall" +alias vplu="vagrant plugin update" From b6ed2e7ac378438689d3348b4be00b2bce4fd9a8 Mon Sep 17 00:00:00 2001 From: Robert McLeod Date: Wed, 8 Jul 2015 07:54:42 +1200 Subject: [PATCH 002/488] added aliases for ssh-config and global-status So the following aliases call the respective commands: vgs = vagrant global-status vsshc = vagrant ssh-config --- plugins/vagrant/vagrant.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh index a238d9ffe3f98..a4e9b06c2f52c 100644 --- a/plugins/vagrant/vagrant.plugin.zsh +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -5,12 +5,14 @@ alias vd="vagrant destroy" alias vdf="vagrant destroy -f" alias vssh="vagrant ssh" +alias vsshc="vagrant ssh-config" alias vrdp="vagrant rdp" alias vh="vagrant halt" alias vssp="vagrant suspend" alias vst="vagrant status" alias vre="vagrant resume" +alias vgs="vagrant global-status" alias vpr="vagrant provision" alias vr="vagrant reload" From 9dd76fb6bc29071bd616d9ea32e29ce7b4dcba73 Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 23 Sep 2016 12:02:23 +0800 Subject: [PATCH 003/488] add task description to fabric completion --- plugins/fabric/_fab | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 9628e12247405..79d596ed6f2fe 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -5,7 +5,10 @@ local curcontext=$curcontext state line declare -A opt_args declare target_list -target_list=(`fab --shortlist 2>/dev/null`) +IFS="$(printf '\n+')" target_list=($(fab -l | awk '{ + if(NR > 2) + printf "%s:%s\n", $1, substr($0, index($0, $2)) +}' 2>/dev/null)) _targets() { _describe -t commands "fabric targets" target_list From 67e0ef7aa6a494b2357c64a204214f7b19fb52e7 Mon Sep 17 00:00:00 2001 From: "GIL B. Chan" Date: Sun, 7 Apr 2019 18:48:22 +0900 Subject: [PATCH 004/488] edit colorize plugin: add `-f terminal` option The option (`pygmentize -f terminal <...>`) lets pygments use terminal color scheme. Otherwise, it would use its default colors, which might be unbalanced with that of terminal (e.g. not harmonious with background color of terminal). --- plugins/colorize/colorize.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 8eede9a94d50a..d52e95c499504 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -9,7 +9,7 @@ colorize_via_pygmentize() { # pygmentize stdin if no arguments passed if [ $# -eq 0 ]; then - pygmentize -g + pygmentize -f terminal -g return $? fi @@ -20,9 +20,9 @@ colorize_via_pygmentize() { do lexer=$(pygmentize -N "$FNAME") if [[ $lexer != text ]]; then - pygmentize -l "$lexer" "$FNAME" + pygmentize -f terminal -l "$lexer" "$FNAME" else - pygmentize -g "$FNAME" + pygmentize -f terminal -g "$FNAME" fi done } From c1446b4750a31506daba7fc7d41957dd515e8022 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sat, 6 Jul 2019 12:10:30 -0400 Subject: [PATCH 005/488] Automatic title: Replace fg with description from jobs --- lib/termsupport.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index aa14f3f07fe4a..a74ad992284bc 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -72,7 +72,19 @@ function omz_termsupport_preexec { local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} local LINE="${2:gs/%/%%}" - title '$CMD' '%100>...>$LINE%<<' + if [[ "$CMD" = fg ]]; then + # replace fg, possibly with argument, with description from jobs + local JOB + if [[ ${(z)1} = fg ]]; then # no arguments + JOB="$(jobs %%)" + else # arguments + JOB="$(jobs ${${(z)1}[2]})" + fi + JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status + title ${JOB:gs/%/%%} ${JOB:gs/%/%%} + else + title '$CMD' '%100>...>$LINE%<<' + fi } precmd_functions+=(omz_termsupport_precmd) From 902e3172c9b991ca0995a0dcd658caa29b918d8e Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sun, 7 Jul 2019 10:48:36 -0400 Subject: [PATCH 006/488] Avoid error messages when there is no job --- lib/termsupport.zsh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index a74ad992284bc..59a1efb02c3ca 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -72,19 +72,22 @@ function omz_termsupport_preexec { local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} local LINE="${2:gs/%/%%}" + # replace fg, possibly with argument, with description from jobs if [[ "$CMD" = fg ]]; then - # replace fg, possibly with argument, with description from jobs local JOB if [[ ${(z)1} = fg ]]; then # no arguments - JOB="$(jobs %%)" + JOB="$(jobs %% 2>/dev/null)" else # arguments - JOB="$(jobs ${${(z)1}[2]})" + JOB="$(jobs ${${(z)1}[2]} 2>/dev/null)" + fi + if [[ $? -eq 0 ]]; then + JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status + title ${JOB:gs/%/%%} ${JOB:gs/%/%%} + return fi - JOB="${${(z)JOB}[4,$]}" # trim job number, +, pid, status - title ${JOB:gs/%/%%} ${JOB:gs/%/%%} - else - title '$CMD' '%100>...>$LINE%<<' fi + + title '$CMD' '%100>...>$LINE%<<' } precmd_functions+=(omz_termsupport_precmd) From d855547661ee4173bd01ab89ad18418d4dbf508a Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Fri, 12 Jul 2019 17:01:10 -0400 Subject: [PATCH 007/488] clipboard: Reduce unnecessary special-casing on stdin Ideally the parameter would just be removed-users could always just do "clipcopy < some-file". but removing the parameter would break backwards compatibility. In any case, this simplifies the logic considerably. --- lib/clipboard.zsh | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 2c93d1bb5c3a2..15ad6d91683d9 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -17,32 +17,17 @@ # function clipcopy() { emulate -L zsh - local file=$1 + local file="${1:-/dev/stdin}" + if [[ $OSTYPE == darwin* ]]; then - if [[ -z $file ]]; then - pbcopy - else - cat $file | pbcopy - fi + pbcopy < "${file}" elif [[ $OSTYPE == cygwin* ]]; then - if [[ -z $file ]]; then - cat > /dev/clipboard - else - cat $file > /dev/clipboard - fi + cat "${file}" > /dev/clipboard else if (( $+commands[xclip] )); then - if [[ -z $file ]]; then - xclip -in -selection clipboard - else - xclip -in -selection clipboard $file - fi + xclip -in -selection clipboard < "${file}" elif (( $+commands[xsel] )); then - if [[ -z $file ]]; then - xsel --clipboard --input - else - cat "$file" | xsel --clipboard --input - fi + xsel --clipboard --input < "${file}" else print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 return 1 From 956ca639bba5780dc6272e76b0507c67e93c098b Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Fri, 12 Jul 2019 17:16:01 -0400 Subject: [PATCH 008/488] clipboard: Avoid unnecessary re-detection each time Previously, OS detection would happen on each invocation. This makes it happen once (unless it fails, in which case it will try again on the next invocation). This has the additional benefit of localizing the platform-specific checks and commands, too, versus spreading them out in separate functions. --- lib/clipboard.zsh | 65 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 15ad6d91683d9..512a5a2489c79 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -15,26 +15,9 @@ # # clipcopy - copies a file's contents to clipboard # -function clipcopy() { - emulate -L zsh - local file="${1:-/dev/stdin}" - - if [[ $OSTYPE == darwin* ]]; then - pbcopy < "${file}" - elif [[ $OSTYPE == cygwin* ]]; then - cat "${file}" > /dev/clipboard - else - if (( $+commands[xclip] )); then - xclip -in -selection clipboard < "${file}" - elif (( $+commands[xsel] )); then - xsel --clipboard --input < "${file}" - else - print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi - fi -} - +# +## +# # clippaste - "Paste" data from clipboard to stdout # # Usage: @@ -52,20 +35,40 @@ function clipcopy() { # # # Paste to a file # clippaste > file.txt -function clippaste() { +# +function detect-clipboard() { emulate -L zsh + if [[ $OSTYPE == darwin* ]]; then - pbpaste + function clipcopy() { pbcopy < "${1:-/dev/stdin}"; } + function clippaste() { pbpaste; } elif [[ $OSTYPE == cygwin* ]]; then - cat /dev/clipboard + function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } + function clippaste() { cat /dev/clipboard; } + elif (( $+commands[xclip] )); then + function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } + function clippaste() { xclip -out -selection clipboard; } + elif (( $+commands[xsel] )); then + function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } + function clippaste() { xsel --clipboard --output; } else - if (( $+commands[xclip] )); then - xclip -out -selection clipboard - elif (( $+commands[xsel] )); then - xsel --clipboard --output - else - print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi + function _retry_clipboard_detection_or_fail() { + local clipcmd="${1}"; shift + if detect-clipboard; then + "${clipcmd}" "$@" + else + print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 + return 1 + fi + } + function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } + function cilppaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } + return 1 fi } + +# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set, +# which is not really an error. If the user calls them, they will attempt to redetect +# (for example, perhaps the user has now installed xclip) and then either print an error +# or proceed successfully. +detect-clipboard || true From 01e934d6346a93acd6b4343de3256d5ba82c5961 Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Fri, 12 Jul 2019 17:39:16 -0400 Subject: [PATCH 009/488] clipboard: Add support for several more clipboards This implements essentially the same heuristic as neovim, with the additional (existing) special support for Cygwin. See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121 - pbcopy, pbpaste (macOS) - cygwin (Windows running Cygwin) - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) - xclip (if $DISPLAY is set) - xsel (if $DISPLAY is set) - lemonade (for SSH) https://github.com/pocke/lemonade - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ - win32yank (Windows) - tmux (if $TMUX is set) --- lib/clipboard.zsh | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 512a5a2489c79..17d8d1aaf1a95 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -3,10 +3,23 @@ # This file has support for doing system clipboard copy and paste operations # from the command line in a generic cross-platform fashion. # -# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other -# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the -# "system clipboard", and the X Windows `xclip` command must be installed. - +# This is uses essentially the same heuristic as neovim, with the additional +# special support for Cygwin. +# See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121 +# +# - pbcopy, pbpaste (macOS) +# - cygwin (Windows running Cygwin) +# - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) +# - xclip (if $DISPLAY is set) +# - xsel (if $DISPLAY is set) +# - lemonade (for SSH) https://github.com/pocke/lemonade +# - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ +# - win32yank (Windows) +# - tmux (if $TMUX is set) +# +# Defines two functions, clipcopy and clippaste, based on the detected platform. +## +# # clipcopy - Copy data to clipboard # # Usage: @@ -15,7 +28,6 @@ # # clipcopy - copies a file's contents to clipboard # -# ## # # clippaste - "Paste" data from clipboard to stdout @@ -39,18 +51,33 @@ function detect-clipboard() { emulate -L zsh - if [[ $OSTYPE == darwin* ]]; then + if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then function clipcopy() { pbcopy < "${1:-/dev/stdin}"; } function clippaste() { pbpaste; } - elif [[ $OSTYPE == cygwin* ]]; then + elif [[ "${OSTYPE}" == cygwin* ]]; then function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } function clippaste() { cat /dev/clipboard; } - elif (( $+commands[xclip] )); then + elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then + function clipcopy() { wl-copy < "${1:-/dev/stdin}"; } + function clippaste() { wl-paste; } + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } function clippaste() { xclip -out -selection clipboard; } - elif (( $+commands[xsel] )); then - function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } + elif [ -n "${DISPLAY:-}" ] && $(( ${+commands[xsel]} )); then + function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } function clippaste() { xsel --clipboard --output; } + elif (( ${+commands[lemonade]} )); then + function clipcopy() { lemonade copy < "${1:-/dev/stdin}"; } + function clippaste() { lemonade paste; } + elif (( ${+commands[doitclient]} )); then + function clipcopy() { doitclient wclip < "${1:-/dev/stdin}"; } + function clippaste() { doitclient wclip -r; } + elif (( ${+commands[win32yank]} )); then + function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; } + function clippaste() { win32yank -o; } + elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then + function clipcopy() { tmux load-buffer "${1:-/dev/stdin}"; } + function clippaste() { tmux save-buffer -; } else function _retry_clipboard_detection_or_fail() { local clipcmd="${1}"; shift From d71d3d99050fa2b658f41602b830c971235b9202 Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Sun, 14 Jul 2019 12:52:47 -0400 Subject: [PATCH 010/488] clipboard: Fix "cilppaste" -> "clippaste" typo --- lib/clipboard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 17d8d1aaf1a95..671d33d8ee7e0 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -89,7 +89,7 @@ function detect-clipboard() { fi } function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } - function cilppaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } + function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } return 1 fi } From 841008c947d5fbe780111539804945c46dcdfaf4 Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Sun, 14 Jul 2019 12:53:27 -0400 Subject: [PATCH 011/488] clipboard: Fix tmux clipcopy after testing Tmux must have special handling for /dev/stdin since it's managing the terminal itself. This was tested with tmux-2.9a on macOS. --- lib/clipboard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 671d33d8ee7e0..5001f46956205 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -76,7 +76,7 @@ function detect-clipboard() { function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; } function clippaste() { win32yank -o; } elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then - function clipcopy() { tmux load-buffer "${1:-/dev/stdin}"; } + function clipcopy() { tmux load-buffer "${1:--}"; } function clippaste() { tmux save-buffer -; } else function _retry_clipboard_detection_or_fail() { From d81cd753e0b3a845e8f3549da245dbad102a6e4c Mon Sep 17 00:00:00 2001 From: Robert Estelle Date: Sun, 14 Jul 2019 12:56:48 -0400 Subject: [PATCH 012/488] clipboard: Fix bad expansion of exit-code test --- lib/clipboard.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 5001f46956205..333f58dd88fbc 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -63,7 +63,7 @@ function detect-clipboard() { elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } function clippaste() { xclip -out -selection clipboard; } - elif [ -n "${DISPLAY:-}" ] && $(( ${+commands[xsel]} )); then + elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } function clippaste() { xsel --clipboard --output; } elif (( ${+commands[lemonade]} )); then From 1be840b8319b40c5608d18816031f6b2d6dc6849 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sat, 5 Oct 2019 11:05:46 +0200 Subject: [PATCH 013/488] Create README.md --- plugins/redis-cli/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/redis-cli/README.md diff --git a/plugins/redis-cli/README.md b/plugins/redis-cli/README.md new file mode 100644 index 0000000000000..f6e947f4ca3c3 --- /dev/null +++ b/plugins/redis-cli/README.md @@ -0,0 +1,14 @@ +# Redis-CLI + +This plugin adds [redis-cli](https://redis.io/topics/rediscli) completion, based off homebrew completion + +To use it, add `redis-cli` to the plugins array in your zshrc file: + +```zsh +plugins=(... redis-cli) +``` +## Requirements + +In order to make this work, you will need to have the redis installed. + +More info on the usage and install: https://redis.io/topics/quickstart From e1cb349ffe411b6de2fef696885ec687853d152f Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sat, 5 Oct 2019 11:14:12 +0200 Subject: [PATCH 014/488] Update README.md --- plugins/redis-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/redis-cli/README.md b/plugins/redis-cli/README.md index f6e947f4ca3c3..64956df13feca 100644 --- a/plugins/redis-cli/README.md +++ b/plugins/redis-cli/README.md @@ -9,6 +9,6 @@ plugins=(... redis-cli) ``` ## Requirements -In order to make this work, you will need to have the redis installed. +In order to make this work, you will need to have redis installed. More info on the usage and install: https://redis.io/topics/quickstart From 53d987346f4d465c100f3dab234953db48eed7a1 Mon Sep 17 00:00:00 2001 From: Erwan ROUSSEL Date: Sat, 5 Oct 2019 11:30:21 +0200 Subject: [PATCH 015/488] Create README.md --- plugins/perl/README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/perl/README.md diff --git a/plugins/perl/README.md b/plugins/perl/README.md new file mode 100644 index 0000000000000..f2f4b79ec2748 --- /dev/null +++ b/plugins/perl/README.md @@ -0,0 +1,36 @@ +# Perl + +This plugin adds [perl](https://www.perl.org/) useful aliases/functions. + +To use it, add `perl` to the plugins array in your zshrc file: + +```zsh +plugins=(... perl) +``` + +## Aliases + +| Aliases | Command | Description | +| :------------ | :-------------- | :----------------------------------- | +| pbi | perlbrew install|Install specific perl version | +| pbl | perlbrew list |List all perl version installed | +| pbo | perlbrew off |Go back to the system perl | +| pbs | perlbrew switch |Turn it back on | +| pbu | perlbrew use |Use specific version of perl | +| pd | perldoc |Show the perl documentation | +| ple | perl -wlne |Use perl like awk/sed | +| latest-perl | curl `...` |Show the latest stable release of Perl| + +## Functions + +`newpl` - creates a basic Perl script file and opens it with $EDITOR + +`pgs` - Perl Global Substitution (find pattern = 1st arg ; replace pattern = 2nd arg ; filename = 3rd arg) + +`prep` - Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. (pattern = 1st arg ; filename = 2nd arg) + +## Requirements + +In order to make this work, you will need to have perl installed. + +More info on the usage and install: https://www.perl.org/get.html From dd0ade161c0fc47ea4a9e43ce3787170db2f8f60 Mon Sep 17 00:00:00 2001 From: Alex Morozoff Date: Sun, 6 Oct 2019 15:24:25 -0400 Subject: [PATCH 016/488] Create README.md Added README for UFW plugin issue: [Good first PR] Add READMEs to undocumented plugins #7175 --- plugins/ufw/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/ufw/README.md diff --git a/plugins/ufw/README.md b/plugins/ufw/README.md new file mode 100644 index 0000000000000..a27487a46b0f4 --- /dev/null +++ b/plugins/ufw/README.md @@ -0,0 +1,17 @@ +# UFW +This plugin adds support for managing everybody's favorite Uncomplicated Firewall (UFW). Learn more about [`UFW`](https://wiki.ubuntu.com/UncomplicatedFirewall). + +To use it, add ufw to the plugins array of your zshrc file: +``` +plugins=(... ufw) +``` +UFW is a simple Ubuntu interface for managing iptables. + +Some of the commands include: + +* `allow /` add an allow rule +* `default` set default policy +* `delete /` delete RULE +* `deny /` add deny rule +* `disable` disables the firewall +* `enable` enables the firewall From 4b65f439e2c92b7c839dd355f8701d72f3a8ea2b Mon Sep 17 00:00:00 2001 From: Michael C Date: Sun, 6 Oct 2019 15:33:06 +0200 Subject: [PATCH 017/488] docs: add README.md for Dash plugin --- plugins/dash/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/dash/README.md diff --git a/plugins/dash/README.md b/plugins/dash/README.md new file mode 100644 index 0000000000000..f69f834f3b38f --- /dev/null +++ b/plugins/dash/README.md @@ -0,0 +1,29 @@ +# Dash plugin + +This plugin adds command line functionality for [Dash](https://kapeli.com/dash), +an API Documentation Browser. + +This plugin requires Dash to be installed to work. + +To use it, add `dash` to the plugins array in your zshrc file: + +```zsh +plugins=(... dash) +``` + +Make sure to source your rc file: +``` +source ~/.zshrc +``` + +## Usage + +Open and switch to the dash application. +``` +dash +``` + +Query for something in dash app. +``` +dash golang +``` From 357336bfb399ac95db21ceed40dc7b18eea6779c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Oct 2019 17:04:31 +0200 Subject: [PATCH 018/488] Remove redundant section and document keyword args --- plugins/dash/README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/plugins/dash/README.md b/plugins/dash/README.md index f69f834f3b38f..0ca3e4e44d7a5 100644 --- a/plugins/dash/README.md +++ b/plugins/dash/README.md @@ -1,9 +1,8 @@ # Dash plugin This plugin adds command line functionality for [Dash](https://kapeli.com/dash), -an API Documentation Browser. - -This plugin requires Dash to be installed to work. +an API Documentation Browser for macOS. This plugin requires Dash to be installed +to work. To use it, add `dash` to the plugins array in your zshrc file: @@ -11,19 +10,19 @@ To use it, add `dash` to the plugins array in your zshrc file: plugins=(... dash) ``` -Make sure to source your rc file: -``` -source ~/.zshrc -``` - ## Usage -Open and switch to the dash application. +- Open and switch to the dash application. ``` dash ``` -Query for something in dash app. +- Query for something in dash app: `dash query` +``` +dash golang +``` + +- You can optionally provide a keyword: `dash [keyword:]query` ``` -dash golang +dash python:tuple ``` From b45e0f4836d7b2a3b5fe2266d669d878ccd737e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Oct 2019 17:08:38 +0200 Subject: [PATCH 019/488] dash: simplify completion logic --- plugins/dash/dash.plugin.zsh | 52 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh index b00d4877ec446..ace2e33c1d6f7 100644 --- a/plugins/dash/dash.plugin.zsh +++ b/plugins/dash/dash.plugin.zsh @@ -35,36 +35,30 @@ _dash() { if [[ "$locator" == "platform" ]]; then # Since these are the only special cases right now, let's not do the # expensive processing unless we have to - if [[ "$keyword" == "python" || "$keyword" == "java" || \ - "$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then + if [[ "$keyword" = (python|java|qt|cocos2d) ]]; then docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"` - if [[ "$keyword" == "python" ]]; then - if [[ "$docsetName" == "Python 2" ]]; then - keyword="python2" - elif [[ "$docsetName" == "Python 3" ]]; then - keyword="python3" - fi - elif [[ "$keyword" == "java" ]]; then - if [[ "$docsetName" == "Java SE7" ]]; then - keyword="java7" - elif [[ "$docsetName" == "Java SE6" ]]; then - keyword="java6" - elif [[ "$docsetName" == "Java SE8" ]]; then - keyword="java8" - fi - elif [[ "$keyword" == "qt" ]]; then - if [[ "$docsetName" == "Qt 5" ]]; then - keyword="qt5" - elif [[ "$docsetName" == "Qt 4" ]]; then - keyword="qt4" - elif [[ "$docsetName" == "Qt" ]]; then - keyword="qt4" - fi - elif [[ "$keyword" == "cocos2d" ]]; then - if [[ "$docsetName" == "Cocos3D" ]]; then - keyword="cocos3d" - fi - fi + case "$keyword" in + python) + case "$docsetName" in + "Python 2") keyword="python2" ;; + "Python 3") keyword="python3" ;; + esac ;; + java) + case "$docsetName" in + "Java SE7") keyword="java7" ;; + "Java SE6") keyword="java6" ;; + "Java SE8") keyword="java8" ;; + esac ;; + qt) + case "$docsetName" in + "Qt 5") keyword="qt5" ;; + "Qt 4"|Qt) keyword="qt4" ;; + esac ;; + cocos2d) + case "$docsetName" in + Cocos3D) keyword="cocos3d" ;; + esac ;; + esac fi fi From 456814d8a61c644e59fdea8914e8dc7d2ba3dbf4 Mon Sep 17 00:00:00 2001 From: Aditya J Karia Date: Mon, 7 Oct 2019 20:53:00 +0530 Subject: [PATCH 020/488] mysql-macports: add README (#8210) --- plugins/mysql-macports/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/mysql-macports/README.md diff --git a/plugins/mysql-macports/README.md b/plugins/mysql-macports/README.md new file mode 100644 index 0000000000000..a4224d9c0f4fb --- /dev/null +++ b/plugins/mysql-macports/README.md @@ -0,0 +1,20 @@ +# MySQL-Macports plugin + +This plugin adds aliases for some of the commonly used [MySQL](https://www.mysql.com/) commands when installed using [MacPorts](https://www.macports.org/) on macOS. + +To use it, add `mysql-macports` to the plugins array in your zshrc file: + +```zsh +plugins=(... mysql-macports) +``` + +For instructions on how to install MySQL using MacPorts, read the [MacPorts wiki](https://trac.macports.org/wiki/howto/MySQL/). + +## Aliases + +| Alias | Command | Description | +| ------------ | --------------------------------------------------------- | ------------------------------------------ | +| mysqlstart | `sudo /opt/local/share/mysql5/mysql/mysql.server start` | Start the MySQL server. | +| mysqlstop | `sudo /opt/local/share/mysql5/mysql/mysql.server stop` | Stop the MySQL server. | +| mysqlrestart | `sudo /opt/local/share/mysql5/mysql/mysql.server restart` | Restart the MySQL server. | +| mysqlstatus | `mysqladmin5 -u root -p ping` | Check whether the MySQL server is running. | From a9d382a297560647be79070349ac34a66101b9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Oct 2019 17:25:44 +0200 Subject: [PATCH 021/488] Small changes --- plugins/redis-cli/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/redis-cli/README.md b/plugins/redis-cli/README.md index 64956df13feca..bb6e94a0fac32 100644 --- a/plugins/redis-cli/README.md +++ b/plugins/redis-cli/README.md @@ -1,12 +1,13 @@ # Redis-CLI -This plugin adds [redis-cli](https://redis.io/topics/rediscli) completion, based off homebrew completion +This plugin adds [redis-cli](https://redis.io/topics/rediscli) completion, based off of Homebrew completion. To use it, add `redis-cli` to the plugins array in your zshrc file: ```zsh plugins=(... redis-cli) ``` + ## Requirements In order to make this work, you will need to have redis installed. From 896dd271c8cadce8b8a618225cb4e79b9bca50f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Oct 2019 17:40:51 +0200 Subject: [PATCH 022/488] Some syntax changes and more function docs --- plugins/perl/README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/plugins/perl/README.md b/plugins/perl/README.md index f2f4b79ec2748..dd9b7dc75392d 100644 --- a/plugins/perl/README.md +++ b/plugins/perl/README.md @@ -10,27 +10,28 @@ plugins=(... perl) ## Aliases -| Aliases | Command | Description | -| :------------ | :-------------- | :----------------------------------- | -| pbi | perlbrew install|Install specific perl version | -| pbl | perlbrew list |List all perl version installed | -| pbo | perlbrew off |Go back to the system perl | -| pbs | perlbrew switch |Turn it back on | -| pbu | perlbrew use |Use specific version of perl | -| pd | perldoc |Show the perl documentation | -| ple | perl -wlne |Use perl like awk/sed | -| latest-perl | curl `...` |Show the latest stable release of Perl| +| Aliases | Command | Description | +| :------------ | :----------------- | :------------------------------------- | +| pbi | `perlbrew install` | Install specific perl version | +| pbl | `perlbrew list` | List all perl version installed | +| pbo | `perlbrew off` | Go back to the system perl | +| pbs | `perlbrew switch` | Turn it back on | +| pbu | `perlbrew use` | Use specific version of perl | +| pd | `perldoc` | Show the perl documentation | +| ple | `perl -wlne` | Use perl like awk/sed | +| latest-perl | `curl ...` | Show the latest stable release of Perl | ## Functions -`newpl` - creates a basic Perl script file and opens it with $EDITOR +* `newpl`: creates a basic Perl script file and opens it with $EDITOR. -`pgs` - Perl Global Substitution (find pattern = 1st arg ; replace pattern = 2nd arg ; filename = 3rd arg) +* `pgs`: Perl Global Substitution: `pgs ` + Looks for `` and replaces it with `` in ``. -`prep` - Perl grep, because 'grep -P' is terrible. Lets you work with pipes or files. (pattern = 1st arg ; filename = 2nd arg) +* `prep`: Perl grep, because 'grep -P' is terrible: `prep []` + Lets you work with pipes or files (if no `` provided, use stdin). ## Requirements In order to make this work, you will need to have perl installed. - More info on the usage and install: https://www.perl.org/get.html From d5e7040ebdfc9d9525b964c35ef1e704da632be2 Mon Sep 17 00:00:00 2001 From: Joe Rattazzi Date: Mon, 7 Oct 2019 10:53:18 -0500 Subject: [PATCH 023/488] pyenv: add README (#8224) --- plugins/pyenv/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/pyenv/README.md diff --git a/plugins/pyenv/README.md b/plugins/pyenv/README.md new file mode 100644 index 0000000000000..d063b55b9b645 --- /dev/null +++ b/plugins/pyenv/README.md @@ -0,0 +1,16 @@ +# pyenv + +This plugin looks for [pyenv](https://github.com/pyenv/pyenv), a Simple Python version +management system, and loads it if it's found. It also loads pyenv-virtualenv, a pyenv +plugin to manage virtualenv, if it's found. + +To use it, add `pyenv` to the plugins array in your zshrc file: + +```zsh +plugins=(... pyenv) +``` + +## Functions + +- `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python + version, if pyenv wasn't found. From 5f066dabc89b66479b36b5837ed11dc3c36a1d55 Mon Sep 17 00:00:00 2001 From: Denis Titusov Date: Mon, 7 Oct 2019 19:01:08 +0300 Subject: [PATCH 024/488] Add README for pow and powify plugins (#8225) --- plugins/pow/README.md | 21 +++++++++++++++++++++ plugins/powify/README.md | 10 ++++++++++ 2 files changed, 31 insertions(+) create mode 100644 plugins/pow/README.md create mode 100644 plugins/powify/README.md diff --git a/plugins/pow/README.md b/plugins/pow/README.md new file mode 100644 index 0000000000000..1f8a9d136377a --- /dev/null +++ b/plugins/pow/README.md @@ -0,0 +1,21 @@ +# pow plugin + +This plugin adds completion and commands for [pow](http://pow.cx/), a +zero-configuration Rack server for macOS. + +To use it, add pow to the plugins array of your zshrc file: + +```sh +plugins=(... pow) +``` + +## Commands + +- `kapow` will restart an app. + + ```bash + kapow myapp + ``` + +- `kaput` will show the standard output from any pow app. +- `repow` will restart the pow process. diff --git a/plugins/powify/README.md b/plugins/powify/README.md new file mode 100644 index 0000000000000..fd58b860e4d1f --- /dev/null +++ b/plugins/powify/README.md @@ -0,0 +1,10 @@ +# powify plugin + +This plugin adds autocompletion for [powify](https://github.com/sethvargo/powify), +an easy-to-use wrapper for Basecamp's [pow](https://github.com/basecamp/pow). + +To use it, add powify to the plugins array of your zshrc file: + +```sh +plugins=(... powify) +``` From 5efe52d991ab1f2596c3aa7766c981412c621fd7 Mon Sep 17 00:00:00 2001 From: Michael C Date: Mon, 7 Oct 2019 18:04:49 +0200 Subject: [PATCH 025/488] virtualenvwrapper: add README (#8226) --- plugins/virtualenvwrapper/README.md | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 plugins/virtualenvwrapper/README.md diff --git a/plugins/virtualenvwrapper/README.md b/plugins/virtualenvwrapper/README.md new file mode 100644 index 0000000000000..63eb58541d236 --- /dev/null +++ b/plugins/virtualenvwrapper/README.md @@ -0,0 +1,38 @@ +# Virtualenvwrapper plugin + +This plugin loads Python's [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) shell tools. + +To use it, add `virtualenvwrapper` to the plugins array in your zshrc file: + +```zsh +plugins=(... virtualenvwrapper) +``` + +## Usage + +The plugin allows to automatically activate virtualenvs on cd into git repositories with a matching name: + +``` +➜ github $ cd ansible +(ansible) ➜ ansible git:(devel) $ cd docs +(ansible) ➜ docs git:(devel) $ cd .. +(ansible) ➜ ansible git:(devel) $ cd .. +➜ github $ +``` + +We can override this by having a `.venv` file in the directory containing a differently named virtualenv: + +``` +➜ github $ cat ansible/.venv +myvirtualenv +➜ github $ cd ansible +(myvirtualenv) ➜ ansible git:(devel) $ cd .. +➜ github $ +``` + +We can disable this behaviour by setting `DISABLE_VENV_CD=1` before Oh My Zsh is sourced: +```zsh +DISABLE_VENV_CD=1 +plugins=(... virtualenvwrapper) +source $ZSH/oh-my-zsh.sh +``` From a3b63aa6ab948c1be278fbea6046cf09f69d3c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 7 Oct 2019 18:08:14 +0200 Subject: [PATCH 026/488] Reword --- plugins/ufw/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/ufw/README.md b/plugins/ufw/README.md index a27487a46b0f4..ac377cd173906 100644 --- a/plugins/ufw/README.md +++ b/plugins/ufw/README.md @@ -1,11 +1,12 @@ -# UFW -This plugin adds support for managing everybody's favorite Uncomplicated Firewall (UFW). Learn more about [`UFW`](https://wiki.ubuntu.com/UncomplicatedFirewall). +# UFW plugin + +This plugin adds completion for managing everybody's favorite Uncomplicated Firewall (UFW), +a simple interface for managing iptables. Learn more about [`UFW`](https://wiki.ubuntu.com/UncomplicatedFirewall). To use it, add ufw to the plugins array of your zshrc file: ``` plugins=(... ufw) ``` -UFW is a simple Ubuntu interface for managing iptables. Some of the commands include: From fdebc2272e8789e9120ab9b195754e423990b317 Mon Sep 17 00:00:00 2001 From: Griffin J Rademacher Date: Mon, 7 Oct 2019 12:37:42 -0400 Subject: [PATCH 027/488] Add READMEs for tugboat and colemak plugins (#8207) --- plugins/colemak/README.md | 48 +++++++++++++++++++++++++++++++++++++++ plugins/tugboat/README.md | 12 ++++++++++ 2 files changed, 60 insertions(+) create mode 100644 plugins/colemak/README.md create mode 100644 plugins/tugboat/README.md diff --git a/plugins/colemak/README.md b/plugins/colemak/README.md new file mode 100644 index 0000000000000..4da4bc126cd3a --- /dev/null +++ b/plugins/colemak/README.md @@ -0,0 +1,48 @@ +# Colemak plugin + +This plugin remaps keys in `zsh`'s [`vi`-style navigation mode](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Keymaps) +for a [Colemak](https://colemak.com/) keyboard layout, to match the QWERTY position: + +![Colemak layout on a US keyboard](https://colemak.com/wiki/images/6/6c/Colemak2.png) + +To use it, add it to the plugins array in your `~/.zshrc` file: + +``` +plugins=(... colemak) +``` + +You will also need to enable `vi` mode, so add another line to `~/.zshrc`: +``` +bindkey -v +``` + +Restart your shell and hit the `` key to activate `vicmd` (navigation) mode, +and start navigating `zsh` with your new keybindings! + +## Key bindings for vicmd + +| Old | New | Binding | Description | +|------------|------------|---------------------------|----------------------------------------------------| +| `CTRL`+`j` | `CTRL`+`n` | accept-line | Insert new line | +| `j` | `n` | down-line-or-history | Move one line down or command history forwards | +| `k` | `e` | up-line-or-history | Move one line up or command history backwards | +| `l` | `i` | vi-forward-char | Move one character to the right | +| `n` | `k` | vi-repeat-search | Repeat command search forwards | +| `N` | `K` | vi-rev-repeat-search | Repeat command search backwards | +| `i` | `u` | vi-insert | Enter insert mode | +| `I` | `U` | vi-insert-bol | Move to first non-blank char and enter insert mode | +| `` | `l` | vi-undo-change | Undo change | +| `J` | `N` | vi-join | Join the current line with the next one | +| `e` | `j` | vi-forward-word-end | Move to the end of the next word | +| `E` | `J` | vi-forward-blank-word-end | Move to end of the current or next word | + +## Key bindings for less + +| Keyboard shortcut | `less` key binding | +|-------------------|--------------------| +| `n` | forw-line | +| `e` | back-line | +| `k` | repeat-search | +| `ESC`+`k` | repeat-search-all | +| `K` | reverse-search | +| `ESC`+`K` | reverse-search-all | diff --git a/plugins/tugboat/README.md b/plugins/tugboat/README.md new file mode 100644 index 0000000000000..14f828f854d14 --- /dev/null +++ b/plugins/tugboat/README.md @@ -0,0 +1,12 @@ +# Tugboat plugin + +This plugin adds autocompletion for Tugboat, a command line tool for interacting with your +[DigitalOcean droplets](https://www.digitalocean.com/products/droplets/). + +To use it, add it to the plugins array in your `~/.zshrc` file: + +```zsh +plugins=(... tugboat) +``` + +Further documentation for Tugboat can be found in the [Tugboat repository](https://github.com/petems/tugboat). From 7e842cddc45b8bdebe1b198e83eb96fd07b37787 Mon Sep 17 00:00:00 2001 From: Austin Ratcliff Date: Mon, 7 Oct 2019 11:50:01 -0500 Subject: [PATCH 028/488] cloudapp: add README (#8229) --- plugins/cloudapp/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugins/cloudapp/README.md diff --git a/plugins/cloudapp/README.md b/plugins/cloudapp/README.md new file mode 100644 index 0000000000000..62975a6318472 --- /dev/null +++ b/plugins/cloudapp/README.md @@ -0,0 +1,24 @@ +# CloudApp plugin + +[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line. + +To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: + +``` +plugins=(... dash) +``` + +## Requirements + +1. [Aaron Russell's `cloudapp_api` gem](https://github.com/aaronrussell/cloudapp_api#installation) + +2. That you set your CloudApp credentials in `~/.cloudapp` as a simple text file like below: + ``` + email + password + ``` + +## Usage + +- `cloudapp `: uploads `` to your CloudApp account, and if you're using + macOS, copies the URL to your clipboard. From 82bd8828eb243199fccea87f5489a21a5be9c89c Mon Sep 17 00:00:00 2001 From: Chaitanya Raj Date: Tue, 8 Oct 2019 14:01:57 +0530 Subject: [PATCH 029/488] Create README.md for compleat plugin --- plugins/compleat/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/compleat/README.md diff --git a/plugins/compleat/README.md b/plugins/compleat/README.md new file mode 100644 index 0000000000000..1d7f0492d8bde --- /dev/null +++ b/plugins/compleat/README.md @@ -0,0 +1,9 @@ +# compleat + +This plugin runs [bashcompinit](https://github.com/zsh-users/zsh/blob/master/Completion/bashcompinit) which will allow zsh to read bash completion specifications and functions. + +To use it add compleat to the plugins array in your zshrc file. + + ``` +plugins=(... compleat) +``` \ No newline at end of file From c714d3fcedd2e729350b5f69f4a9312b9fc68a43 Mon Sep 17 00:00:00 2001 From: Qinfeng Chen Date: Tue, 8 Oct 2019 09:48:08 -0400 Subject: [PATCH 030/488] gradle: support gdub completion (#6135) --- plugins/gradle/gradle.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh index 8d578e27b4584..6be5831793edd 100644 --- a/plugins/gradle/gradle.plugin.zsh +++ b/plugins/gradle/gradle.plugin.zsh @@ -181,3 +181,4 @@ _gradlew_tasks () { ############################################################################ compdef _gradle_tasks gradle compdef _gradlew_tasks gradlew +compdef _gradlew_tasks gw From b09aed9cc7e2099f3e7f2aa2632660bc510f3e35 Mon Sep 17 00:00:00 2001 From: 14nrv <34603467+14nrv@users.noreply.github.com> Date: Tue, 8 Oct 2019 20:38:25 +0200 Subject: [PATCH 031/488] yarn: add ytc alias for test with coverage (#7664) --- plugins/yarn/README.md | 1 + plugins/yarn/yarn.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index 439a9355f76b3..a94f183e4025a 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -35,6 +35,7 @@ plugins=(... yarn) | ys | `yarn serve` | Start the dev server | | yst | `yarn start` | Run the start script defined in `package.json` | | yt | `yarn test` | Run the test script defined in `package.json` | +| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage | | yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | | yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | | yup | `yarn upgrade` | Upgrade packages to their latest version | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index 6dc4786de6aaa..e7b6ce0d16338 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -20,6 +20,7 @@ alias yrun="yarn run" alias ys="yarn serve" alias yst="yarn start" alias yt="yarn test" +alias ytc="yarn test --coverage" alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" alias yup="yarn upgrade" From 7d410549cdeb838c45db4225a3b7d63e7098866d Mon Sep 17 00:00:00 2001 From: Karolis Mazukna Date: Tue, 8 Oct 2019 22:42:18 +0100 Subject: [PATCH 032/488] Adds chruby plugib README.md --- plugins/chruby/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 plugins/chruby/README.md diff --git a/plugins/chruby/README.md b/plugins/chruby/README.md new file mode 100644 index 0000000000000..c5e4b93327a24 --- /dev/null +++ b/plugins/chruby/README.md @@ -0,0 +1,19 @@ +# chruby plugin + +This plugin loads the [chruby](https://github.com/postmodern/chruby). Supports brew and manual installation of chruby. + +To use it, add `chruby` to the plugins array in your zshrc file: + +```zsh +plugins=(... chruby) +``` + +## Usage + +If you'd prefer to specify an explicit path to load chruby from +you can set variables like so: + +``` +zstyle :omz:plugins:chruby path /local/path/to/chruby.sh +zstyle :omz:plugins:chruby auto /local/path/to/auto.sh +``` From c9841f43b1a95c6cc5fcca8422b47f8df511ecf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 9 Oct 2019 15:11:34 +0200 Subject: [PATCH 033/488] yarn: use zsh-completions latest version (87e1313) Closes #7300 Closes #8115 Closes #8118 --- plugins/yarn/_yarn | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn index 382f58a0abacd..3689ae960d0e0 100644 --- a/plugins/yarn/_yarn +++ b/plugins/yarn/_yarn @@ -71,7 +71,7 @@ _global_commands=( 'bin:Displays the location of the yarn bin folder' 'remove:Remove installed package from dependencies updating package.json' 'upgrade:Upgrades packages to their latest version based on the specified range' - 'upgrade-interactive' + 'upgrade-interactive:Interactively upgrade packages' ) _yarn_commands_scripts() { @@ -81,9 +81,21 @@ _yarn_commands_scripts() { } _yarn_scripts() { - local -a scripts - scripts=($(yarn run --json 2>/dev/null | sed -E '/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed -e 's/:/\\:/g')) - _describe 'script' scripts + local -a commands binaries scripts + local -a scriptNames scriptCommands + local i runJSON + + runJSON=$(yarn run --json 2>/dev/null) + binaries=($(sed -E '/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON")) + scriptNames=($(sed -E '/possibleCommands/!d;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON")) + scriptCommands=("${(@f)$(sed -E '/possibleCommands/!d;s/.*"hints":\{([^}]+)\}.*/\1/;s/"[^"]+"://g;s/:/\\:/g;s/","/\n/g;s/(^"|"$)//g' <<< "$runJSON")}") + + for (( i=1; i <= $#scriptNames; i++ )); do + scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}") + done + + commands=($scripts $binaries) + _describe 'command' commands } _yarn_global_commands() { @@ -240,7 +252,8 @@ _yarn() { run) _arguments \ - '1: :_yarn_scripts' + '1: :_yarn_scripts' \ + '*:: :_default' ;; tag) @@ -255,6 +268,11 @@ _yarn() { '*:: :->team_args' ;; + upgrade-interactive) + _arguments \ + '--latest:use the version tagged latest in the registry:' + ;; + version) _arguments \ '--new-version:version:' \ @@ -266,6 +284,10 @@ _yarn() { _arguments \ '1:query:_files' ;; + + *) + _default + ;; esac ;; esac From 79b2944a8ae19fc9d065d3b92c916345feb65fa4 Mon Sep 17 00:00:00 2001 From: Frani Date: Wed, 9 Oct 2019 10:17:05 -0300 Subject: [PATCH 034/488] yarn: add yarn version alias (#8138) --- plugins/yarn/README.md | 1 + plugins/yarn/yarn.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md index a94f183e4025a..e6daae44fbf0d 100644 --- a/plugins/yarn/README.md +++ b/plugins/yarn/README.md @@ -39,5 +39,6 @@ plugins=(... yarn) | yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache | | yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade | | yup | `yarn upgrade` | Upgrade packages to their latest version | +| yv | `yarn version` | Update the version of your package | | yw | `yarn workspace` | Run a command within a single workspace. | | yws | `yarn workspaces` | Run a command within all defined workspaces. | diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh index e7b6ce0d16338..18c5dcc89a2e6 100644 --- a/plugins/yarn/yarn.plugin.zsh +++ b/plugins/yarn/yarn.plugin.zsh @@ -24,5 +24,6 @@ alias ytc="yarn test --coverage" alias yuc="yarn global upgrade && yarn cache clean" alias yui="yarn upgrade-interactive" alias yup="yarn upgrade" +alias yv="yarn version" alias yw="yarn workspace" alias yws="yarn workspaces" From f5614d2b3a844305b363b50e6857ca064fdbbc84 Mon Sep 17 00:00:00 2001 From: otherpaco <27810032+otherpaco@users.noreply.github.com> Date: Wed, 9 Oct 2019 15:55:35 +0200 Subject: [PATCH 035/488] terminalapp: delete plugin deprecated since 2015 (#8230) --- plugins/terminalapp/terminalapp.plugin.zsh | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 plugins/terminalapp/terminalapp.plugin.zsh diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh deleted file mode 100644 index 7c0c278b98387..0000000000000 --- a/plugins/terminalapp/terminalapp.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# This file is intentionally empty. -# -# The terminalapp plugin is deprecated and may be removed in a future release. -# Its functionality has been folded in to the core lib/termsupport.zsh, which -# is loaded for all users. You can remove terminalapp from your $plugins list -# once all your systems are updated to the current version of Oh My Zsh. From 8bb9b044699f5c96830c7fe2bb78de19854d4973 Mon Sep 17 00:00:00 2001 From: otherpaco <27810032+otherpaco@users.noreply.github.com> Date: Wed, 9 Oct 2019 16:58:58 +0200 Subject: [PATCH 036/488] singlechar: add README (#8232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/singlechar/README.md | 118 +++++++++++++++++++++++ plugins/singlechar/singlechar.plugin.zsh | 12 +-- 2 files changed, 119 insertions(+), 11 deletions(-) create mode 100644 plugins/singlechar/README.md diff --git a/plugins/singlechar/README.md b/plugins/singlechar/README.md new file mode 100644 index 0000000000000..d89029900e651 --- /dev/null +++ b/plugins/singlechar/README.md @@ -0,0 +1,118 @@ +# Singlechar plugin + +This plugin adds single char shortcuts (and combinations) for some commands. + +To use it, add `singlechar` to the plugins array of your zshrc file: +``` +plugins=(... singlechar) +``` + +## Aliases + +### CAT, GREP, CURL, WGET + +| Alias | Command | Description | +|-------|------------------|-------------| +| y | `grep -Ri` | Find case-insensitive string in all files and directories, recursively. Follows symlinks. | +| n | `grep -Rvi` | Same as above but only show lines that don't match the string. | +| f | `grep -Rli` | Same as 'y' but only print the filenames where the string is found. | +| fn | `grep -Rlvi` | Same as above but only show files that don't contain the string. | +| f. | `find . \| grep` | Grep list of files in current directory | +| f: | `find` | 'find' command | +| p | `less` | 'less' command | +| m | `man` | 'man' command | +| d | `wget` | 'wget' command | +| u | `curl` | 'curl' command | +| c | `cat` | 'cat' command | +| w | `echo >` | Write arguments to file, overwriting it if it exists. | +| a | `echo >>` | Write arguments to file, appending them if the file exists. | +| w: | `cat >` | Write stdin to file, overwriting if it exists. | +| a: | `cat >>` | Write stdin to file, appending it if the file exists. | + +### XARGS + +These aliases are versions of the aliases above but using xargs. This can be used +by piping the arguments to the xargs aliases. + +| Alias | Command | Description | +|-------|----------------------|---------------------------------| +| x | `xargs` | 'xargs' command | +| xy | `xargs grep -Ri` | Same as 'y' alias using xargs. | +| xn | `xargs grep -Rvi` | Same as 'n' alias using xargs. | +| xf | `xargs grep -Rli` | Same as 'f' alias using xargs. | +| xfn | `xargs grep -Rlvi` | Same as 'fn' alias using xargs. | +| xf. | `xargs find \| grep` | Same as 'f.' alias using xargs. | +| xf: | `xargs find` | Same as 'f:' alias using xargs. | +| xc | `xargs cat` | Same as 'c' alias using xargs. | +| xp | `xargs less` | Same as 'p' alias using xargs. | +| xm | `xargs man` | Same as 'm' alias using xargs. | +| xd | `xargs wget` | Same as 'd' alias using xargs. | +| xu | `xargs curl` | Same as 'u' alias using xargs. | +| xw | `xargs echo >` | Same as 'w' alias using xargs. | +| xa | `xargs echo >>` | Same as 'a' alias using xargs. | +| xw: | `xargs cat >` | Same as 'w:' alias using xargs. | +| xa: | `xargs >>` | Same as 'a:' alias using xargs. | + +### SUDO + +These aliases are versions of the aliases above in [CAT, GREP, CURL, WGET](#cat-grep-curl-wget) +but using sudo to run them with root permission. + +| Alias | Command | Description | +|-------|-----------------------|--------------------------------| +| s | `sudo` | 'sudo' command | +| sy | `sudo grep -Ri` | Same as 'y' alias using sudo. | +| sn | `sudo grep -Riv` | Same as 'n' alias using sudo. | +| sf | `sudo grep -Rli` | Same as 'f' alias using sudo. | +| sfn | `sudo grep -Rlvi` | Same as 'fn' alias using sudo. | +| sf. | `sudo find . \| grep` | Same as 'f.' alias using sudo. | +| sf: | `sudo find` | Same as 'f:' alias using sudo. | +| sp | `sudo less` | Same as 'p' alias using sudo. | +| sm | `sudo man` | Same as 'm' alias using sudo. | +| sd | `sudo wget` | Same as 'd' alias using sudo. | +| sc | `sudo cat` | Same as 'c' alias using sudo. | +| sw | `sudo echo >` | Same as 'w' alias using sudo. | +| sa | `sudo echo >>` | Same as 'a' alias using sudo. | +| sw: | `sudo cat >` | Same as 'w:' alias using sudo. | +| sa: | `sudo cat >>` | Same as 'a:' alias using sudo. | + +### SUDO-XARGS + +Same as above but using both sudo and xargs. + +| Alias | Command | Description | +|-------|---------------------------|---------------------------------| +| sx | `sudo xargs` | 'sudo xargs' command | +| sxy | `sudo xargs grep -Ri` | Same as 'xy' alias using sudo. | +| sxn | `sudo xargs grep -Riv` | Same as 'xn' alias using sudo. | +| sxf | `sudo xargs grep -li` | Same as 'xf' alias using sudo. | +| sxfn | `sudo xargs grep -lvi` | Same as 'xfn' alias using sudo. | +| sxf. | `sudo xargs find \| grep` | Same as 'xf.' alias using sudo. | +| sxf: | `sudo xargs find` | Same as 'xf:' alias using sudo. | +| sxp | `sudo xargs less` | Same as 'xp' alias using sudo. | +| sxm | `sudo xargs man` | Same as 'xm' alias using sudo. | +| sxd | `sudo xargs wget` | Same as 'xd' alias using sudo. | +| sxu | `sudo xargs curl` | Same as 'xu' alias using sudo. | +| sxc | `sudo xargs cat` | Same as 'xc' alias using sudo. | +| sxw | `sudo xargs echo >` | Same as 'xw' alias using sudo. | +| sxa | `sudo xargs echo >>` | Same as 'xa' alias using sudo. | +| sxw: | `sudo xargs cat >` | Same as 'xw:' alias using sudo. | +| sxa: | `sudo xargs cat >>` | Same as 'xa:' alias using sudo. | + +## Options + +The commands `grep`, `sudo`, `wget`, `curl`, and `less` can be configured to use other commands +via the setup variables below, before Oh My Zsh is sourced. If they are not set yet, they will +use their default values: + +| Setup variable | Default value | +|----------------|---------------| +| GREP | `grep` | +| ROOT | `sudo` | +| WGET | `wget` | +| CURL | `curl` | +| PAGER | `less` | + +## Author + +- [Karolin Varner](https://github.com/koraa) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 44bd998aa56b1..d4b0b67351365 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -1,13 +1,3 @@ -################################################################################ -# FILE: singlechar.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Michael Varner (musikmichael@web.de) -# VERSION: 1.0.0 -# -# This plugin adds single char shortcuts (and combinations) for some commands. -# -################################################################################ - ########################### # Settings @@ -130,4 +120,4 @@ alias sxd='"$ROOT" xargs "$WGET"' alias sxu='"$ROOT" xargs "$CURL"' alias sxw:='"$ROOT" xargs cat >' -alias sxa:='"$ROOT" xargs cat >>' \ No newline at end of file +alias sxa:='"$ROOT" xargs cat >>' From abc05fa422a183e974df9faefc61a8512abe1db9 Mon Sep 17 00:00:00 2001 From: Noah Nichols Date: Wed, 9 Oct 2019 11:51:47 -0400 Subject: [PATCH 037/488] sprunge: add README and refactor (#8239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/sprunge/README.md | 31 +++++++++++ plugins/sprunge/sprunge.plugin.zsh | 86 ++++++++++++++---------------- 2 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 plugins/sprunge/README.md diff --git a/plugins/sprunge/README.md b/plugins/sprunge/README.md new file mode 100644 index 0000000000000..2a363d3bd93a9 --- /dev/null +++ b/plugins/sprunge/README.md @@ -0,0 +1,31 @@ +# Sprunge plugin + +This plugin uploads data and fetch URL from the pastebin http://sprunge.us + +To enable it, add 'sprunge' to your plugins: +``` +plugins=(... sprunge) +``` + +## Usage + +| Command | Description | +|------------------------------|-------------------------------------------| +| `sprunge filename.txt` | Uploads filename.txt | +| `sprunge "this is a string"` | Uploads plain text | +| `sprunge < filename.txt` | Redirects filename.txt content to sprunge | +| `echo data \| sprunge` | Any piped data will be uploaded | + +Once sprunge has processed the input it will give you a unique HTTP address: +``` +$ sprunge "hello" +http://sprunge.us/XxjnKz +``` + +## Notes + +- Sprunge accepts piped data, stdin redirection, text strings as input or filenames. + Only one of these can be used at a time. +- Argument precedence goes as follows: stdin > piped input > text strings. +- If a filename is mispelled or doesn't have the necessary path description, it will NOT + generate an error, but instead treat it as a text string. diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index e1c89b729202d..5d5687a826427 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -2,12 +2,9 @@ # Created by the blogger at the URL below...I don't know where to find his/her name # Original found at https://www.shellperson.net/sprunge-pastebin-script/ -usage() { -description | fmt -s >&2 -} - -description() { -cat << HERE +sprunge() { + if [[ "$1" = --help ]]; then + fmt -s >&2 << EOF DESCRIPTION Upload data and fetch URL from the pastebin http://sprunge.us @@ -19,44 +16,41 @@ USAGE piped_data | $0 NOTES --------------------------------------------------------------------------- -* INPUT METHODS * -$0 can accept piped data, STDIN redirection [&2 - if [ "$*" ]; then - echo Arguments present... >&2 - if [ -f "$*" ]; then - echo Uploading the contents of "$*"... >&2 - cat "$*" - else - echo Uploading the text: \""$*"\"... >&2 - echo "$*" - fi | curl -F 'sprunge=<-' http://sprunge.us - else - echo No arguments found, printing USAGE and exiting. >&2 - usage - fi - else - echo Using input from a pipe or STDIN redirection... >&2 - curl -F 'sprunge=<-' http://sprunge.us - fi + Input Methods: + $0 can accept piped data, STDIN redirection [< filename.txt], text strings following the command as arguments, or filenames as arguments. Only one of these methods can be used at a time, so please see the note on precedence. Also, note that using a pipe or STDIN redirection will treat tabs as spaces, or disregard them entirely (if they appear at the beginning of a line). So I suggest using a filename as an argument if tabs are important either to the function or readability of the code. + + Precedence: + STDIN redirection has precedence, then piped input, then a filename as an argument, and finally text strings as arguments. For example: + + echo piped | $0 arguments.txt < stdin_redirection.txt + + In this example, the contents of file_as_stdin_redirection.txt would be uploaded. Both the piped_text and the file_as_argument.txt are ignored. If there is piped input and arguments, the arguments will be ignored, and the piped input uploaded. + + Filenames: + If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it. + +EOF + return + fi + + if [ -t 0 ]; then + echo Running interactively, checking for arguments... >&2 + if [ "$*" ]; then + echo Arguments present... >&2 + if [ -f "$*" ]; then + echo Uploading the contents of "$*"... >&2 + cat "$*" + else + echo Uploading the text: \""$*"\"... >&2 + echo "$*" + fi | curl -F 'sprunge=<-' http://sprunge.us + else + echo No arguments found, printing USAGE and exiting. >&2 + sprunge --help + return 1 + fi + else + echo Using input from a pipe or STDIN redirection... >&2 + curl -F 'sprunge=<-' http://sprunge.us + fi } From 7ea05bd5003a1b7bd69b69fbcf3bfe3de4fcfe7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 9 Oct 2019 18:07:02 +0200 Subject: [PATCH 038/488] Change description --- plugins/compleat/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/compleat/README.md b/plugins/compleat/README.md index 1d7f0492d8bde..630c915034280 100644 --- a/plugins/compleat/README.md +++ b/plugins/compleat/README.md @@ -1,9 +1,8 @@ -# compleat +# compleat plugin -This plugin runs [bashcompinit](https://github.com/zsh-users/zsh/blob/master/Completion/bashcompinit) which will allow zsh to read bash completion specifications and functions. +This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion. -To use it add compleat to the plugins array in your zshrc file. - - ``` +To use it, add compleat to the plugins array in your zshrc file: +``` plugins=(... compleat) -``` \ No newline at end of file +``` From 11e23477527a0314ffbed74a3d061ae76034da15 Mon Sep 17 00:00:00 2001 From: Martin Mladenov <30376060+martinmladenov@users.noreply.github.com> Date: Wed, 9 Oct 2019 19:09:29 +0300 Subject: [PATCH 039/488] git-escape-magic: fix typos in README (#8234) --- plugins/git-escape-magic/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/git-escape-magic/README.md b/plugins/git-escape-magic/README.md index c3e3898f50ca9..7fefed39dc6af 100644 --- a/plugins/git-escape-magic/README.md +++ b/plugins/git-escape-magic/README.md @@ -4,13 +4,13 @@ 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. +An excerpt from that project's readme explains its 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. ## Usage -To use this plugin add it to your list of plugins in your `.zshrc` file. +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 +**NOTE**: If you use url-quote-magic, it must be included before this plugin runs to prevent any conflicts. From 98cd133c4d15c1a147679cc00c0bd924fd91f11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 9 Oct 2019 18:12:58 +0200 Subject: [PATCH 040/488] Reword and add extra information --- plugins/chruby/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/chruby/README.md b/plugins/chruby/README.md index c5e4b93327a24..d373006a526c8 100644 --- a/plugins/chruby/README.md +++ b/plugins/chruby/README.md @@ -1,9 +1,10 @@ # chruby plugin -This plugin loads the [chruby](https://github.com/postmodern/chruby). Supports brew and manual installation of chruby. +This plugin loads [chruby](https://github.com/postmodern/chruby), a tool that changes the +current Ruby version, and completion and a prompt function to display the Ruby version. +Supports brew and manual installation of chruby. To use it, add `chruby` to the plugins array in your zshrc file: - ```zsh plugins=(... chruby) ``` From c5b4613bf6e1256e56b5451bccce5972a255a58b Mon Sep 17 00:00:00 2001 From: Maciej Motyka <39633561+maciejmotyka@users.noreply.github.com> Date: Wed, 9 Oct 2019 19:13:25 +0200 Subject: [PATCH 041/488] python: add recurse flag to pygrep (#8217) As described in #7053 --- plugins/python/python.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index f754ea261b7f3..950b0e01aea4b 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -11,5 +11,5 @@ function pyclean() { } # Grep among .py files -alias pygrep='grep --include="*.py"' +alias pygrep='grep -r --include="*.py"' From 49c423c7e0a6d5193b77e60107e7c329da28d987 Mon Sep 17 00:00:00 2001 From: 927589452 <927589452@users.noreply.github.com> Date: Wed, 9 Oct 2019 19:24:44 +0200 Subject: [PATCH 042/488] battery: add support for sysctl in FreeBSD (#8155) --- plugins/battery/battery.plugin.zsh | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 8f398cfb34214..6b668471606f9 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -7,6 +7,9 @@ # Email: neuralsandwich@gmail.com # # Modified to add support for Apple Mac # ########################################### +# Author: J (927589452) # +# Modified to add support for FreeBSD # +########################################### if [[ "$OSTYPE" = darwin* ]] ; then @@ -64,6 +67,52 @@ if [[ "$OSTYPE" = darwin* ]] ; then [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] } +elif [[ "$OSTYPE" = freebsd* ]] ; then + + function battery_is_charging() { + [[ $(sysctl -n hw.acpi.battery.state) -eq 2 ]] + } + + function battery_pct() { + if (( $+commands[sysctl] )) ; then + echo "$(sysctl -n hw.acpi.battery.life)" + fi + } + + function battery_pct_remaining() { + if [ ! $(battery_is_charging) ] ; then + battery_pct + else + echo "External Power" + fi + } + + function battery_time_remaining() { + remaining_time=$(sysctl -n hw.acpi.battery.time) + if [[ $remaining_time -ge 0 ]] ; then + # calculation from https://www.unix.com/shell-programming-and-scripting/23695-convert-minutes-hours-minutes-seconds.html + ((hour=$remaining_time/60)) + ((minute=$remaining_time-$hour*60)) + echo $hour:$minute + fi + } + + function battery_pct_prompt() { + b=$(battery_pct_remaining) + if [ ! $(battery_is_charging) ] ; then + if [ $b -gt 50 ] ; then + color='green' + elif [ $b -gt 20 ] ; then + color='yellow' + else + color='red' + fi + echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" + else + echo "∞" + fi + } + elif [[ "$OSTYPE" = linux* ]] ; then function battery_is_charging() { From a2cc84dd20d13f60bab51438ebbf4ea220a255ee Mon Sep 17 00:00:00 2001 From: Kirill <30822663+KirillDemtchenko@users.noreply.github.com> Date: Wed, 9 Oct 2019 21:55:16 +0300 Subject: [PATCH 043/488] fbterm: add README (#8241) --- plugins/fbterm/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/fbterm/README.md diff --git a/plugins/fbterm/README.md b/plugins/fbterm/README.md new file mode 100644 index 0000000000000..eec33d7ee676e --- /dev/null +++ b/plugins/fbterm/README.md @@ -0,0 +1,9 @@ +# fbterm + +This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm) +if on a real TTY (`/dev/tty*`). + +To use it, add fbterm to the plugins array of your zshrc file: +``` +plugins=(... fbterm) +``` From 710a3d5a1e2888a4dfb1769f8f1edd8a590eee22 Mon Sep 17 00:00:00 2001 From: Kirill <30822663+KirillDemtchenko@users.noreply.github.com> Date: Wed, 9 Oct 2019 22:04:49 +0300 Subject: [PATCH 044/488] emotty: add README (#8240) --- plugins/emotty/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/emotty/README.md diff --git a/plugins/emotty/README.md b/plugins/emotty/README.md new file mode 100644 index 0000000000000..2cfbe120cb49a --- /dev/null +++ b/plugins/emotty/README.md @@ -0,0 +1,39 @@ +# emotty plugin + +This plugin returns an emoji for the current $TTY number so it can be used +in a prompt. + +To use it, add emotty to the plugins array in your zshrc file: +``` +plugins=(... emotty) +``` + +**NOTE:** it requires the [emoji plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/emoji). + +## Usage + +The function `emotty` displays an emoji from the current character set (default: `emoji`), based +on the number associated to the `$TTY`. + +There are different sets of emoji characters available, to choose a different +set, set `$emotty_set` to the name of the set you would like to use, e.g.: +``` +emotty_set=nature +``` + +### Character Sets + +- emoji +- loral +- love +- nature +- stellar +- zodiac + +Use the `display_emotty` function to list the emojis in the current character set, or +the character set passed as the first argument. For example: + +``` +$ display_emotty zodiac + +``` From 35aa3c13311e12ff3375f2eef561562244433ee8 Mon Sep 17 00:00:00 2001 From: jotaro-sama <36264038+jotaro-sama@users.noreply.github.com> Date: Thu, 10 Oct 2019 03:57:25 +0200 Subject: [PATCH 045/488] add readme for the rust plugin --- plugins/rust/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/rust/README.md diff --git a/plugins/rust/README.md b/plugins/rust/README.md new file mode 100644 index 0000000000000..7cc1ceb662207 --- /dev/null +++ b/plugins/rust/README.md @@ -0,0 +1,15 @@ +# rust + +This plugin adds completion for [`rustc`](https://doc.rust-lang.org/rustc/index.html), the compiler for the Rust programming language. + +To use it, add `rust` to the plugins array in your zshrc file: + +```zsh +plugins=(... rust) +``` + +## Aliases + +| Command | Description | +|------------------|---------------------------------------------------------------------------------| +| `rustc` | Compiler for the Rust language | From bb97a9b3ecb809dc7f4f64713170e42b44853d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 10 Oct 2019 11:07:33 +0200 Subject: [PATCH 046/488] Delete alias section --- plugins/rust/README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/plugins/rust/README.md b/plugins/rust/README.md index 7cc1ceb662207..83d7d91ba23ac 100644 --- a/plugins/rust/README.md +++ b/plugins/rust/README.md @@ -7,9 +7,3 @@ To use it, add `rust` to the plugins array in your zshrc file: ```zsh plugins=(... rust) ``` - -## Aliases - -| Command | Description | -|------------------|---------------------------------------------------------------------------------| -| `rustc` | Compiler for the Rust language | From f2be66177d440719dc58ce974077709b9b1b8f33 Mon Sep 17 00:00:00 2001 From: Yasna Kateb Date: Mon, 14 Oct 2019 13:05:12 +0330 Subject: [PATCH 047/488] Added README for pod --- plugins/pod/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/pod/README.md diff --git a/plugins/pod/README.md b/plugins/pod/README.md new file mode 100644 index 0000000000000..1009a08553c67 --- /dev/null +++ b/plugins/pod/README.md @@ -0,0 +1,10 @@ +# pod + +This plugin adds completion for [`CocoaPods`](https://cocoapods.org/) +CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. + +To use it, add `pod` to the plugins array in your zshrc file: + +```zsh +plugins=(... pod) +``` From c1bc062e6b56e03fe0b8b31df9520941d219b43f Mon Sep 17 00:00:00 2001 From: yasnakateb <37741028+yasnakateb@users.noreply.github.com> Date: Mon, 14 Oct 2019 13:06:20 +0330 Subject: [PATCH 048/488] Update README --- plugins/pod/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pod/README.md b/plugins/pod/README.md index 1009a08553c67..0a3cc7a36c251 100644 --- a/plugins/pod/README.md +++ b/plugins/pod/README.md @@ -1,6 +1,6 @@ # pod -This plugin adds completion for [`CocoaPods`](https://cocoapods.org/) +This plugin adds completion for [`CocoaPods`](https://cocoapods.org/). CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. To use it, add `pod` to the plugins array in your zshrc file: From f56b678888c0ad4ac71458680d75d88b442cf09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 15 Oct 2019 16:51:51 +0200 Subject: [PATCH 049/488] fzf: check for dpkg before checking for fzf in debian Fixes #8253 Co-authored-by: Mariusz B --- plugins/fzf/fzf.plugin.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index 646148297735e..f701fdf3252e7 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -1,9 +1,9 @@ function setup_using_base_dir() { - # Declare all variables local not no mess with outside env in any way - local fzf_base - local fzf_shell - local fzfdirs - local dir + # Declare all variables local not no mess with outside env in any way + local fzf_base + local fzf_shell + local fzfdirs + local dir test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}" @@ -58,7 +58,7 @@ function setup_using_base_dir() { function setup_using_debian_package() { - dpkg -s fzf &> /dev/null + (( $+command[dpkg] )) && dpkg -s fzf &> /dev/null if (( $? )); then # Either not a debian based distro, or no fzf installed. In any case skip ahead return 1 From ca6b3977834889f56d03356061394ca80f3520c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 15 Oct 2019 22:56:45 +0200 Subject: [PATCH 050/488] meta: remove automatic bug label on bug reports People sometimes use the bug report template for things that are support. Maintainers will confirm whether it's a bug with the appropriate label. --- .github/ISSUE_TEMPLATE/bug_report.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ff55f36be22e9..076c355444091 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,6 @@ --- name: Bug report about: Create a report to help us improve -labels: 'Type: bug' --- From 1f8989aee81740760fd4202172c90446d1c391d9 Mon Sep 17 00:00:00 2001 From: Kenny Heaton Date: Tue, 15 Oct 2019 16:21:16 -0500 Subject: [PATCH 051/488] rake: add README (#8254) --- plugins/rake/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/rake/README.md diff --git a/plugins/rake/README.md b/plugins/rake/README.md new file mode 100644 index 0000000000000..e235bd91a2c53 --- /dev/null +++ b/plugins/rake/README.md @@ -0,0 +1,37 @@ +# Rake plugin + +This plugin adds support for [rake](https://ruby.github.io/rake/), the Ruby +build tool or Ruby Make. + +To use it, add `rake` to the plugins array in your zshrc file: + +```zsh +plugins=(... rake) +``` + +## Aliases + +The plugin aliases the rake command so you can pass arguments when invoking rake tasks +without having to escape the brackets, i.e., you can run +``` +rake namespace:task['argument'] +``` +instead of having to do +``` +rake namespace:task\['argument'\] +``` + +| Alias | Command | Description | +|--------|--------------------------------|-----------------------------------------------| +| rake | `noglob rake` | Allows unescaped square brackets | +| brake | `noglob bundle exec rake` | Same as above but call rake using bundler | +| srake | `noglob sudo rake` | Same as rake but using sudo | +| sbrake | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler | + +## Jim Weirich + +The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich), author of Rake +and big time contributor to the Ruby open source community. He passed away in 2014: + +> Thank you Jim for everything you contributed to the Ruby and open source community +> over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/robbyrussell/oh-my-zsh/commit/598a9c6f990756386517d66b6bcf77e53791e905) From 11f36cf9226618666a3335833e5cfb246fce44b9 Mon Sep 17 00:00:00 2001 From: flowin Date: Tue, 15 Oct 2019 23:25:56 +0200 Subject: [PATCH 052/488] screen: add README (#8256) --- plugins/screen/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/screen/README.md diff --git a/plugins/screen/README.md b/plugins/screen/README.md new file mode 100644 index 0000000000000..103e17237075e --- /dev/null +++ b/plugins/screen/README.md @@ -0,0 +1,10 @@ +# screen + +This plugin sets title and hardstatus of the tab window for [screen](https://www.gnu.org/software/screen/), +the terminal multiplexer. + +To use it add `screen` to the plugins array in your zshrc file. + +```zsh +plugins=(... screen) +``` From 767be6c42f1b71fe497c46faa67c2ef4e70ab829 Mon Sep 17 00:00:00 2001 From: Sofia Rivas Date: Tue, 15 Oct 2019 16:46:40 -0500 Subject: [PATCH 053/488] git-remote-branch: add README (#8259) --- plugins/git-remote-branch/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/git-remote-branch/README.md diff --git a/plugins/git-remote-branch/README.md b/plugins/git-remote-branch/README.md new file mode 100644 index 0000000000000..bd73e5dec0b58 --- /dev/null +++ b/plugins/git-remote-branch/README.md @@ -0,0 +1,14 @@ +# git-remote-branch plugin + +This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch), +or `git_remote_branch`. + +To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file: +``` +plugins=(... git-remote-branch) +``` + +## Deprecation + +[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived), +meaning it's not actively maintained anymore. Use at your own risk. From f7d9dae12e82b724dcb0f482b03b9771c82b5906 Mon Sep 17 00:00:00 2001 From: Shriniwas Sharma Date: Wed, 16 Oct 2019 09:28:19 +0200 Subject: [PATCH 054/488] bira: move virtualenv information (#8266) --- themes/bira.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index d00f72f5dc05b..cdae68d6c33f7 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -16,7 +16,7 @@ local venv_prompt='$(virtualenv_prompt_info)' ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" -PROMPT="╭─${venv_prompt}${user_host}${current_dir}${rvm_ruby}${git_branch} +PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${git_branch}${venv_prompt} ╰─%B${user_symbol}%b " RPROMPT="%B${return_code}%b" From 563c0708ab7100c23aab218a9053a61d81fe1317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= Date: Wed, 16 Oct 2019 17:59:06 +0200 Subject: [PATCH 055/488] fzf: fix regression (#8269) Typo introduced in f56b678 fixing #8253 --- plugins/fzf/fzf.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh index f701fdf3252e7..fe471a363f9d1 100644 --- a/plugins/fzf/fzf.plugin.zsh +++ b/plugins/fzf/fzf.plugin.zsh @@ -58,7 +58,7 @@ function setup_using_base_dir() { function setup_using_debian_package() { - (( $+command[dpkg] )) && dpkg -s fzf &> /dev/null + (( $+commands[dpkg] )) && dpkg -s fzf &> /dev/null if (( $? )); then # Either not a debian based distro, or no fzf installed. In any case skip ahead return 1 From 3e4d10c4f17b2fe57090a524d5d78781beda204a Mon Sep 17 00:00:00 2001 From: Shahin Sorkh Date: Wed, 16 Oct 2019 19:31:15 +0330 Subject: [PATCH 056/488] lib: allow alias expansion in _ sudo alias (#8268) --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/misc.zsh b/lib/misc.zsh index 36c3ae2e5c7ae..61571afc9cdde 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -22,7 +22,7 @@ env_default 'PAGER' 'less' env_default 'LESS' '-R' ## super user alias -alias _='sudo' +alias _='sudo ' ## more intelligent acking for ubuntu users if which ack-grep &> /dev/null; then From a41d308f70181db085938c5a8f2fe3d0d8e312c5 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Fri, 18 Oct 2019 09:43:25 -0700 Subject: [PATCH 057/488] bundler: make it play nice with functions that call wrapped commands (#8271) When another function calls one of the bundler plugin's wrapper functions, the command to run gets passed as an array instead of a space-separated string. That works fine when the arguments are expanded alone, like `bundle exec $@`, but something like `./bin/$@` will expand to something like `./bin/rake ./bin/--silent ./bin/--tasks`, which of course will explode. This was causing a nasty interaction with the rake-fast plugin, and I'd be shocked if it wasn't causing other problems. The fix is to explicitly turn off the `RC_EXPAND_PARAM` option for that expansion. See http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion for more details. --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c4a4fd40a56d7..d93fac01ed62c 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -95,7 +95,7 @@ _binstubbed() { _run-with-bundler() { if _bundler-installed && _within-bundled-project; then if _binstubbed $1; then - ./bin/$@ + ./bin/${^^@} else bundle exec $@ fi From e8a6d328ac36df80901dae540c6a466354327bb0 Mon Sep 17 00:00:00 2001 From: Nick <24370162+deltaclock@users.noreply.github.com> Date: Fri, 18 Oct 2019 17:05:47 +0000 Subject: [PATCH 058/488] eecms: add README (#8277) --- plugins/eecms/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 plugins/eecms/README.md diff --git a/plugins/eecms/README.md b/plugins/eecms/README.md new file mode 100644 index 0000000000000..c538355218391 --- /dev/null +++ b/plugins/eecms/README.md @@ -0,0 +1,11 @@ +# eecms plugin + +This plugin adds auto-completion of console commands for [`eecms`](https://github.com/ExpressionEngine/ExpressionEngine). + +To use it, add `eecms` to the plugins array of your `.zshrc` file: +``` +plugins=(... eecms) +``` + +It also adds the alias `eecms` which finds the eecms file in the current project +and runs it with php. From 45d2236941cdb55d33c418c7779b66f3fd1dd3f0 Mon Sep 17 00:00:00 2001 From: Nick <24370162+deltaclock@users.noreply.github.com> Date: Fri, 18 Oct 2019 17:12:05 +0000 Subject: [PATCH 059/488] phing: add README (#8278) --- plugins/phing/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/phing/README.md diff --git a/plugins/phing/README.md b/plugins/phing/README.md new file mode 100644 index 0000000000000..e2ac0bdf5bef0 --- /dev/null +++ b/plugins/phing/README.md @@ -0,0 +1,8 @@ +# Phing plugin + +This plugin adds autocompletion for [`phing`](https://github.com/phingofficial/phing) targets. + +To use it, add `phing` to the plugins array of your `.zshrc` file: +``` +plugins=(... eecms) +``` From efee47b5c0438f7dd0cfd03b9339bd6e1b4ab932 Mon Sep 17 00:00:00 2001 From: flowin Date: Fri, 18 Oct 2019 20:05:49 +0200 Subject: [PATCH 060/488] pass: add README (#8282) --- plugins/pass/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugins/pass/README.md diff --git a/plugins/pass/README.md b/plugins/pass/README.md new file mode 100644 index 0000000000000..2b070498119fc --- /dev/null +++ b/plugins/pass/README.md @@ -0,0 +1,22 @@ +# pass + +This plugin provides completion for the [pass](https://www.passwordstore.org/) password manager. + +To use it, add `pass` to the plugins array in your zshrc file. + +``` +plugins=(... pass) +``` + +## Configuration + +### Multiple repositories + +If you use multiple repositories, you can configure completion like this: +```zsh +compdef _pass workpass +zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" +workpass() { + PASSWORD_STORE_DIR=$HOME/work/pass pass $@ +} +``` From 6b6f2b6dfdc4bc327e814477170f81f0b91a9740 Mon Sep 17 00:00:00 2001 From: Vsevolod Romashov <7@7vn.ru> Date: Fri, 18 Oct 2019 22:55:56 +0300 Subject: [PATCH 061/488] bundler: support new file naming convention (#6594) --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index d93fac01ed62c..665cb5e435320 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -82,7 +82,7 @@ _bundler-installed() { _within-bundled-project() { local check_dir="$PWD" while [ "$check_dir" != "/" ]; do - [ -f "$check_dir/Gemfile" ] && return + [ -f "$check_dir/Gemfile" -o -f "$check_dir/gems.rb" ] && return check_dir="$(dirname $check_dir)" done false From 74165aba4ad500e6467973c5037e1379c55e9560 Mon Sep 17 00:00:00 2001 From: Angelos Orfanakos Date: Fri, 18 Oct 2019 22:56:30 +0300 Subject: [PATCH 062/488] rails: detect gems.rb in _rake_command (#8223) --- plugins/rails/rails.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index a8ec79db28ca9..1fd5f0f863edd 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -17,7 +17,7 @@ function _rake_command () { bin/stubs/rake $@ elif [ -e "bin/rake" ]; then bin/rake $@ - elif type bundle &> /dev/null && [ -e "Gemfile" ]; then + elif type bundle &> /dev/null && ([ -e "Gemfile" ] || [ -e "gems.rb" ]); then bundle exec rake $@ else command rake $@ From 39a4f9281b5d41736eb37ab535cb81a909e9f4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Zu=CC=88hlke?= Date: Fri, 18 Oct 2019 23:37:51 +0200 Subject: [PATCH 063/488] Add Readme.md for supervisor. Sync completion with original source. --- plugins/supervisor/README.md | 13 +++++++++++++ plugins/supervisor/_supervisorctl | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 plugins/supervisor/README.md diff --git a/plugins/supervisor/README.md b/plugins/supervisor/README.md new file mode 100644 index 0000000000000..25a04c9683fb3 --- /dev/null +++ b/plugins/supervisor/README.md @@ -0,0 +1,13 @@ +# supervisor plugin + +This plugin adds tab-completion for supervisord/supervisorctl in [Supervisor](http://supervisord.org/). + +Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. + +To use it, add `supervisor` to the plugins array in your zshrc file: + +```zsh +plugins=(... supervisor) +``` + +These scripts are from [zshcompfunc4supervisor](https://bitbucket.org/hhatto/zshcompfunc4supervisor). diff --git a/plugins/supervisor/_supervisorctl b/plugins/supervisor/_supervisorctl index d159f20e07f9a..9f576c0c07420 100644 --- a/plugins/supervisor/_supervisorctl +++ b/plugins/supervisor/_supervisorctl @@ -112,6 +112,13 @@ _supervisorctl_start() { '*::supvervisor process:_get_supervisor_procs' } +(( $+functions[_supervisorctl_restart] )) || +_supervisorctl_restart() { + # TODO: add 'all' + _arguments -s \ + '*::supvervisor process:_get_supervisor_procs' +} + (( $+functions[_supervisorctl_status] )) || _supervisorctl_status() { _arguments \ From 166719c0abecbcea418f2fc1db2939ed811971d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Zu=CC=88hlke?= Date: Fri, 18 Oct 2019 23:52:26 +0200 Subject: [PATCH 064/488] Format docker Readme like the other plugins. --- plugins/docker/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index e91798485da03..f7e5b8fe47582 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -1,5 +1,13 @@ ## Docker autocomplete plugin +This plugin adds auto-completion for docker. + +To use it add `docker` to the plugins array in your zshrc file. + +```zsh +plugins=(... docker) +``` + A copy of the completion script from the [docker/cli](https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker) git repo. From f48a40ee91b48ca78703395e07aba5b2dd9e3c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 19 Oct 2019 17:28:43 +0200 Subject: [PATCH 065/488] Reorganize stuff --- plugins/docker/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index f7e5b8fe47582..4d9f3ae9bce16 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -1,13 +1,11 @@ -## Docker autocomplete plugin +# Docker plugin -This plugin adds auto-completion for docker. +This plugin adds auto-completion for [docker](https://www.docker.com/). To use it add `docker` to the plugins array in your zshrc file. - ```zsh plugins=(... docker) ``` -A copy of the completion script from the -[docker/cli](https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker) -git repo. +A copy of the completion script from the docker/cli git repo: +https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker From 160a801bedc9663db5539d4f663d2c2dbdf6cdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 19 Oct 2019 17:29:46 +0200 Subject: [PATCH 066/488] Clean up README --- plugins/supervisor/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/supervisor/README.md b/plugins/supervisor/README.md index 25a04c9683fb3..1eacea6d39f8b 100644 --- a/plugins/supervisor/README.md +++ b/plugins/supervisor/README.md @@ -1,11 +1,10 @@ # supervisor plugin -This plugin adds tab-completion for supervisord/supervisorctl in [Supervisor](http://supervisord.org/). - -Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. +This plugin adds tab-completion for `supervisord`/`supervisorctl` in [Supervisor](http://supervisord.org/). +Supervisor is a client/server system that allows its users to monitor and control a number +of processes on UNIX-like operating systems. To use it, add `supervisor` to the plugins array in your zshrc file: - ```zsh plugins=(... supervisor) ``` From aebf333b0ce05bb6710729180335957ceed80dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Z=C3=BChlke?= Date: Sat, 19 Oct 2019 17:39:03 +0200 Subject: [PATCH 067/488] magic-enter: update README (#8284) --- plugins/magic-enter/Readme.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/magic-enter/Readme.md b/plugins/magic-enter/Readme.md index b401ab415d0e3..78514c67d821d 100644 --- a/plugins/magic-enter/Readme.md +++ b/plugins/magic-enter/Readme.md @@ -1,14 +1,17 @@ -## Magic Enter +## Magic Enter plugin -**Maintainer:** [@dufferzafar](https://github.com/dufferzafar) - -Makes your enter key magical, by binding commonly used commands to it. +This plugin 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! +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`. -```bash +```zsh +# defaults MAGIC_ENTER_GIT_COMMAND='git status -u .' MAGIC_ENTER_OTHER_COMMAND='ls -lh .' -plugins=(magic-enter) +plugins=(... magic-enter) ``` + +**Maintainer:** [@dufferzafar](https://github.com/dufferzafar) From 05dfd0ae8520e58e852c574f55c83fe6f49fb189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 19 Oct 2019 17:51:28 +0200 Subject: [PATCH 068/488] cargo: update completion to latest version (cdac4a8) https://github.com/rust-lang/cargo/blob/cdac4a8/src/etc/_cargo --- plugins/cargo/_cargo | 853 ++++++++++++++++++------------------------- 1 file changed, 358 insertions(+), 495 deletions(-) diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 395c517cd37e5..12694901ed046 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -2,489 +2,367 @@ autoload -U regexp-replace -zstyle -T ':completion:*:*:cargo:*' tag-order && \ - zstyle ':completion:*:*:cargo:*' tag-order 'common-commands' - _cargo() { -local context state state_descr line -typeset -A opt_args - -# leading items in parentheses are an exclusion list for the arguments following that arg -# See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions -# - => exclude all other options -# 1 => exclude positional arg 1 -# * => exclude all other args -# +blah => exclude +blah -_arguments \ - '(- 1 *)'{-h,--help}'[show help message]' \ - '(- 1 *)--list[list installed commands]' \ - '(- 1 *)'{-V,--version}'[show version information]' \ - {-v,--verbose}'[use verbose output]' \ - --color'[colorization option]' \ - '(+beta +nightly)+stable[use the stable toolchain]' \ - '(+stable +nightly)+beta[use the beta toolchain]' \ - '(+stable +beta)+nightly[use the nightly toolchain]' \ - '1: :->command' \ - '*:: :->args' - -case $state in - command) - _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds' - ;; - - args) - case $words[1] in - bench) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-default-features[do not build the default features]' \ - '--no-run[compile but do not run]' \ - '(-p,--package)'{-p=,--package=}'[package to run benchmarks for]:packages:_get_package_names' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - build) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-default-features[do not build the default features]' \ - '(-p,--package)'{-p=,--package=}'[package to build]:packages:_get_package_names' \ - '--release=[build in release mode]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - check) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - "${command_scope_spec[@]}" \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-default-features[do not check the default features]' \ - '(-p,--package)'{-p=,--package=}'[package to check]:packages:_get_package_names' \ - '--release=[check in release mode]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - clean) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-p,--package)'{-p=,--package=}'[package to clean]:packages:_get_package_names' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[whether or not to clean release artifacts]' \ - '--target=[target triple(default:all)]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - doc) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-deps[do not build docs for dependencies]' \ - '--no-default-features[do not build the default features]' \ - '--open[open docs in browser after the build]' \ - '(-p, --package)'{-p,--package}'=[package to document]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[build for the target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - fetch) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - generate-lockfile) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - git-checkout) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--reference=[REF]' \ - '--url=[URL]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - help) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '*: :_cargo_cmds' \ - ;; - - init) - _arguments \ - '--bin[use binary template]' \ - '--vcs:initialize a new repo with a given VCS:(git hg none)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--name=[set the resulting package name]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - install) - _arguments \ - '--bin=[only install the specified binary]' \ - '--branch=[branch to use when installing from git]' \ - '--color=:colorization option:(auto always never)' \ - '--debug[build in debug mode instead of release mode]' \ - '--example[install the specified example instead of binaries]' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '--git=[URL from which to install the crate]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--no-default-features[do not build the default features]' \ - '--path=[local filesystem path to crate to install]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--rev=[specific commit to use when installing from git]' \ - '--root=[directory to install packages into]: :_files -/' \ - '--tag=[tag to use when installing from git]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--vers=[version to install from crates.io]' \ - ;; - - locate-project) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - ;; - - login) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[Host to set the token for]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - metadata) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "--no-deps[output information only about the root package and don't fetch dependencies]" \ - '--no-default-features[do not include the default feature]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '--format-version=[format version(default: 1)]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - new) - _arguments \ - '--bin[use binary template]' \ - '--vcs:initialize a new repo with a given VCS:(git hg none)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--name=[set the resulting package name]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - owner) - _arguments \ - '(-a, --add)'{-a,--add}'[add owner LOGIN]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--index[registry index]' \ - '(-l, --list)'{-l,--list}'[list owners of a crate]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-r, --remove)'{-r,--remove}'[remove owner LOGIN]' \ - '--token[API token to use when authenticating]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - package) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-l, --list)'{-l,--list}'[print files included in a package without making one]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-metadata[ignore warnings about a lack of human-usable metadata]' \ - '--no-verify[do not build to verify contents]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - pkgid) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - publish) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[Host to set the token for]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--no-verify[Do not verify tarball until before publish]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--token[token to use when uploading]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - read-manifest) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - run) - _arguments \ - '--example=[name of the bin target]' \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--bin=[name of the bin target]' \ - '--no-default-features[do not build the default features]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release=[build in release mode]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '*: :_normal' \ - ;; - - rustc) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '--features=[features to compile for the package]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to fetch dependencies for]: :_files -/' \ - '--no-default-features[do not compile default features for the package]' \ - '(-p, --package)'{-p,--package}'=[profile to compile for]' \ - '--profile=[profile to build the selected target for]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[target triple which compiles will be for]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "${command_scope_spec[@]}" \ - ;; - - rustdoc) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '--features=[space-separated list of features to also build]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to document]: :_files -/' \ - '--no-default-features[do not build the `default` feature]' \ - '--open[open the docs in a browser after the operation]' \ - '(-p, --package)'{-p,--package}'=[package to document]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[build for the target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - "${command_scope_spec[@]}" \ - ;; - - search) - _arguments \ - '--color=:colorization option:(auto always never)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--host=[host of a registry to search in]' \ - '--limit=[limit the number of results]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - ;; - - test) - _arguments \ - '--features=[space separated feature list]' \ - '--all-features[enable all available features]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '--test=[test name]: :_test_names' \ - '--no-default-features[do not build the default features]' \ - '--no-fail-fast[run all tests regardless of failure]' \ - '--no-run[compile but do not run]' \ - '(-p,--package)'{-p=,--package=}'[package to run tests for]:packages:_get_package_names' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--release[build artifacts in release mode, with optimizations]' \ - '--target=[target triple]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '1: :_test_names' \ - '(--doc --bin --example --test --bench)--lib[only test library]' \ - '(--lib --bin --example --test --bench)--doc[only test documentation]' \ - '(--lib --doc --example --test --bench)--bin=[binary name]' \ - '(--lib --doc --bin --test --bench)--example=[example name]' \ - '(--lib --doc --bin --example --bench)--test=[test name]' \ - '(--lib --doc --bin --example --test)--bench=[benchmark name]' \ - '--message-format:error format:(human json short)' \ - '--frozen[require lock and cache up to date]' \ - '--locked[require lock up to date]' - ;; - - uninstall) - _arguments \ - '--bin=[only uninstall the binary NAME]' \ - '--color=:colorization option:(auto always never)' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \ - '--root=[directory to uninstall packages from]: :_files -/' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - ;; - - update) - _arguments \ - '--aggressive=[force dependency update]' \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-p,--package)'{-p=,--package=}'[package to update]:packages:__get_package_names' \ - '--precise=[update single dependency to PRECISE]: :' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - verify-project) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--manifest-path=[path to manifest]: :_files -/' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - version) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - ;; - - yank) - _arguments \ - '(-h, --help)'{-h,--help}'[show help message]' \ - '--index[registry index]' \ - '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ - '--token[API token to use when authenticating]' \ - '--undo[undo a yank, putting a version back into the index]' \ - '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ - '--color=:colorization option:(auto always never)' \ - '--vers[yank version]' \ - ;; - esac - ;; -esac + local curcontext="$curcontext" ret=1 + local -a command_scope_spec common parallel features msgfmt triple target registry + local -a state line state_descr # These are set by _arguments + typeset -A opt_args + + common=( + '(-q --quiet)*'{-v,--verbose}'[use verbose output]' + '(-q --quiet -v --verbose)'{-q,--quiet}'[no output printed to stdout]' + '-Z+[pass unstable (nightly-only) flags to cargo]: :_cargo_unstable_flags' + '--frozen[require that Cargo.lock and cache are up-to-date]' + '--locked[require that Cargo.lock is up-to-date]' + '--color=[specify colorization option]:coloring:(auto always never)' + '(- 1 *)'{-h,--help}'[show help message]' + ) + + # leading items in parentheses are an exclusion list for the arguments following that arg + # See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions + # - => exclude all other options + # 1 => exclude positional arg 1 + # * => exclude all other args + # +blah => exclude +blah + _arguments -s -S -C $common \ + '(- 1 *)--list[list installed commands]' \ + '(- 1 *)--explain=[provide a detailed explanation of an error message]:error code' \ + '(- 1 *)'{-V,--version}'[show version information]' \ + '(+beta +nightly)+stable[use the stable toolchain]' \ + '(+stable +nightly)+beta[use the beta toolchain]' \ + '(+stable +beta)+nightly[use the nightly toolchain]' \ + '1: :_cargo_cmds' \ + '*:: :->args' + + # These flags are mutually exclusive specifiers for the scope of a command; as + # they are used in multiple places without change, they are expanded into the + # appropriate command's `_arguments` where appropriate. + command_scope_spec=( + '(--bin --example --test --lib)--bench=[specify benchmark name]: :_cargo_benchmark_names' + '(--bench --bin --test --lib)--example=[specify example name]:example name' + '(--bench --example --test --lib)--bin=[specify binary name]:binary name' + '(--bench --bin --example --test)--lib=[specify library name]:library name' + '(--bench --bin --example --lib)--test=[specify test name]:test name' + ) + + parallel=( + '(-j --jobs)'{-j+,--jobs=}'[specify number of parallel jobs]:jobs [# of CPUs]' + ) + + features=( + '(--all-features)--features=[specify features to activate]:feature' + '(--features)--all-features[activate all available features]' + "--no-default-features[don't build the default features]" + ) + + msgfmt='--message-format=[specify error format]:error format [human]:(human json short)' + triple='--target=[specify target triple]:target triple' + target='--target-dir=[specify directory for all generated artifacts]:directory:_directories' + manifest='--manifest-path=[specify path to manifest]:path:_directories' + registry='--registry=[specify registry to use]:registry' + + case $state in + args) + curcontext="${curcontext%:*}-${words[1]}:" + case ${words[1]} in + bench) + _arguments -s -A "^--" $common $parallel $features $msgfmt $triple $target $manifest \ + "${command_scope_spec[@]}" \ + '--all-targets[benchmark all targets]' \ + "--no-run[compile but don't run]" \ + '(-p --package)'{-p+,--package=}'[specify package to run benchmarks for]:package:_cargo_package_names' \ + '--exclude=[exclude packages from the benchmark]:spec' \ + '--no-fail-fast[run all benchmarks regardless of failure]' \ + '1: :_guard "^-*" "bench name"' \ + '*:args:_default' + ;; + + build) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \ + "${command_scope_spec[@]}" \ + '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \ + '--release[build in release mode]' \ + '--build-plan[output the build plan in JSON]' \ + ;; + + check) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--all-targets[equivalent to specifying --lib --bins --tests --benches --examples]' \ + "${command_scope_spec[@]}" \ + '(-p --package)'{-p+,--package=}'[specify package to check]:package:_cargo_package_names' \ + '--release[check in release mode]' \ + ;; + + clean) + _arguments -s -S $common $triple $target $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to clean]:package:_cargo_package_names' \ + '--release[clean release artifacts]' \ + '--doc[clean just the documentation directory]' + ;; + + doc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--no-deps[do not build docs for dependencies]' \ + '--document-private-items[include non-public items in the documentation]' \ + '--open[open docs in browser after the build]' \ + '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \ + '--release[build artifacts in release mode, with optimizations]' \ + ;; + + fetch) + _arguments -s -S $common $triple $manifest + ;; + + fix) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + "${command_scope_spec[@]}" \ + '--broken-code[fix code even if it already has compiler errors]' \ + '--edition[fix in preparation for the next edition]' \ + '--edition-idioms[fix warnings to migrate to the idioms of an edition]' \ + '--allow-no-vcs[fix code even if a VCS was not detected]' \ + '--allow-dirty[fix code even if the working directory is dirty]' \ + '--allow-staged[fix code even if the working directory has staged changes]' + ;; + + generate-lockfile) + _arguments -s -S $common $manifest + ;; + + git-checkout) + _arguments -s -S $common \ + '--reference=:reference' \ + '--url=:url:_urls' + ;; + + help) + _cargo_cmds + ;; + + init) + _arguments -s -S $common $registry \ + '--lib[use library template]' \ + '--edition=[specify edition to set for the crate generated]:edition:(2015 2018)' \ + '--vcs=[initialize a new repo with a given VCS]:vcs:(git hg pijul fossil none)' \ + '--name=[set the resulting package name]:name' \ + '1:path:_directories' + ;; + + install) + _arguments -s -S $common $parallel $features $triple $registry \ + '(-f --force)'{-f,--force}'[force overwriting of existing crates or binaries]' \ + '--bin=[only install the specified binary]:binary' \ + '--branch=[branch to use when installing from git]:branch' \ + '--debug[build in debug mode instead of release mode]' \ + '--example=[install the specified example instead of binaries]:example' \ + '--git=[specify URL from which to install the crate]:url:_urls' \ + '--path=[local filesystem path to crate to install]: :_directories' \ + '--rev=[specific commit to use when installing from git]:commit' \ + '--root=[directory to install packages into]: :_directories' \ + '--tag=[tag to use when installing from git]:tag' \ + '--vers=[version to install from crates.io]:version' \ + '--list[list all installed packages and their versions]' \ + '*: :_guard "^-*" "crate"' + ;; + + locate-project) + _arguments -s -S $common $manifest + ;; + + login) + _arguments -s -S $common $registry \ + '*: :_guard "^-*" "token"' + ;; + + metadata) + _arguments -s -S $common $features $manifest \ + "--no-deps[output information only about the root package and don't fetch dependencies]" \ + '--format-version=[specify format version]:version [1]:(1)' + ;; + + new) + _arguments -s -S $common $registry \ + '--lib[use library template]' \ + '--vcs:initialize a new repo with a given VCS:(git hg none)' \ + '--name=[set the resulting package name]' + ;; + + owner) + _arguments -s -S $common $registry \ + '(-a --add)'{-a,--add}'[specify name of a user or team to invite as an owner]:name' \ + '--index=[specify registry index]:index' \ + '(-l --list)'{-l,--list}'[list owners of a crate]' \ + '(-r --remove)'{-r,--remove}'[specify name of a user or team to remove as an owner]:name' \ + '--token=[specify API token to use when authenticating]:token' \ + '*: :_guard "^-*" "crate"' + ;; + + package) + _arguments -s -S $common $parallel $features $triple $target $manifest \ + '(-l --list)'{-l,--list}'[print files included in a package without making one]' \ + '--no-metadata[ignore warnings about a lack of human-usable metadata]' \ + '--allow-dirty[allow dirty working directories to be packaged]' \ + "--no-verify[don't build to verify contents]" + ;; + + pkgid) + _arguments -s -S $common $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to get ID specifier for]:package:_cargo_package_names' \ + '*: :_guard "^-*" "spec"' + ;; + + publish) + _arguments -s -S $common $parallel $features $triple $target $manifest $registry \ + '--index=[specify registry index]:index' \ + '--allow-dirty[allow dirty working directories to be packaged]' \ + "--no-verify[don't verify the contents by building them]" \ + '--token=[specify token to use when uploading]:token' \ + '--dry-run[perform all checks without uploading]' + ;; + + read-manifest) + _arguments -s -S $common $manifest + ;; + + run) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--example=[name of the bin target]:name' \ + '--bin=[name of the bin target]:name' \ + '(-p --package)'{-p+,--package=}'[specify package with the target to run]:package:_cargo_package_names' \ + '--release[build in release mode]' \ + '*: :_default' + ;; + + rustc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '(-p --package)'{-p+,--package=}'[specify package to build]:package:_cargo_package_names' \ + '--profile=[specify profile to build the selected target for]:profile' \ + '--release[build artifacts in release mode, with optimizations]' \ + "${command_scope_spec[@]}" \ + '*: : _dispatch rustc rustc -default-' + ;; + + rustdoc) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--document-private-items[include non-public items in the documentation]' \ + '--open[open the docs in a browser after the operation]' \ + '(-p --package)'{-p+,--package=}'[specify package to document]:package:_cargo_package_names' \ + '--release[build artifacts in release mode, with optimizations]' \ + "${command_scope_spec[@]}" \ + '*: : _dispatch rustdoc rustdoc -default-' + ;; + + search) + _arguments -s -S $common $registry \ + '--index=[specify registry index]:index' \ + '--limit=[limit the number of results]:results [10]' \ + '*: :_guard "^-*" "query"' + ;; + + test) + _arguments -s -S $common $parallel $features $msgfmt $triple $target $manifest \ + '--test=[test name]: :_cargo_test_names' \ + '--no-fail-fast[run all tests regardless of failure]' \ + '--no-run[compile but do not run]' \ + '(-p --package)'{-p+,--package=}'[package to run tests for]:package:_cargo_package_names' \ + '--all[test all packages in the workspace]' \ + '--release[build artifacts in release mode, with optimizations]' \ + '1: :_cargo_test_names' \ + '(--doc --bin --example --test --bench)--lib[only test library]' \ + '(--lib --bin --example --test --bench)--doc[only test documentation]' \ + '(--lib --doc --example --test --bench)--bin=[binary name]' \ + '(--lib --doc --bin --test --bench)--example=[example name]' \ + '(--lib --doc --bin --example --bench)--test=[test name]' \ + '(--lib --doc --bin --example --test)--bench=[benchmark name]' \ + '*: :_default' + ;; + + uninstall) + _arguments -s -S $common \ + '(-p --package)'{-p+,--package=}'[specify package to uninstall]:package:_cargo_package_names' \ + '--bin=[only uninstall the specified binary]:name' \ + '--root=[directory to uninstall packages from]: :_files -/' \ + '*:crate:_cargo_installed_crates -F line' + ;; + + update) + _arguments -s -S $common $manifest \ + '--aggressive=[force dependency update]' \ + "--dry-run[don't actually write the lockfile]" \ + '(-p --package)'{-p+,--package=}'[specify package to update]:package:_cargo_package_names' \ + '--precise=[update single dependency to precise release]:release' + ;; + + verify-project) + _arguments -s -S $common $manifest + ;; + + version) + _arguments -s -S $common + ;; + + yank) + _arguments -s -S $common $registry \ + '--vers=[specify yank version]:version' \ + '--undo[undo a yank, putting a version back into the index]' \ + '--index=[specify registry index to yank from]:registry index' \ + '--token=[specify API token to use when authenticating]:token' \ + '*: :_guard "^-*" "crate"' + ;; + *) + # allow plugins to define their own functions + if ! _call_function ret _cargo-${words[1]}; then + # fallback on default completion for unknown commands + _default && ret=0 + fi + (( ! ret )) + ;; + esac + ;; + esac +} + +_cargo_unstable_flags() { + local flags + flags=( help ${${${(M)${(f)"$(_call_program flags cargo -Z help)"}:#*--*}/ #-- #/:}##*-Z } ) + _describe -t flags 'unstable flag' flags } -_cargo_cmds(){ -local -a commands;commands=( -'bench:execute all benchmarks of a local package' -'build:compile the current package' -'check:check the current package without compiling' -'clean:remove generated artifacts' -'doc:build package documentation' -'fetch:fetch package dependencies' -'generate-lockfile:create lockfile' -'git-checkout:git checkout' -'help:get help for commands' -'init:create new package in current directory' -'install:install a Rust binary' -'locate-project:print "Cargo.toml" location' -'login:login to remote server' -'metadata:the metadata for a package in json' -'new:create a new package' -'owner:manage the owners of a crate on the registry' -'package:assemble local package into a distributable tarball' -'pkgid:print a fully qualified package specification' -'publish:upload package to the registry' -'read-manifest:print manifest in JSON format' -'run:run the main binary of the local package' -'rustc:compile a package and all of its dependencies' -'rustdoc:build documentation for a package' -'search:search packages on crates.io' -'test:execute all unit and tests of a local package' -'uninstall:remove a Rust binary' -'update:update dependencies' -'verify-project:check Cargo.toml' -'version:show version information' -'yank:remove pushed file from index' -) -_describe -t common-commands 'common commands' commands +_cargo_installed_crates() { + local expl + _description crates expl 'crate' + compadd "$@" "$expl[@]" - ${${${(f)"$(cargo install --list)"}:# *}%% *} } -_cargo_all_cmds(){ -local -a commands;commands=($(cargo --list)) -_describe -t all-commands 'all commands' commands +_cargo_cmds() { + local -a commands + # This uses Parameter Expansion Flags, which are a built-in Zsh feature. + # See more: http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags + # and http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion + # + # # How this work? + # + # First it splits the result of `cargo --list` at newline, then it removes the first line. + # Then it removes indentation (4 whitespaces) before each items. (Note the x## pattern [1]). + # Then it replaces those spaces between item and description with a `:` + # + # [1]: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#patterns + commands=( ${${${(M)"${(f)$(_call_program commands cargo --list)}":# *}/ ##/}/ ##/:} ) + _describe -t commands 'command' commands } #FIXME: Disabled until fixed #gets package names from the manifest file -_get_package_names() -{ -} - -#TODO:see if it makes sense to have 'locate-project' to have non-json output. -#strips package name from json stuff -_locate_manifest(){ -local manifest=`cargo locate-project 2>/dev/null` -regexp-replace manifest '\{"root":"|"\}' '' -echo $manifest +_cargo_package_names() { + _message -e packages package } # Extracts the values of "name" from the array given in $1 and shows them as # command line options for completion -_get_names_from_array() -{ - local -a filelist; - local manifest=$(_locate_manifest) +_cargo_names_from_array() { + # strip json from the path + local manifest=${${${"$(cargo locate-project)"}%\"\}}##*\"} if [[ -z $manifest ]]; then return 0 fi @@ -494,51 +372,36 @@ _get_names_from_array() local in_block=false local block_name=$1 names=() - while read line - do + while read -r line; do if [[ $last_line == "[[$block_name]]" ]]; then in_block=true else - if [[ $last_line =~ '.*\[\[.*' ]]; then + if [[ $last_line =~ '\s*\[\[.*' ]]; then in_block=false fi fi if [[ $in_block == true ]]; then - if [[ $line =~ '.*name.*=' ]]; then - regexp-replace line '^.*name *= *|"' "" - names+=$line + if [[ $line =~ '\s*name\s*=' ]]; then + regexp-replace line '^\s*name\s*=\s*|"' '' + names+=( "$line" ) fi fi last_line=$line - done < $manifest - _describe $block_name names + done < "$manifest" + _describe "$block_name" names } #Gets the test names from the manifest file -_test_names() -{ - _get_names_from_array "test" +_cargo_test_names() { + _cargo_names_from_array "test" } #Gets the bench names from the manifest file -_benchmark_names() -{ - _get_names_from_array "bench" +_cargo_benchmark_names() { + _cargo_names_from_array "bench" } -# These flags are mutually exclusive specifiers for the scope of a command; as -# they are used in multiple places without change, they are expanded into the -# appropriate command's `_arguments` where appropriate. -set command_scope_spec -command_scope_spec=( - '(--bin --example --test --lib)--bench=[benchmark name]: :_benchmark_names' - '(--bench --bin --test --lib)--example=[example name]' - '(--bench --example --test --lib)--bin=[binary name]' - '(--bench --bin --example --test)--lib=[library name]' - '(--bench --bin --example --lib)--test=[test name]' -) - _cargo From 090ab73daa587cd592bbd03445223bc570f91367 Mon Sep 17 00:00:00 2001 From: Netoun Date: Sun, 20 Oct 2019 19:19:58 +0200 Subject: [PATCH 069/488] safe-paste: add README (#8292) --- plugins/safe-paste/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/safe-paste/README.md diff --git a/plugins/safe-paste/README.md b/plugins/safe-paste/README.md new file mode 100644 index 0000000000000..a2e7ddbfcb3c1 --- /dev/null +++ b/plugins/safe-paste/README.md @@ -0,0 +1,9 @@ +# safe-paste + +Preventing any code from actually running while pasting, so you have a chance to review what was actually pasted before running it. + +To use it, add `safe-paste` to the plugins array in your zshrc file: + +```zsh +plugins=(... safe-paste) +``` From a7c740b1d7d0033c6de118439c7935962b2a5c2a Mon Sep 17 00:00:00 2001 From: Kenny Heaton Date: Sun, 20 Oct 2019 13:16:37 -0500 Subject: [PATCH 070/488] rbenv: add README (#8293) --- plugins/rbenv/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/rbenv/README.md diff --git a/plugins/rbenv/README.md b/plugins/rbenv/README.md new file mode 100644 index 0000000000000..43a2e93ac7efb --- /dev/null +++ b/plugins/rbenv/README.md @@ -0,0 +1,26 @@ +# rbenv plugin + +The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby +version and gemset information into your prompt. + +Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed. +https://github.com/jf/rbenv-gemset + +To use it, add `rbenv` to the plugins array in your zshrc file: +```zsh +plugins=(... rbenv) +``` + +## Alias + +| Alias | Command | Description | +|----------------|---------------------|----------------------------------| +| rubies | `rbenv versions` | List the installed Ruby versions | +| gemsets | `rbenv gemset list` | List the existing gemsets | + +## Functions + +* `current_ruby`: The version of Ruby currently being used. +* `current_gemset`: The name of the current gemset. +* `gems`: Lists installed gems with enhanced formatting and color. +* `rbenv_prompt_info`: For adding information to your prompt. Format: `@`. From 534ec60bfd14ee640076c7594ee4fa723fafd1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 21 Oct 2019 16:42:06 +0200 Subject: [PATCH 071/488] Set default git-config values known to fix repository issues - core.autocrlf=false -> #4069 - fsck.zeroPaddedFilemode -> #4963 Fixes #4069 Fixes #4963 --- tools/install.sh | 6 +++++- tools/upgrade.sh | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 61010214ebfa3..a5a90e6f65e73 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -90,7 +90,11 @@ setup_ohmyzsh() { exit 1 fi - git clone --depth=1 --branch "$BRANCH" "$REMOTE" "$ZSH" || { + git clone -c core.eol=lf -c core.autocrlf=false \ + -c fsck.zeroPaddedFilemode=ignore \ + -c fetch.fsck.zeroPaddedFilemode=ignore \ + -c receive.fsck.zeroPaddedFilemode=ignore \ + --depth=1 --branch "$BRANCH" "$REMOTE" "$ZSH" || { error "git clone of oh-my-zsh repo failed" exit 1 } diff --git a/tools/upgrade.sh b/tools/upgrade.sh index d234c7f8854ed..0dd855b70884a 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -20,8 +20,18 @@ else NORMAL="" fi -printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh" cd "$ZSH" + +# Set git-config values known to fix git errors +# Line endings (#4069) +git config core.eol lf +git config core.autocrlf false +# zeroPaddedFilemode fsck errors (#4963) +git config fsck.zeroPaddedFilemode ignore +git config fetch.fsck.zeroPaddedFilemode ignore +git config receive.fsck.zeroPaddedFilemode ignore + +printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh" if git pull --rebase --stat origin master then printf '%s' "$GREEN" From 40df67bc3b9b51caa24df5d220487043040d1f9a Mon Sep 17 00:00:00 2001 From: Tim <0xTim@users.noreply.github.com> Date: Tue, 22 Oct 2019 17:24:05 +0100 Subject: [PATCH 072/488] swiftpm: update completion for Swift 5.1 (#8248) --- plugins/swiftpm/README.md | 2 +- plugins/swiftpm/_swift | 190 ++++++++++++++++++++------------------ 2 files changed, 100 insertions(+), 92 deletions(-) diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md index 2914585113f1c..a722c03e4ff7a 100644 --- a/plugins/swiftpm/README.md +++ b/plugins/swiftpm/README.md @@ -2,7 +2,7 @@ ## Description -This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.0. +This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager), as well as autocompletion for Swift 5.1. To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`: diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift index 1366b4d9ce7e0..fe6f1c9aa99a8 100644 --- a/plugins/swiftpm/_swift +++ b/plugins/swiftpm/_swift @@ -82,13 +82,15 @@ _swift_build() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--build-tests[Build both source and test targets]" "--product[Build the specified product]:Build the specified product: " "--target[Build the specified target]:Build the specified target: " @@ -125,13 +127,15 @@ _swift_run() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--skip-build[Skip building the executable product]" "--build-tests[Build both source and test targets]" "--repl[Launch Swift REPL for the package]" @@ -166,13 +170,15 @@ _swift_package() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" '(-): :->command' '(-)*:: :->arg' ) @@ -181,49 +187,61 @@ _swift_package() { (command) local modes modes=( - 'update:Update package dependencies' + 'completion-tool:Completion tool (for shell completions)' + 'dump-package:Print parsed Package.swift as JSON' 'describe:Describe the current package' - 'resolve:Resolve package dependencies' - 'tools-version:Manipulate tools version of the current package' - 'unedit:Remove a package from editable mode' + 'clean:Delete build artifacts' 'show-dependencies:Print the resolved dependency graph' + 'init:Initialize a new package' + 'unedit:Remove a package from editable mode' + 'tools-version:Manipulate tools version of the current package' 'fetch:' - 'dump-package:Print parsed Package.swift as JSON' + 'resolve:Resolve package dependencies' + 'reset:Reset the complete cache/build directory' + 'generate-xcodeproj:Generates an Xcode project' 'edit:Put a package in editable mode' 'config:Manipulate configuration of the package' - 'completion-tool:Completion tool (for shell completions)' - 'clean:Delete build artifacts' - 'generate-xcodeproj:Generates an Xcode project' - 'reset:Reset the complete cache/build directory' - 'init:Initialize a new package' + 'update:Update package dependencies' ) _describe "mode" modes ;; (arg) case ${words[1]} in - (update) - _swift_package_update + (completion-tool) + _swift_package_completion-tool + ;; + (dump-package) + _swift_package_dump-package ;; (describe) _swift_package_describe ;; - (resolve) - _swift_package_resolve + (clean) + _swift_package_clean ;; - (tools-version) - _swift_package_tools-version + (show-dependencies) + _swift_package_show-dependencies + ;; + (init) + _swift_package_init ;; (unedit) _swift_package_unedit ;; - (show-dependencies) - _swift_package_show-dependencies + (tools-version) + _swift_package_tools-version ;; (fetch) _swift_package_fetch ;; - (dump-package) - _swift_package_dump-package + (resolve) + _swift_package_resolve + ;; + (reset) + _swift_package_reset + ;; + (generate-xcodeproj) + _swift_package_generate-xcodeproj ;; (edit) _swift_package_edit @@ -231,27 +249,22 @@ _swift_package() { (config) _swift_package_config ;; - (completion-tool) - _swift_package_completion-tool - ;; - (clean) - _swift_package_clean - ;; - (generate-xcodeproj) - _swift_package_generate-xcodeproj - ;; - (reset) - _swift_package_reset - ;; - (init) - _swift_package_init + (update) + _swift_package_update ;; esac ;; esac } -_swift_package_update() { +_swift_package_completion-tool() { + arguments=( + ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" + ) + _arguments $arguments && return +} + +_swift_package_dump-package() { arguments=( ) _arguments $arguments && return @@ -264,20 +277,23 @@ _swift_package_describe() { _arguments $arguments && return } -_swift_package_resolve() { +_swift_package_clean() { arguments=( - ":The name of the package to resolve:_swift_dependency" - "--version[The version to resolve at]:The version to resolve at: " - "--branch[The branch to resolve at]:The branch to resolve at: " - "--revision[The revision to resolve at]:The revision to resolve at: " ) _arguments $arguments && return } -_swift_package_tools-version() { +_swift_package_show-dependencies() { arguments=( - "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " - "--set-current[Set tools version of package to the current tools version in use]" + "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" + ) + _arguments $arguments && return +} + +_swift_package_init() { + arguments=( + "--type[empty|library|executable|system-module|manifest]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" + "--name[Provide custom package name]:Provide custom package name: " ) _arguments $arguments && return } @@ -290,9 +306,10 @@ _swift_package_unedit() { _arguments $arguments && return } -_swift_package_show-dependencies() { +_swift_package_tools-version() { arguments=( - "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}" + "--set[Set tools version of package to the given value]:Set tools version of package to the given value: " + "--set-current[Set tools version of package to the current tools version in use]" ) _arguments $arguments && return } @@ -303,8 +320,30 @@ _swift_package_fetch() { _arguments $arguments && return } -_swift_package_dump-package() { +_swift_package_resolve() { arguments=( + ":The name of the package to resolve:_swift_dependency" + "--version[The version to resolve at]:The version to resolve at: " + "--branch[The branch to resolve at]:The branch to resolve at: " + "--revision[The revision to resolve at]:The revision to resolve at: " + ) + _arguments $arguments && return +} + +_swift_package_reset() { + arguments=( + ) + _arguments $arguments && return +} + +_swift_package_generate-xcodeproj() { + arguments=( + "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" + "--enable-code-coverage[Enable code coverage in the generated project]" + "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" + "--legacy-scheme-generator[Use the legacy scheme generator]" + "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" + "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]" ) _arguments $arguments && return } @@ -330,8 +369,8 @@ _swift_package_config() { local modes modes=( 'unset-mirror:Remove an existing mirror' - 'set-mirror:Set a mirror for a dependency' 'get-mirror:Print mirror configuration for the given package dependency' + 'set-mirror:Set a mirror for a dependency' ) _describe "mode" modes ;; @@ -340,12 +379,12 @@ _swift_package_config() { (unset-mirror) _swift_package_config_unset-mirror ;; - (set-mirror) - _swift_package_config_set-mirror - ;; (get-mirror) _swift_package_config_get-mirror ;; + (set-mirror) + _swift_package_config_set-mirror + ;; esac ;; esac @@ -359,14 +398,6 @@ _swift_package_config_unset-mirror() { _arguments $arguments && return } -_swift_package_config_set-mirror() { - arguments=( - "--package-url[The package dependency url]:The package dependency url: " - "--mirror-url[The mirror url]:The mirror url: " - ) - _arguments $arguments && return -} - _swift_package_config_get-mirror() { arguments=( "--package-url[The package dependency url]:The package dependency url: " @@ -374,41 +405,16 @@ _swift_package_config_get-mirror() { _arguments $arguments && return } -_swift_package_completion-tool() { - arguments=( - ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}" - ) - _arguments $arguments && return -} - -_swift_package_clean() { - arguments=( - ) - _arguments $arguments && return -} - -_swift_package_generate-xcodeproj() { - arguments=( - "--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files" - "--enable-code-coverage[Enable code coverage in the generated project]" - "--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files" - "--legacy-scheme-generator[Use the legacy scheme generator]" - "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]" - "--skip-extra-files[Do not add file references for extra files to the generated Xcode project]" - ) - _arguments $arguments && return -} - -_swift_package_reset() { +_swift_package_config_set-mirror() { arguments=( + "--package-url[The package dependency url]:The package dependency url: " + "--mirror-url[The mirror url]:The mirror url: " ) _arguments $arguments && return } -_swift_package_init() { +_swift_package_update() { arguments=( - "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}" - "--name[Provide custom package name]:Provide custom package name: " ) _arguments $arguments && return } @@ -440,13 +446,15 @@ _swift_test() { "(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]" "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]" "--static-swift-stdlib[Link Swift stdlib statically]" - "--enable-llbuild-library[Enable building with the llbuild library]" "--force-resolved-versions[]" "--disable-automatic-resolution[Disable automatic resolution if Package.resolved file is out-of-date]" "--enable-index-store[Enable indexing-while-building feature]" "--disable-index-store[Disable indexing-while-building feature]" "--enable-pubgrub-resolver[\[Experimental\] Enable the new Pubgrub dependency resolver]" "--enable-parseable-module-interfaces[]" + "--trace-resolver[]" + "(--jobs -j)"{--jobs,-j}"[The number of jobs to spawn in parallel during the build process]:The number of jobs to spawn in parallel during the build process: " + "--enable-test-discovery[Enable test discovery on platforms without Objective-C runtime]" "--skip-build[Skip building the test target]" "(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]" "--generate-linuxmain[Generate LinuxMain.swift entries for the package]" From eaa682c0a64daad3138e6f08e7b6c8825700049f Mon Sep 17 00:00:00 2001 From: Lukasz Chrzaszcz Date: Thu, 24 Oct 2019 17:42:33 +0200 Subject: [PATCH 073/488] Add profiles documentation --- plugins/profiles/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/profiles/README.md diff --git a/plugins/profiles/README.md b/plugins/profiles/README.md new file mode 100644 index 0000000000000..b590a370f49b2 --- /dev/null +++ b/plugins/profiles/README.md @@ -0,0 +1,21 @@ +# profiles plugin + +This plugin allows you to create separate configuration files for zsh based +on a domain of your host. + +It takes your `HOST` and looks for files named according to the domain parts +in `$ZSH_CUSTOM/profiles/` directory. + +For example, for `HOST=my.domain.com`, it will try to load the following files: + +```text +$ZSH_CUSTOM/profiles/my.domain.com +$ZSH_CUSTOM/profiles/domain.com +$ZSH_CUSTOM/profiles/com +``` + +To use it, add profiles to the plugins array of your zshrc file: + +```sh +plugins=(... profiles) +``` From 225425fe091ca052997833279ccc08643818c24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 24 Oct 2019 17:56:08 +0200 Subject: [PATCH 074/488] Fix target_list creation. Supports fabric 1 and 2 --- plugins/fabric/_fab | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 79d596ed6f2fe..89e73e58bfa60 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -4,13 +4,19 @@ local curcontext=$curcontext state line declare -A opt_args -declare target_list -IFS="$(printf '\n+')" target_list=($(fab -l | awk '{ - if(NR > 2) - printf "%s:%s\n", $1, substr($0, index($0, $2)) -}' 2>/dev/null)) +declare -a target_list +target_list=("${(@f)$(fab -l 2>/dev/null | awk '{ + if (NF == 0 || NR == 1) return + if (NF < 2) print $1 + else { + docstring=substr($0, index($0,$2)) + gsub(":", "\\:", docstring) + print $1":"docstring + } +}')}") -_targets() { +_fab_targets() { + [[ -n "$target_list" ]] || return _describe -t commands "fabric targets" target_list } @@ -31,7 +37,7 @@ _arguments -w -S -C \ '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \ '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \ '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \ - "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \ + "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_fab_targets" \ '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \ '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \ '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \ @@ -56,7 +62,7 @@ if [[ CURRENT -ge 1 ]]; then levels) _describe -t commands "output levels" output_levels;; *) - _targets;; + _fab_targets;; esac return From 4eab95f08a7bd9f5378568a3b7740dae803dcecc Mon Sep 17 00:00:00 2001 From: Anton Balaniuc Date: Fri, 25 Oct 2019 11:59:53 +0100 Subject: [PATCH 075/488] mvn: add autocompletion for openliberty (#8244) --- plugins/mvn/mvn.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 01aef814d5970..0866e55535283 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -267,6 +267,8 @@ function listMavenCompletions { stage:copy # toolchain toolchain:toolchain + #liberty + liberty:clean-server liberty:compile-jsp liberty:configure-arquillian liberty:create-server liberty:debug liberty:debug-server liberty:deploy liberty:dev liberty:display-url liberty:dump-server liberty:install-apps liberty:install-feature liberty:install-server liberty:java-dump-server liberty:package-server liberty:run liberty:run-server liberty:server-status liberty:start liberty:start-server liberty:status liberty:stop liberty:stop-server liberty:test-start-server liberty:test-stop-server liberty:undeploy liberty:uninstall-feature # options "-Dmaven.test.skip=true" -DskipTests -DskipITs -Dmaven.surefire.debug -DenableCiProfile "-Dpmd.skip=true" "-Dcheckstyle.skip=true" "-Dtycho.mode=maven" "-Dmaven.test.failure.ignore=true" "-DgroupId=" "-DartifactId=" "-Dversion=" "-Dpackaging=jar" "-Dfile=" From c1e5cbed5bbefbe09608581d0b47774652221780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 25 Oct 2019 13:14:36 +0200 Subject: [PATCH 076/488] Fix order and reword some things --- plugins/profiles/README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/plugins/profiles/README.md b/plugins/profiles/README.md index b590a370f49b2..5aa1918e26a35 100644 --- a/plugins/profiles/README.md +++ b/plugins/profiles/README.md @@ -1,21 +1,25 @@ # profiles plugin This plugin allows you to create separate configuration files for zsh based -on a domain of your host. +on your long hostname (including the domain). -It takes your `HOST` and looks for files named according to the domain parts -in `$ZSH_CUSTOM/profiles/` directory. +To use it, add profiles to the plugins array of your zshrc file: -For example, for `HOST=my.domain.com`, it will try to load the following files: +```sh +plugins=(... profiles) +``` + +It takes your `$HOST` variable and looks for files named according to the +domain parts in `$ZSH_CUSTOM/profiles/` directory. + +For example, for `HOST=host.domain.com`, it will try to load the following files, +in this order: ```text -$ZSH_CUSTOM/profiles/my.domain.com -$ZSH_CUSTOM/profiles/domain.com $ZSH_CUSTOM/profiles/com +$ZSH_CUSTOM/profiles/domain.com +$ZSH_CUSTOM/profiles/host.domain.com ``` -To use it, add profiles to the plugins array of your zshrc file: - -```sh -plugins=(... profiles) -``` +This means that if there are conflicting settings on those files, the one to take +precedence will be the last applied, i.e. the one in host.domain.com. From 36092aac0c3e1979caf4afb9fa9bd2115f404fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chrz=C4=85szcz?= Date: Fri, 25 Oct 2019 13:14:53 +0200 Subject: [PATCH 077/488] powder: add README (#8310) --- plugins/powder/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 plugins/powder/README.md diff --git a/plugins/powder/README.md b/plugins/powder/README.md new file mode 100644 index 0000000000000..a83b1f2d32db7 --- /dev/null +++ b/plugins/powder/README.md @@ -0,0 +1,8 @@ +# Powder + +This plugin provides completion for [powder](https://github.com/powder-rb/powder/). + +To use it, add powder to the plugins array of your zshrc file: +``` +plugins=(... powder) +``` From 9785d24172a8cc558e90dd266e37ef5ffa29aa80 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 25 Oct 2019 11:24:35 +0000 Subject: [PATCH 078/488] python: fix and extend pyclean (#7762) Deleting `.mypy_cache` did not work, because the directories were not empty. They contain JSON files instead of compiled byte-code. This extends the cleanup by also getting rid of `.pytest_cache` directories. --- plugins/python/python.plugin.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 950b0e01aea4b..f39cd80b7a86e 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -1,13 +1,14 @@ # Find python file alias pyfind='find . -name "*.py"' -# Remove python compiled byte-code and mypy cache in either current directory or in a -# list of specified directories +# Remove python compiled byte-code and mypy/pytest cache in either the current +# directory or in a list of specified directories (including sub directories). function pyclean() { ZSH_PYCLEAN_PLACES=${*:-'.'} find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete - find ${ZSH_PYCLEAN_PLACES} -type d -name ".mypy_cache" -delete + find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".mypy_cache" -exec rm -r "{}" + + find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".pytest_cache" -exec rm -r "{}" + } # Grep among .py files From e363109a6d3367d8be1dd66f05a38eb38b4257d7 Mon Sep 17 00:00:00 2001 From: Vice Versa <0x7c48@gmail.com> Date: Sun, 27 Oct 2019 18:36:00 +0200 Subject: [PATCH 079/488] alias-finder: fix wc numeric conditional (#8251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Never use `[[` for numeric comparisons, for that, we’ll use `((`. --- plugins/alias-finder/alias-finder.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 2bfaad597e26e..6b8fa66ce4290 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -14,7 +14,7 @@ alias-finder() { esac done cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep - if [[ $(wc -l <<< $cmd) == 1 ]]; then + if (( $(wc -l <<< $cmd) == 1 )); then while [[ $cmd != "" ]]; do if [[ $longer = true ]]; then wordStart="'{0,1}" From 687c50bdf999f8efd45f3c8f578a62329b0633da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 30 Oct 2019 23:12:45 +0100 Subject: [PATCH 080/488] fabric: fix awk "return not in function" error in completion Fixes #8337 --- plugins/fabric/_fab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 89e73e58bfa60..9102dadeff9bd 100644 --- a/plugins/fabric/_fab +++ b/plugins/fabric/_fab @@ -6,7 +6,7 @@ declare -A opt_args declare -a target_list target_list=("${(@f)$(fab -l 2>/dev/null | awk '{ - if (NF == 0 || NR == 1) return + if (NF == 0 || NR == 1) next if (NF < 2) print $1 else { docstring=substr($0, index($0,$2)) From 0ec59e25c7f6ac11d0988082fef908ff753126a2 Mon Sep 17 00:00:00 2001 From: Sudhin MN <34642968+sudhinm@users.noreply.github.com> Date: Tue, 5 Nov 2019 17:57:19 +0530 Subject: [PATCH 081/488] fasd: add README (#8334) --- plugins/fasd/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/fasd/README.md diff --git a/plugins/fasd/README.md b/plugins/fasd/README.md new file mode 100644 index 0000000000000..1641a92d0e36d --- /dev/null +++ b/plugins/fasd/README.md @@ -0,0 +1,21 @@ +# fasd + +[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. + +To use it, add `fasd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +## Installation + +Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install) + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. | +| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. | +| j | `fasd_cd -d -i` | cd with interactive selection | \ No newline at end of file From 7cc3a32bff9b283bf5eea139b92cbfddf3b75de5 Mon Sep 17 00:00:00 2001 From: Wang Guan Date: Thu, 31 Oct 2013 05:46:27 +0900 Subject: [PATCH 082/488] Add an option about git submodules to ignore $GIT_STATUS_IGNORE_SUBMODULES can be used to specify handling of submodules. It can be: not set : ignore dirty submodules (this was default zsh behavior) "git" : do not use "--ignore-submodules" and let git choose, this obeys setting in .gitmodules other : comes into "--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES" --- lib/git.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 640561e97563e..e8ef0d78d4c5e 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -17,6 +17,19 @@ function parse_git_dirty() { if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then FLAGS+='--untracked-files=no' fi + case "$GIT_STATUS_IGNORE_SUBMODULES" in + "") + # if unset: ignore dirty submodules + FLAGS+="--ignore-submodules=dirty" + ;; + "git") + # let git decide (this respects per-repo config in .gitmodules) + ;; + *) + # other values are passed to --ignore-submodules + FLAGS+="--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES" + ;; + esac STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1) fi if [[ -n $STATUS ]]; then From b7e37cea90b2bc718c66f90c0f9d52d1aa49ca79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 6 Nov 2019 19:41:13 +0100 Subject: [PATCH 083/488] Clean up ignore submodules logic in parse_git_dirty --- lib/git.zsh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index e8ef0d78d4c5e..7affdec68c367 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -18,16 +18,13 @@ function parse_git_dirty() { FLAGS+='--untracked-files=no' fi case "$GIT_STATUS_IGNORE_SUBMODULES" in - "") - # if unset: ignore dirty submodules - FLAGS+="--ignore-submodules=dirty" - ;; - "git") + git) # let git decide (this respects per-repo config in .gitmodules) ;; *) + # if unset: ignore dirty submodules # other values are passed to --ignore-submodules - FLAGS+="--ignore-submodules=$GIT_STATUS_IGNORE_SUBMODULES" + FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}" ;; esac STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1) From 1546e1226a7b739776bda43f264b221739ba0397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 6 Nov 2019 19:46:52 +0100 Subject: [PATCH 084/488] Fix badly resolved rebase conflict --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 7affdec68c367..2054fe272843f 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -12,7 +12,7 @@ function git_prompt_info() { function parse_git_dirty() { local STATUS local -a FLAGS - FLAGS=('--porcelain' '--ignore-submodules=dirty') + FLAGS=('--porcelain') if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then FLAGS+='--untracked-files=no' From fc99e6db3e917a0556afe56273c901220c8105a9 Mon Sep 17 00:00:00 2001 From: Eric Dobbs Date: Wed, 6 Nov 2019 12:25:36 -0700 Subject: [PATCH 085/488] emacs: support BSD mktemp in emacsclient.sh (#8351) Piping stdin to emacs alias on MacOS was breaking (--tmpdir is not supported in BSD flavored mktemp). Tested in MacOS 10.14 and debian:buster to confirm it still works in linux. --- plugins/emacs/emacsclient.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 26b28d495b6a6..0aa8d6f408964 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -20,7 +20,8 @@ _emacsfun() # tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh) if [ "$#" -ge "2" -a "$2" = "-" ] then - tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)" + tempfile="$(mktemp --tmpdir emacs-stdin-$USER.XXXXXXX 2>/dev/null \ + || mktemp -t emacs-stdin-$USER)" # support BSD mktemp cat - > "$tempfile" _emacsfun --no-wait $tempfile else From 107e512c9e62b140d8591c578527c901b1db9d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 6 Nov 2019 21:22:15 +0100 Subject: [PATCH 086/488] Remove line below copyright so that GitHub shows LICENSE details --- LICENSE.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4d465b1c31fc0..eb9978a7a5238 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,7 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2009-2019 Robby Russell and contributors -See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors +Copyright (c) 2009-2019 Robby Russell and contributors (https://github.com/robbyrussell/oh-my-zsh/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ef96a38fa599c983823f0e1ef530de847ee76da0 Mon Sep 17 00:00:00 2001 From: Isaac Clayton Date: Fri, 8 Nov 2019 22:42:02 +0800 Subject: [PATCH 087/488] Upgrade some URLs to HTTPS (#8202) * Update http to https in Solarized * Upgrade http to https for 'Burger In Your Shell' * Upgrade http to https for tmux.github.io --- plugins/emoji-clock/emoji-clock.plugin.zsh | 2 +- plugins/tmux/README.md | 2 +- themes/sunrise.zsh-theme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/emoji-clock/emoji-clock.plugin.zsh b/plugins/emoji-clock/emoji-clock.plugin.zsh index 0a55528f0d37e..bdd606f89fe27 100644 --- a/plugins/emoji-clock/emoji-clock.plugin.zsh +++ b/plugins/emoji-clock/emoji-clock.plugin.zsh @@ -2,7 +2,7 @@ # FILE: emoji-clock.plugin.zsh # DESCRIPTION: The current time with half hour accuracy as an emoji symbol. # Inspired by Andre Torrez' "Put A Burger In Your Shell" -# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html +# https://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html # AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) # VERSION: 1.0.0 # ----------------------------------------------------------------------------- diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 427119d3db070..e887ceebb277e 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -1,6 +1,6 @@ # tmux -This plugin provides aliases for [tmux](http://tmux.github.io/), the terminal multiplexer. +This plugin provides aliases for [tmux](https://tmux.github.io/), the terminal multiplexer. To use it add `tmux` to the plugins array in your zshrc file. ```zsh diff --git a/themes/sunrise.zsh-theme b/themes/sunrise.zsh-theme index e3f4019d6afd8..2111576c3bfb3 100644 --- a/themes/sunrise.zsh-theme +++ b/themes/sunrise.zsh-theme @@ -1,5 +1,5 @@ # Sunrise theme for oh-my-zsh -# Intended to be used with Solarized: http://ethanschoonover.com/solarized +# Intended to be used with Solarized: https://ethanschoonover.com/solarized # Color shortcuts R=$fg_no_bold[red] From 86b39cfa0a42cd0962be2b8072e73229280c362b Mon Sep 17 00:00:00 2001 From: StelFux <22601105+StelFux@users.noreply.github.com> Date: Fri, 8 Nov 2019 21:44:44 +0100 Subject: [PATCH 088/488] tmux: allow to define a custom configuration path (#7606) --- plugins/tmux/README.md | 1 + plugins/tmux/tmux.extra.conf | 2 +- plugins/tmux/tmux.plugin.zsh | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index e887ceebb277e..1e25af38fca52 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -37,3 +37,4 @@ The plugin also supports the following - | `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) | | `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) | | `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` | +| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) | \ No newline at end of file diff --git a/plugins/tmux/tmux.extra.conf b/plugins/tmux/tmux.extra.conf index beffd380c4307..3420d19d4324c 100644 --- a/plugins/tmux/tmux.extra.conf +++ b/plugins/tmux/tmux.extra.conf @@ -1,2 +1,2 @@ set -g default-terminal $ZSH_TMUX_TERM -source $HOME/.tmux.conf +source $ZSH_TMUX_CONFIG \ No newline at end of file diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 2f3c3e79dcfec..d7b29969073c7 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -34,6 +34,8 @@ alias tkss='tmux kill-session -t' # Tmux states this should be screen-256color, but you may need to change it on # systems without the proper terminfo : ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color} +# Set the configuration path +: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf} # Determine if the terminal supports 256 colors if [[ $terminfo[colors] == 256 ]]; then @@ -43,7 +45,7 @@ else fi # Set the correct local config file to use. -if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$HOME/.tmux.conf" ]]; then +if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$ZSH_TMUX_CONFIG" ]]; then export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.extra.conf" else export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.only.conf" @@ -65,8 +67,9 @@ function _zsh_tmux_plugin_run() { # If failed, just run tmux, fixing the TERM variable if requested. if [[ $? -ne 0 ]]; then - [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") - $tmux_cmd new-session + [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") || \ + [[ -e "$ZSH_TMUX_CONFIG" ]] && tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") + $tmux_cmd new-session fi if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then From 24726678dd39ab69f5a14a789775fe53ccfd7c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 9 Nov 2019 12:37:41 +0100 Subject: [PATCH 089/488] extract: keep *.gz files with pigz and gunzip Fixes #8368 --- plugins/extract/extract.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 5e9b9ff2424cf..d3d847daf1f90 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -41,7 +41,7 @@ extract() { && tar --lzma -xvf "$1" \ || lzcat "$1" | tar xvf - ;; (*.tar) tar xvf "$1" ;; - (*.gz) (( $+commands[pigz] )) && pigz -d "$1" || gunzip "$1" ;; + (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; From 8b6b2ea07e7e18129757195731a3df5d57465807 Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Sat, 9 Nov 2019 12:49:17 +0100 Subject: [PATCH 090/488] upgrade: remove double whitespace in message (#7517) --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 0dd855b70884a..f64a0096e82b4 100644 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -43,7 +43,7 @@ then printf '%s\n' ' /____/ ' printf "${BLUE}%s\n" "Hooray! Oh My Zsh has been updated and/or is at the current version." printf "${BLUE}${BOLD}%s${NORMAL}\n" "To keep up on the latest news and updates, follow us on twitter: https://twitter.com/ohmyzsh" - printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh" + printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/collections/oh-my-zsh" else printf "${RED}%s${NORMAL}\n" 'There was an error updating. Try again later?' fi From 24d83d1e8c84689d6fe0953f6fa6743d983fa07a Mon Sep 17 00:00:00 2001 From: Yuan-Hao Chen Date: Thu, 14 Nov 2019 20:34:02 +0800 Subject: [PATCH 091/488] tmux: fix bad tmux config syntax and logical expression error in 86b39cf (#8374) --- plugins/tmux/tmux.extra.conf | 2 +- plugins/tmux/tmux.plugin.zsh | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/tmux/tmux.extra.conf b/plugins/tmux/tmux.extra.conf index 3420d19d4324c..c4aaad0b0ad25 100644 --- a/plugins/tmux/tmux.extra.conf +++ b/plugins/tmux/tmux.extra.conf @@ -1,2 +1,2 @@ set -g default-terminal $ZSH_TMUX_TERM -source $ZSH_TMUX_CONFIG \ No newline at end of file +source-file $ZSH_TMUX_CONFIG \ No newline at end of file diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index d7b29969073c7..5b5d1b1ba342f 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -67,9 +67,12 @@ function _zsh_tmux_plugin_run() { # If failed, just run tmux, fixing the TERM variable if requested. if [[ $? -ne 0 ]]; then - [[ "$ZSH_TMUX_FIXTERM" == "true" ]] && tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") || \ - [[ -e "$ZSH_TMUX_CONFIG" ]] && tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") - $tmux_cmd new-session + if [[ "$ZSH_TMUX_FIXTERM" == "true" ]]; then + tmux_cmd+=(-f "$_ZSH_TMUX_FIXED_CONFIG") + elif [[ -e "$ZSH_TMUX_CONFIG" ]]; then + tmux_cmd+=(-f "$ZSH_TMUX_CONFIG") + fi + $tmux_cmd new-session fi if [[ "$ZSH_TMUX_AUTOQUIT" == "true" ]]; then From e453731fc93419cb71661dd1f277965e3d07ff0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20H=C3=89JA?= Date: Thu, 14 Nov 2019 18:32:21 +0100 Subject: [PATCH 092/488] osx: fix exit on unknown command in spotify function (#8375) --- plugins/osx/spotify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/osx/spotify b/plugins/osx/spotify index 39f8e043719de..78d6c7d0fce6b 100644 --- a/plugins/osx/spotify +++ b/plugins/osx/spotify @@ -470,7 +470,7 @@ while [ $# -gt 0 ]; do break ;; * ) showHelp; - exit 1; + break; esac done From 0ad988c598cf9ceda392815ea0c823a76720d17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Diovani=20Gon=C3=A7alves?= Date: Fri, 15 Nov 2019 12:47:11 -0300 Subject: [PATCH 093/488] tmux: export ZSH_TMUX_CONFIG again to provide to tmux (#8390) --- plugins/tmux/tmux.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 5b5d1b1ba342f..dad3db57838ae 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -46,6 +46,7 @@ fi # Set the correct local config file to use. if [[ "$ZSH_TMUX_ITERM2" == "false" && -e "$ZSH_TMUX_CONFIG" ]]; then + export ZSH_TMUX_CONFIG export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.extra.conf" else export _ZSH_TMUX_FIXED_CONFIG="${0:h:a}/tmux.only.conf" From 66e2284a08f86e5dcf661e3cf220483e1fb1f530 Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Fri, 15 Nov 2019 14:11:50 -0500 Subject: [PATCH 094/488] Add support for chroma --- plugins/colorize/colorize.plugin.zsh | 47 ++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index 565ba5a36e452..051d2269ce73e 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -3,21 +3,46 @@ alias ccat='colorize_via_pygmentize' alias cless='colorize_via_pygmentize_less' colorize_via_pygmentize() { - if ! (( $+commands[pygmentize] )); then - echo "package 'Pygments' is not installed!" + + if [[ $ZSH_COLORIZE_TOOL != "chroma" && $ZSH_COLORIZE_TOOL != "pygmentize" ]]; then + echo "ZSH_COLORIZE_TOOL not recognized. Options are 'pygmentize' or 'chroma'" return 1 fi - # If the environment varianle ZSH_COLORIZE_STYLE + if [ -z $ZSH_COLORIZE_TOOL ]; then + if (( $+commands[pygmentize] )); then + ZSH_COLORIZE_TOOL="pygmentize" + elif (( $+commands[chroma] )); then + ZSH_COLORIZE_TOOL="chroma" + else + echo "niether 'Pygments' nor 'chroma' is not installed!" + return 1 + fi + fi + + echo "Tool: $ZSH_COLORIZE_TOOL" + + # If the environment variable ZSH_COLORIZE_STYLE # is set, use that theme instead. Otherwise, # use the default. if [ -z $ZSH_COLORIZE_STYLE ]; then - ZSH_COLORIZE_STYLE="default" + if [[ $ZSH_COLORIZE_TOOL == "pygmentize" ]]; then + ZSH_COLORIZE_STYLE="default" + else + # Choosing 'emacs' to match pygmentize's default as per: + # https://github.com/pygments/pygments/blob/master/pygments/styles/default.py#L19 + ZSH_COLORIZE_STYLE="emacs" + fi fi + echo "color style: $ZSH_COLORIZE_STYLE" # pygmentize stdin if no arguments passed if [ $# -eq 0 ]; then - pygmentize -O style="$ZSH_COLORIZE_STYLE" -g + if [[ $ZSH_COLORIZE_TOOL == "pygmentize" ]]; then + pygmentize -O style="$ZSH_COLORIZE_STYLE" -g + else + chroma --style="$ZSH_COLORIZE_STYLE" + fi return $? fi @@ -27,11 +52,15 @@ colorize_via_pygmentize() { local FNAME lexer for FNAME in "$@" do - lexer=$(pygmentize -N "$FNAME") - if [[ $lexer != text ]]; then - pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME" + if [[ $ZSH_COLORIZE_TOOL == "pygmentize" ]]; then + lexer=$(pygmentize -N "$FNAME") + if [[ $lexer != text ]]; then + pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME" + else + pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME" + fi else - pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME" + chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME" fi done } From 8aa070db0e1f8a5752f0e45834b7093b9b72860f Mon Sep 17 00:00:00 2001 From: "Aaron N. Brock" Date: Fri, 15 Nov 2019 15:34:24 -0500 Subject: [PATCH 095/488] Update README.md --- plugins/colorize/README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md index d1f878e6219cb..b6e27fd273fcb 100644 --- a/plugins/colorize/README.md +++ b/plugins/colorize/README.md @@ -10,12 +10,23 @@ To use it, add colorize to the plugins array of your zshrc file: ``` plugins=(... colorize) ``` +## Configuration -## Styles +### Colorize tool + +Colorize supports using either the `pygmentize` tool or the `chroma` tool. By default colorize uses `pygmentize` unless it's not installed & `chroma` is installed. However, you can override this with the `ZSH_COLORIZE_TOOL` environment variable: + +``` +ZSH_COLORIZE_TOOL=chroma +``` + +### Styles Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable: -`ZSH_COLORIZE_STYLE="colorful"` +``` +ZSH_COLORIZE_STYLE="colorful" +``` ## Usage @@ -32,4 +43,6 @@ In the latter form, the file contents will be concatenated and presented by less ## Requirements -You have to install Pygments first: [pygments.org](http://pygments.org/download/) +You have to either install Pygments: [pygments.org](http://pygments.org/download/) + +Or install chroma: [https://github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) \ No newline at end of file From 451fb257032a37a7d9cae4631c03f65fd3aa7f1c Mon Sep 17 00:00:00 2001 From: James Jensen Date: Sat, 16 Nov 2019 05:59:20 +0800 Subject: [PATCH 096/488] osx: modify itunes function to support Apple Music (#8372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change `itunes` to `music`, as iTunes was renamed to Music in _**macOS** Catalina 10.15_ Co-authored-by: Marc Cornellà --- plugins/osx/README.md | 35 +++++++++++++++-------------- plugins/osx/osx.plugin.zsh | 46 ++++++++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/plugins/osx/README.md b/plugins/osx/README.md index 4595ee3195e92..f3881ec6bef68 100644 --- a/plugins/osx/README.md +++ b/plugins/osx/README.md @@ -42,20 +42,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Commands -| Command | Description | -| :-------------- | :-------------------------------------------------- | -| `tab` | Open the current directory in a new tab | -| `split_tab` | Split the current terminal tab horizontally | -| `vsplit_tab` | Split the current terminal tab vertically | -| `ofd` | Open the current directory in a Finder window | -| `pfd` | Return the path of the frontmost Finder window | -| `pfs` | Return the current Finder selection | -| `cdf` | `cd` to the current Finder directory | -| `pushdf` | `pushd` to the current Finder directory | -| `quick-look` | Quick-Look a specified file | -| `man-preview` | Open a specified man page in Preview app | -| `showfiles` | Show hidden files | -| `hidefiles` | Hide the hidden files | -| `itunes` | Control iTunes. Use `itunes -h` for usage details | -| `spotify` | Control Spotify and search by artist, album, track… | -| `rmdsstore` | Remove .DS\_Store files recursively in a directory | +| Command | Description | +| :-------------- | :---------------------------------------------------- | +| `tab` | Open the current directory in a new tab | +| `split_tab` | Split the current terminal tab horizontally | +| `vsplit_tab` | Split the current terminal tab vertically | +| `ofd` | Open the current directory in a Finder window | +| `pfd` | Return the path of the frontmost Finder window | +| `pfs` | Return the current Finder selection | +| `cdf` | `cd` to the current Finder directory | +| `pushdf` | `pushd` to the current Finder directory | +| `quick-look` | Quick-Look a specified file | +| `man-preview` | Open a specified man page in Preview app | +| `showfiles` | Show hidden files | +| `hidefiles` | Hide the hidden files | +| `itunes` | DEPRECATED. Use `music` from macOS Catalina on | +| `music` | Control Apple Music. Use `music -h` for usage details | +| `spotify` | Control Spotify and search by artist, album, track… | +| `rmdsstore` | Remove .DS\_Store files recursively in a directory | diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index eb3c4fb7a185b..03e9c1c8c3a8b 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -219,7 +219,19 @@ function vncviewer() { } # iTunes control function -function itunes() { +function itunes music() { + local APP_NAME=Music + + autoload is-at-least + if is-at-least 10.15 $(sw_vers -productVersion); then + if [[ $0 = itunes ]]; then + echo >&2 The itunes function name is deprecated. Use \`music\' instead. + return 1 + fi + else + APP_NAME=iTunes + fi + local opt=$1 local playlist=$2 shift @@ -236,7 +248,7 @@ function itunes() { opt="$opt track" ;; vol) - local new_volume volume=$(osascript -e 'tell application "iTunes" to get sound volume') + local new_volume volume=$(osascript -e "tell application \"$APP_NAME\" to get sound volume") if [[ $# -eq 0 ]]; then echo "Current volume is ${volume}." return 0 @@ -251,26 +263,26 @@ function itunes() { opt="set sound volume to ${new_volume}" ;; playlist) - # Inspired by: https://gist.github.com/nakajijapan/ac8b45371064ae98ea7f -if [[ ! -z "$playlist" ]]; then - osascript -e 'tell application "iTunes"' -e "set new_playlist to \"$playlist\" as string" -e "play playlist new_playlist" -e "end tell" 2>/dev/null; + # Inspired by: https://gist.github.com/nakajijapan/ac8b45371064ae98ea7f + if [[ ! -z "$playlist" ]]; then + osascript -e "tell application \"$APP_NAME\"" -e "set new_playlist to \"$playlist\" as string" -e "play playlist new_playlist" -e "end tell" 2>/dev/null; if [[ $? -eq 0 ]]; then opt="play" else opt="stop" fi - else - opt="set allPlaylists to (get name of every playlist)" - fi - ;; + else + opt="set allPlaylists to (get name of every playlist)" + fi + ;; playing|status) - local state=`osascript -e 'tell application "iTunes" to player state as string'` + local state=`osascript -e "tell application \"$APP_NAME\" to player state as string"` if [[ "$state" = "playing" ]]; then - currenttrack=`osascript -e 'tell application "iTunes" to name of current track as string'` - currentartist=`osascript -e 'tell application "iTunes" to artist of current track as string'` + currenttrack=`osascript -e "tell application \"$APP_NAME\" to name of current track as string"` + currentartist=`osascript -e "tell application \"$APP_NAME\" to artist of current track as string"` echo -E "Listening to $fg[yellow]$currenttrack$reset_color by $fg[yellow]$currentartist$reset_color"; else - echo "iTunes is" $state; + echo "$APP_NAME is" $state; fi return 0 ;; @@ -284,7 +296,7 @@ if [[ ! -z "$playlist" ]]; then if [[ -n "$state" && ! "$state" =~ "^(on|off|toggle)$" ]] then - print "Usage: itunes shuffle [on|off|toggle]. Invalid option." + print "Usage: $0 shuffle [on|off|toggle]. Invalid option." return 1 fi @@ -305,14 +317,14 @@ EOF esac ;; ""|-h|--help) - echo "Usage: itunes