From c840594c6ffdcecc241c9ccb130daeb630831ef7 Mon Sep 17 00:00:00 2001
From: Robert McLeod
Date: Fri, 10 Apr 2015 15:07:29 +1200
Subject: [PATCH 001/343] 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 000000000..a238d9ffe
--- /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/343] 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 a238d9ffe..a4e9b06c2 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/343] 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 9628e1224..79d596ed6 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/343] 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 8eede9a94..d52e95c49 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/343] 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 aa14f3f07..a74ad9922 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/343] 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 a74ad9922..59a1efb02 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/343] 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 2c93d1bb5..15ad6d916 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/343] 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 15ad6d916..512a5a248 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/343] 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 512a5a248..17d8d1aaf 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/343] 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 17d8d1aaf..671d33d8e 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/343] 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 671d33d8e..5001f4695 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/343] 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 5001f4695..333f58dd8 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 eaa682c0a64daad3138e6f08e7b6c8825700049f Mon Sep 17 00:00:00 2001
From: Lukasz Chrzaszcz
Date: Thu, 24 Oct 2019 17:42:33 +0200
Subject: [PATCH 013/343] 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 000000000..b590a370f
--- /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 014/343] 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 79d596ed6..89e73e58b 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 015/343] 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 01aef814d..0866e5553 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 016/343] Fix order and reword some things
---
plugins/profiles/README.md | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/plugins/profiles/README.md b/plugins/profiles/README.md
index b590a370f..5aa1918e2 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.
-
-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
-```
+on your long hostname (including the domain).
To use it, add profiles to the plugins array of your zshrc file:
```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/com
+$ZSH_CUSTOM/profiles/domain.com
+$ZSH_CUSTOM/profiles/host.domain.com
+```
+
+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 017/343] 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 000000000..a83b1f2d3
--- /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 018/343] 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 950b0e01a..f39cd80b7 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 019/343] 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 2bfaad597..6b8fa66ce 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 020/343] 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 89e73e58b..9102dadef 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 021/343] 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 000000000..1641a92d0
--- /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 022/343] 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 640561e97..e8ef0d78d 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 023/343] 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 e8ef0d78d..7affdec68 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 024/343] 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 7affdec68..2054fe272 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 025/343] 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 26b28d495..0aa8d6f40 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 026/343] 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 4d465b1c3..eb9978a7a 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 027/343] 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 0a55528f0..bdd606f89 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 427119d3d..e887ceebb 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 e3f4019d6..2111576c3 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 028/343] 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 e887ceebb..1e25af38f 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 beffd380c..3420d19d4 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 2f3c3e79d..d7b299690 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 029/343] 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 5e9b9ff24..d3d847daf 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 030/343] 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 0dd855b70..f64a0096e 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 031/343] 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 3420d19d4..c4aaad0b0 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 d7b299690..5b5d1b1ba 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 032/343] 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 39f8e0437..78d6c7d0f 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 033/343] 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 5b5d1b1ba..dad3db578 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 034/343] 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 565ba5a36..051d2269c 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 035/343] 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 d1f878e62..b6e27fd27 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 036/343] 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 4595ee319..f3881ec6b 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 eb3c4fb7a..03e9c1c8c 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
+[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
+
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
Sounds boring. Let's try again.
From 4888d4ad1aefc9fa73d3b62500facaa1d97f31d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 18 Nov 2019 00:07:06 +0100
Subject: [PATCH 042/343] Add Twitter follow badge to README
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 713af1e86..2a5ec178a 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,7 @@
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
+[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
From 26df8a22741ea4bb5264233344e42ce900fd26b6 Mon Sep 17 00:00:00 2001
From: Syphdias
Date: Mon, 18 Nov 2019 20:14:07 +0100
Subject: [PATCH 043/343] git-auto-fetch: stop plugin from asking for ssh-key
passphrase (#8399)
---
plugins/git-auto-fetch/git-auto-fetch.plugin.zsh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
index 56ab86dbe..5c42c21a7 100644
--- a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
+++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
@@ -1,16 +1,17 @@
GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60}
function git-fetch-all {
- (`git rev-parse --is-inside-work-tree 2>/dev/null` &&
- dir=`git rev-parse --git-dir` &&
+ (`command git rev-parse --is-inside-work-tree 2>/dev/null` &&
+ dir=`command git rev-parse --git-dir` &&
[[ ! -f $dir/NO_AUTO_FETCH ]] &&
(( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) &&
- git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
+ GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
+ command git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
}
function git-auto-fetch {
- `git rev-parse --is-inside-work-tree 2>/dev/null` || return
- guard="`git rev-parse --git-dir`/NO_AUTO_FETCH"
+ `command git rev-parse --is-inside-work-tree 2>/dev/null` || return
+ guard="`command git rev-parse --git-dir`/NO_AUTO_FETCH"
(rm $guard 2>/dev/null &&
echo "${fg_bold[green]}enabled${reset_color}") ||
From 68c4c06283739cc0c7f619172b35544e88921308 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Richard=20P=C3=B6ttler?=
Date: Tue, 19 Nov 2019 17:00:53 +0100
Subject: [PATCH 044/343] extract: add RPM archive support (#8347)
Also more quiet extraction. -D for cpio was not used due to additional
output.
---
plugins/extract/README.md | 1 +
plugins/extract/_extract | 2 +-
plugins/extract/extract.plugin.zsh | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index 83b878c32..41b6a61f1 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -27,6 +27,7 @@ plugins=(... extract)
| `jar` | Java Archive |
| `lzma` | LZMA archive |
| `rar` | WinRAR archive |
+| `rpm` | RPM package |
| `sublime-package` | Sublime Text package |
| `tar` | Tarball |
| `tar.bz2` | Tarball with bzip2 compression |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 33d49fcc5..0257ce231 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index d3d847daf..27b9e50f1 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -48,6 +48,7 @@ extract() {
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
+ (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;;
(*.deb)
mkdir -p "$extract_dir/control"
From d4f32e9f3a6471ce689aa8fb5a9f04e8565bcff6 Mon Sep 17 00:00:00 2001
From: Taico Aerts
Date: Tue, 19 Nov 2019 17:03:37 +0100
Subject: [PATCH 045/343] rails: fix rendering issue in README (#8410)
---
plugins/rails/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/rails/README.md b/plugins/rails/README.md
index 5549ba18b..ad83fffe8 100644
--- a/plugins/rails/README.md
+++ b/plugins/rails/README.md
@@ -18,7 +18,7 @@ plugins=(... rails)
| `rcs` | `rails console --sandbox` | Test code in a sandbox, without changing any data |
| `rd` | `rails destroy` | Undo a generate operation |
| `rdb` | `rails dbconsole` | Interact with your db from the console |
-| `rgen` | `rails generate` | Generate boilerplate code |
+| `rgen`| `rails generate` | Generate boilerplate code |
| `rgm` | `rails generate migration` | Generate a db migration |
| `rp` | `rails plugin` | Run a Rails plugin command |
| `ru` | `rails runner` | Run Ruby code in the context of Rails |
@@ -44,7 +44,7 @@ plugins=(... rails)
| `rlc` | `rake log:clear` | Clear Rails logs |
| `rn` | `rake notes` | Search for notes (`FIXME`, `TODO`) in code comments |
| `rr` | `rake routes` | List all defined routes |
-| `rrg` | `rake routes | grep` | List and filter the defined routes |
+| `rrg` | `rake routes \| grep` | List and filter the defined routes |
| `rt` | `rake test` | Run Rails tests |
| `rmd` | `rake middleware` | Interact with Rails middlewares |
| `rsts` | `rake stats` | Print code statistics |
From 1ba0af650ac575a7d35b10146d2e7a7b3b2e2ae6 Mon Sep 17 00:00:00 2001
From: Jacob Tomaw
Date: Tue, 19 Nov 2019 12:47:12 -0500
Subject: [PATCH 046/343] Use safer append to hook function arrays (#8406)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Use add-zsh-hook to add functions to hooks. That way they won't be added again
when doing `source ~/.zshrc` multiple times.
Co-authored-by: Marc Cornellà
---
.gitignore | 1 +
lib/termsupport.zsh | 7 ++++---
plugins/alias-finder/alias-finder.plugin.zsh | 5 +++--
plugins/dirhistory/dirhistory.plugin.zsh | 3 ++-
plugins/dirpersist/dirpersist.plugin.zsh | 3 ++-
plugins/git-prompt/git-prompt.plugin.zsh | 7 ++++---
plugins/last-working-dir/last-working-dir.plugin.zsh | 3 ++-
plugins/pipenv/pipenv.plugin.zsh | 3 ++-
plugins/timer/timer.plugin.zsh | 5 +++--
plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 5 ++---
themes/pygmalion-virtualenv.zsh-theme | 5 ++---
themes/pygmalion.zsh-theme | 5 ++---
12 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/.gitignore b/.gitignore
index 87a79cdae..251c9dc9f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ custom/
# temp files directories
cache/
log/
+*.swp
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index aa14f3f07..f5e367fcb 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -75,8 +75,9 @@ function omz_termsupport_preexec {
title '$CMD' '%100>...>$LINE%<<'
}
-precmd_functions+=(omz_termsupport_precmd)
-preexec_functions+=(omz_termsupport_preexec)
+autoload -U add-zsh-hook
+add-zsh-hook precmd omz_termsupport_precmd
+add-zsh-hook preexec omz_termsupport_preexec
# Keep Apple Terminal.app's current working directory updated
@@ -99,7 +100,7 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
- precmd_functions+=(update_terminalapp_cwd)
+ add-zsh-hook precmd update_terminalapp_cwd
# Run once to get initial cwd set
update_terminalapp_cwd
fi
diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh
index 6b8fa66ce..caee9b5a3 100644
--- a/plugins/alias-finder/alias-finder.plugin.zsh
+++ b/plugins/alias-finder/alias-finder.plugin.zsh
@@ -4,7 +4,7 @@ alias-finder() {
case $i in
-e|--exact) exact=true;;
-l|--longer) longer=true;;
- *)
+ *)
if [[ -z $cmd ]]; then
cmd=$i
else
@@ -43,4 +43,5 @@ preexec_alias-finder() {
fi
}
-preexec_functions+=(preexec_alias-finder)
+autoload -U add-zsh-hook
+add-zsh-hook preexec preexec_alias-finder
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
index 239915e48..35c43d76a 100644
--- a/plugins/dirhistory/dirhistory.plugin.zsh
+++ b/plugins/dirhistory/dirhistory.plugin.zsh
@@ -53,7 +53,8 @@ function push_future() {
}
# Called by zsh when directory changes
-chpwd_functions+=(chpwd_dirhistory)
+autoload -U add-zsh-hook
+add-zsh-hook chpwd chpwd_dirhistory
function chpwd_dirhistory() {
push_past $PWD
# If DIRHISTORY_CD is not set...
diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh
index 616e2c3c6..daadc3850 100644
--- a/plugins/dirpersist/dirpersist.plugin.zsh
+++ b/plugins/dirpersist/dirpersist.plugin.zsh
@@ -11,7 +11,8 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
[[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
fi
-chpwd_functions+=(chpwd_dirpersist)
+autoload -U add-zsh-hook
+add-zsh-hook chpwd chpwd_dirpersist
chpwd_dirpersist() {
if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
local -ax my_stack
diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh
index 76ac2e62b..da674af98 100644
--- a/plugins/git-prompt/git-prompt.plugin.zsh
+++ b/plugins/git-prompt/git-prompt.plugin.zsh
@@ -20,9 +20,10 @@ function precmd_update_git_vars() {
fi
}
-chpwd_functions+=(chpwd_update_git_vars)
-precmd_functions+=(precmd_update_git_vars)
-preexec_functions+=(preexec_update_git_vars)
+autoload -U add-zsh-hook
+add-zsh-hook chpwd chpwd_update_git_vars
+add-zsh-hook precmd precmd_update_git_vars
+add-zsh-hook preexec preexec_update_git_vars
## Function definitions
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index 53bb19e46..fd21705ae 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -2,7 +2,8 @@
typeset -g ZSH_LAST_WORKING_DIRECTORY
# Updates the last directory once directory is changed
-chpwd_functions+=(chpwd_last_working_dir)
+autoload -U add-zsh-hook
+add-zsh-hook chpwd chpwd_last_working_dir
chpwd_last_working_dir() {
if [ "$ZSH_SUBSHELL" = 0 ]; then
local cache_file="$ZSH_CACHE_DIR/last-working-dir"
diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh
index 0a5dc56a4..ec41c3e02 100644
--- a/plugins/pipenv/pipenv.plugin.zsh
+++ b/plugins/pipenv/pipenv.plugin.zsh
@@ -23,7 +23,8 @@ _togglePipenvShell() {
fi
fi
}
-chpwd_functions+=(_togglePipenvShell)
+autoload -U add-zsh-hook
+add-zsh-hook chpwd _togglePipenvShell
# Aliases
alias pch="pipenv check"
diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
index 231134e7d..728377c5c 100644
--- a/plugins/timer/timer.plugin.zsh
+++ b/plugins/timer/timer.plugin.zsh
@@ -25,5 +25,6 @@ __timer_display_timer_precmd() {
fi
}
-preexec_functions+=(__timer_save_time_preexec)
-precmd_functions+=(__timer_display_timer_precmd)
+autoload -U add-zsh-hook
+add-zsh-hook preexec __timer_save_time_preexec
+add-zsh-hook precmd __timer_display_timer_precmd
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index e27c6bb76..2a4b43189 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -96,7 +96,6 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
# Append workon_cwd to the chpwd_functions array, so it will be called on cd
# http://zsh.sourceforge.net/Doc/Release/Functions.html
- if ! (( $chpwd_functions[(I)workon_cwd] )); then
- chpwd_functions+=(workon_cwd)
- fi
+ autoload -U add-zsh-hook
+ add-zsh-hook chpwd workon_cwd
fi
diff --git a/themes/pygmalion-virtualenv.zsh-theme b/themes/pygmalion-virtualenv.zsh-theme
index ea28e125a..605e3d10c 100644
--- a/themes/pygmalion-virtualenv.zsh-theme
+++ b/themes/pygmalion-virtualenv.zsh-theme
@@ -28,7 +28,8 @@ prompt_setup_pygmalion(){
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
- precmd_functions+=(prompt_pygmalion_precmd)
+ autoload -U add-zsh-hook
+ add-zsh-hook precmd prompt_pygmalion_precmd
}
prompt_pygmalion_precmd(){
@@ -46,5 +47,3 @@ prompt_pygmalion_precmd(){
}
prompt_setup_pygmalion
-
-
diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme
index 5f5fe7f9a..cd773e4a4 100644
--- a/themes/pygmalion.zsh-theme
+++ b/themes/pygmalion.zsh-theme
@@ -12,7 +12,8 @@ prompt_setup_pygmalion(){
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
- precmd_functions+=(prompt_pygmalion_precmd)
+ autoload -U add-zsh-hook
+ add-zsh-hook precmd prompt_pygmalion_precmd
}
prompt_pygmalion_precmd(){
@@ -30,5 +31,3 @@ prompt_pygmalion_precmd(){
}
prompt_setup_pygmalion
-
-
From c130aadb6a66aa680a322c08d87ad773316f713d Mon Sep 17 00:00:00 2001
From: Jacob Tomaw
Date: Tue, 19 Nov 2019 13:44:00 -0500
Subject: [PATCH 047/343] Replace "restart shell" documentation "exec zsh"
(#8411)
Running `source ~/.zshrc` can have side effects, it's better to reload the whole
zsh session with `exec zsh`.
---
plugins/catimg/README.md | 4 ++--
plugins/dircycle/README.md | 4 ++--
plugins/encode64/README.md | 4 ++--
plugins/lol/README.md | 4 ++--
plugins/sudo/README.md | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md
index 2fc28a1c6..42b59a62c 100644
--- a/plugins/catimg/README.md
+++ b/plugins/catimg/README.md
@@ -17,10 +17,10 @@ Plugin for displaying images on the terminal using the the `catimg.sh` script pr
)
```
-2. Reload the source file or restart your Terminal session:
+2. Restart the shell or restart your Terminal session:
```console
- $ source ~/.zshrc
+ $ exec zsh
$
```
diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md
index 3ac162f05..3c9b3a96f 100644
--- a/plugins/dircycle/README.md
+++ b/plugins/dircycle/README.md
@@ -15,10 +15,10 @@ This plugin enables directory navigation similar to using back and forward on br
)
```
-2. Reload the source file or restart your Terminal session:
+2. Restart the shell or restart your Terminal session:
```console
- $ source ~/.zshrc
+ $ exec zsh
$
```
diff --git a/plugins/encode64/README.md b/plugins/encode64/README.md
index 9850da85f..66fc7cba4 100644
--- a/plugins/encode64/README.md
+++ b/plugins/encode64/README.md
@@ -20,10 +20,10 @@ Alias plugin for encoding or decoding using `base64` command
)
```
-2. Restart your terminal session or reload configuration by running:
+2. Restart your terminal session or restart the shell:
```sh
- source ~/.zshrc
+ exec zsh
```
## Usage and examples
diff --git a/plugins/lol/README.md b/plugins/lol/README.md
index b0e54f575..8fba7b713 100644
--- a/plugins/lol/README.md
+++ b/plugins/lol/README.md
@@ -13,10 +13,10 @@ Plugin for adding catspeak aliases, because why not
)
```
-2. Reload the source file or restart your Terminal session:
+2. Restart your terminal session or restart the shell:
```console
- $ source ~/.zshrc
+ $ exec zsh
$
```
diff --git a/plugins/sudo/README.md b/plugins/sudo/README.md
index ebfdfd10d..25eb85829 100644
--- a/plugins/sudo/README.md
+++ b/plugins/sudo/README.md
@@ -13,10 +13,10 @@ Easily prefix your current or previous commands with `sudo` by pressing esc
)
```
-2. Reload the source file or restart your Terminal session:
+2. Restart your shell or restart your Terminal session:
```console
- $ source ~/.zshrc
+ $ exec zsh
$
```
From 2e88a21f6996ab199936fc80e974e4ff7f572b9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5vard=20Moen?=
Date: Wed, 20 Nov 2019 17:47:46 +0100
Subject: [PATCH 048/343] terraform: update completion (#8396)
---
plugins/terraform/_terraform | 95 +++++++++++++++++++++++++++++++++---
1 file changed, 89 insertions(+), 6 deletions(-)
diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform
index 1d1315a8a..5b3655801 100644
--- a/plugins/terraform/_terraform
+++ b/plugins/terraform/_terraform
@@ -1,6 +1,6 @@
#compdef terraform
-local -a _terraform_cmds
+local -a _terraform_cmds opt_args
_terraform_cmds=(
'apply:Builds or changes infrastructure'
'console:Interactive console for Terraform interpolations'
@@ -16,13 +16,21 @@ _terraform_cmds=(
'push:Upload this Terraform module to Atlas to run'
'refresh:Update local state file against real resources'
'show:Inspect Terraform state or plan'
+ 'state:Advanced state management'
'taint:Manually mark a resource for recreation'
'untaint:Manually unmark a resource as tainted'
'validate:Validates the Terraform files'
'version:Prints the Terraform version'
'workspace:Workspace management'
+ '0.12upgrade:Rewrites pre-0.12 module source code for v0.12'
)
+__012upgrade() {
+ _arguments \
+ '-yes[Skip the initial introduction messages and interactive confirmation. This can be used to run this command in batch from a script.]' \
+ '-force[ Override the heuristic that attempts to detect if a configuration is already written for v0.12 or later. Some of the transformations made by this command are not idempotent, so re-running against the same module may change the meanings expressions in the module.]'
+}
+
__apply() {
_arguments \
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
@@ -35,7 +43,7 @@ __apply() {
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
'-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
- '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
'-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
}
@@ -59,7 +67,7 @@ __destroy() {
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
'-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
- '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
'-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
}
@@ -140,7 +148,7 @@ __plan() {
'-parallelism=[(10) Limit the number of concurrent operations.]' \
'-refresh=[(true) Update state prior to checking for differences.]' \
'-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]' \
- '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
'-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' \
}
@@ -172,7 +180,7 @@ __refresh() {
'-no-color[If specified, output will not contain any color.]' \
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
- '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
'-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
}
@@ -183,6 +191,70 @@ __show() {
'-no-color[If specified, output will not contain any color.]'
}
+__state() {
+ local -a __state_cmds
+ __state_cmds=(
+ 'list:List resources in the state'
+ 'mv:Move an item in the state'
+ 'pull:Pull current state and output to stdout'
+ 'push:Update remote state from a local state file'
+ 'rm:Remove instances from the state'
+ 'show:Show a resource in the state'
+ )
+ _describe -t state "state commands" __state_cmds
+}
+
+__state_list() {
+ _arguments \
+ '-state=[(path) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]' \
+ '-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]' \
+ "*:address:__statelist"
+}
+
+__state_mv() {
+ _arguments \
+ "-dry-run[If set, prints out what would've been moved but doesn't actually move anything.]" \
+ "-backup=[(path) Path where Terraform should write the backup for the original state. This can't be disabled. If not set, Terraform will write it to the same path as the statefile with a \".backup\" extension.]:file:_files" \
+ "-backup-out=[(path) Path where Terraform should write the backup for the destination state. This can't be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:file:_files" \
+ "-lock=[(true|false) Lock the state files when locking is supported.]:lock:(true false)" \
+ "-lock-timeout=[(seconds) Duration to retry a state lock.]" \
+ '-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:file:_files' \
+ "-state-out=[(path) Path to the destination state file to write to. If this isn't specified, the source state file will be used. This can be a new or existing path.]:file:_files" \
+ "::" \
+ ":source:__statelist" \
+ ":destination: "
+}
+
+__state_push() {
+ _arguments \
+ "-force[Write the state even if lineages don't match or the remote serial is higher.]" \
+ '-lock=[(true|false) Lock the state file when locking is supported.]:lock:(true false)' \
+ "-lock-timeout=[(seconds) Duration to retry a state lock.]" \
+ "::" \
+ ":destination:_files"
+}
+
+__state_rm() {
+ _arguments \
+ "-dry-run[If set, prints out what would've been removed but doesn't actually remove anything.]" \
+ "-backup=[(path) Path where Terraform should write the backup for the original state.]:file:_files" \
+ "-lock=[(true|false) Lock the state files when locking is supported.]:lock:(true false)" \
+ "-lock-timeout=[(seconds) Duration to retry a state lock.]" \
+ '-state=[(path) Path to the state file to update. Defaults to the current workspace state.]:file:_files' \
+ "*:address:__statelist"
+}
+
+
+__state_show() {
+ _arguments \
+ '-state=[(path) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]' \
+ "*:address:__statelist"
+}
+
+__statelist() {
+ compadd $(terraform state list $opt_args[-state])
+}
+
__taint() {
_arguments \
'-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \
@@ -192,7 +264,8 @@ __taint() {
'-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \
'-no-color[If specified, output will not contain any color.]' \
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
- '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]'
+ '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]' \
+ "*:address:__statelist"
}
__untaint() {
@@ -236,6 +309,8 @@ fi
local -a _command_args
case "$words[1]" in
+ 0.12upgrade)
+ __012upgrade ;;
apply)
__apply ;;
console)
@@ -264,6 +339,14 @@ case "$words[1]" in
__refresh ;;
show)
__show ;;
+ state)
+ test $CURRENT -lt 3 && __state
+ [[ $words[2] = "list" ]] && __state_list
+ [[ $words[2] = "mv" ]] && __state_mv
+ [[ $words[2] = "push" ]] && __state_push
+ [[ $words[2] = "rm" ]] && __state_rm
+ [[ $words[2] = "show" ]] && __state_show
+ ;;
taint)
__taint ;;
untaint)
From 9b5aebac2be65c4752f727b2b558acdf96077475 Mon Sep 17 00:00:00 2001
From: Jacob Tomaw
Date: Wed, 20 Nov 2019 11:53:45 -0500
Subject: [PATCH 049/343] colorize: update Pygments download link (#8407)
---
plugins/colorize/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md
index d1f878e62..32dc97b6e 100644
--- a/plugins/colorize/README.md
+++ b/plugins/colorize/README.md
@@ -32,4 +32,4 @@ 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 install Pygments first: [pygments.org](http://pygments.org/download.html)
From bb10c979ef22b2c5242dc0348b3ea3a1bf9b731d Mon Sep 17 00:00:00 2001
From: Jason Pickens
Date: Wed, 20 Nov 2019 19:05:16 +0200
Subject: [PATCH 050/343] jenv: only add to PATH if not already on it (#8414)
This prevents the jenv plugin from messing up the PATH and putting `user/local/bin` back at the front of the PATH, undoing any careful setup done before enabling this plugin.
---
plugins/jenv/jenv.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh
index 2eda8037b..b85906a0b 100644
--- a/plugins/jenv/jenv.plugin.zsh
+++ b/plugins/jenv/jenv.plugin.zsh
@@ -15,7 +15,7 @@ if [[ $FOUND_JENV -eq 0 ]]; then
fi
if [[ $FOUND_JENV -eq 1 ]]; then
- export PATH="${jenvdir}/bin:$PATH"
+ (( $+commands[jenv] )) || export PATH="${jenvdir}/bin:$PATH"
eval "$(jenv init - zsh)"
function jenv_prompt_info() { jenv version-name 2>/dev/null }
From b80b1a1e8b30e5f2a7c4977019cf56e72c434037 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 21 Nov 2019 02:26:18 +0100
Subject: [PATCH 051/343] Actions to take after repository migration is
complete (#8394)
* Change project URL from robbyrussell to ohmyzsh org
* Update git remote to use ohmyzsh org repository
---
CONTRIBUTING.md | 10 ++++-----
LICENSE.txt | 2 +-
README.md | 26 +++++++++++-----------
plugins/bundler/README.md | 2 +-
plugins/emotty/README.md | 2 +-
plugins/fedora/README.md | 2 +-
plugins/gitfast/README.md | 2 +-
plugins/go/README.md | 2 +-
plugins/history-substring-search/README.md | 2 +-
plugins/meteor/README.md | 2 +-
plugins/mvn/README.md | 2 +-
plugins/ng/README.md | 2 +-
plugins/percol/README.md | 4 ++--
plugins/rake/README.md | 2 +-
plugins/thefuck/README.md | 2 +-
plugins/urltools/README.md | 8 +++----
plugins/wd/README.md | 6 ++---
templates/zshrc.zsh-template | 2 +-
themes/gallifrey.zsh-theme | 2 +-
tools/install.sh | 10 ++++-----
tools/upgrade.sh | 6 +++++
21 files changed, 52 insertions(+), 46 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f575157c2..be67e93b0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,7 +31,7 @@ your problem.
If you find one, comment on it so we can know there are more people experiencing it.
-If not, look at the [Troubleshooting](https://github.com/robbyrussell/oh-my-zsh/wiki/Troubleshooting)
+If not, look at the [Troubleshooting](https://github.com/ohmyzsh/ohmyzsh/wiki/Troubleshooting)
page for instructions on how to gather data to better debug your problem.
Then, you can go ahead and create an issue with as much detail as you can provide.
@@ -62,7 +62,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa
You should be familiar with the basics of
[contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork
-[properly set up](https://github.com/robbyrussell/oh-my-zsh/wiki/Contribution-Technical-Practices).
+[properly set up](https://github.com/ohmyzsh/ohmyzsh/wiki/Contribution-Technical-Practices).
You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree.
@@ -85,7 +85,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa
### You have an addition
-Please [do not](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#dont-send-us-your-theme-for-now)
+Please [do not](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#dont-send-us-your-theme-for-now)
send themes for now.
Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests
@@ -109,7 +109,7 @@ to help you check whether a similar contribution to yours already exists. Please
before making any contribution, it avoids duplicates and eases maintenance. Trust me,
that works 90% of the time.
-You can also take a look at the [FAQ](https://github.com/robbyrussell/oh-my-zsh/wiki/FAQ)
+You can also take a look at the [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ)
to be sure your contribution has not already come up.
If all fails, your thing has probably not been reported yet, so you can go ahead
@@ -121,5 +121,5 @@ and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-reque
Very nice!! :)
-Please have a look at the [Volunteer](https://github.com/robbyrussell/oh-my-zsh/wiki/Volunteers)
+Please have a look at the [Volunteer](https://github.com/ohmyzsh/ohmyzsh/wiki/Volunteers)
page for instructions on where to start and more.
diff --git a/LICENSE.txt b/LICENSE.txt
index eb9978a7a..7431907a6 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2009-2019 Robby Russell and contributors (https://github.com/robbyrussell/oh-my-zsh/contributors)
+Copyright (c) 2009-2019 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/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
diff --git a/README.md b/README.md
index 2a5ec178a..ac4b3879c 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://
### Prerequisites
* A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work.
-* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
+* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
* `git` should be installed
@@ -33,13 +33,13 @@ Oh My Zsh is installed by running one of the following commands in your terminal
#### via curl
```shell
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
#### via wget
```shell
-sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```
#### Manual inspection
@@ -49,7 +49,7 @@ that by downloading the install script first, looking through it so everything l
then running it:
```shell
-curl -Lo install.sh https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
+curl -Lo install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh
```
@@ -57,7 +57,7 @@ sh install.sh
### Plugins
-Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
+Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins) directory and/or the [wiki](https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins) to see what's currently available.
#### Enabling Plugins
@@ -89,7 +89,7 @@ Most plugins (should! we're working on this) include a __README__, which documen
### Themes
-We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes) on the wiki. Check them out!
+We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki. Check them out!
#### Selecting a Theme
@@ -105,7 +105,7 @@ To use a different theme, simply change the value to match the name of your desi
```shell
ZSH_THEME="agnoster" # (this is one of the fancy ones)
-# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster
+# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
```
_Note: many themes require installing the [Powerline Fonts](https://github.com/powerline/fonts) in order to render properly._
@@ -114,7 +114,7 @@ Open up a new terminal window and your prompt should look something like this:
![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png)
-In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes).
+In case you did not find a suitable theme for your needs, please have a look at the wiki for [more of them](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes).
If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
@@ -160,14 +160,14 @@ flag `--unattended` to the `install.sh` script. This will have the effect of not
the default shell, and also won't run `zsh` when the installation has finished.
```shell
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended
+sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
```
#### Installing from a forked repository
The install script also accepts these variables to allow installation of a different repository:
-- `REPO` (default: `robbyrussell/oh-my-zsh`): this takes the form of `owner/repository`. If you set
+- `REPO` (default: `ohmyzsh/ohmyzsh`): this takes the form of `owner/repository`. If you set
this variable, the installer will look for a repository at `https://github.com/{owner}/{repository}`.
- `REMOTE` (default: `https://github.com/${REPO}.git`): this is the full URL of the git repository
@@ -191,7 +191,7 @@ REPO=apjanke/oh-my-zsh BRANCH=edge sh install.sh
##### 1. Clone the repository:
```shell
-git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
+git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
```
##### 2. *Optionally*, backup your existing `~/.zshrc` file:
@@ -273,13 +273,13 @@ Before you participate in our delightful community, please read the [code of con
I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
-We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can.
+We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/ohmyzsh/ohmyzsh/issues) and help where you can.
See [Contributing](CONTRIBUTING.md) for more details.
### Do NOT send us themes
-We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page.
+We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/ohmyzsh/ohmyzsh/wiki/External-themes) wiki page.
## Contributors
diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md
index a7d40cd0a..9f211b02f 100644
--- a/plugins/bundler/README.md
+++ b/plugins/bundler/README.md
@@ -42,7 +42,7 @@ This will exclude the `foreman` and `spin` gems (i.e. their executable) from bei
## Excluded gems
-These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification.
+These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/ohmyzsh/ohmyzsh/pull/2923) on GitHub for clarification.
`berks`
`foreman`
diff --git a/plugins/emotty/README.md b/plugins/emotty/README.md
index 2cfbe120c..ee571705a 100644
--- a/plugins/emotty/README.md
+++ b/plugins/emotty/README.md
@@ -8,7 +8,7 @@ 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).
+**NOTE:** it requires the [emoji plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/emoji).
## Usage
diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md
index 6594799b3..85d8d7dea 100644
--- a/plugins/fedora/README.md
+++ b/plugins/fedora/README.md
@@ -1 +1 @@
-The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.
+The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dnf) instead.
diff --git a/plugins/gitfast/README.md b/plugins/gitfast/README.md
index 84e35d77c..23db5393b 100644
--- a/plugins/gitfast/README.md
+++ b/plugins/gitfast/README.md
@@ -11,5 +11,5 @@ plugins=(... gitfast)
## Aliases
An earlier version of the plugin also loaded the git plugin. If you want to keep those
-aliases enable the [git plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git)
+aliases enable the [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git)
as well.
diff --git a/plugins/go/README.md b/plugins/go/README.md
index 6ce6f4ee2..bf43b9feb 100644
--- a/plugins/go/README.md
+++ b/plugins/go/README.md
@@ -1 +1 @@
-The go plugin is deprecated. Use the [golang plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/golang) instead.
+The go plugin is deprecated. Use the [golang plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/golang) instead.
diff --git a/plugins/history-substring-search/README.md b/plugins/history-substring-search/README.md
index 7fb0fa0b6..0ffb21351 100644
--- a/plugins/history-substring-search/README.md
+++ b/plugins/history-substring-search/README.md
@@ -9,7 +9,7 @@ You can also use K and J in VI mode or ^P and ^N in EMACS mode for the same.
[1]: https://fishshell.com
[2]: https://www.zsh.org/mla/users/2009/msg00818.html
[3]: https://sourceforge.net/projects/fizsh/
-[4]: https://github.com/robbyrussell/oh-my-zsh/pull/215
+[4]: https://github.com/ohmyzsh/ohmyzsh/pull/215
[5]: https://github.com/zsh-users/zsh-history-substring-search
[6]: https://github.com/zsh-users/zsh-syntax-highlighting
diff --git a/plugins/meteor/README.md b/plugins/meteor/README.md
index 4bee87f8f..187a45a62 100644
--- a/plugins/meteor/README.md
+++ b/plugins/meteor/README.md
@@ -1,6 +1,6 @@
## Introduction
-The [meteor plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/meteor) provides many
+The [meteor plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/meteor) provides many
[useful aliases](#aliases) as well as completion for the `meteor` command.
Enable it by adding `meteor` to the plugins array in your zshrc file:
diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md
index 88f5be8ba..3bbba5b4f 100644
--- a/plugins/mvn/README.md
+++ b/plugins/mvn/README.md
@@ -55,4 +55,4 @@ has colored output, so this function will be soon removed from the plugin.
### Known bugs
It has a bug where it will swallow mvn prompts for user input, _e.g._ when using
-`archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052).
+`archetype:generate`. See [#5052](https://github.com/ohmyzsh/ohmyzsh/issues/5052).
diff --git a/plugins/ng/README.md b/plugins/ng/README.md
index 86ad64041..94a450c18 100644
--- a/plugins/ng/README.md
+++ b/plugins/ng/README.md
@@ -1,6 +1,6 @@
## NG Plugin
-This [ng plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ng)
+This [ng plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ng)
adds completion support for Angular's CLI (named ng).
Ng is hosted on [ng home](https://github.com/catull/angular-cli)
diff --git a/plugins/percol/README.md b/plugins/percol/README.md
index b262e414e..ec5de4f86 100644
--- a/plugins/percol/README.md
+++ b/plugins/percol/README.md
@@ -1,6 +1,6 @@
## percol
-Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and [jump plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh)
+Provides some useful function to make [percol](https://github.com/mooz/percol) work with zsh history and [jump plugin](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/jump/jump.plugin.zsh)
### Requirements
@@ -8,7 +8,7 @@ Provides some useful function to make [percol](https://github.com/mooz/percol) w
pip install percol
```
-And [jump](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/jump/jump.plugin.zsh) for `oh-my-zsh` is a optional requirement.
+And [jump](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/jump/jump.plugin.zsh) for `oh-my-zsh` is a optional requirement.
### Usage
diff --git a/plugins/rake/README.md b/plugins/rake/README.md
index e235bd91a..e888c0785 100644
--- a/plugins/rake/README.md
+++ b/plugins/rake/README.md
@@ -34,4 +34,4 @@ The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich),
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)
+> over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/ohmyzsh/ohmyzsh/commit/598a9c6f990756386517d66b6bcf77e53791e905)
diff --git a/plugins/thefuck/README.md b/plugins/thefuck/README.md
index a9b7550d7..bd407b316 100644
--- a/plugins/thefuck/README.md
+++ b/plugins/thefuck/README.md
@@ -6,4 +6,4 @@
Press `ESC` twice to correct previous console command.
## Notes
-`Esc`-`Esc` key binding conflicts with [sudo](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo) plugin.
+`Esc`-`Esc` key binding conflicts with [sudo](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo) plugin.
diff --git a/plugins/urltools/README.md b/plugins/urltools/README.md
index 548301c72..29c371070 100644
--- a/plugins/urltools/README.md
+++ b/plugins/urltools/README.md
@@ -21,9 +21,9 @@ Original idea and aliases: [Ruslan Spivak](https://ruslanspivak.wordpress.com/20
## Examples
```zsh
-urlencode 'https://github.com/robbyrussell/oh-my-zsh/search?q=urltools&type=Code'
-# returns https%3A%2F%2Fgithub.com%2Frobbyrussell%2Foh-my-zsh%2Fsearch%3Fq%3Durltools%26type%3DCode
+urlencode 'https://github.com/ohmyzsh/ohmyzsh/search?q=urltools&type=Code'
+# returns https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh%2Fsearch%3Fq%3Durltools%26type%3DCode
-urldecode 'https%3A%2F%2Fgithub.com%2Frobbyrussell%2Foh-my-zsh%2Fsearch%3Fq%3Durltools%26type%3DCode'
-# returns https://github.com/robbyrussell/oh-my-zsh/search?q=urltools&type=Code
+urldecode 'https%3A%2F%2Fgithub.com%2Fohmyzsh%2Fohmyzsh%2Fsearch%3Fq%3Durltools%26type%3DCode'
+# returns https://github.com/ohmyzsh/ohmyzsh/search?q=urltools&type=Code
```
diff --git a/plugins/wd/README.md b/plugins/wd/README.md
index b1deeffd5..91d5d0ae7 100644
--- a/plugins/wd/README.md
+++ b/plugins/wd/README.md
@@ -13,7 +13,7 @@ wd
### oh-my-zsh
-`wd` comes bundled with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
+`wd` comes bundled with [oh-my-zshell](https://github.com/ohmyzsh/ohmyzsh)!
Just add the plugin in your `~/.zshrc` file:
@@ -53,7 +53,7 @@ Run either in terminal:
#### Completion
-If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utilize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
+If you're NOT using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) and you want to utilize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
fpath=(~/path/to/wd $fpath)
@@ -85,7 +85,7 @@ Also, you may have to force a rebuild of `zcompdump` by running:
$ wd ...
This is a wrapper for the zsh `dirs` function.
- (You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)).
+ (You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/ohmyzsh/ohmyzsh)).
* Remove warp point test point:
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 3cc5ad46c..d16713ccb 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -7,7 +7,7 @@ export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
-# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
+# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme
index 768547064..47b057fa3 100644
--- a/themes/gallifrey.zsh-theme
+++ b/themes/gallifrey.zsh-theme
@@ -1,4 +1,4 @@
-# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey
+# ZSH Theme - Preview: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#gallifrey
return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
host_color="%(!.%{$fg[red]%}.%{$fg[green]%})"
diff --git a/tools/install.sh b/tools/install.sh
index a5a90e6f6..ae248be89 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -1,12 +1,12 @@
#!/bin/sh
#
# This script should be run via curl:
-# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or wget:
-# sh -c "$(wget -qO- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
+# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#
# As an alternative, you can first download the install script and run it afterwards:
-# wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
+# wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
# sh install.sh
#
# You can tweak the install behavior by setting variables when running the script. For
@@ -15,7 +15,7 @@
#
# Respects the following environment variables:
# ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
-# REPO - name of the GitHub repo to install from (default: robbyrussell/oh-my-zsh)
+# REPO - name of the GitHub repo to install from (default: ohmyzsh/ohmyzsh)
# REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
# BRANCH - branch to check out immediately after install (default: master)
#
@@ -33,7 +33,7 @@ set -e
# Default settings
ZSH=${ZSH:-~/.oh-my-zsh}
-REPO=${REPO:-robbyrussell/oh-my-zsh}
+REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index f64a0096e..55768cd6e 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -31,6 +31,12 @@ git config fsck.zeroPaddedFilemode ignore
git config fetch.fsck.zeroPaddedFilemode ignore
git config receive.fsck.zeroPaddedFilemode ignore
+# Update upstream remote to ohmyzsh org
+remote=$(git remote -v | awk '/https:\/\/github\.com\/robbyrussell\/oh-my-zsh\.git/{ print $1; exit }')
+if [[ -n "$remote" ]]; then
+ git remote set-url "$remote" "https://github.com/ohmyzsh/ohmyzsh.git"
+fi
+
printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh"
if git pull --rebase --stat origin master
then
From 1c98b9cc38d34647f1d6357919a0f4e1d5ebd4cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 21 Nov 2019 03:29:16 +0100
Subject: [PATCH 052/343] Remove current directory from sys.path in python
invocations (#8408)
* Remove current directory from sys.path in python invocations
---
plugins/django/django.plugin.zsh | 3 ++-
plugins/jsontools/jsontools.plugin.zsh | 13 ++++++++-----
plugins/salt/_salt | 2 +-
plugins/urltools/urltools.plugin.zsh | 8 ++++----
4 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
index 86558ff2e..c2d00c171 100644
--- a/plugins/django/django.plugin.zsh
+++ b/plugins/django/django.plugin.zsh
@@ -374,7 +374,8 @@ _managepy-commands() {
_applist() {
local line
local -a apps
- _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
+ _call_program help-command "python -c \"import sys; del sys.path[0];\\
+ import os.path as op, re, django.conf;\\
bn=op.basename(op.abspath(op.curdir));[sys\\
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
diff --git a/plugins/jsontools/jsontools.plugin.zsh b/plugins/jsontools/jsontools.plugin.zsh
index 20d5eb1c9..912c83509 100644
--- a/plugins/jsontools/jsontools.plugin.zsh
+++ b/plugins/jsontools/jsontools.plugin.zsh
@@ -11,9 +11,10 @@ if [[ $(whence node) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METH
alias urlencode_json='xargs -0 node -e "console.log(encodeURIComponent(process.argv[1]))"'
alias urldecode_json='xargs -0 node -e "console.log(decodeURIComponent(process.argv[1]))"'
elif [[ $(whence python) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METHOD" = "xpython" ) ]]; then
- alias pp_json='python -mjson.tool'
+ alias pp_json='python -c "import sys; del sys.path[0]; import runpy; runpy._run_module_as_main(\"json.tool\")"'
alias is_json='python -c "
-import json, sys;
+import sys; del sys.path[0];
+import json;
try:
json.loads(sys.stdin.read())
except ValueError, e:
@@ -22,11 +23,13 @@ else:
print True
sys.exit(0)"'
alias urlencode_json='python -c "
-import urllib, json, sys;
+import sys; del sys.path[0];
+import urllib, json;
print urllib.quote_plus(sys.stdin.read())
sys.exit(0)"'
alias urldecode_json='python -c "
-import urllib, json, sys;
+import sys; del sys.path[0];
+import urllib, json;
print urllib.unquote_plus(sys.stdin.read())
sys.exit(0)"'
elif [[ $(whence ruby) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_METHOD" = "xruby" ) ]]; then
@@ -36,4 +39,4 @@ elif [[ $(whence ruby) != "" && ( "x$JSONTOOLS_METHOD" = "x" || "x$JSONTOOLS_MET
alias urldecode_json='ruby -e "require \"uri\"; puts URI.unescape(STDIN.read)"'
fi
-unset JSONTOOLS_METHOD
\ No newline at end of file
+unset JSONTOOLS_METHOD
diff --git a/plugins/salt/_salt b/plugins/salt/_salt
index 10b782af4..78d8611d2 100644
--- a/plugins/salt/_salt
+++ b/plugins/salt/_salt
@@ -271,7 +271,7 @@ _salt_comp(){
fi
if _cache_invalid salt/salt_dir || ! _retrieve_cache salt/salt_dir; then
- salt_dir="${$(python2 -c 'import salt; print(salt.__file__);')%__init__*}"
+ salt_dir="${$(python2 -c 'import sys; del sys.path[0]; import salt; print(salt.__file__);')%__init__*}"
_store_cache salt/salt_dir salt_dir
fi
}
diff --git a/plugins/urltools/urltools.plugin.zsh b/plugins/urltools/urltools.plugin.zsh
index 47d9a34e4..b443e5027 100644
--- a/plugins/urltools/urltools.plugin.zsh
+++ b/plugins/urltools/urltools.plugin.zsh
@@ -12,11 +12,11 @@ if [[ $(whence node) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD
alias urlencode='node -e "console.log(encodeURIComponent(process.argv[1]))"'
alias urldecode='node -e "console.log(decodeURIComponent(process.argv[1]))"'
elif [[ $(whence python3) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then
- alias urlencode='python3 -c "import sys, urllib.parse as up; print(up.quote_plus(sys.argv[1]))"'
- alias urldecode='python3 -c "import sys, urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"'
+ alias urlencode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.quote_plus(sys.argv[1]))"'
+ alias urldecode='python3 -c "import sys; del sys.path[0]; import urllib.parse as up; print(up.unquote_plus(sys.argv[1]))"'
elif [[ $(whence python2) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xpython" ) ]]; then
- alias urlencode='python2 -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
- alias urldecode='python2 -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
+ alias urlencode='python2 -c "import sys; del sys.path[0]; import urllib as ul; print ul.quote_plus(sys.argv[1])"'
+ alias urldecode='python2 -c "import sys; del sys.path[0]; import urllib as ul; print ul.unquote_plus(sys.argv[1])"'
elif [[ $(whence xxd) != "" && ( "x$URLTOOLS_METHOD" = "x" || "x$URLTOOLS_METHOD" = "xshell" ) ]]; then
function urlencode() {echo $@ | tr -d "\n" | xxd -plain | sed "s/\(..\)/%\1/g"}
function urldecode() {printf $(echo -n $@ | sed 's/\\/\\\\/g;s/\(%\)\([0-9a-fA-F][0-9a-fA-F]\)/\\x\2/g')"\n"}
From 3cc1fa40466ea5cee134e6e780786f4fba7eef4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 21 Nov 2019 19:10:30 +0100
Subject: [PATCH 053/343] Fix non-POSIX conditional syntax
Fixes #8416
---
tools/upgrade.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 55768cd6e..3005e6542 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -33,7 +33,7 @@ git config receive.fsck.zeroPaddedFilemode ignore
# Update upstream remote to ohmyzsh org
remote=$(git remote -v | awk '/https:\/\/github\.com\/robbyrussell\/oh-my-zsh\.git/{ print $1; exit }')
-if [[ -n "$remote" ]]; then
+if [ -n "$remote" ]; then
git remote set-url "$remote" "https://github.com/ohmyzsh/ohmyzsh.git"
fi
From 76d6b0256398ad1becbc304a78f51bbacfee50e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 21 Nov 2019 19:16:41 +0100
Subject: [PATCH 054/343] lol: fix yolo alias using https URL
Fixes #8418
---
plugins/lol/lol.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
index 585f96e4f..3c30259a1 100644
--- a/plugins/lol/lol.plugin.zsh
+++ b/plugins/lol/lol.plugin.zsh
@@ -45,7 +45,7 @@ alias bringz='git pull'
alias chicken='git add'
alias oanward='git commit -m'
alias ooanward='git commit -am'
-alias yolo='git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'
+alias yolo='git commit -m "$(curl -s http://whatthecommit.com/index.txt)"'
alias letcat='git checkout'
alias violenz='git rebase'
From be73666f34c3a2762d606be7f1997b120929e17c Mon Sep 17 00:00:00 2001
From: Peter Mosmans
Date: Thu, 16 Jun 2016 11:05:09 +1000
Subject: [PATCH 055/343] tmux: add support for forced unicode support (#5166)
When ZSH_TMUX_UNICODE=true then tmux is informed that UTF-8 is supported.
Closes #5166
---
plugins/tmux/tmux.plugin.zsh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index dad3db578..e52443a71 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -36,6 +36,8 @@ alias tkss='tmux kill-session -t'
: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
# Set the configuration path
: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf}
+# Set -u option to support unicode
+: ${ZSH_TMUX_UNICODE:=false}
# Determine if the terminal supports 256 colors
if [[ $terminfo[colors] == 256 ]]; then
@@ -62,6 +64,7 @@ function _zsh_tmux_plugin_run() {
local -a tmux_cmd
tmux_cmd=(command tmux)
[[ "$ZSH_TMUX_ITERM2" == "true" ]] && tmux_cmd+=(-CC)
+ [[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u)
# Try to connect to an existing session.
[[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]] && $tmux_cmd attach
From 7b73c9ca1ced57cdf545e860e880658753b81777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sat, 23 Nov 2019 22:14:27 +0100
Subject: [PATCH 056/343] tmux: add ZSH_TMUX_UNICODE to README
---
plugins/tmux/README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md
index 1e25af38f..db57f5be2 100644
--- a/plugins/tmux/README.md
+++ b/plugins/tmux/README.md
@@ -37,4 +37,5 @@ 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
+| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
+| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
From 4deafdff962eca8739e321113f5ba338d3990756 Mon Sep 17 00:00:00 2001
From: Giuseppe
Date: Mon, 25 Nov 2019 16:36:33 +0100
Subject: [PATCH 057/343] Fix change to old shell on uninstall (#8430)
If there's no `~/.shell.pre-oh-my-zsh`, don't assume the default choice
is Bash. In fact Zsh is the default shell for macOS since Catalina
(10.15) [1], yet users of other OSes have likely to have Bash as their
default.
This commit fix issue #8252
[1] https://support.apple.com/en-us/HT208050
---
tools/uninstall.sh | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/tools/uninstall.sh b/tools/uninstall.sh
index da31a6a14..b327a0163 100644
--- a/tools/uninstall.sh
+++ b/tools/uninstall.sh
@@ -25,18 +25,14 @@ if [ -e "$ZSHRC_ORIG" ]; then
echo "Your original zsh config was restored."
fi
-if hash chsh >/dev/null 2>&1; then
- if [ -f ~/.shell.pre-oh-my-zsh ]; then
- old_shell=$(cat ~/.shell.pre-oh-my-zsh)
- else
- old_shell=/bin/bash
- fi
+if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
+ old_shell=$(cat ~/.shell.pre-oh-my-zsh)
echo "Switching your shell back to '$old_shell':"
if chsh -s "$old_shell"; then
rm -f ~/.shell.pre-oh-my-zsh
else
echo "Could not change default shell. Change it manually by running chsh"
- echo "or editing the /etc/passwd file."
+ echo "or editing the /etc/passwd file."
fi
fi
From 671d21ac5305e815668500563a6b7ef61057b659 Mon Sep 17 00:00:00 2001
From: Michal Bultrowicz
Date: Mon, 25 Nov 2019 18:59:31 +0100
Subject: [PATCH 058/343] Mention FAQ in the README (#8051)
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index ac4b3879c..bfb42c0fd 100644
--- a/README.md
+++ b/README.md
@@ -132,6 +132,10 @@ ZSH_THEME_RANDOM_CANDIDATES=(
)
```
+### FAQ
+
+If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ).
+
## Advanced Topics
If you're the type that likes to get their hands dirty, these sections might resonate.
From 6390afd6de2978ca19920adb4d8958c1ee788f49 Mon Sep 17 00:00:00 2001
From: Meng Bo
Date: Thu, 28 Nov 2019 22:41:58 +0800
Subject: [PATCH 059/343] fzf: change debian completion file path (#8402)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Newer Debian packages install completions file in
/usr/share/doc/fzf/examples/completion.zsh
* Default to buster/stretch path if completion file not found
See file list in order from older to newer fzf package versions:
- https://packages.debian.org/stretch-backports/amd64/fzf/filelist
- https://packages.debian.org/buster/amd64/fzf/filelist
- https://packages.debian.org/bullseye/amd64/fzf/filelist
- https://packages.debian.org/sid/amd64/fzf/filelist
Co-authored-by: Marc Cornellà
---
plugins/fzf/fzf.plugin.zsh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index fe471a363..83626009d 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -67,7 +67,10 @@ function setup_using_debian_package() {
# NOTE: There is no need to configure PATH for debian package, all binaries
# are installed to /usr/bin by default
- local completions="/usr/share/zsh/vendor-completions/_fzf"
+ # Determine completion file path: first bullseye/sid, then buster/stretch
+ local completions="/usr/share/doc/fzf/examples/completion.zsh"
+ [[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"
+
local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh"
# Auto-completion
From 16154453ea701772acd144f22d3ddf9b6f3a40d3 Mon Sep 17 00:00:00 2001
From: Reza Hamouleh
Date: Thu, 28 Nov 2019 20:10:34 +0330
Subject: [PATCH 060/343] sbt: use new sbt command naming convention (#8426)
---
plugins/sbt/README.md | 10 +++++-----
plugins/sbt/_sbt | 20 ++++++++++----------
plugins/sbt/sbt.plugin.zsh | 10 +++++-----
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/plugins/sbt/README.md b/plugins/sbt/README.md
index f1a5753b9..f0201938e 100644
--- a/plugins/sbt/README.md
+++ b/plugins/sbt/README.md
@@ -17,16 +17,16 @@ plugins=(... sbt)
| sbcln | `sbt clean` | Deletes all generated files |
| sbcc | `sbt clean compile` | Deletes generated files, compiles the main sources |
| sbco | `sbt console` | Starts Scala with the compiled sources and all dependencies |
-| sbcq | `sbt console-quick` | Starts Scala with all dependencies |
-| sbcp | `sbt console-project` | Starts Scala with sbt and the build definitions |
+| sbcq | `sbt consoleQuick` | Starts Scala with all dependencies |
+| sbcp | `sbt consoleProject` | Starts Scala with sbt and the build definitions |
| sbd | `sbt doc` | Generates API documentation for Scala source files |
| sbdc | `sbt dist:clean` | Deletes the distribution packages |
| sbdi | `sbt dist` | Creates the distribution packages |
-| sbgi | `sbt gen-idea` | Create Idea project files |
+| sbgi | `sbt genIdea` | Create Idea project files |
| sbp | `sbt publish` | Publishes artifacts to the repository |
-| sbpl | `sbt publish-local` | Publishes artifacts to the local Ivy repository |
+| sbpl | `sbt publishLocal` | Publishes artifacts to the local Ivy repository |
| sbr | `sbt run` | Runs the main class for the project |
-| sbrm | `sbt run-main` | Runs the specified main class for the project |
+| sbrm | `sbt runMain` | Runs the specified main class for the project |
| sbu | `sbt update` | Resolves and retrieves external dependencies |
| sbx | `sbt test` | Compiles and runs all tests |
| sba | `sbt assembly` | Create a fat JAR with all dependencies |
diff --git a/plugins/sbt/_sbt b/plugins/sbt/_sbt
index a601c9b97..2138a722f 100644
--- a/plugins/sbt/_sbt
+++ b/plugins/sbt/_sbt
@@ -6,23 +6,23 @@ _sbt_commands=(
'clean:delete files produced by the build'
'compile:compile sources'
'console:start the Scala REPL with project classes on the classpath'
- 'console-quick:start the Scala REPL with project deps on the classpath'
- 'console-project:start the Scala REPL w/sbt+build-def on the classpath'
+ 'consoleQuick:start the Scala REPL with project deps on the classpath'
+ 'consoleProject:start the Scala REPL w/sbt+build-def on the classpath'
'dist:generate distribution artifacts'
'dist\:clean:clean distribution artifacts'
'doc:generate API documentation'
- 'gen-idea:generate Intellij Idea project files'
+ 'genIdea:generate Intellij Idea project files'
'package:produce the main artifact, such as a binary jar'
- 'package-doc:produce a doc artifact, such as a jar containing API docs'
- 'package-src:produce a source artifact, such as a jar containing sources'
+ 'packageDoc:produce a doc artifact, such as a jar containing API docs'
+ 'packageSrc:produce a source artifact, such as a jar containing sources'
'publish:publish artifacts to a repository'
- 'publish-local:publish artifacts to the local repository'
- 'publish-m2:publish artifacts to the local Maven 2 repository'
+ 'publishLocal:publish artifacts to the local repository'
+ 'publishM2:publish artifacts to the local Maven 2 repository'
'run:run a main class'
- 'run-main:run the main class selected by the first argument'
+ 'runMain:run the main class selected by the first argument'
'test:execute all tests'
- 'test-only:execute the tests provided as arguments'
- 'test-quick:execute previously failed tests'
+ 'testOnly:execute the tests provided as arguments'
+ 'testQuick:execute previously failed tests'
'update:resolve and optionally retrieve dependencies'
)
diff --git a/plugins/sbt/sbt.plugin.zsh b/plugins/sbt/sbt.plugin.zsh
index f883b7fee..851302c68 100644
--- a/plugins/sbt/sbt.plugin.zsh
+++ b/plugins/sbt/sbt.plugin.zsh
@@ -9,17 +9,17 @@
alias sbc='sbt compile'
alias sbcc='sbt clean compile'
alias sbco='sbt console'
-alias sbcq='sbt console-quick'
+alias sbcq='sbt consoleQuick'
alias sbcln='sbt clean'
-alias sbcp='sbt console-project'
+alias sbcp='sbt consoleProject'
alias sbd='sbt doc'
alias sbdc='sbt dist:clean'
alias sbdi='sbt dist'
-alias sbgi='sbt gen-idea'
+alias sbgi='sbt genIdea'
alias sbp='sbt publish'
-alias sbpl='sbt publish-local'
+alias sbpl='sbt publishLocal'
alias sbr='sbt run'
-alias sbrm='sbt run-main'
+alias sbrm='sbt runMain'
alias sbu='sbt update'
alias sbx='sbt test'
alias sba='sbt assembly'
From 903a3e9daa110944a9edc37a5952b4a9ff630b39 Mon Sep 17 00:00:00 2001
From: matthewhembree <47449406+matthewhembree@users.noreply.github.com>
Date: Thu, 28 Nov 2019 15:37:37 -0600
Subject: [PATCH 061/343] keychain: pass host as argument to keychain (#8436)
---
plugins/keychain/keychain.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh
index af34793e7..def97d8d1 100644
--- a/plugins/keychain/keychain.plugin.zsh
+++ b/plugins/keychain/keychain.plugin.zsh
@@ -15,7 +15,7 @@ function _start_agent() {
zstyle -a :omz:plugins:keychain options options
# start keychain...
- keychain ${^options:-} --agents ${agents:-gpg} ${^identities}
+ keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST
# Get the filenames to store/lookup the environment from
_keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"
From 664664f6cd8a1c02a38063c8f2104f0515a19399 Mon Sep 17 00:00:00 2001
From: jtagcat <38327267+jtagcat@users.noreply.github.com>
Date: Sat, 7 Dec 2019 20:03:13 +0000
Subject: [PATCH 062/343] arcanist: clarify README (#8461)
---
plugins/arcanist/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/arcanist/README.md b/plugins/arcanist/README.md
index 4bb8c8090..f2ca8cf55 100644
--- a/plugins/arcanist/README.md
+++ b/plugins/arcanist/README.md
@@ -2,4 +2,4 @@
**Maintainer:** [@emzar](https://github.com/emzar)
-This plugin adds many useful aliases.
+This plugin adds many useful aliases for [arcanist](https://github.com/phacility/arcanist).
From 1761685d3e8d0594ff580c968874665e64a9a9cb Mon Sep 17 00:00:00 2001
From: Filipe Nascimento
Date: Tue, 17 Dec 2019 13:35:40 -0300
Subject: [PATCH 063/343] extract: add zstd support (#8469)
---
plugins/extract/README.md | 3 +++
plugins/extract/_extract | 2 +-
plugins/extract/extract.plugin.zsh | 5 +++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index 41b6a61f1..aca300097 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -34,15 +34,18 @@ plugins=(... extract)
| `tar.gz` | Tarball with gzip compression |
| `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression |
+| `tar.zst` | Tarball with zstd compression |
| `tbz` | Tarball with bzip compression |
| `tbz2` | Tarball with bzip2 compression |
| `tgz` | Tarball with gzip compression |
| `tlz` | Tarball with lzma compression |
| `txz` | Tarball with lzma2 compression |
+| `tzst` | Tarball with zstd compression |
| `war` | Web Application archive (Java-based) |
| `xpi` | Mozilla XPI module file |
| `xz` | LZMA2 archive |
| `zip` | Zip archive |
+| `zst` | Zstandard file (zstd) |
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
more information regarding archive formats.
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 0257ce231..47b918b29 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 27b9e50f1..b7d4e3ba7 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -40,6 +40,10 @@ extract() {
tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
+ (*.tar.zst|*.tzst)
+ tar --zstd --help &> /dev/null \
+ && tar --zstd -xvf "$1" \
+ || zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
@@ -59,6 +63,7 @@ extract() {
cd ..; rm *.tar.* debian-binary
cd ..
;;
+ (*.zst) unzstd "$1" ;;
(*)
echo "extract: '$1' cannot be extracted" >&2
success=1
From ad1169bf39d8cab3e0139299d8200dd18bdc2038 Mon Sep 17 00:00:00 2001
From: Mustaqim Malim
Date: Wed, 18 Dec 2019 09:53:54 +0000
Subject: [PATCH 064/343] extract: add tar.lz support (#8479)
---
plugins/extract/README.md | 1 +
plugins/extract/_extract | 2 +-
plugins/extract/extract.plugin.zsh | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index aca300097..d6e4fa116 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -32,6 +32,7 @@ plugins=(... extract)
| `tar` | Tarball |
| `tar.bz2` | Tarball with bzip2 compression |
| `tar.gz` | Tarball with gzip compression |
+| `tar.lz` | Tarball with lzip compression |
| `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression |
| `tar.zst` | Tarball with zstd compression |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 47b918b29..e9d12d4d3 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index b7d4e3ba7..5cc30d1ce 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -45,6 +45,7 @@ extract() {
&& tar --zstd -xvf "$1" \
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
+ (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
From 7dddfe0a39b75acbe265c47b6d1dc575d6dedd9f Mon Sep 17 00:00:00 2001
From: Anatoli Babenia
Date: Wed, 18 Dec 2019 13:06:39 +0300
Subject: [PATCH 065/343] fasd: fix plugins name in README (#8483)
---
plugins/fasd/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/fasd/README.md b/plugins/fasd/README.md
index 1641a92d0..a5c74e5b8 100644
--- a/plugins/fasd/README.md
+++ b/plugins/fasd/README.md
@@ -5,7 +5,7 @@
To use it, add `fasd` to the plugins array in your zshrc file:
```zsh
-plugins=(... fd)
+plugins=(... fasd)
```
## Installation
@@ -18,4 +18,4 @@ Please find detailed installation guide [`here`](https://github.com/clvv/fasd#in
|-------|-------------------------------------------|-------------------------------------------------------------|
| 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
+| j | `fasd_cd -d -i` | cd with interactive selection |
From 4338a731b77d9f7a73b554667626e35b3fb5f7e3 Mon Sep 17 00:00:00 2001
From: pprugger
Date: Thu, 19 Dec 2019 10:50:20 +0100
Subject: [PATCH 066/343] fzf: add support for FreeBSD (#8474)
---
plugins/fzf/fzf.plugin.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index 83626009d..c8aefd7ab 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -12,6 +12,7 @@ function setup_using_base_dir() {
"${HOME}/.fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
+ "/usr/local/share/examples/fzf"
)
for dir in ${fzfdirs}; do
if [[ -d "${dir}" ]]; then
From 3d6be08e71219e75405ef0d535cc9c3defbb3367 Mon Sep 17 00:00:00 2001
From: giovanepadawan <51273591+giovanepadawan@users.noreply.github.com>
Date: Fri, 20 Dec 2019 03:35:50 +0100
Subject: [PATCH 067/343] yarn: add alias for yarn lint (#8481)
---
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 e6daae44f..05f18a499 100644
--- a/plugins/yarn/README.md
+++ b/plugins/yarn/README.md
@@ -27,6 +27,7 @@ plugins=(... yarn)
| yh | `yarn help` | Show help for a yarn command |
| yi | `yarn init` | Interactively creates or updates a package.json file |
| yin | `yarn install` | Install dependencies defined in `package.json` |
+| yln | `yarn lint` | Run the lint script defined in `package.json` |
| yls | `yarn list` | List installed packages |
| yout | `yarn outdated` | Check for outdated package dependencies |
| yp | `yarn pack` | Create a compressed gzip archive of package dependencies |
diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh
index 18c5dcc89..9cfcb7539 100644
--- a/plugins/yarn/yarn.plugin.zsh
+++ b/plugins/yarn/yarn.plugin.zsh
@@ -12,6 +12,7 @@ alias ygu="yarn global upgrade"
alias yh="yarn help"
alias yi="yarn init"
alias yin="yarn install"
+alias yln="yarn lint"
alias yls="yarn list"
alias yout="yarn outdated"
alias yp="yarn pack"
From 1a0500b00dd417ea2d9d3ea12bbad5318f8d7e55 Mon Sep 17 00:00:00 2001
From: Jay Tavares
Date: Sat, 21 Dec 2019 00:08:03 -0500
Subject: [PATCH 068/343] Change order of automatic virtualenv
activation/deactivation (#6687)
When navigating from a virtualenv project directory, first deactivate the virtualenv.
Then, check to see if destination directory is also a virtualenv project directory.
If it is activate that virtualenv. See #5817.
---
plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index 2a4b43189..b07b2a306 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -77,6 +77,12 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
else
ENV_NAME=""
fi
+
+ if [[ -n $CD_VIRTUAL_ENV && "$ENV_NAME" != "$CD_VIRTUAL_ENV" ]]; then
+ # We've just left the repo, deactivate the environment
+ # Note: this only happens if the virtualenv was activated automatically
+ deactivate && unset CD_VIRTUAL_ENV
+ fi
if [[ "$ENV_NAME" != "" ]]; then
# Activate the environment only if it is not already active
if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
@@ -86,10 +92,6 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
source $ENV_NAME/bin/activate && export CD_VIRTUAL_ENV="$ENV_NAME"
fi
fi
- elif [[ -n $CD_VIRTUAL_ENV && -n $VIRTUAL_ENV ]]; then
- # We've just left the repo, deactivate the environment
- # Note: this only happens if the virtualenv was activated automatically
- deactivate && unset CD_VIRTUAL_ENV
fi
fi
}
From 16ef5cca44d23fbde33de77cf44d0f05804d43e9 Mon Sep 17 00:00:00 2001
From: Robby Russell
Date: Fri, 20 Dec 2019 21:45:39 -0800
Subject: [PATCH 069/343] Update link for Pygments
Also moving the dependencies section up
---
plugins/colorize/README.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md
index 32dc97b6e..036724a1a 100644
--- a/plugins/colorize/README.md
+++ b/plugins/colorize/README.md
@@ -6,11 +6,17 @@ Colorize will highlight the content based on the filename extension. If it can't
method for a given extension, it will try to find one by looking at the file contents. If no highlight method
is found it will just cat the file normally, without syntax highlighting.
+## Setup
+
To use it, add colorize to the plugins array of your zshrc file:
```
plugins=(... colorize)
```
+### Requirements
+
+This plugin requires that Pygments be installed: [pygments.org](https://pygments.org/)
+
## 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:
@@ -29,7 +35,3 @@ Note that `cless` will behave as less when provided more than one file: you have
the commands `:n` for next and `:p` for previous. The downside is that less options are not supported.
But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`.
In the latter form, the file contents will be concatenated and presented by less as a single file.
-
-## Requirements
-
-You have to install Pygments first: [pygments.org](http://pygments.org/download.html)
From e204c596ef5a1075914c5e7810ec1eba4bbe7411 Mon Sep 17 00:00:00 2001
From: lieryan
Date: Sat, 21 Dec 2019 18:33:39 +1100
Subject: [PATCH 070/343] Rewrite gitstatus collection to be more robust
(#7322)
Fix the finicky parsing logic and just ask git the necessary information
directly.
---
plugins/git-prompt/gitstatus.py | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index 390a50a6f..300365d71 100644
--- a/plugins/git-prompt/gitstatus.py
+++ b/plugins/git-prompt/gitstatus.py
@@ -4,26 +4,21 @@ from __future__ import print_function
import os
import sys
import re
-import shlex
from subprocess import Popen, PIPE, check_output
def get_tagname_or_hash():
"""return tagname if exists else hash"""
- cmd = 'git log -1 --format="%h%d"'
- output = check_output(shlex.split(cmd)).decode('utf-8').strip()
- hash_, tagname = None, None
# get hash
- m = re.search('\(.*\)$', output)
- if m:
- hash_ = output[:m.start()-1]
- # get tagname
- m = re.search('tag: .*[,\)]', output)
- if m:
- tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1]
+ hash_cmd = ['git', 'rev-parse', '--short', 'HEAD']
+ hash_ = check_output(hash_cmd).strip()
- if tagname:
- return tagname.replace(' ', '')
+ # get tagname
+ tags_cmd = ['git', 'for-each-ref', '--points-at=HEAD', '--count=2', '--sort=-version:refname', '--format=%(refname:short)', 'refs/tags']
+ tags = check_output(tags_cmd).split()
+
+ if tags:
+ return tags[0] + ('+' if len(tags) > 1 else '')
elif hash_:
return hash_
return None
From e21fbe7dffff1619c2deb02eea8cccbd7e9814f4 Mon Sep 17 00:00:00 2001
From: ProbstDJakob
Date: Sun, 22 Dec 2019 21:21:14 +0100
Subject: [PATCH 071/343] colorize: update plugin to support less options
(#8392)
---
plugins/colorize/README.md | 18 +++---
plugins/colorize/colorize.plugin.zsh | 83 +++++++++++++++++++---------
2 files changed, 64 insertions(+), 37 deletions(-)
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md
index d37443011..ee4ab8036 100644
--- a/plugins/colorize/README.md
+++ b/plugins/colorize/README.md
@@ -17,10 +17,10 @@ plugins=(... colorize)
### Requirements
-This plugin requires that either of the following tools be installed:
+This plugin requires that at least one of the following tools is installed:
-* Chroma: [https://github.com/alecthomas/chroma](https://github.com/alecthomas/chroma)
-* Pygments be installed: [pygments.org](https://pygments.org/)
+* [Chroma](https://github.com/alecthomas/chroma)
+* [Pygments](https://pygments.org/download/)
### Colorize tool
@@ -41,12 +41,8 @@ ZSH_COLORIZE_STYLE="colorful"
## Usage
* `ccat [files]`: colorize the contents of the file (or files, if more than one are provided).
- If no arguments are passed it will colorize the standard input or stdin.
+ If no files are passed it will colorize the standard input.
-* `cless [files]`: colorize the contents of the file (or files, if more than one are provided) and
- open less. If no arguments are passed it will colorize the standard input or stdin.
-
-Note that `cless` will behave as less when provided more than one file: you have to navigate files with
-the commands `:n` for next and `:p` for previous. The downside is that less options are not supported.
-But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`.
-In the latter form, the file contents will be concatenated and presented by less as a single file.
+* `cless [less-options] [files]`: colorize the contents of the file (or files, if more than one are provided) and open less.
+ If no files are passed it will colorize the standard input.
+ The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope.
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index 3e91a9f46..6ed9739fa 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -1,8 +1,11 @@
-# easier alias to use the plugin
-alias ccat='colorize_via_pygmentize'
-alias cless='colorize_via_pygmentize_less'
+# Easier alias to use the plugin
+alias ccat="colorize_cat"
+alias cless="colorize_less"
-colorize_via_pygmentize() {
+# '$0:A' gets the absolute path of this file
+ZSH_COLORIZE_PLUGIN_PATH=$0:A
+
+colorize_check_requirements() {
local available_tools=("chroma" "pygmentize")
if [ -z "$ZSH_COLORIZE_TOOL" ]; then
@@ -23,6 +26,12 @@ colorize_via_pygmentize() {
echo "Package '$ZSH_COLORIZE_TOOL' is not installed!" >&2
return 1
fi
+}
+
+colorize_cat() {
+ if ! colorize_check_requirements; then
+ return 1
+ fi
# If the environment variable ZSH_COLORIZE_STYLE
# is set, use that theme instead. Otherwise,
@@ -32,7 +41,7 @@ colorize_via_pygmentize() {
ZSH_COLORIZE_STYLE="emacs"
fi
- # pygmentize stdin if no arguments passed
+ # Use stdin if no arguments have been passed.
if [ $# -eq 0 ]; then
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
@@ -42,12 +51,9 @@ colorize_via_pygmentize() {
return $?
fi
- # guess lexer from file extension, or
- # guess it from file contents if unsuccessful
-
+ # Guess lexer from file extension, or guess it from file contents if unsuccessful.
local FNAME lexer
- for FNAME in "$@"
- do
+ for FNAME in "$@"; do
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
lexer=$(pygmentize -N "$FNAME")
if [[ $lexer != text ]]; then
@@ -61,22 +67,47 @@ colorize_via_pygmentize() {
done
}
-colorize_via_pygmentize_less() (
- # this function is a subshell so tmp_files can be shared to cleanup function
- declare -a tmp_files
+# The less option 'F - Forward forever; like "tail -f".' will not work in this implementation
+# caused by the lack of the ability to follow the file within pygmentize.
+colorize_less() {
+ if ! colorize_check_requirements; then
+ return 1
+ fi
- cleanup () {
- [[ ${#tmp_files} -gt 0 ]] && rm -f "${tmp_files[@]}"
- exit
+ _cless() {
+ # LESS="-R $LESS" enables raw ANSI colors, while maintain already set options.
+ local LESS="-R $LESS"
+
+ # This variable tells less to pipe every file through the specified command
+ # (see the man page of less INPUT PREPROCESSOR).
+ # 'zsh -ic "colorize_cat %s 2> /dev/null"' would not work for huge files like
+ # the ~/.zsh_history. For such files the tty of the preprocessor will be supended.
+ # Therefore we must source this file to make colorize_cat available in the
+ # preprocessor without the interactive mode.
+ # `2>/dev/null` will suppress the error for large files 'broken pipe' of the python
+ # script pygmentize, which will show up if less has not fully "loaded the file"
+ # (e.g. when not scrolled to the bottom) while already the next file will be displayed.
+ local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
+ ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
+ colorize_cat %s 2> /dev/null'"
+
+ # LESSCLOSE will be set to prevent any errors by executing a user script
+ # which assumes that his LESSOPEN has been executed.
+ local LESSCLOSE=""
+
+ LESS="$LESS" LESSOPEN="$LESSOPEN" LESSCLOSE="$LESSCLOSE" less "$@"
}
- trap 'cleanup' EXIT HUP TERM INT
- while (( $# != 0 )); do #TODO: filter out less opts
- tmp_file="$(mktemp -t "tmp.colorize.XXXX.$(sed 's/\//./g' <<< "$1")")"
- tmp_files+=("$tmp_file")
- colorize_via_pygmentize "$1" > "$tmp_file"
- shift 1
- done
-
- less -f "${tmp_files[@]}"
-)
+ if [ -t 0 ]; then
+ _cless "$@"
+ else
+ # The input is not associated with a terminal, therefore colorize_cat will
+ # colorize this input and pass it to less.
+ # Less has now to decide what to use. If any files have been provided, less
+ # will ignore the input by default, otherwise the colorized input will be used.
+ # If files have been supplied and the input has been redirected, this will
+ # lead to unnecessary overhead, but retains the ability to use the less options
+ # without checking for them inside this script.
+ colorize_cat | _cless "$@"
+ fi
+}
From 38929084f98684b9267d7f0cfe3e7f9aa5f861d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 22 Dec 2019 23:03:54 +0100
Subject: [PATCH 072/343] fastfile: add README
---
plugins/fastfile/README.md | 84 ++++++++++++++++++++++++++++
plugins/fastfile/fastfile.plugin.zsh | 39 +++++--------
2 files changed, 98 insertions(+), 25 deletions(-)
create mode 100644 plugins/fastfile/README.md
diff --git a/plugins/fastfile/README.md b/plugins/fastfile/README.md
new file mode 100644
index 000000000..37f5b2f53
--- /dev/null
+++ b/plugins/fastfile/README.md
@@ -0,0 +1,84 @@
+# Fastfile plugin
+
+This plugin adds a way to reference certain files or folders used frequently using
+a global alias or shortcut.
+
+To use it, add `fastfile` to the plugins array in your zshrc file:
+```zsh
+plugins=(... fastfile)
+```
+
+## Usage
+
+Example: you access folder `/code/project/backend/database` very frequently.
+
+First, generate a shortcut with the name `pjdb`:
+```zsh
+$ fastfile pjdb /code/project/backend/database
+```
+
+Next time you want to access it, use `§pjdb`. For example:
+```zsh
+$ cd §pjdb
+$ subl §pjdb
+```
+where § is the fastfile prefix (see [below](#options) for how to change).
+
+**Note:** shortcuts with spaces in the name are assigned a global alias
+where the spaces have been substituted with underscores (`_`). For example:
+a shortcut named `"hello world"` corresponds with `§hello_world`.
+
+
+## Functions
+
+- `fastfile `: generate a shortcut.
+
+- `fastfile_print `: prints a shortcut, with the format
+ ` -> `.
+
+- `fastfile_ls`: lists all shortcuts.
+
+- `fastfile_rm `: remove a shortcut.
+
+- `fastfile_sync`: generates the global aliases for the shortcuts.
+
+
+### Internal functions
+
+- `fastfile_resolv `: resolves the location of the shortcut
+ file, i.e., the file in the fastfile directory where the shortcut path
+ is stored.
+
+- `fastfile_get `: get the real path of the shortcut.
+
+
+## Aliases
+
+| Alias | Function |
+|--------|------------------|
+| ff | `fastfile` |
+| ffp | `fastfile_print` |
+| ffrm | `fastfile_rm` |
+| ffls | `fastfile_ls` |
+| ffsync | `fastfile_sync` |
+
+
+## Options
+
+These are options you can set to change certain parts of the plugin. To change
+them, add `=` to your zshrc file, before Oh My Zsh is sourced.
+For example: `fastfile_var_prefix='@'`.
+
+- `fastfile_var_prefix`: prefix for the global aliases created. Controls the prefix of the
+ created global aliases.
+ **Default:** `§` (section sign), easy to type in a german keyboard via the combination
+ [`⇧ Shift`+`3`](https://en.wikipedia.org/wiki/German_keyboard_layout#/media/File:KB_Germany.svg),
+ or using `⌥ Option`+`6` in macOS.
+
+- `fastfile_dir`: directory where the fastfile shortcuts are stored. Needs to end
+ with a trailing slash.
+ **Default:** `$HOME/.fastfile/`.
+
+## Author
+
+- [Karolin Varner](https://github.com/koraa)
diff --git a/plugins/fastfile/fastfile.plugin.zsh b/plugins/fastfile/fastfile.plugin.zsh
index 775e9483e..a4229e4c2 100644
--- a/plugins/fastfile/fastfile.plugin.zsh
+++ b/plugins/fastfile/fastfile.plugin.zsh
@@ -1,15 +1,5 @@
-################################################################################
-# FILE: fastfile.plugin.zsh
-# DESCRIPTION: oh-my-zsh plugin file.
-# AUTHOR: Michael Varner (musikmichael@web.de)
-# VERSION: 1.0.0
-#
-# This plugin adds the ability to on the fly generate and access file shortcuts.
-#
-################################################################################
-
###########################
-# Settings
+# Settings
# These can be overwritten any time.
# If they are not set yet, they will be
@@ -33,7 +23,7 @@ default fastfile_var_prefix "§"
function fastfile() {
test "$2" || 2="."
file=$(readlink -f "$2")
-
+
test "$1" || 1="$(basename "$file")"
name=$(echo "$1" | tr " " "_")
@@ -51,7 +41,7 @@ function fastfile() {
# Arguments:
# 1. name - The name of the shortcut
# STDOUT:
-# The path
+# The path to the shortcut file
#
function fastfile_resolv() {
echo "${fastfile_dir}${1}"
@@ -88,12 +78,12 @@ function fastfile_print() {
# (=> fastfle_print) for each shortcut
#
function fastfile_ls() {
- for f in "${fastfile_dir}"/*; do
- file=`basename "$f"` # To enable simpler handeling of spaces in file names
- varkey=`echo "$file" | tr " " "_"`
+ for f in "${fastfile_dir}"/*; do
+ file=`basename "$f"` # To enable simpler handeling of spaces in file names
+ varkey=`echo "$file" | tr " " "_"`
- # Special format for colums
- echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")"
+ # Special format for colums
+ echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")"
done | column -t -s "|"
}
@@ -102,7 +92,6 @@ function fastfile_ls() {
#
# Arguments:
# 1. name - The name of the shortcut (default: name of the file)
-# 2. file - The file or directory to make the shortcut for
# STDOUT:
# => fastfle_print
#
@@ -115,11 +104,11 @@ function fastfile_rm() {
# Generate the aliases for the shortcuts
#
function fastfile_sync() {
- for f in "${fastfile_dir}"/*; do
- file=`basename "$f"` # To enable simpler handeling of spaces in file names
- varkey=`echo "$file" | tr " " "_"`
+ for f in "${fastfile_dir}"/*; do
+ file=`basename "$f"` # To enable simpler handeling of spaces in file names
+ varkey=`echo "$file" | tr " " "_"`
- alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'"
+ alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'"
done
}
@@ -133,6 +122,6 @@ alias ffls=fastfile_ls
alias ffsync=fastfile_sync
##################################
-# Init
+# Init
-fastfile_sync
\ No newline at end of file
+fastfile_sync
From 7360d898d8b64b40276eab72bcd9e1ea4fc8f7ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 26 Dec 2019 23:12:17 +0100
Subject: [PATCH 073/343] gas: add README
---
plugins/gas/README.md | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 plugins/gas/README.md
diff --git a/plugins/gas/README.md b/plugins/gas/README.md
new file mode 100644
index 000000000..cd8800e7d
--- /dev/null
+++ b/plugins/gas/README.md
@@ -0,0 +1,9 @@
+# Gas plugin
+
+This plugin adds autocompletion for the [gas](http://walle.github.com/gas) command,
+a utility to manage Git authors.
+
+To use it, add `gas` to the plugins array of your zshrc file:
+```zsh
+plugins=(... gas)
+```
From 59930902e1bee022ec031cd276df66174e1990d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 26 Dec 2019 23:23:23 +0100
Subject: [PATCH 074/343] glassfish: add README
---
plugins/glassfish/README.md | 9 +++++++++
plugins/glassfish/glassfish.plugin.zsh | 3 ---
2 files changed, 9 insertions(+), 3 deletions(-)
create mode 100644 plugins/glassfish/README.md
diff --git a/plugins/glassfish/README.md b/plugins/glassfish/README.md
new file mode 100644
index 000000000..1f4a8be34
--- /dev/null
+++ b/plugins/glassfish/README.md
@@ -0,0 +1,9 @@
+# glassfish
+
+The glassfish plugin adds completion for the `asadmin` utility, a command to manage
+[Oracle GlassFish](https://docs.oracle.com/cd/E18930_01/html/821-2416/giobi.html) servers.
+
+To use it, add `glassfish` to the plugins array in your zshrc file:
+```zsh
+plugins=(... glassfish)
+```
diff --git a/plugins/glassfish/glassfish.plugin.zsh b/plugins/glassfish/glassfish.plugin.zsh
index fde2edb2a..e69de29bb 100644
--- a/plugins/glassfish/glassfish.plugin.zsh
+++ b/plugins/glassfish/glassfish.plugin.zsh
@@ -1,3 +0,0 @@
-# if there is a user named 'glassfish' on the system, we'll assume
-# that is the user asadmin should be run as
-# grep -e '^glassfish' /etc/passwd > /dev/null && alias asadmin='sudo -u glassfish asadmin'
\ No newline at end of file
From a952854c122c0e728f7bb5577fabda6b6a0c6a79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 00:04:40 +0100
Subject: [PATCH 075/343] gnu-utils: add README, simplify plugin
---
plugins/gnu-utils/README.md | 38 +++++++
plugins/gnu-utils/gnu-utils.plugin.zsh | 148 ++++++++++++-------------
2 files changed, 112 insertions(+), 74 deletions(-)
create mode 100644 plugins/gnu-utils/README.md
diff --git a/plugins/gnu-utils/README.md b/plugins/gnu-utils/README.md
new file mode 100644
index 000000000..f5fa81e2f
--- /dev/null
+++ b/plugins/gnu-utils/README.md
@@ -0,0 +1,38 @@
+# gnu-utils plugin
+
+This plugin binds GNU coreutils to their default names, so that you don't have
+to call them using their prefixed name, which starts with `g`. This is useful
+in systems which don't have GNU coreutils installed by default, mainly macOS
+or FreeBSD, which use BSD coreutils.
+
+To use it, add `gnu-utils` to the plugins array in your zshrc file:
+```zsh
+plugins=(... gnu-utils)
+```
+
+The plugin works by changing the path that the command hash points to, so
+instead of `ls` pointing to `/bin/ls`, it points to wherever `gls` is
+installed.
+
+Since `hash -rf` or `rehash` refreshes the command hashes, it also wraps
+`hash` and `rehash` so that the coreutils binding is always done again
+after calling these two commands.
+
+Look at the source code of the plugin to see which GNU coreutils are tried
+to rebind. Open an issue if there are some missing.
+
+## Other methods
+
+The plugin also documents two other ways to do this:
+
+1. Using a function wrapper, such that, for example, there exists a function
+named `ls` which calls `gls` instead. Since functions have a higher preference
+than commands, this ends up calling the GNU coreutil. It has also a higher
+preference over shell builtins (`gecho` is called instead of the builtin `echo`).
+
+2. Using an alias. This has an even higher preference than functions, but they
+could be overridden because of a user setting.
+
+## Author
+
+- [Sorin Ionescu](https://github.com/sorin-ionescu).
diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
index b66e25d7f..967b8b4ea 100644
--- a/plugins/gnu-utils/gnu-utils.plugin.zsh
+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
@@ -5,79 +5,79 @@
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
-
-if [[ -x "${commands[gwhoami]}" ]]; then
- __gnu_utils() {
- emulate -L zsh
- local gcmds
- local gcmd
- local cmd
- local prefix
-
- # coreutils
- gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
- 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
- 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
- 'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
- 'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
- 'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
- 'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
- 'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
- 'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
- 'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
- 'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
- 'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
- 'gwhoami' 'gyes')
-
- # findutils
- gcmds+=('gfind' 'gxargs' 'glocate')
-
- # Not part of either coreutils or findutils, installed separately.
- gcmds+=('gsed' 'gtar' 'gtime')
-
- for gcmd in "${gcmds[@]}"; do
- #
- # This method allows for builtin commands to be primary but it's
- # lost if hash -r or rehash -f is executed. Thus, those two
- # functions have to be wrapped.
- #
- (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
-
- #
- # This method generates wrapper functions.
- # It will override shell builtins.
- #
- # (( ${+commands[$gcmd]} )) && \
- # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
-
- #
- # This method is inflexible since the aliases are at risk of being
- # overridden resulting in the BSD coreutils being called.
- #
- # (( ${+commands[$gcmd]} )) && \
- # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
- done
-
- return 0
- }
- __gnu_utils;
-
- function hash() {
- if [[ "$*" =~ "-(r|f)" ]]; then
- builtin hash "$@"
- __gnu_utils
- else
- builtin hash "$@"
- fi
- }
-
- function rehash() {
- if [[ "$*" =~ "-f" ]]; then
- builtin rehash "$@"
- __gnu_utils
- else
- builtin rehash "$@"
- fi
- }
+# Detect if GNU coreutils are installed by looking for gwhoami
+if [[ ! -x "${commands[gwhoami]}" ]]; then
+ return
fi
+__gnu_utils() {
+ emulate -L zsh
+ local gcmds
+ local gcmd
+ local cmd
+ local prefix
+
+ # coreutils
+ gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
+ 'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
+ 'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
+ 'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
+ 'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
+ 'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
+ 'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
+ 'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
+ 'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
+ 'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
+ 'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
+ 'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
+ 'gwhoami' 'gyes')
+
+ # findutils
+ gcmds+=('gfind' 'gxargs' 'glocate')
+
+ # Not part of either coreutils or findutils, installed separately.
+ gcmds+=('gsed' 'gtar' 'gtime')
+
+ for gcmd in "${gcmds[@]}"; do
+ # Do nothing if the command isn't found
+ (( ${+commands[$gcmd]} )) || continue
+
+ # This method allows for builtin commands to be primary but it's
+ # lost if hash -r or rehash -f is executed. Thus, those two
+ # functions have to be wrapped.
+ #
+ hash ${gcmd[2,-1]}=${commands[$gcmd]}
+
+ # This method generates wrapper functions.
+ # It will override shell builtins.
+ #
+ # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
+
+ # This method is inflexible since the aliases are at risk of being
+ # overridden resulting in the BSD coreutils being called.
+ #
+ # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
+ done
+
+ return 0
+}
+__gnu_utils
+
+function hash() {
+ if [[ "$*" =~ "-(r|f)" ]]; then
+ builtin hash "$@"
+ __gnu_utils
+ else
+ builtin hash "$@"
+ fi
+}
+
+function rehash() {
+ if [[ "$*" =~ "-f" ]]; then
+ builtin rehash "$@"
+ __gnu_utils
+ else
+ builtin rehash "$@"
+ fi
+}
+
From 132607447d24477bcedac7e0accd3fe83b9b6a1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 00:49:50 +0100
Subject: [PATCH 076/343] knife: add README and reformat completion file
---
plugins/knife/README.md | 25 +++++
plugins/knife/_knife | 215 +++++++++++++++++++++-------------------
2 files changed, 136 insertions(+), 104 deletions(-)
create mode 100644 plugins/knife/README.md
diff --git a/plugins/knife/README.md b/plugins/knife/README.md
new file mode 100644
index 000000000..b167f1655
--- /dev/null
+++ b/plugins/knife/README.md
@@ -0,0 +1,25 @@
+# knife plugin
+
+This plugin adds completion for [knife](https://docs.chef.io/knife.html), a command-line tool
+to interact with [Chef](https://chef.io), a platform to automate and manage infrastructure via
+code.
+
+To use it, add `knife` to the plugins array in your zshrc file:
+```zsh
+plugins=(... knife)
+```
+
+## Options
+
+- `KNIFE_RELATIVE_PATH`: if set to `true`, the completion script will look for local cookbooks
+ under the `cookbooks` folder in the chef root directory. It has preference over the other two
+ options below. **Default:** empty.
+
+- `KNIFE_COOKBOOK_PATH`: if set, it points to the folder that contains local cookbooks, for
+ example: `/path/to/my/chef/cookbooks`. **Default:** `cookbook_path` field in `knife.rb`
+ (see below).
+
+- `KNIFE_CONF_PATH`: variable pointing to the `knife.rb` configuration file, for example
+ `/path/to/my/.chef/knife.rb`. Only used if `$KNIFE_COOKBOOK_PATH` isn't set. If it exists,
+ `$PWD/.chef/knife.rb` is used instead. Otherwise, if it's set, its value is used.
+ **Default**: `$HOME/.chef/knife.rb`.
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index 0d61ff15c..06b12a3b0 100644
--- a/plugins/knife/_knife
+++ b/plugins/knife/_knife
@@ -3,13 +3,13 @@
# You can override the path to knife.rb and your cookbooks by setting
# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb
# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks
-# If you want your local cookbooks path to be calculated relative to where you are then
+# If you want your local cookbooks path to be calculated relative to where you are then
# set the below option
-# KNIFE_RELATIVE_PATH=true
+# KNIFE_RELATIVE_PATH=true
# Read around where these are used for more detail.
# These flags should be available everywhere according to man knife
-knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
+knife_general_flags=(--help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes)
# knife has a very special syntax, some example calls are:
# knife status
@@ -25,183 +25,191 @@ _knife() {
typeset -A opt_args
cloudproviders=(bluebox ec2 rackspace slicehost terremark)
_arguments \
- '1: :->knifecmd'\
- '2: :->knifesubcmd'\
+ '1: :->knifecmd' \
+ '2: :->knifesubcmd' \
'3: :->knifesubcmd2' \
'4: :->knifesubcmd3' \
'5: :->knifesubcmd4' \
'6: :->knifesubcmd5'
-
+
case $state in
knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload vault windows $cloudproviders
- ;;
+ ;;
knifesubcmd)
case $words[2] in
- (bluebox|ec2|rackspace|slicehost|terremark)
+ bluebox|ec2|rackspace|slicehost|terremark)
compadd "$@" server images
- ;;
+ ;;
client)
compadd -Q "$@" "bulk delete" list create show delete edit reregister
- ;;
+ ;;
configure)
compadd "$@" client
- ;;
+ ;;
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
- ;;
+ ;;
diff)
_arguments '*:file or directory:_files -g "*"'
- ;;
+ ;;
environment)
compadd -Q "$@" list create delete edit show "from file"
- ;;
+ ;;
node)
- compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
- ;;
+ compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
+ ;;
recipe)
- compadd "$@" list
- ;;
+ compadd "$@" list
+ ;;
role)
compadd -Q "$@" "bulk delete" create delete edit "from file" list show
- ;;
+ ;;
upload)
- _arguments '*:file or directory:_files -g "*"'
- ;;
+ _arguments '*:file or directory:_files -g "*"'
+ ;;
vault)
compadd -Q "$@" create decrypt delete edit remove "rotate all keys" "rotate keys" show update
- ;;
+ ;;
windows)
compadd "$@" bootstrap
- ;;
+ ;;
*)
- _arguments '2:Subsubcommands:($(_knife_options1))'
+ _arguments '2:Subsubcommands:($(_knife_options1))'
+ ;;
esac
- ;;
- knifesubcmd2)
+ ;;
+ knifesubcmd2)
case $words[3] in
- server)
+ server)
compadd "$@" list create delete
- ;;
- images)
+ ;;
+ images)
compadd "$@" list
- ;;
- site)
+ ;;
+ site)
compadd "$@" vendor show share search download list unshare
- ;;
- (show|delete|edit)
- _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
- ;;
- (upload|test)
- _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
- ;;
+ ;;
+ show|delete|edit)
+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
+ ;;
+ upload|test)
+ _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
+ ;;
list)
- compadd -a "$@" knife_general_flags
- ;;
+ compadd -a "$@" knife_general_flags
+ ;;
bag)
compadd -Q "$@" show edit list "from file" create delete
- ;;
+ ;;
*)
_arguments '3:Subsubcommands:($(_knife_options2))'
+ ;;
esac
- ;;
- knifesubcmd3)
- case $words[3] in
- show)
- case $words[2] in
- cookbook)
- versioncomp=1
- _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
- ;;
- (node|client|role)
- compadd "$@" --attribute
- esac
- esac
- case $words[4] in
- (show|edit)
- _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
;;
- file)
+ knifesubcmd3)
+ case $words[3] in
+ show)
+ case $words[2] in
+ cookbook)
+ versioncomp=1
+ _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
+ ;;
+ node|client|role)
+ compadd "$@" --attribute
+ ;;
+ esac
+ ;;
+ esac
+ case $words[4] in
+ show|edit)
+ _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
+ ;;
+ file)
case $words[2] in
environment)
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_chef_root)/environments"'
- ;;
+ ;;
node)
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_chef_root)/nodes"'
- ;;
+ ;;
role)
_arguments '*:files:_path_files -g "*.(rb|json)" -W "$(_chef_root)/roles"'
- ;;
+ ;;
*)
_arguments '*:Subsubcommands:($(_knife_options3))'
- esac
- ;;
- list)
- compadd -a "$@" knife_general_flags
- ;;
- *)
- _arguments '*:Subsubcommands:($(_knife_options3))'
+ ;;
+ esac
+ ;;
+ list)
+ compadd -a "$@" knife_general_flags
+ ;;
+ *)
+ _arguments '*:Subsubcommands:($(_knife_options3))'
+ ;;
esac
;;
- knifesubcmd4)
- if (( versioncomp > 0 )); then
- compadd "$@" attributes definitions files libraries providers recipes resources templates
- else
- case $words[5] in
- file)
- _arguments '*:directory:_path_files -/ -W "$(_chef_root)/data_bags" -qS \ '
+ knifesubcmd4)
+ if ((versioncomp > 0)); then
+ compadd "$@" attributes definitions files libraries providers recipes resources templates
+ else
+ case $words[5] in
+ file)
+ _arguments '*:directory:_path_files -/ -W "$(_chef_root)/data_bags" -qS \ '
;;
- *) _arguments '*:Subsubcommands:($(_knife_options2))'
+ *) _arguments '*:Subsubcommands:($(_knife_options2))' ;;
esac
- fi
- ;;
- knifesubcmd5)
- case $words[5] in
- file)
- _arguments '*:files:_path_files -g "*.json" -W "$(_chef_root)/data_bags/$words[6]"'
- ;;
- *)
- _arguments '*:Subsubcommands:($(_knife_options3))'
- esac
- esac
+ fi
+ ;;
+ knifesubcmd5)
+ case $words[5] in
+ file)
+ _arguments '*:files:_path_files -g "*.json" -W "$(_chef_root)/data_bags/$words[6]"'
+ ;;
+ *)
+ _arguments '*:Subsubcommands:($(_knife_options3))'
+ ;;
+ esac
+ ;;
+ esac
}
# Helper functions to provide the argument completion for several depths of commands
_knife_options1() {
- ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+ (for line in $(knife $words[2] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
}
_knife_options2() {
- ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+ (for line in $(knife $words[2] $words[3] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
}
_knife_options3() {
- ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+ (for line in $(knife $words[2] $words[3] $words[4] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
}
# The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() {
- (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_clients_remote() {
- (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_nodes_remote() {
- (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_cookbooks_remote() {
- (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_sitecookbooks_remote() {
- (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_data_bags_remote() {
- (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_environments_remote() {
@@ -210,14 +218,14 @@ _chef_environments_remote() {
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
- if [ $KNIFE_RELATIVE_PATH ]; then
+ if [ $KNIFE_RELATIVE_PATH ]; then
local cookbook_path="$(_chef_root)/cookbooks"
- else
+ else
local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}
if [ -f ./.chef/knife.rb ]; then
knife_rb="./.chef/knife.rb"
fi
- local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
+ local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/')}
fi
(for i in $cookbook_path; do ls $i; done)
}
@@ -227,12 +235,11 @@ _cookbook_versions() {
(knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
}
-# Searches up from current directory to find the closest folder that has a .chef folder
-# Useful for the knife upload/from file commands
-_chef_root () {
+# Searches up from current directory to find the closest folder that has a .chef folder
+# Useful for the knife upload/from file commands
+_chef_root() {
directory="$PWD"
- while [ $directory != '/' ]
- do
+ while [ $directory != '/' ]; do
test -e "$directory/.chef" && echo "$directory" && return
directory="${directory:h}"
done
From 9c0ceb7a5291950551d95d9314573c26c73e6b0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 00:56:03 +0100
Subject: [PATCH 077/343] knife_ssh: add README
---
plugins/knife_ssh/README.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 plugins/knife_ssh/README.md
diff --git a/plugins/knife_ssh/README.md b/plugins/knife_ssh/README.md
new file mode 100644
index 000000000..cb836b7f3
--- /dev/null
+++ b/plugins/knife_ssh/README.md
@@ -0,0 +1,14 @@
+# knife_ssh plugin
+
+This plugin adds a `knife_ssh` function as well as completion for it, to allow
+connecting via ssh to servers managed with [Chef](https://www.chef.io/).
+
+To use it, add `knife_ssh` to the plugins array in your zshrc file:
+```zsh
+plugins=(... knife_ssh)
+```
+
+The plugin creates a cache of the Chef node list via `knife`, and stores it
+in `$HOME/.knife_comp~`, when first triggering knife_ssh completion.
+
+**Requirements:** `knife` has to be installed.
From e891fbff9e2e70acfbeff0734cd1fc012861e6ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 00:58:31 +0100
Subject: [PATCH 078/343] knife_ssh: small tweaks
---
plugins/knife_ssh/knife_ssh.plugin.zsh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/plugins/knife_ssh/knife_ssh.plugin.zsh b/plugins/knife_ssh/knife_ssh.plugin.zsh
index 7fdd42a1e..dc425a33e 100644
--- a/plugins/knife_ssh/knife_ssh.plugin.zsh
+++ b/plugins/knife_ssh/knife_ssh.plugin.zsh
@@ -1,17 +1,17 @@
function knife_ssh() {
- grep -q $1 ~/.knife_comp~ 2> /dev/null || rm -f ~/.knife_comp~;
+ grep -q $1 ~/.knife_comp~ 2> /dev/null || rm -f ~/.knife_comp~
ssh $(knife node show $1 | awk '/IP:/{print $2}')
}
_knife_ssh() {
if hash knife 2>/dev/null; then
if [[ ! -f ~/.knife_comp~ ]]; then
- echo "\nGenerating ~/.knife_comp~..." >/dev/stderr
+ echo "\nGenerating ~/.knife_comp~..." >&2
knife node list > ~/.knife_comp~
fi
- compadd $(<~/.knife_comp~)
+ compadd $(< ~/.knife_comp~)
else
- echo "Could not find knife" > /dev/stderr;
+ echo "Could not find knife" >&2
fi
}
From 4fd25920070f85bf358d297e79af1e85aac07f5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 01:05:47 +0100
Subject: [PATCH 079/343] paver: add README
---
plugins/paver/README.md | 12 ++++++++++++
plugins/paver/paver.plugin.zsh | 6 +++---
2 files changed, 15 insertions(+), 3 deletions(-)
create mode 100644 plugins/paver/README.md
diff --git a/plugins/paver/README.md b/plugins/paver/README.md
new file mode 100644
index 000000000..c38d898ba
--- /dev/null
+++ b/plugins/paver/README.md
@@ -0,0 +1,12 @@
+# Paver
+
+This plugin adds completion for the `paver` command-line tool of [Paver](https://pythonhosted.org/Paver/).
+
+To use it, add `paver` to the plugins array of your zshrc file:
+```zsh
+plugins=(... paver)
+```
+
+The completion function creates a cache of paver tasks with the name `.paver_tasks`,
+in the current working directory. It regenerates that cache when the `pavement.py`
+changes.
diff --git a/plugins/paver/paver.plugin.zsh b/plugins/paver/paver.plugin.zsh
index 40bdbd12f..7e70ea37c 100644
--- a/plugins/paver/paver.plugin.zsh
+++ b/plugins/paver/paver.plugin.zsh
@@ -1,7 +1,7 @@
_paver_does_target_list_need_generating () {
- [ ! -f .paver_targets ] && return 0;
- [ pavement.py -nt .paver_targets ] && return 0;
- return 1;
+ [ ! -f .paver_targets ] && return 0
+ [ pavement.py -nt .paver_targets ] && return 0
+ return 1
}
_paver () {
From 9655377b9e02284188deddd3829159a0e35cc48f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 01:54:02 +0100
Subject: [PATCH 080/343] rbfu: add README
---
plugins/rbfu/README.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 plugins/rbfu/README.md
diff --git a/plugins/rbfu/README.md b/plugins/rbfu/README.md
new file mode 100644
index 000000000..f1f9fa2f7
--- /dev/null
+++ b/plugins/rbfu/README.md
@@ -0,0 +1,17 @@
+# rbfu plugin
+
+This plugin starts [rbfu](https://github.com/hmans/rbfu), a minimal Ruby version
+manager, and adds some useful functions.
+
+To use it, add `rbfu` to the plugins array in your zshrc file:
+```zsh
+plugins=(... rbfu)
+```
+
+**Note: `rbfu` is deprecated and should no longer be used.**
+
+## Functions
+
+- `rbfu-rubies`: lists all installed rubies available to rbfu.
+
+- `rvm_prompt_info`: shows the Ruby version being used with rbfu.
From 0c2f7514fc65d23fe86ad4c8eb6807ec7c18043f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:07:59 +0100
Subject: [PATCH 081/343] sfffe: add README
---
plugins/sfffe/README.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 plugins/sfffe/README.md
diff --git a/plugins/sfffe/README.md b/plugins/sfffe/README.md
new file mode 100644
index 000000000..29044e85b
--- /dev/null
+++ b/plugins/sfffe/README.md
@@ -0,0 +1,17 @@
+# "Search files for Front-End"
+
+This plugin adds a few functions for searching files used in Front-End web development.
+
+To use it, add `sfffe` to the plugins array in your zshrc file:
+```zsh
+plugins=(... sfffe)
+```
+
+**Requires:** `ack`
+
+## Functions
+
+- `ajs`: look for string in `.js` files.
+- `acss`: look for string in `.css` files.
+- `fjs`: search for `.js` files under the current working directory.
+- `fcss`: search for `.css` files under the current working directory.
From ca8a5a0a84d4bb38c0a953e633a7ee446037a616 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:25:59 +0100
Subject: [PATCH 082/343] svn-fast-info: add README, reorg. plugin
---
plugins/svn-fast-info/README.md | 55 +++++++++++++++++++
.../svn-fast-info/svn-fast-info.plugin.zsh | 42 +++++++-------
2 files changed, 75 insertions(+), 22 deletions(-)
create mode 100644 plugins/svn-fast-info/README.md
diff --git a/plugins/svn-fast-info/README.md b/plugins/svn-fast-info/README.md
new file mode 100644
index 000000000..04c596fd8
--- /dev/null
+++ b/plugins/svn-fast-info/README.md
@@ -0,0 +1,55 @@
+# svn-fast-info plugin
+
+Faster alternative to the main SVN plugin implementation. Works with svn 1.6 and newer.
+Use as a drop-in replacement to the svn plugin, not as complementary.
+
+To use it, add `svn-fast-info` to the plugins array in your zshrc file:
+```zsh
+plugins=(... svn-fast-info)
+```
+
+It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
+It displays the current status of the local files (added, deleted, modified, replaced, or else...)
+
+Use `svn_prompt_info` method to display the svn repository status in your theme.
+
+## Functions
+
+- `svn_prompt_info`: displays all the available information regarding the status of the svn repository.
+
+- `svn_repo_need_upgrade`: shows whether the repository needs upgrading. `svn_prompt_info` queries the
+ rest of functions or not based on the result of this function.
+
+- `svn_current_branch_name`: shows the current branch.
+
+- `svn_repo_root_name`: displays the repository root.
+
+- `svn_current_revision`: shows the currently checked-out revision.
+
+- `svn_status_info`: shows a bunch of symbols depending on the status of the files in the repository.
+
+## Options
+
+- `ZSH_THEME_SVN_PROMPT_PREFIX`: sequence displayed at the beginning of the prompt info output.
+
+- `ZSH_THEME_SVN_PROMPT_SUFFIX`: sequence displayed at the end of the prompt info output.
+
+- `ZSH_THEME_SVN_PROMPT_CLEAN`: sequence displayed when the status of the repository is clean.
+
+- `ZSH_THEME_SVN_PROMPT_ADDITIONS`: sequence displayed if there are added files in the repository.
+ **Default:** `+`.
+
+- `ZSH_THEME_SVN_PROMPT_DELETIONS`: sequence displayed if there are deleted files in the repository.
+ **Default:** `✖`.
+
+- `ZSH_THEME_SVN_PROMPT_MODIFICATIONS`: sequence displayed if there are modified files in the repository.
+ **Default:** `✎`.
+
+- `ZSH_THEME_SVN_PROMPT_REPLACEMENTS`: sequence displayed if there are replaced files in the repository.
+ **Default:** `∿`.
+
+- `ZSH_THEME_SVN_PROMPT_UNTRACKED`: sequence displayed if there are untracked files in the repository.
+ **Default:** `?`.
+
+- `ZSH_THEME_SVN_PROMPT_DIRTY`: sequence displayed if the repository is dirty.
+ **Default:** `!`.
diff --git a/plugins/svn-fast-info/svn-fast-info.plugin.zsh b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
index fe5265315..f40a59685 100644
--- a/plugins/svn-fast-info/svn-fast-info.plugin.zsh
+++ b/plugins/svn-fast-info/svn-fast-info.plugin.zsh
@@ -1,17 +1,6 @@
-# vim:ft=zsh ts=2 sw=2 sts=2 et
-#
-# Faster alternative to the current SVN plugin implementation.
-#
-# Works with svn 1.6, 1.7, 1.8.
-# Use `svn_prompt_info` method to enquire the svn data.
-# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
-# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
-#
-# Use as a drop-in replacement of the svn plugin not as complementary plugin
-
function svn_prompt_info() {
local info
- info=$(svn info 2>&1) || return 1; # capture stdout and stderr
+ info=$(svn info 2>&1) || return 1 # capture stdout and stderr
local repo_need_upgrade=$(svn_repo_need_upgrade $info)
if [[ -n $repo_need_upgrade ]]; then
@@ -27,7 +16,6 @@ function svn_prompt_info() {
printf '%s%s%s%s %s%s%s:%s%s%s%s' \
"$ZSH_PROMPT_BASE_COLOR" \
"$ZSH_THEME_SVN_PROMPT_PREFIX" \
- \
"$(svn_status_info $info)" \
"$ZSH_PROMPT_BASE_COLOR" \
\
@@ -37,14 +25,13 @@ function svn_prompt_info() {
\
"$(svn_current_revision $info)" \
"$ZSH_PROMPT_BASE_COLOR" \
- \
"$ZSH_THEME_SVN_PROMPT_SUFFIX" \
"$ZSH_PROMPT_BASE_COLOR"
fi
}
function svn_repo_need_upgrade() {
- grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
+ grep -q "E155036" <<< "${1:-$(svn info 2> /dev/null)}" && \
echo "E155036: upgrade repo with svn upgrade"
}
@@ -63,12 +50,23 @@ function svn_current_revision() {
function svn_status_info() {
local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
local svn_status="$(svn status 2> /dev/null)";
- if command grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
- if command grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"; fi
- if command grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
- if command grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"; fi
- if command grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
- if command grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DIRTY:-!}"; fi
+ if command grep -E '^\s*A' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"
+ fi
+ if command grep -E '^\s*D' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"
+ fi
+ if command grep -E '^\s*M' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"
+ fi
+ if command grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"
+ fi
+ if command grep -E '^\s*\?' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"
+ fi
+ if command grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then
+ svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DIRTY:-!}"
+ fi
echo $svn_status_string
}
-
From 8ea20fdca794a2a2c2f39cebd1e1861f9f0c6fbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:34:35 +0100
Subject: [PATCH 083/343] tmux-cssh: add README
---
plugins/tmux-cssh/README.md | 10 ++++++++++
plugins/tmux-cssh/_tmux-cssh | 24 ++++++++++++------------
2 files changed, 22 insertions(+), 12 deletions(-)
create mode 100644 plugins/tmux-cssh/README.md
diff --git a/plugins/tmux-cssh/README.md b/plugins/tmux-cssh/README.md
new file mode 100644
index 000000000..4602a502a
--- /dev/null
+++ b/plugins/tmux-cssh/README.md
@@ -0,0 +1,10 @@
+# tmux-cssh plugin
+
+This plugin adds autocompletion for [`tmux-cssh`](https://github.com/zinic/tmux-cssh/).
+
+To use it, add `tmux-cssh` to the plugins array in your zshrc file:
+```zsh
+plugins=(... tmux-cssh)
+```
+
+First upstream repo, now disappeared: https://github.com/dennishafemann/tmux-cssh.
diff --git a/plugins/tmux-cssh/_tmux-cssh b/plugins/tmux-cssh/_tmux-cssh
index 604e2e478..3e81b82ea 100644
--- a/plugins/tmux-cssh/_tmux-cssh
+++ b/plugins/tmux-cssh/_tmux-cssh
@@ -5,21 +5,21 @@
# Author: Manfred Touron (@moul)
_arguments \
-'(-h --help)'{-h,--help}'[This help.]' \
-'(-u --user)'{-u,--user}'[User to use.]' \
-'(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \
-'(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \
-'(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \
-'(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \
-'(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \
-'(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \
-'(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \
-'(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \
+ '(-h --help)'{-h,--help}'[This help.]' \
+ '(-u --user)'{-u,--user}'[User to use.]' \
+ '(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \
+ '(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \
+ '(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \
+ '(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \
+ '(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \
+ '(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \
+ '(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \
+ '(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \
':hosts:_hosts' \
'*:: :->subcmds' \
&& return 0
if (( CURRENT == 1 )); then
- _describe -t commands "tmux-cssh command"
- return
+ _describe -t commands "tmux-cssh command"
+ return
fi
From 67b5bfaaa316212221a01d4fe2eedcd0fc64c230 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:37:27 +0100
Subject: [PATCH 084/343] Rename some plugin READMEs for consistency
---
plugins/firewalld/{readme.md => README.md} | 0
plugins/magic-enter/{Readme.md => README.md} | 0
plugins/ros/{README.mkd => README.md} | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename plugins/firewalld/{readme.md => README.md} (100%)
rename plugins/magic-enter/{Readme.md => README.md} (100%)
rename plugins/ros/{README.mkd => README.md} (100%)
diff --git a/plugins/firewalld/readme.md b/plugins/firewalld/README.md
similarity index 100%
rename from plugins/firewalld/readme.md
rename to plugins/firewalld/README.md
diff --git a/plugins/magic-enter/Readme.md b/plugins/magic-enter/README.md
similarity index 100%
rename from plugins/magic-enter/Readme.md
rename to plugins/magic-enter/README.md
diff --git a/plugins/ros/README.mkd b/plugins/ros/README.md
similarity index 100%
rename from plugins/ros/README.mkd
rename to plugins/ros/README.md
From c63fca8581352028651f6bc9c2074620c3a27352 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:47:26 +0100
Subject: [PATCH 085/343] otp: add README and use clipcopy
---
plugins/otp/README.md | 22 ++++++++++++++++++++++
plugins/otp/otp.plugin.zsh | 19 +++++--------------
2 files changed, 27 insertions(+), 14 deletions(-)
create mode 100644 plugins/otp/README.md
diff --git a/plugins/otp/README.md b/plugins/otp/README.md
new file mode 100644
index 000000000..8331fd02b
--- /dev/null
+++ b/plugins/otp/README.md
@@ -0,0 +1,22 @@
+# otp plugin
+
+This plugin allows you to create one-time passwords using [`oathtool`](https://www.nongnu.org/oath-toolkit/man-oathtool.html),
+able to replace MFA devices. The oathtool key is kept in a GPG-encrypted file so the codes
+can only be generated by a user able to decrypt it.
+
+To use it, add `otp` to the plugins array in your zshrc file:
+```zsh
+plugins=(... otp)
+```
+
+Provided aliases:
+
+- `otp_add_device`: creates a new encrypted storage for an oathtool key and stores it
+ on the disk. For encrypting the key, it will ask for a GPG user ID (your GPG key's
+ email address). Then the OTP key needs to be pasted, followed by a CTRL+D character
+ inserted on an empty line.
+
+- `ot`: generates a MFA code based on the given key and copies it to the clipboard
+ (on Linux it relies on xsel, on MacOS X it uses pbcopy instead).
+
+The plugin uses `$HOME/.otp` to store its internal files.
diff --git a/plugins/otp/otp.plugin.zsh b/plugins/otp/otp.plugin.zsh
index 4bce34fd3..8be125c93 100644
--- a/plugins/otp/otp.plugin.zsh
+++ b/plugins/otp/otp.plugin.zsh
@@ -12,32 +12,23 @@ function ot () {
return 1
fi
- if [[ `uname` == 'Darwin' ]] then # MacOS X
- export COPY_CMD='pbcopy'
- elif command -v xsel > /dev/null 2>&1; then # Any Unix with xsel installed
- export COPY_CMD='xsel --clipboard --input'
- else
- COPY_CMD='true'
- fi
+ COPY_CMD='true'
- if [[ "x$1" == "x" ]]; then
- echo "usage: otpw "
+ if [[ -z "$1" ]]; then
+ echo "usage: $0 "
return 1
elif [ ! -f $OTP_HOME/$1.otp.asc ]; then
echo "missing profile $1, you might need to create it first using otp_add_device"
return 1
else
totpkey=$(gpg --decrypt $OTP_HOME/$1.otp.asc)
- oathtool --totp --b $totpkey | tee /dev/stderr | `echo $COPY_CMD`
- if [[ $COPY_CMD == 'true' ]] then
- echo "Note: you might consider installing xsel for clipboard integration"
- fi
+ oathtool --totp --b $totpkey | tee /dev/stderr | clipcopy
fi
}
function otp_add_device () {
if [[ "x$1" == "x" ]] then
- echo "usage: otp_add "
+ echo "usage: $0 "
return 1
else
echo "Enter an email address attached to your GPG private key, then paste the secret configuration key followed by ^D"
From d99ddab0cadfbb047f23b5d2037b54b4f4437ae4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 27 Dec 2019 02:51:54 +0100
Subject: [PATCH 086/343] codeclimate: add README
---
plugins/codeclimate/README.md | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 plugins/codeclimate/README.md
diff --git a/plugins/codeclimate/README.md b/plugins/codeclimate/README.md
new file mode 100644
index 000000000..0d712ac63
--- /dev/null
+++ b/plugins/codeclimate/README.md
@@ -0,0 +1,8 @@
+# codeclimate plugin
+
+This plugin adds autocompletion for the [`codeclimate` CLI](https://github.com/codeclimate/codeclimate).
+
+To use it, add `codeclimate` to the plugins array in your zshrc file:
+```zsh
+plugins=(... codeclimate)
+```
From cf9aa420d6bc48cd8780a58b7cff854add0f3897 Mon Sep 17 00:00:00 2001
From: Robby Russell
Date: Fri, 27 Dec 2019 06:43:43 -0800
Subject: [PATCH 087/343] Relocating chat/twitter
Moving down below the intro copy so that first content to new-comers is a description of the project
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index bfb42c0fd..291fb512b 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,6 @@
-[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
-[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
-
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
Sounds boring. Let's try again.
@@ -15,7 +12,10 @@ Once installed, your terminal shell will become the talk of the town _or your mo
Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬
-To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
+To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
+
+[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
+[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
## Getting Started
From 31219c02463f1f57271a3d336b4c25b9902ca4ad Mon Sep 17 00:00:00 2001
From: Carver Schmidt <46279291+carverschmidt@users.noreply.github.com>
Date: Sat, 28 Dec 2019 11:01:26 -0600
Subject: [PATCH 088/343] osx: fix exit on quit command in spotify function
(#8504)
---
plugins/osx/spotify | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/osx/spotify b/plugins/osx/spotify
index 78d6c7d0f..6233d813d 100644
--- a/plugins/osx/spotify
+++ b/plugins/osx/spotify
@@ -307,7 +307,7 @@ while [ $# -gt 0 ]; do
"quit" ) cecho "Quitting Spotify.";
osascript -e 'tell application "Spotify" to quit';
- exit 0 ;;
+ break ;;
"next" ) cecho "Going to next track." ;
osascript -e 'tell application "Spotify" to next track';
From 9bfcab7d10e216df9fe7110334a41cf2f802bace Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sat, 28 Dec 2019 18:00:35 +0100
Subject: [PATCH 089/343] osx: use return instead of exit in spotify function
---
plugins/osx/spotify | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/plugins/osx/spotify b/plugins/osx/spotify
index 6233d813d..663215a74 100644
--- a/plugins/osx/spotify
+++ b/plugins/osx/spotify
@@ -148,11 +148,11 @@ if [ $# = 0 ]; then
else
if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then
echo "The Spotify application must be installed."
- exit 1
+ return 1
fi
if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then
- osascript -e 'tell application "Spotify" to activate' || exit 1
+ osascript -e 'tell application "Spotify" to activate' || return 1
sleep 2
fi
fi
@@ -170,12 +170,12 @@ while [ $# -gt 0 ]; do
if [ -z "${CLIENT_ID}" ]; then
cecho "Invalid Client ID, please update ${USER_CONFIG_FILE}";
showAPIHelp;
- exit 1;
+ return 1
fi
if [ -z "${CLIENT_SECRET}" ]; then
cecho "Invalid Client Secret, please update ${USER_CONFIG_FILE}";
showAPIHelp;
- exit 1;
+ return 1
fi
SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r');
SPOTIFY_PLAY_URI="";
@@ -194,7 +194,7 @@ while [ $# -gt 0 ]; do
cecho "Autorization failed, please check ${USER_CONFG_FILE}"
cecho "${SPOTIFY_TOKEN_RESPONSE_DATA}"
showAPIHelp
- exit 1
+ return 1
fi
SPOTIFY_ACCESS_TOKEN=$( \
printf "${SPOTIFY_TOKEN_RESPONSE_DATA}" \
@@ -358,7 +358,7 @@ while [ $# -gt 0 ]; do
echo " vol down # Decreases the volume by 10%.";
echo " vol [amount] # Sets the volume to an amount between 0 and 100.";
echo " vol # Shows the current Spotify volume.";
- exit 1;
+ return 1
fi
osascript -e "tell application \"Spotify\" to set sound volume to $newvol";
@@ -468,9 +468,10 @@ while [ $# -gt 0 ]; do
"help" )
showHelp;
break ;;
+
* )
showHelp;
- break;
+ return 1 ;;
esac
done
From d56d6dc145e20dbea9c45f7aa1c09f8e2b5859a1 Mon Sep 17 00:00:00 2001
From: Khas'Mek
Date: Sat, 28 Dec 2019 21:17:37 -0700
Subject: [PATCH 090/343] Plugins: repo - add more aliases. (#3917)
---
plugins/repo/repo.plugin.zsh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/plugins/repo/repo.plugin.zsh b/plugins/repo/repo.plugin.zsh
index 33f4195c7..51cd32fc4 100644
--- a/plugins/repo/repo.plugin.zsh
+++ b/plugins/repo/repo.plugin.zsh
@@ -16,3 +16,15 @@ compdef _repo ru='repo upload'
alias rst='repo status'
compdef _repo rst='repo status'
+
+alias rsto='repo status -o'
+compdef _repo rsto='repo status -o'
+
+alias rfa='repo forall -c'
+compdef _repo rfa='repo forall -c'
+
+alias rfap='repo forall -p -c'
+compdef _repo rfap='repo forall -p -c'
+
+alias rinf='repo info'
+compdef _repo rinf='repo info'
From 016dd30f4c215dcc326f2ddc68dcb54603915f43 Mon Sep 17 00:00:00 2001
From: Charles Assus
Date: Sun, 29 Dec 2019 05:29:07 +0100
Subject: [PATCH 091/343] New alias zwip that launch cucumber with the :wip
profile (#4111)
* Add zeus rake cucumber:wip, alias swip
* Add the right command for zwip alias :D
* Add the right command
* respect the coding style
* respect the coding final
---
plugins/zeus/README.md | 1 +
plugins/zeus/zeus.plugin.zsh | 1 +
2 files changed, 2 insertions(+)
diff --git a/plugins/zeus/README.md b/plugins/zeus/README.md
index 451880049..84ed70c91 100644
--- a/plugins/zeus/README.md
+++ b/plugins/zeus/README.md
@@ -24,6 +24,7 @@
* `zcu` aliases `zeus cucumber`
* `zucumber` aliases `zeus cucumber`
+* `zwip` aliases `zeus cucumber --profile wip`
* `zspec` aliases `zeus rspec`
diff --git a/plugins/zeus/zeus.plugin.zsh b/plugins/zeus/zeus.plugin.zsh
index 0c01083a5..5dec1a48c 100644
--- a/plugins/zeus/zeus.plugin.zsh
+++ b/plugins/zeus/zeus.plugin.zsh
@@ -33,6 +33,7 @@ alias zunner='zeus runner'
# Cucumber
alias zcu='zeus cucumber'
alias zucumber='zeus cucumber'
+alias zwip='zeus cucumber --profile wip'
# Rspec
alias zspec='zeus rspec'
From b0be0439e5d99e186a9ae084eb4ed69c51d4b7cb Mon Sep 17 00:00:00 2001
From: khalil choudhry
Date: Sun, 29 Dec 2019 09:35:31 +0500
Subject: [PATCH 092/343] Feature/ionic plugin aliases (#8494)
* Add DS_Store to gitignore
* Add ionic aliases
* Add ionic plugin readme
---
.gitignore | 1 +
plugins/ionic/README.md | 30 ++++++++++++++++++++++++++++++
plugins/ionic/ionic.plugin.zsh | 15 +++++++++++++++
3 files changed, 46 insertions(+)
create mode 100644 plugins/ionic/README.md
create mode 100644 plugins/ionic/ionic.plugin.zsh
diff --git a/.gitignore b/.gitignore
index 251c9dc9f..ec24a19bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ custom/
cache/
log/
*.swp
+.DS_Store
diff --git a/plugins/ionic/README.md b/plugins/ionic/README.md
new file mode 100644
index 000000000..3ec4fc8b7
--- /dev/null
+++ b/plugins/ionic/README.md
@@ -0,0 +1,30 @@
+# Ionic plugin
+
+This plugin adds completion for the [Ionic CLI](https://ionicframework.com/docs/cli),
+as well as some aliases for common Ionic commands.
+
+To use it, add `ionic` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... ionic)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|--------------------------------------|------------------------------------------------------------------|
+| iv | `ionic --version` | Check Ionic version |
+| ih | `ionic --help` | Ionic help command |
+| ist | `ionic start` | Create a new project |
+| ii | `ionic info` | Print system/environment info |
+| is | `ionic serve` | Start a local dev server for app dev/testing |
+| icba | `ionic cordova build android` | Build web assets and prepare app for android platform targets |
+| icbi | `ionic cordova build ios` | Build web assets and prepare app for ios platform targets |
+| icra | `ionic cordova run android` | Run an Ionic project on a connected android device |
+| icri | `ionic cordova run ios` | Run an Ionic project on a connected ios device |
+| icrsa | `ionic cordova resources android` | Automatically create icon and splash screen resources for android|
+| icrsi | `ionic cordova resources ios` | Automatically create icon and splash screen resources for ios |
+| icpaa | `ionic cordova platform add android` | Add Cordova android platform targets |
+| icpai | `ionic cordova platform add ios` | Add Cordova ios platform targets |
+| icpra | `ionic cordova platform rm android` | Remove Cordova platform targets |
+| icpri | `ionic cordova platform rm ios` | Remove Cordova platform targets |
diff --git a/plugins/ionic/ionic.plugin.zsh b/plugins/ionic/ionic.plugin.zsh
new file mode 100644
index 000000000..cf388af1b
--- /dev/null
+++ b/plugins/ionic/ionic.plugin.zsh
@@ -0,0 +1,15 @@
+alias iv="ionic --version"
+alias ih="ionic --help"
+alias ist="ionic start"
+alias ii="ionic info"
+alias is="ionic serve"
+alias icba="ionic cordova build android"
+alias icbi="ionic cordova build ios"
+alias icra="ionic cordova run android"
+alias icri="ionic cordova run ios"
+alias icrsa="ionic cordova resources android"
+alias icrsi="ionic cordova resources ios"
+alias icpaa="ionic cordova platform add android"
+alias icpai="ionic cordova platform add ios"
+alias icpra="ionic cordova platform rm android"
+alias icpri="ionic cordova platform rm ios"
From 6bac9eb103fe6c777182746e3a6e84dfc882338b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 29 Dec 2019 05:36:29 +0100
Subject: [PATCH 093/343] extract: add lrz support (#8500)
---
plugins/extract/README.md | 2 ++
plugins/extract/_extract | 2 +-
plugins/extract/extract.plugin.zsh | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index d6e4fa116..a6630de3f 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -25,6 +25,7 @@ plugins=(... extract)
| `gz` | Gzip file |
| `ipsw` | iOS firmware file |
| `jar` | Java Archive |
+| `lrz` | LRZ archive |
| `lzma` | LZMA archive |
| `rar` | WinRAR archive |
| `rpm` | RPM package |
@@ -32,6 +33,7 @@ plugins=(... extract)
| `tar` | Tarball |
| `tar.bz2` | Tarball with bzip2 compression |
| `tar.gz` | Tarball with gzip compression |
+| `tar.lrz` | Tarball with lrzip compression |
| `tar.lz` | Tarball with lzip compression |
| `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index e9d12d4d3..034fe6df0 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 5cc30d1ce..349c9a776 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -46,9 +46,11 @@ extract() {
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
+ (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
+ (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
From 8ed19ab54d6980da777ccea185658e213b26f533 Mon Sep 17 00:00:00 2001
From: Shaun Tabone
Date: Sun, 29 Dec 2019 05:37:38 +0100
Subject: [PATCH 094/343] Added MicroK8s plugin for ZSH (#8499)
* Added MicroK8s plugin for ZSH
* Added caching for kubectl and helm commands
* Added title in compadd and enhanced README
---
plugins/microk8s/README.md | 24 ++++++++
plugins/microk8s/microk8s.plugin.zsh | 82 ++++++++++++++++++++++++++++
2 files changed, 106 insertions(+)
create mode 100644 plugins/microk8s/README.md
create mode 100644 plugins/microk8s/microk8s.plugin.zsh
diff --git a/plugins/microk8s/README.md b/plugins/microk8s/README.md
new file mode 100644
index 000000000..2b4ea206f
--- /dev/null
+++ b/plugins/microk8s/README.md
@@ -0,0 +1,24 @@
+# MicroK8s plugin
+
+This plugin provides completion and useful aliases for [MicroK8s](https://microk8s.io/).
+
+To use it, add `microk8s` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... microk8s)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|------------------|----------------------------------------------------------------------------------------------------------|
+| mco | microk8s.config | Shows the Kubernetes config file. |
+| mct | microk8s.ctr | Interact with containerd CLI. |
+| mdi | microk8s.disable | Disables an addon. |
+| me | microk8s.enable | Enables an addon. |
+| mh | microk8s.helm | Interact with Helm CLI. |
+| mis | microk8s.istio | Interact with Istio CLI. |
+| mk | microk8s.kubectl | Interact with Kubernetes CLI. |
+| msp | microk8s.stop | Stops all Kubernetes services. |
+| mst | microk8s.start | Starts MicroK8s after it is being stopped. |
+| msts | microk8s.status | Provides an overview of the MicroK8s state (running / not running) as well as the set of enabled addons. |
\ No newline at end of file
diff --git a/plugins/microk8s/microk8s.plugin.zsh b/plugins/microk8s/microk8s.plugin.zsh
new file mode 100644
index 000000000..048a9ab83
--- /dev/null
+++ b/plugins/microk8s/microk8s.plugin.zsh
@@ -0,0 +1,82 @@
+# ---------------------------------------------------------- #
+# Aliases and Completions for MicroK8s (https://microk8s.io) #
+# Author: Shaun Tabone (https://github.com/xontab) #
+# ---------------------------------------------------------- #
+
+# Helper function to cache and load completions
+_microk8s_cache_completion() {
+ local cache="${ZSH_CACHE_DIR}/microk8s_$(echo $1)_completion"
+ if [[ ! -f $cache ]]; then
+ $2 $cache
+ fi
+
+ [[ -f $cache ]] && source $cache
+}
+
+# ---------------------------------------------------------- #
+# microk8s.enable #
+# ALIAS: me #
+# ---------------------------------------------------------- #
+_microk8s_enable_get_command_list() {
+ microk8s.enable --help | tail -n +7 | awk '{$1=$1;print}'
+}
+
+_microk8s_enable() {
+ compadd -X "MicroK8s Addons" $(_microk8s_enable_get_command_list)
+}
+
+compdef _microk8s_enable microk8s.enable
+alias me='microk8s.enable'
+
+# ---------------------------------------------------------- #
+# microk8s.disable #
+# ALIAS: mdi #
+# ---------------------------------------------------------- #
+_microk8s_disable_get_command_list() {
+ microk8s.disable --help | tail -n +7 | awk '{$1=$1;print}'
+}
+
+_microk8s_disable() {
+ compadd -X "MicroK8s Addons" $(_microk8s_disable_get_command_list)
+}
+
+compdef _microk8s_disable microk8s.disable
+alias mdi='microk8s.disable'
+
+# ---------------------------------------------------------- #
+# microk8s.kubectl #
+# ALIAS: mk #
+# ---------------------------------------------------------- #
+_microk8s_kubectl_completion() {
+ if [ $commands[microk8s.kubectl] ]; then
+ microk8s.kubectl 2>/dev/null >/dev/null && microk8s.kubectl completion zsh | sed 's/__start_kubectl kubectl/__start_kubectl microk8s.kubectl/g' >$1
+ fi
+}
+
+_microk8s_cache_completion 'kubectl' _microk8s_kubectl_completion
+
+alias mk='microk8s.kubectl'
+
+# ---------------------------------------------------------- #
+# microk8s.helm #
+# ALIAS: mh #
+# ---------------------------------------------------------- #
+_microk8s_helm_completion() {
+ if [ $commands[microk8s.helm] ]; then
+ microk8s.helm completion zsh | sed 's/__start_helm helm/__start_helm microk8s.helm/g' >$1
+ fi
+}
+
+_microk8s_cache_completion 'helm' _microk8s_helm_completion
+
+alias mh='microk8s.helm'
+
+# ---------------------------------------------------------- #
+# Other Aliases #
+# ---------------------------------------------------------- #
+alias mco='microk8s.config'
+alias mct='microk8s.ctr'
+alias mis='microk8s.istio'
+alias mst='microk8s.start'
+alias msts='microk8s.status'
+alias msp='microk8s.stop'
From d5f8fac465857941eabfbd0fcb58610c0fc002dc Mon Sep 17 00:00:00 2001
From: Shaun Tabone
Date: Sun, 29 Dec 2019 05:54:58 +0100
Subject: [PATCH 095/343] Feature/add dotnet plugin (#8503)
* Added dotnet CLI aliases and completions
* Modified README
---
plugins/dotnet/README.md | 21 ++++++
plugins/dotnet/dotnet.plugin.zsh | 117 +++++++++++++++++++++++++++++++
2 files changed, 138 insertions(+)
create mode 100644 plugins/dotnet/README.md
create mode 100644 plugins/dotnet/dotnet.plugin.zsh
diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md
new file mode 100644
index 000000000..7a6d6a995
--- /dev/null
+++ b/plugins/dotnet/README.md
@@ -0,0 +1,21 @@
+# .NET Core CLI plugin
+
+This plugin provides completion and useful aliases for [.NET Core CLI](https://dotnet.microsoft.com/).
+
+To use it, add `dotnet` to the plugins array in your zshrc file.
+
+```
+plugins=(... dotnet)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|--------------|-------------------------------------------------------------------|
+| dn | dotnet new | Create a new .NET project or file. |
+| dr | dotnet run | Build and run a .NET project output. |
+| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
+| ds | dotnet sln | Modify Visual Studio solution files. |
+| da | dotnet add | Add a package or reference to a .NET project. |
+| dp | dotnet pack | Create a NuGet package. |
+| dng | dotnet nuget | Provides additional NuGet commands. |
\ No newline at end of file
diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh
new file mode 100644
index 000000000..8b9a45a97
--- /dev/null
+++ b/plugins/dotnet/dotnet.plugin.zsh
@@ -0,0 +1,117 @@
+# --------------------------------------------------------------------- #
+# Aliases and Completions for .NET Core (https://dotnet.microsoft.com/) #
+# Author: Shaun Tabone (https://github.com/xontab) #
+# --------------------------------------------------------------------- #
+
+# Helper function to cache and load completions
+local cache_base_path="${ZSH_CACHE_DIR}/dotnet_"
+_dotnet_cache_completion() {
+ local cache="${cache_base_path}$(echo $1)_completion"
+ if [[ ! -f $cache ]]; then
+ $2 $cache
+ fi
+
+ [[ -f $cache ]] && cat $cache
+}
+
+_dotnet_cache_completion_cleanup() {
+ local cache="${cache_base_path}$(echo $1)_completion"
+ rm -f $cache
+}
+
+# --------------------------------------------------------------------- #
+# dotnet new #
+# ALIAS: dn #
+# --------------------------------------------------------------------- #
+_dotnet_new_completion() {
+ if [ $commands[dotnet] ]; then
+ dotnet new -l | tail -n +21 | sed 's/ \+/:/g' | cut -d : -f 2 >$1
+ fi
+}
+
+_dotnet_new_completion_cached() {
+ _dotnet_cache_completion 'new' _dotnet_new_completion
+}
+
+_dotnet_cache_completion_cleanup 'new'
+
+alias dn='dotnet new'
+
+# --------------------------------------------------------------------- #
+# dotnet #
+# --------------------------------------------------------------------- #
+_dotnet() {
+ if [ $CURRENT -eq 2 ]; then
+ _arguments \
+ '--diagnostics[Enable diagnostic output.]' \
+ '--help[Show command line help.]' \
+ '--info[Display .NET Core information.]' \
+ '--list-runtimes[Display the installed runtimes.]' \
+ '--list-sdks[Display the installed SDKs.]' \
+ '--version[Display .NET Core SDK version in use.]'
+
+ _values \
+ 'add[Add a package or reference to a .NET project.]' \
+ 'build[Build a .NET project.]' \
+ 'build-server[Interact with servers started by a build.]' \
+ 'clean[Clean build outputs of a .NET project.]' \
+ 'help[Show command line help.]' \
+ 'list[List project references of a .NET project.]' \
+ 'msbuild[Run Microsoft Build Engine (MSBuild) commands.]' \
+ 'new[Create a new .NET project or file.]' \
+ 'nuget[Provides additional NuGet commands.]' \
+ 'pack[Create a NuGet package.]' \
+ 'publish[Publish a .NET project for deployment.]' \
+ 'remove[Remove a package or reference from a .NET project.]' \
+ 'restore[Restore dependencies specified in a .NET project.]' \
+ 'run[Build and run a .NET project output.]' \
+ 'sln[Modify Visual Studio solution files.]' \
+ 'store[Store the specified assemblies in the runtime package store.]' \
+ 'test[Run unit tests using the test runner specified in a .NET project.]' \
+ 'tool[Install or manage tools that extend the .NET experience.]' \
+ 'vstest[Run Microsoft Test Engine (VSTest) commands.]' \
+ 'dev-certs[Create and manage development certificates.]' \
+ 'fsi[Start F# Interactive / execute F# scripts.]' \
+ 'sql-cache[SQL Server cache command-line tools.]' \
+ 'user-secrets[Manage development user secrets.]' \
+ 'watch[Start a file watcher that runs a command when files change.]'
+ return
+ fi
+
+ if [ $CURRENT -eq 3 ]; then
+ case ${words[2]} in
+ "new")
+ compadd -X ".NET Installed Templates" $(_dotnet_new_completion_cached)
+ return
+ ;;
+ "sln")
+ _values \
+ 'add[Add one or more projects to a solution file.]' \
+ 'list[List all projects in a solution file.]' \
+ 'remove[Remove one or more projects from a solution file.]'
+ return
+ ;;
+ "nuget")
+ _values \
+ 'delete[Deletes a package from the server.]' \
+ 'locals[Clears or lists local NuGet resources such as http requests cache, packages folder, plugin operations cache or machine-wide global packages folder.]' \
+ 'push[Pushes a package to the server and publishes it.]'
+ return
+ ;;
+ esac
+ fi
+
+ _arguments '*::arguments: _normal'
+}
+
+compdef _dotnet dotnet
+
+# --------------------------------------------------------------------- #
+# Other Aliases #
+# --------------------------------------------------------------------- #
+alias dr='dotnet run'
+alias dt='dotnet test'
+alias ds='dotnet sln'
+alias da='dotnet add'
+alias dp='dotnet pack'
+alias dng='dotnet nuget'
From df55690daddb4e57b5cef719263f2fa988da04ee Mon Sep 17 00:00:00 2001
From: Alaa Qutaish
Date: Sun, 29 Dec 2019 05:58:31 +0100
Subject: [PATCH 096/343] Add kubectl log since aliases (#8448)
---
plugins/kubectl/kubectl.plugin.zsh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 6c1696d5e..369b6ad25 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -115,7 +115,13 @@ alias kgaa='kubectl get all --all-namespaces'
# Logs
alias kl='kubectl logs'
+alias kl1h='kubectl logs --since 1h'
+alias kl1m='kubectl logs --since 1m'
+alias kl1s='kubectl logs --since 1s'
alias klf='kubectl logs -f'
+alias klf1h='kubectl logs --since 1h -f'
+alias klf1m='kubectl logs --since 1m -f'
+alias klf1s='kubectl logs --since 1s -f'
# File copy
alias kcp='kubectl cp'
From 42d04d386d357319a034d0c373daf119370637c0 Mon Sep 17 00:00:00 2001
From: Alaa Qutaish
Date: Sun, 29 Dec 2019 05:59:14 +0100
Subject: [PATCH 097/343] Add kubectl all-namespaces aliases for k8s objects
(#8434)
---
plugins/kubectl/kubectl.plugin.zsh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 369b6ad25..cc447b87e 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -37,6 +37,7 @@ alias kdelf='kubectl delete -f'
# Pod management.
alias kgp='kubectl get pods'
+alias kgpa='kubectl get pods --all-namespaces'
alias kgpw='kgp --watch'
alias kgpwide='kgp -o wide'
alias kep='kubectl edit pods'
@@ -48,6 +49,7 @@ alias kgpl='kgp -l'
# Service management.
alias kgs='kubectl get svc'
+alias kgsa='kubectl get svc --all-namespaces'
alias kgsw='kgs --watch'
alias kgswide='kgs -o wide'
alias kes='kubectl edit svc'
@@ -56,6 +58,7 @@ alias kdels='kubectl delete svc'
# Ingress management
alias kgi='kubectl get ingress'
+alias kgia='kubectl get ingress --all-namespaces'
alias kei='kubectl edit ingress'
alias kdi='kubectl describe ingress'
alias kdeli='kubectl delete ingress'
@@ -69,17 +72,20 @@ alias kcn='kubectl config set-context $(kubectl config current-context) --namesp
# ConfigMap management
alias kgcm='kubectl get configmaps'
+alias kgcma='kubectl get configmaps --all-namespaces'
alias kecm='kubectl edit configmap'
alias kdcm='kubectl describe configmap'
alias kdelcm='kubectl delete configmap'
# Secret management
alias kgsec='kubectl get secret'
+alias kgseca='kubectl get secret --all-namespaces'
alias kdsec='kubectl describe secret'
alias kdelsec='kubectl delete secret'
# Deployment management.
alias kgd='kubectl get deployment'
+alias kgda='kubectl get deployment --all-namespaces'
alias kgdw='kgd --watch'
alias kgdwide='kgd -o wide'
alias ked='kubectl edit deployment'
@@ -98,6 +104,7 @@ alias kru='kubectl rollout undo'
# Statefulset management.
alias kgss='kubectl get statefulset'
+alias kgssa='kubectl get statefulset --all-namespaces'
alias kgssw='kgss --watch'
alias kgsswide='kgss -o wide'
alias kess='kubectl edit statefulset'
@@ -134,6 +141,7 @@ alias kdelno='kubectl delete node'
# PVC management.
alias kgpvc='kubectl get pvc'
+alias kgpvca='kubectl get pvc --all-namespaces'
alias kgpvcw='kgpvc --watch'
alias kepvc='kubectl edit pvc'
alias kdpvc='kubectl describe pvc'
From e034030f3974f725ce11360dcdd166c2ae32e2b8 Mon Sep 17 00:00:00 2001
From: Zeshan Khattak
Date: Sun, 29 Dec 2019 10:03:26 +0500
Subject: [PATCH 098/343] Laravel artisan commands extension (#8425)
---
plugins/laravel/README.md | 17 +++++++++++++++++
plugins/laravel/laravel.plugin.zsh | 15 +++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md
index 44798b68d..95f590191 100644
--- a/plugins/laravel/README.md
+++ b/plugins/laravel/README.md
@@ -29,6 +29,12 @@ plugins=(... laravel)
| `pamc` | `php artisan make:controller` |
| `pams` | `php artisan make:seeder` |
| `pamt` | `php artisan make:test` |
+| `pamfa` | `php artisan make:factory` |
+| `pamp` | `php artisan make:policy` |
+| `pame` | `php artisan make:event` |
+| `pamj` | `php artisan make:job` |
+| `paml` | `php artisan make:listener` |
+| `pamn` | `php artisan make:notification` |
## Clears
@@ -38,3 +44,14 @@ plugins=(... laravel)
| `pacoc` | `php artisan config:clear` |
| `pavic` | `php artisan view:clear` |
| `paroc` | `php artisan route:clear` |
+
+## Queues
+
+| Alias | Description |
+|:-:|:-:|
+| `paqf` | `php artisan queue:failed` |
+| `paqft` | `php artisan queue:failed-table` |
+| `paql` | `php artisan queue:listen` |
+| `paqr` | `php artisan queue:retry` |
+| `paqt` | `php artisan queue:table` |
+| `paqw` | `php artisan queue:work` |
diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
index 7ddfd85ba..a8382d3c9 100644
--- a/plugins/laravel/laravel.plugin.zsh
+++ b/plugins/laravel/laravel.plugin.zsh
@@ -17,6 +17,13 @@ alias pamm='php artisan make:model'
alias pamc='php artisan make:controller'
alias pams='php artisan make:seeder'
alias pamt='php artisan make:test'
+alias pamfa='php artisan make:factory'
+alias pamp='php artisan make:policy'
+alias pame='php artisan make:event'
+alias pamj='php artisan make:job'
+alias paml='php artisan make:listener'
+alias pamn='php artisan make:notification'
+alias pampp='php artisan make:provider'
# Clears
@@ -24,3 +31,11 @@ alias pacac='php artisan cache:clear'
alias pacoc='php artisan config:clear'
alias pavic='php artisan view:clear'
alias paroc='php artisan route:clear'
+
+# queues
+alias paqf='php artisan queue:failed'
+alias paqft='php artisan queue:failed-table'
+alias paql='php artisan queue:listen'
+alias paqr='php artisan queue:retry'
+alias paqt='php artisan queue:table'
+alias paqw='php artisan queue:work'
From d9e64344aa151f9b8e13a4f8054509a5d78bb718 Mon Sep 17 00:00:00 2001
From: sinrimin
Date: Sun, 29 Dec 2019 13:04:24 +0800
Subject: [PATCH 099/343] -mAdd hitokoto plugin (#8422)
---
plugins/hitokoto/README.md | 15 +++++++++++++++
plugins/hitokoto/hitokoto.plugin.zsh | 14 ++++++++++++++
2 files changed, 29 insertions(+)
create mode 100644 plugins/hitokoto/README.md
create mode 100644 plugins/hitokoto/hitokoto.plugin.zsh
diff --git a/plugins/hitokoto/README.md b/plugins/hitokoto/README.md
new file mode 100644
index 000000000..3a8758f56
--- /dev/null
+++ b/plugins/hitokoto/README.md
@@ -0,0 +1,15 @@
+# hitokoto plugin
+
+Displays a random quote taken from [hitokoto.cn](https://v1.hitokoto.cn/)
+
+Created by [Sinrimin](https://github.com/sinrimin)
+
+## Usage
+
+Add the plugin to the plugins array in your zshrc file and restart zsh:
+
+```zsh
+plugins=(... hitokoto)
+```
+
+Then, run `hitokoto` to get a new random quote.
diff --git a/plugins/hitokoto/hitokoto.plugin.zsh b/plugins/hitokoto/hitokoto.plugin.zsh
new file mode 100644
index 000000000..8646ebf3b
--- /dev/null
+++ b/plugins/hitokoto/hitokoto.plugin.zsh
@@ -0,0 +1,14 @@
+if ! (( $+commands[curl] )); then
+ echo "hitokoto plugin needs curl to work" >&2
+ return
+fi
+
+function hitokoto {
+ emulate -L zsh
+ Q=$(curl -s --connect-timeout 2 "https://v1.hitokoto.cn" | jq -j '.hitokoto+"\t"+.from')
+
+ TXT=$(echo "$Q" | awk -F '\t' '{print $1}')
+ WHO=$(echo "$Q" | awk -F '\t' '{print $2}')
+
+ [[ -n "$WHO" && -n "$TXT" ]] && print -P "%F{3}${WHO}%f: “%F{5}${TXT}%f”"
+}
From ca627655dbd1d110dbea34ec4a8c1964a1da83d2 Mon Sep 17 00:00:00 2001
From: Angel_Kitty
Date: Wed, 1 Jan 2020 11:45:52 +0800
Subject: [PATCH 100/343] Bump license year (#8512)
---
LICENSE.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/LICENSE.txt b/LICENSE.txt
index 7431907a6..45ba85a37 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2009-2019 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
+Copyright (c) 2009-2020 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/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 78b07e92fd4a3a5e1f92ee4e3d680c39b72c2245 Mon Sep 17 00:00:00 2001
From: Aloxaf
Date: Sun, 5 Jan 2020 00:15:24 +0800
Subject: [PATCH 101/343] extract: add lz4 support (#8510)
---
plugins/extract/README.md | 2 ++
plugins/extract/_extract | 2 +-
plugins/extract/extract.plugin.zsh | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index a6630de3f..81e8e1d23 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -26,6 +26,7 @@ plugins=(... extract)
| `ipsw` | iOS firmware file |
| `jar` | Java Archive |
| `lrz` | LRZ archive |
+| `lz4` | LZ4 archive |
| `lzma` | LZMA archive |
| `rar` | WinRAR archive |
| `rpm` | RPM package |
@@ -35,6 +36,7 @@ plugins=(... extract)
| `tar.gz` | Tarball with gzip compression |
| `tar.lrz` | Tarball with lrzip compression |
| `tar.lz` | Tarball with lzip compression |
+| `tar.lz4` | Tarball with lz4 compression |
| `tar.xz` | Tarball with lzma2 compression |
| `tar.zma` | Tarball with lzma compression |
| `tar.zst` | Tarball with zstd compression |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 034fe6df0..1a263a744 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 349c9a776..a5594b81a 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -46,11 +46,13 @@ extract() {
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
+ (*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
+ (*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
From aaa87063a27cd581b5f0fa1f23a0170f623686a9 Mon Sep 17 00:00:00 2001
From: Vlad Dmitrievich <2tunnels@gmail.com>
Date: Wed, 15 Jan 2020 15:08:45 +0200
Subject: [PATCH 102/343] pyenv: only run if pyenv not in $PATH (#8462)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is needed if in between the update of `$PATH` the `$commands` parameter hasn't
been updated, i.e. if there was no `rehash` or `hash -rf` or automatic rehash.
Co-authored-by: Marc Cornellà
---
plugins/pyenv/pyenv.plugin.zsh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index 40e58b5c2..4c75156bd 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -1,7 +1,8 @@
# This plugin loads pyenv into the current shell and provides prompt info via
# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
-FOUND_PYENV=$+commands[pyenv]
+# Load pyenv only if command not already available
+command -v pyenv &> /dev/null && FOUND_PYENV=1 || FOUND_PYENV=0
if [[ $FOUND_PYENV -ne 1 ]]; then
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
From 56297902e9d0f7a14f6d4d88b24eaea7392f3c32 Mon Sep 17 00:00:00 2001
From: Andras Svraka
Date: Thu, 16 Jan 2020 18:19:56 +0100
Subject: [PATCH 103/343] lib: add MSYS2 support to clipboard integration
(#8542)
---
lib/clipboard.zsh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
index 2c93d1bb5..5bba11d16 100644
--- a/lib/clipboard.zsh
+++ b/lib/clipboard.zsh
@@ -24,7 +24,7 @@ function clipcopy() {
else
cat $file | pbcopy
fi
- elif [[ $OSTYPE == cygwin* ]]; then
+ elif [[ $OSTYPE == (cygwin|msys)* ]]; then
if [[ -z $file ]]; then
cat > /dev/clipboard
else
@@ -71,7 +71,7 @@ function clippaste() {
emulate -L zsh
if [[ $OSTYPE == darwin* ]]; then
pbpaste
- elif [[ $OSTYPE == cygwin* ]]; then
+ elif [[ $OSTYPE == (cygwin|msys)* ]]; then
cat /dev/clipboard
else
if (( $+commands[xclip] )); then
From ce298d090b737cbce2a87afaada2195b0bb2e801 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 19 Jan 2020 13:39:18 +0100
Subject: [PATCH 104/343] yarn: use zsh-completions latest version (493984e)
---
plugins/yarn/_yarn | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/plugins/yarn/_yarn b/plugins/yarn/_yarn
index 3689ae960..70e783b86 100644
--- a/plugins/yarn/_yarn
+++ b/plugins/yarn/_yarn
@@ -86,9 +86,11 @@ _yarn_scripts() {
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")}")
+ # Some sed utilities (e.g. Mac OS / BSD) don't interpret `\n` in a replacement
+ # pattern as a newline. See https://superuser.com/q/307165
+ 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]}")
From 530056d50d63b67dfaa169e2600a7c600ea18aa1 Mon Sep 17 00:00:00 2001
From: James Wright
Date: Sun, 19 Jan 2020 09:47:28 -0700
Subject: [PATCH 105/343] colored-man-pages: force `env` command (#8551)
Invoke `env` via `command` to ignore shell functions and aliases.
---
plugins/colored-man-pages/colored-man-pages.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index ac6a94654..f74105d40 100644
--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
@@ -17,7 +17,7 @@ EOF
fi
function colored() {
- env \
+ command env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
From a04728f1681ca2a185245fb9f6f6eb869c113ad0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 19 Jan 2020 17:52:15 +0100
Subject: [PATCH 106/343] init: force use of builtin test in is_plugin
Fixes #8545
---
oh-my-zsh.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 6b2662d5e..c3fae6efb 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -32,8 +32,8 @@ fi
is_plugin() {
local base_dir=$1
local name=$2
- test -f $base_dir/plugins/$name/$name.plugin.zsh \
- || test -f $base_dir/plugins/$name/_$name
+ builtin test -f $base_dir/plugins/$name/$name.plugin.zsh \
+ || builtin test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
From 4e45e12dc355e3ba34e7e40ce4936fb222f0155c Mon Sep 17 00:00:00 2001
From: Jimmy Merrild Krag
Date: Sun, 19 Jan 2020 20:42:45 +0100
Subject: [PATCH 107/343] virtualenvwrapper: fix finding script on Ubuntu 19.10
(#8451)
---
plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index b07b2a306..b2d2c5cd6 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -22,6 +22,13 @@ elif [[ -f "/usr/local/bin/virtualenvwrapper.sh" ]]; then
virtualenvwrapper="/usr/local/bin/virtualenvwrapper.sh"
source "/usr/local/bin/virtualenvwrapper.sh"
}
+elif [[ -f "/usr/share/virtualenvwrapper/virtualenvwrapper.sh" ]]; then
+ function {
+ setopt local_options
+ unsetopt equals
+ virtualenvwrapper="/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
+ source "/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
+ }
elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
function {
setopt local_options
From 64a7f6b38833d007394b9b4bf5d17e48db77c0d7 Mon Sep 17 00:00:00 2001
From: Modded Gamers <35778371+ModdedGamers@users.noreply.github.com>
Date: Tue, 28 Jan 2020 18:22:27 -0500
Subject: [PATCH 108/343] Create Github Action to run tests (#8569)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The published workflow tests the installer and checks the syntax of known zsh files
in the project.
Co-authored-by: Marc Cornellà
---
.github/workflows/check-suite.yml | 36 +++++++++++++++++++++++++++++++
README.md | 1 +
2 files changed, 37 insertions(+)
create mode 100644 .github/workflows/check-suite.yml
diff --git a/.github/workflows/check-suite.yml b/.github/workflows/check-suite.yml
new file mode 100644
index 000000000..3a7ad354d
--- /dev/null
+++ b/.github/workflows/check-suite.yml
@@ -0,0 +1,36 @@
+name: Check Suite
+on:
+ pull_request:
+ types:
+ - opened
+ - synchronize
+ branches:
+ - master
+ push:
+ branches:
+ - master
+
+jobs:
+ tests:
+ name: Run tests
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ steps:
+ - name: Set up git repository
+ uses: actions/checkout@v2
+ - name: Install zsh
+ if: runner.os == 'Linux'
+ run: sudo apt-get update; sudo apt-get install zsh
+ - name: Test installer
+ run: sh ./tools/install.sh
+ - name: Check syntax
+ run: |
+ for file in ./oh-my-zsh.sh \
+ ./lib/*.zsh \
+ ./plugins/*/*.plugin.zsh \
+ ./plugins/*/_* \
+ ./themes/*.zsh-theme; do
+ zsh -n "$file" || return 1
+ done
diff --git a/README.md b/README.md
index 291fb512b..fddc7c241 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ Finally, you'll begin to get the sort of attention that you have always felt you
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
+![Check Suite](https://github.com/ohmyzsh/ohmyzsh/workflows/Check%20Suite/badge.svg)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
From 7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb Mon Sep 17 00:00:00 2001
From: "Babak K. Shandiz"
Date: Wed, 29 Jan 2020 16:21:40 +0330
Subject: [PATCH 109/343] vscode: use insiders build if stable not found
(#8568)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 🔨 Add calling VS Code Insiders
* ✏️ Update README.md
---
plugins/vscode/README.md | 12 +++++++-----
plugins/vscode/vscode.plugin.zsh | 14 +++++++++++---
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index 74b5a45aa..2c6530650 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -1,6 +1,6 @@
-# VS code
+# VS Code
-This plugin makes interaction between the command line and the code editor easier.
+This plugin makes interaction between the command line and the VS Code editor easier.
To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
@@ -8,9 +8,11 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`
plugins=(... vscode)
```
-If you are using [Visual Studio Code Insiders](https://code.visualstudio.com/insiders/),
-add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and
-the `plugins=()` line). This will make the plugin use the Insiders version instead.
+## VS Code Insiders
+
+🍏 **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.**
+
+But, if you have both Stable and Insiders versions and want to configure the plugin to just use the Insiders version, add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and the `plugins=()` line). This will make the plugin use the Insiders version instead.
```zsh
ZSH_THEME=...
diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
index 4c15df2b0..0144e0baa 100644
--- a/plugins/vscode/vscode.plugin.zsh
+++ b/plugins/vscode/vscode.plugin.zsh
@@ -1,9 +1,17 @@
# VScode zsh plugin
-# author: https://github.com/MarsiBarsi
+# Authors:
+# https://github.com/MarsiBarsi (original author)
+# https://github.com/babakks
-# Use main Visual Studio Code version by default
-: ${VSCODE:=code}
+# Use the stable VS Code release, unless the Insiders version is the only
+# available installation
+if ! which code > /dev/null && which code-insiders > /dev/null; then
+ : ${VSCODE:=code-insiders}
+else
+ : ${VSCODE:=code}
+fi
+# Define aliases
alias vsc="$VSCODE ."
alias vsca="$VSCODE --add"
alias vscd="$VSCODE --diff"
From 05a38c8b99ea5bc54e7fdfc1cc1ea6d2729c05e5 Mon Sep 17 00:00:00 2001
From: Nikita Sharnin <43130421+HikiShi@users.noreply.github.com>
Date: Wed, 29 Jan 2020 21:28:34 +0600
Subject: [PATCH 110/343] lol: fix docs for yolo alias (#8576)
---
plugins/lol/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/lol/README.md b/plugins/lol/README.md
index 8fba7b713..1791de493 100644
--- a/plugins/lol/README.md
+++ b/plugins/lol/README.md
@@ -61,7 +61,7 @@ Plugin for adding catspeak aliases, because why not
| `violenz` | `git rebase` |
| `visible` | `echo` |
| `wtf` | `dmesg` |
-| `yolo` | `git commit -m "$(curl -s https://whatthecommit.com/index.txt)"` |
+| `yolo` | `git commit -m "$(curl -s http://whatthecommit.com/index.txt)"` |
## Usage Examples
@@ -78,6 +78,6 @@ nowai u=r,go= some.file
# ssh root@catserver.org
pwned root@catserver.org
-# git commit -m "$(curl -s https://whatthecommit.com/index.txt)"
+# git commit -m "$(curl -s http://whatthecommit.com/index.txt)"
yolo
```
From dcffc895806f5c2aaade3fce09772e1c9f52504e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 30 Jan 2020 13:31:33 +0100
Subject: [PATCH 111/343] aws: fix array assignment in asp function
Older zsh versions require this syntax change.
Fixes #8525
---
plugins/aws/aws.plugin.zsh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 231ac5ad2..567311372 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -10,7 +10,8 @@ function asp() {
return
fi
- local available_profiles=($(aws_profiles))
+ local -a available_profiles
+ available_profiles=($(aws_profiles))
if [[ -z "${available_profiles[(r)$1]}" ]]; then
echo "${fg[red]}Profile '$1' not found in '${AWS_CONFIG_FILE:-$HOME/.aws/config}'" >&2
echo "Available profiles: ${(j:, :)available_profiles:-no profiles found}${reset_color}" >&2
From 69caf98cf754553fda969b0bf1d4966f0498f58f Mon Sep 17 00:00:00 2001
From: Dennis Rausch
Date: Thu, 30 Jan 2020 18:32:53 -0600
Subject: [PATCH 112/343] fix: Update tmux plugin to use modern terminfo.
(#8582)
* fix: Update tmux plugin to use modern terminfo.
* doc: Update documentation for tmux plugin.
---
plugins/tmux/README.md | 4 ++--
plugins/tmux/tmux.plugin.zsh | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md
index db57f5be2..86a95bd4f 100644
--- a/plugins/tmux/README.md
+++ b/plugins/tmux/README.md
@@ -35,7 +35,7 @@ The plugin also supports the following -
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
| `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_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux`) |
+| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` |
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index e52443a71..5ee37dff0 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -22,18 +22,18 @@ alias tkss='tmux kill-session -t'
: ${ZSH_TMUX_AUTOCONNECT:=true}
# Automatically close the terminal when tmux exits
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
-# Set term to screen or screen-256color based on current terminal support
+# Set term to tmux or tmux-256color based on current terminal support
: ${ZSH_TMUX_FIXTERM:=true}
# Set '-CC' option for iTerm2 tmux integration
: ${ZSH_TMUX_ITERM2:=false}
# The TERM to use for non-256 color terminals.
-# Tmux states this should be screen, but you may need to change it on
+# Tmux states this should be tmux, but you may need to change it on
# systems without the proper terminfo
-: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen}
+: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=tmux}
# The TERM to use for 256 color terminals.
-# Tmux states this should be screen-256color, but you may need to change it on
+# Tmux states this should be tmux-256color, but you may need to change it on
# systems without the proper terminfo
-: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
+: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=tmux-256color}
# Set the configuration path
: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf}
# Set -u option to support unicode
From df56d1ee1fb7430d8979973300bf0c6b53a5446c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Feb 2020 13:02:20 +0100
Subject: [PATCH 113/343] Rename GitHub Action to CI
---
.github/workflows/{check-suite.yml => main.yml} | 2 +-
README.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
rename .github/workflows/{check-suite.yml => main.yml} (97%)
diff --git a/.github/workflows/check-suite.yml b/.github/workflows/main.yml
similarity index 97%
rename from .github/workflows/check-suite.yml
rename to .github/workflows/main.yml
index 3a7ad354d..7ab7efdd6 100644
--- a/.github/workflows/check-suite.yml
+++ b/.github/workflows/main.yml
@@ -1,4 +1,4 @@
-name: Check Suite
+name: CI
on:
pull_request:
types:
diff --git a/README.md b/README.md
index fddc7c241..d36591abc 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Finally, you'll begin to get the sort of attention that you have always felt you
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
-![Check Suite](https://github.com/ohmyzsh/ohmyzsh/workflows/Check%20Suite/badge.svg)
+![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
From 578b0860112af83af25afb687887109748a03c08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Feb 2020 13:07:40 +0100
Subject: [PATCH 114/343] Link to Actions page in GitHub Action badge
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d36591abc..187cceb7d 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Finally, you'll begin to get the sort of attention that you have always felt you
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
-![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)
+[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
From 6bebc254e88ac9b7fdaa7491d031f82ec107e418 Mon Sep 17 00:00:00 2001
From: Aliaksei Maiseyeu
Date: Tue, 4 Feb 2020 15:27:18 +0300
Subject: [PATCH 115/343] af-magic: fix showing aws prompt out of the box
(#8243)
Fix issue related to #7615, #7747 and #6346
After the update, aws prompt (which should be visible out of the box) disappears when a user uses a theme af-magic, because of fact that plugins are loaded before themes.
This pull request fixes issue with not showing aws prompt in theme af-magic, by appending RPROMPT in theme af-magic instead overwriting.
---
themes/af-magic.zsh-theme | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index d185fa1ab..30e997f8c 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -21,9 +21,9 @@ eval my_orange='$FG[214]'
# right prompt
if type "virtualenv_prompt_info" > /dev/null
then
- RPROMPT='$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%'
+ RPROMPT="${RPROMPT}"'$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%'
else
- RPROMPT='$my_gray%n@%m%{$reset_color%}%'
+ RPROMPT="${RPROMPT}"'$my_gray%n@%m%{$reset_color%}%'
fi
# git settings
From 77aa1795d2f05583d4fc63a63abb0144beb5ecff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 4 Feb 2020 19:41:39 +0100
Subject: [PATCH 116/343] Revert "fix: Update tmux plugin to use modern
terminfo. (#8582)"
This reverts commit 69caf98cf754553fda969b0bf1d4966f0498f58f.
---
plugins/tmux/README.md | 4 ++--
plugins/tmux/tmux.plugin.zsh | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md
index 86a95bd4f..db57f5be2 100644
--- a/plugins/tmux/README.md
+++ b/plugins/tmux/README.md
@@ -35,7 +35,7 @@ The plugin also supports the following -
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
| `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: `tmux`) |
-| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` |
+| `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`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index 5ee37dff0..e52443a71 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -22,18 +22,18 @@ alias tkss='tmux kill-session -t'
: ${ZSH_TMUX_AUTOCONNECT:=true}
# Automatically close the terminal when tmux exits
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
-# Set term to tmux or tmux-256color based on current terminal support
+# Set term to screen or screen-256color based on current terminal support
: ${ZSH_TMUX_FIXTERM:=true}
# Set '-CC' option for iTerm2 tmux integration
: ${ZSH_TMUX_ITERM2:=false}
# The TERM to use for non-256 color terminals.
-# Tmux states this should be tmux, but you may need to change it on
+# Tmux states this should be screen, but you may need to change it on
# systems without the proper terminfo
-: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=tmux}
+: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen}
# The TERM to use for 256 color terminals.
-# Tmux states this should be tmux-256color, but you may need to change it on
+# 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:=tmux-256color}
+: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
# Set the configuration path
: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf}
# Set -u option to support unicode
From e81782ac3faf24cac2384a99366f748040b3f20a Mon Sep 17 00:00:00 2001
From: Alastair Rankine
Date: Fri, 7 Feb 2020 06:06:06 -0500
Subject: [PATCH 117/343] virtualenvwrapper: rewrite init script location code
(#8521)
---
.../virtualenvwrapper.plugin.zsh | 64 ++++++-------------
1 file changed, 19 insertions(+), 45 deletions(-)
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index b2d2c5cd6..267bcaeb5 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -1,55 +1,29 @@
-virtualenvwrapper='virtualenvwrapper.sh'
-virtualenvwrapper_lazy='virtualenvwrapper_lazy.sh'
+function {
+ # search in these locations for the init script:
+ for f in $commands[virtualenvwrapper_lazy.sh] \
+ $commands[virtualenvwrapper.sh] \
+ /usr/share/virtualenvwrapper/virtualenvwrapper{_lazy,}.sh \
+ /usr/local/bin/virtualenvwrapper{_lazy,}.sh \
+ /etc/bash_completion.d/virtualenvwrapper \
+ /usr/share/bash-completion/completions/virtualenvwrapper
+ do
+ if [[ -f $f ]]; then
+ source $f
+ return
+ fi
+ done
+ print "[oh-my-zsh] virtualenvwrapper plugin: Cannot find virtualenvwrapper.sh.\n"\
+ "Please install with \`pip install virtualenvwrapper\`" >&2
+}
-if (( $+commands[$virtualenvwrapper_lazy] )); then
- function {
- setopt local_options
- unsetopt equals
- virtualenvwrapper=${${virtualenvwrapper_lazy}:c}
- source ${${virtualenvwrapper_lazy}:c}
- [[ -z "$WORKON_HOME" ]] && WORKON_HOME="$HOME/.virtualenvs"
- }
-elif (( $+commands[$virtualenvwrapper] )); then
- function {
- setopt local_options
- unsetopt equals
- source ${${virtualenvwrapper}:c}
- }
-elif [[ -f "/usr/local/bin/virtualenvwrapper.sh" ]]; then
- function {
- setopt local_options
- unsetopt equals
- virtualenvwrapper="/usr/local/bin/virtualenvwrapper.sh"
- source "/usr/local/bin/virtualenvwrapper.sh"
- }
-elif [[ -f "/usr/share/virtualenvwrapper/virtualenvwrapper.sh" ]]; then
- function {
- setopt local_options
- unsetopt equals
- virtualenvwrapper="/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
- source "/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
- }
-elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
- function {
- setopt local_options
- unsetopt equals
- virtualenvwrapper="/etc/bash_completion.d/virtualenvwrapper"
- source "/etc/bash_completion.d/virtualenvwrapper"
- }
-else
- print "[oh-my-zsh] virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}.\n"\
- "Please install with \`pip install virtualenvwrapper\`" >&2
- return
-fi
if ! type workon &>/dev/null; then
print "[oh-my-zsh] virtualenvwrapper plugin: shell function 'workon' not defined.\n"\
"Please check ${virtualenvwrapper}" >&2
return
fi
-if [[ "$WORKON_HOME" == "" ]]; then
- print "[oh-my-zsh] \$WORKON_HOME is not defined so plugin virtualenvwrapper will not work" >&2
- return
+if [[ -z "$WORKON_HOME" ]]; then
+ WORKON_HOME="$HOME/.virtualenvs"
fi
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
From beab76edfce3500b2fb357c69f3d4fb2a17898fe Mon Sep 17 00:00:00 2001
From: Larson Carter
Date: Fri, 13 Dec 2019 08:18:25 -0600
Subject: [PATCH 118/343] Update issues and PR templates (#8471)
Closes #8471
---
.github/ISSUE_TEMPLATE/bug_report.md | 32 +++++++++++------------
.github/ISSUE_TEMPLATE/feature_request.md | 10 +++----
.github/ISSUE_TEMPLATE/support.md | 2 --
.github/PULL_REQUEST_TEMPLATE.md | 17 ++++++++++++
4 files changed, 37 insertions(+), 24 deletions(-)
create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 076c35544..7c1cb8967 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,6 +1,7 @@
---
name: Bug report
-about: Create a report to help us improve
+about: Create a report to help us improve Oh My Zsh
+labels: 'Type: support'
---
@@ -10,29 +11,26 @@ an issue where no sections have been filled will be deleted without comment.
-->
**Describe the bug**
-
+A clear description of what the bug is.
**To Reproduce**
-
**Expected behavior**
-
+A brief description of what should happen.
-**Screenshots or recordings**
-
+**Screenshots and/or Recordings**
+If applicable, add screenshots to help explain your problem.
+You can also record an asciinema session: https://asciinema.org/
-**System:**
- - OS: [e.g. macOS]
- - Zsh version [e.g. 5.6]
+**Desktop (please complete the following information):**
+ - OS / Distro: [e.g. Arch Linux, macOS]
+ - Latest ohmyzsh Update?: [e.g. Yes/No]
+ - ZSH Version: [e.g. 5.6]
- Terminal emulator [e.g. iTerm2]
**Additional context**
-
+Add any other context about the problem here. This can be themes, plugins, custom configs.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index d9c324a55..346eabaea 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -11,16 +11,16 @@ an issue where no sections have been filled will be deleted without comment.
-->
**Is your feature request related to a particular plugin or theme? If so, specify it.**
-
+The name of the plugin or theme that you would like us to improve. [...]
**Is your feature request related to a problem? Please describe.**
-
+A description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
-
+A description of what you want to happen.
**Describe alternatives you've considered**
-
+A description of any alternative solutions or features you've considered. This can also include other plugins or aliases.
**Additional context**
-
+Add any other context or screenshots about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
diff --git a/.github/ISSUE_TEMPLATE/support.md b/.github/ISSUE_TEMPLATE/support.md
index 3c69a7d5e..d2638412e 100644
--- a/.github/ISSUE_TEMPLATE/support.md
+++ b/.github/ISSUE_TEMPLATE/support.md
@@ -5,8 +5,6 @@ labels: 'Type: support'
---
-
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..6bcb90efe
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,17 @@
+## Standards checklist:
+
+- [ ] The PR title is descriptive.
+- [ ] The PR doesn't replicate another PR which is already open.
+- [ ] I have read the contribution guide and followed all the instructions.
+- [ ] The code follows the code style guide detailed in the wiki.
+- [ ] The code is mine or it's from somewhere with an MIT-compatible license.
+- [ ] The code is efficient, to the best of my ability, and does not waste computer resources.
+- [ ] The code is stable and I have tested it myself, to the best of my abilities.
+
+## Changes:
+
+- [...]
+
+## Other comments:
+
+...
From bfec31666aa9e61cc869fa6e93a031b53fe47d44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20=C5=A0abata?=
Date: Mon, 10 Feb 2020 19:16:02 +0100
Subject: [PATCH 119/343] systemd: refactor and add latest commands (#6250)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Order systemctl commands alphabetically
Simplifying the plugin maintenance.
Signed-off-by: Petr Šabata
* Include the latest systemctl commands
Based on systemd-233. I'm still keeping the old, now unsupported
commands for backwards compatibility as well.
Signed-off-by: Petr Šabata
* Add daemon-reload (#3701)
Closes #3701
Co-authored-by: Javier Tia
---
plugins/systemd/systemd.plugin.zsh | 65 +++++++++++++++++++++++++++---
1 file changed, 59 insertions(+), 6 deletions(-)
diff --git a/plugins/systemd/systemd.plugin.zsh b/plugins/systemd/systemd.plugin.zsh
index 7cd27d450..201ffd998 100644
--- a/plugins/systemd/systemd.plugin.zsh
+++ b/plugins/systemd/systemd.plugin.zsh
@@ -1,12 +1,65 @@
user_commands=(
- list-units is-active status show help list-unit-files
- is-enabled list-jobs show-environment cat list-timers)
+ cat
+ get-default
+ help
+ is-active
+ is-enabled
+ is-failed
+ is-system-running
+ list-dependencies
+ list-jobs
+ list-sockets
+ list-timers
+ list-unit-files
+ list-units
+ show
+ show-environment
+ status)
sudo_commands=(
- start stop reload restart try-restart isolate kill
- reset-failed enable disable reenable preset mask unmask
- link load cancel set-environment unset-environment
- edit)
+ add-requires
+ add-wants
+ cancel
+ daemon-reexec
+ daemon-reload
+ default
+ disable
+ edit
+ emergency
+ enable
+ halt
+ hibernate
+ hybrid-sleep
+ import-environment
+ isolate
+ kexec
+ kill
+ link
+ list-machines
+ load
+ mask
+ poweroff
+ preset
+ preset-all
+ reboot
+ reenable
+ reload
+ reload-or-restart
+ reset-failed
+ rescue
+ restart
+ revert
+ set-default
+ set-environment
+ set-property
+ start
+ stop
+ suspend
+ switch-root
+ try-reload-or-restart
+ try-restart
+ unmask
+ unset-environment)
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
From 22cf7159ec09722421ffe355e852410823d7f49d Mon Sep 17 00:00:00 2001
From: Isaac Cook
Date: Mon, 10 Feb 2020 13:31:55 -0600
Subject: [PATCH 120/343] kube-ps1: add example for common pitfall (#8318)
I ran into this issue, looks like maybe a few other people did as well.
https://github.com/jonmosco/kube-ps1/issues/28#issuecomment-359761463
A simple clarification seems helpful.
---
plugins/kube-ps1/README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md
index 82c0a77e6..fdc1a94e8 100644
--- a/plugins/kube-ps1/README.md
+++ b/plugins/kube-ps1/README.md
@@ -55,6 +55,8 @@ plugins=(
# After the "source Oh My Zsh" line
PROMPT=$PROMPT'$(kube_ps1) '
+# Or in double quotes, don't forget to escape
+PROMPT=$PROMPT"\$(kube_ps1) "
```
Note: The `PROMPT` example above was tested with the theme `robbyrussell`.
From 1c300d3a76a786a83e8a70b7a399db94c8bcf5b7 Mon Sep 17 00:00:00 2001
From: Evan Chiu
Date: Sun, 10 Apr 2016 17:32:37 -0700
Subject: [PATCH 121/343] lib: add git function to determine repository name
(#4989)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes #4989
Co-authored-by: Marc Cornellà
---
lib/git.zsh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/git.zsh b/lib/git.zsh
index 2054fe272..00cb00b19 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -199,3 +199,12 @@ function git_current_user_name() {
function git_current_user_email() {
command git config user.email 2>/dev/null
}
+
+# Output the name of the root directory of the git repository
+# Usage example: $(git_repo_name)
+function git_repo_name() {
+ local repo_path
+ if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then
+ echo ${repo_path:t}
+ fi
+}
From d88fbe625f0a7c6f7296a58e0cd919903cd81511 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20DAVID?=
<632571+groolot@users.noreply.github.com>
Date: Mon, 10 Feb 2020 21:18:14 +0100
Subject: [PATCH 122/343] systemadmin: fix header line sorting in pscpu (#6167)
Inside `pscpu` and `pscpu10` aliases, remove sorting of the header line.
---
plugins/systemadmin/systemadmin.plugin.zsh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
index bdc2219fa..ded25c3a9 100644
--- a/plugins/systemadmin/systemadmin.plugin.zsh
+++ b/plugins/systemadmin/systemadmin.plugin.zsh
@@ -28,8 +28,8 @@ alias mkdir='mkdir -pv'
alias psmem='ps -e -orss=,args= | sort -b -k1,1n'
alias psmem10='ps -e -orss=,args= | sort -b -k1,1n| head -10'
# get top process eating cpu if not work try excute : export LC_ALL='C'
-alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr'
-alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr | head -10'
+alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr'
+alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10'
# top10 of the history
alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
From f362b69df696866704fc1b0b1bcb9a7d2a780b2a Mon Sep 17 00:00:00 2001
From: Yuan Liu
Date: Mon, 10 Feb 2020 12:19:03 -0800
Subject: [PATCH 123/343] common-aliases: fix loading of is-at-least function
(#6215)
---
plugins/common-aliases/common-aliases.plugin.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh
index 785a09c63..ce1995c03 100644
--- a/plugins/common-aliases/common-aliases.plugin.zsh
+++ b/plugins/common-aliases/common-aliases.plugin.zsh
@@ -50,6 +50,7 @@ alias mv='mv -i'
# zsh is able to auto-do some kungfoo
# depends on the SUFFIX :)
+autoload -Uz is-at-least
if is-at-least 4.2.0; then
# open browser on urls
if [[ -n "$BROWSER" ]]; then
From 83aa984d1a11199d5bb23fb1e462f48e9b4edc88 Mon Sep 17 00:00:00 2001
From: Henry Darnell
Date: Mon, 10 Feb 2020 18:39:20 -0600
Subject: [PATCH 124/343] Add dotnet watch and dotnet watch run (#8612)
---
plugins/dotnet/README.md | 20 +++++++++++---------
plugins/dotnet/dotnet.plugin.zsh | 2 ++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md
index 7a6d6a995..a663fc88d 100644
--- a/plugins/dotnet/README.md
+++ b/plugins/dotnet/README.md
@@ -10,12 +10,14 @@ plugins=(... dotnet)
## Aliases
-| Alias | Command | Description |
-|-------|--------------|-------------------------------------------------------------------|
-| dn | dotnet new | Create a new .NET project or file. |
-| dr | dotnet run | Build and run a .NET project output. |
-| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
-| ds | dotnet sln | Modify Visual Studio solution files. |
-| da | dotnet add | Add a package or reference to a .NET project. |
-| dp | dotnet pack | Create a NuGet package. |
-| dng | dotnet nuget | Provides additional NuGet commands. |
\ No newline at end of file
+| Alias | Command | Description |
+|-------|------------------|-------------------------------------------------------------------|
+| dn | dotnet new | Create a new .NET project or file. |
+| dr | dotnet run | Build and run a .NET project output. |
+| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
+| dw | dotnet watch | Watch for source file changes and restart the dotnet command. |
+| dwr | dotnet watch run | Watch for source file changes and restart the `run` command. |
+| ds | dotnet sln | Modify Visual Studio solution files. |
+| da | dotnet add | Add a package or reference to a .NET project. |
+| dp | dotnet pack | Create a NuGet package. |
+| dng | dotnet nuget | Provides additional NuGet commands. |
\ No newline at end of file
diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh
index 8b9a45a97..ed6c68e5d 100644
--- a/plugins/dotnet/dotnet.plugin.zsh
+++ b/plugins/dotnet/dotnet.plugin.zsh
@@ -111,6 +111,8 @@ compdef _dotnet dotnet
# --------------------------------------------------------------------- #
alias dr='dotnet run'
alias dt='dotnet test'
+alias dw='dotnet watch'
+alias dwr='dotnet watch run'
alias ds='dotnet sln'
alias da='dotnet add'
alias dp='dotnet pack'
From 05cae34676ac3a22fb8a0adca8ab9b5301f48fb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 17:43:59 +0100
Subject: [PATCH 125/343] Detect dependency plugins in candy-kingdom and kiwi
themes
Fixes #5029
Fixes #5342
---
themes/candy-kingdom.zsh-theme | 24 +++++++++++++-----------
themes/kiwi.zsh-theme | 4 +---
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme
index 30ce785c0..ad03cc320 100644
--- a/themes/candy-kingdom.zsh-theme
+++ b/themes/candy-kingdom.zsh-theme
@@ -1,16 +1,14 @@
-# neuralsanwich.zsh-theme
-
-if [ "x$OH_MY_ZSH_HG" = "x" ]; then
- OH_MY_ZSH_HG="hg"
-fi
-
-function hg_prompt_info {
- $OH_MY_ZSH_HG prompt --angle-brackets "\
+if ! hg prompt 2>/dev/null; then
+ function hg_prompt_info { }
+else
+ function hg_prompt_info {
+ hg prompt --angle-brackets "\
< on %{$fg[magenta]%}%{$reset_color%}>\
< at %{$fg[yellow]%}%{$reset_color%}>\
%{$fg[green]%}%{$reset_color%}<
patches: >" 2>/dev/null
-}
+ }
+fi
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
@@ -26,5 +24,9 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[red]%}?"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[orange]%}!"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
-local return_status="%{$fg[red]%}%(?..✘)%{$reset_color%}"
-RPROMPT='${return_status}$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
+RPROMPT='%{$fg[red]%}%(?..✘)%{$reset_color%}'
+
+# Add battery status if the battery plugin is enabled
+if (( $+functions[battery_pct_prompt] )); then
+ RPROMPT+='$(battery_time_remaining) $(battery_pct_prompt)%{$reset_color%}'
+fi
diff --git a/themes/kiwi.zsh-theme b/themes/kiwi.zsh-theme
index f93de2b75..94f0ffcbf 100644
--- a/themes/kiwi.zsh-theme
+++ b/themes/kiwi.zsh-theme
@@ -1,6 +1,4 @@
-#
-# Kiwi ZSH Theme
-#
+(( $+functions[battery_pct_prompt] )) || function battery_pct_prompt { }
PROMPT='%{$fg_bold[green]%}┌[%{$fg_bold[cyan]%}kiwish-4.2%{$fg_bold[green]%}]-(%{$fg_bold[white]%}%2~%{$fg_bold[green]%})-$(git_prompt_info)$(svn_prompt_info)$(battery_pct_prompt)
└> % %{$reset_color%}'
From 9dffb3191d5d87509830bcf5367551c2637827bb Mon Sep 17 00:00:00 2001
From: Umberto Nicoletti
Date: Tue, 11 Feb 2020 18:46:56 +0100
Subject: [PATCH 126/343] vagrant: obey VAGRANT_CWD when completing vagrant
commands (#7219)
---
plugins/vagrant/_vagrant | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index 2efb4473d..79c4c6fe6 100644
--- a/plugins/vagrant/_vagrant
+++ b/plugins/vagrant/_vagrant
@@ -69,8 +69,8 @@ __box_list ()
__vm_list ()
{
- _wanted application expl 'command' compadd $(command grep Vagrantfile -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}')
- _wanted application expl 'command' compadd $(command ls .vagrant/machines/ 2>/dev/null)
+ _wanted application expl 'command' compadd $(command grep "${VAGRANT_CWD:-.}/Vagrantfile" -oe '^[^#]*\.vm\.define *[:"]\([a-zA-Z0-9_-]\+\)' 2>/dev/null | awk '{print substr($2, 2)}')
+ _wanted application expl 'command' compadd $(command ls "${VAGRANT_CWD:-.}/.vagrant/machines/" 2>/dev/null)
}
__vagrant-box ()
From bc67a55fe8ff6fce8fdc2c002dbb7159c6008aa0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 19:35:17 +0100
Subject: [PATCH 127/343] jump: fix issues in plugin and document CTRL+G key
binding
- Fixes `readlink -e` dependency which isn't supported in macOS
(fixes #3235).
- Uses native zsh wildcard expansion instead of calls to `ls`.
- Prepends commands with `command` and `builtin` to bypass aliases
and functions.
- Documents CTRL+G key binding to substitute mark name in the command
line with the mark path (https://github.com/ohmyzsh/ohmyzsh/pull/2045#issuecomment-22826540).
---
plugins/jump/README.md | 12 ++++++++++++
plugins/jump/jump.plugin.zsh | 21 ++++++++-------------
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/plugins/jump/README.md b/plugins/jump/README.md
index ed6415289..1b0ce68c0 100644
--- a/plugins/jump/README.md
+++ b/plugins/jump/README.md
@@ -17,3 +17,15 @@ plugins=(... jump)
| `mark [mark-name]` | Create a mark with the given name or with the name of the current directory if none is provided |
| `unmark ` | Remove the given mark |
| `marks` | List the existing marks and the directories they point to |
+
+## Key bindings
+
+Pressing `CTRL`+`G` substitutes the written mark name for the full path of the mark.
+For example, with a mark named `mymark` pointing to `/path/to/my/mark`:
+```zsh
+$ cp /tmp/file mymark
+```
+will become:
+```zsh
+$ cp /tmp/file /path/to/my/mark
+```
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index d161a6da0..4f9134fcd 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -9,22 +9,23 @@
export MARKPATH=$HOME/.marks
jump() {
- cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1}
+ builtin cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1}
}
mark() {
- if [[ ( $# == 0 ) || ( "$1" == "." ) ]]; then
- MARK=$(basename "$PWD")
+ if [[ $# -eq 0 || "$1" = "." ]]; then
+ MARK=${PWD:t}
else
MARK="$1"
fi
- if read -q \?"Mark $PWD as ${MARK}? (y/n) "; then
- mkdir -p "$MARKPATH"; ln -sfn "$PWD" "$MARKPATH/$MARK"
+ if read -q "?Mark $PWD as ${MARK}? (y/n) "; then
+ command mkdir -p "$MARKPATH"
+ command ln -sfn "$PWD" "$MARKPATH/$MARK"
fi
}
unmark() {
- rm -i "$MARKPATH/$1"
+ LANG= command rm -i "$MARKPATH/$1"
}
marks() {
@@ -44,13 +45,7 @@ marks() {
}
_completemarks() {
- if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
- reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_a-zA-Z0-9\.\-]*):$/\2/g'))
- else
- if readlink -e "${MARKPATH}"/* &>/dev/null; then
- reply=($(ls "${MARKPATH}"))
- fi
- fi
+ reply=("${MARKPATH}"/*(N:t))
}
compctl -K _completemarks jump
compctl -K _completemarks unmark
From 3c5bbcf5b99d2b7dc0cbba6d154328344633bd72 Mon Sep 17 00:00:00 2001
From: hqingyi
Date: Fri, 27 Nov 2015 19:29:15 +0800
Subject: [PATCH 128/343] jump: add support for directories starting with a dot
(#4661)
Closes #4661
---
plugins/jump/jump.plugin.zsh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index 4f9134fcd..a21b7a181 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -29,14 +29,14 @@ unmark() {
}
marks() {
- local max=0
- for link in $MARKPATH/*(@); do
+ local link max=0
+ for link in $MARKPATH/{,.}*(@); do
if [[ ${#link:t} -gt $max ]]; then
max=${#link:t}
fi
done
local printf_markname_template="$(printf -- "%%%us " "$max")"
- for link in $MARKPATH/*(@); do
+ for link in $MARKPATH/{,.}*(@); do
local markname="$fg[cyan]${link:t}$reset_color"
local markpath="$fg[blue]$(readlink $link)$reset_color"
printf -- "$printf_markname_template" "$markname"
@@ -45,13 +45,13 @@ marks() {
}
_completemarks() {
- reply=("${MARKPATH}"/*(N:t))
+ reply=("${MARKPATH}"/{,.}*(@N:t))
}
compctl -K _completemarks jump
compctl -K _completemarks unmark
_mark_expansion() {
- setopt extendedglob
+ setopt localoptions extendedglob
autoload -U modify-current-argument
modify-current-argument '$(readlink "$MARKPATH/$ARG")'
}
From 561e7169acd02d5e27542a1d93f1f9533ba52fa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 20:12:01 +0100
Subject: [PATCH 129/343] jump: fix for `marks' and CTRL+G key binding
- marks printed an error when $MARKPATH didn't exist or didn't have any marks
in it.
- The CTRL+G key binding overwrote an argument when it couldn't match it to
an existing mark.
---
plugins/jump/jump.plugin.zsh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index a21b7a181..c2da1144e 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -30,13 +30,13 @@ unmark() {
marks() {
local link max=0
- for link in $MARKPATH/{,.}*(@); do
+ for link in $MARKPATH/{,.}*(@N); do
if [[ ${#link:t} -gt $max ]]; then
max=${#link:t}
fi
done
local printf_markname_template="$(printf -- "%%%us " "$max")"
- for link in $MARKPATH/{,.}*(@); do
+ for link in $MARKPATH/{,.}*(@N); do
local markname="$fg[cyan]${link:t}$reset_color"
local markpath="$fg[blue]$(readlink $link)$reset_color"
printf -- "$printf_markname_template" "$markname"
@@ -53,7 +53,7 @@ compctl -K _completemarks unmark
_mark_expansion() {
setopt localoptions extendedglob
autoload -U modify-current-argument
- modify-current-argument '$(readlink "$MARKPATH/$ARG")'
+ modify-current-argument '$(readlink "$MARKPATH/$ARG" || echo "$ARG")'
}
zle -N _mark_expansion
bindkey "^g" _mark_expansion
From 17428f3c9a99c8d81e57bcf565d39011669e65ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 20:16:43 +0100
Subject: [PATCH 130/343] lib: load bash completion functions automatically
Fixes #8614
---
lib/completion.zsh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/completion.zsh b/lib/completion.zsh
index c7db2eb7b..c932bc925 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -71,3 +71,6 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
+
+# automatically load bash completion functions
+autoload -Uz bashcompinit && bashcompinit
From 1bd7a7ad21c51268ba0f9a0d8b643a82b5788a6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 13:32:13 +0100
Subject: [PATCH 131/343] Fix calculation for battery percentage (#4774)
Co-authored-by: Michael Wolman
---
plugins/battery/battery.plugin.zsh | 31 +++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 6b6684716..5322dd18a 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -169,8 +169,8 @@ fi
function battery_level_gauge() {
local gauge_slots=${BATTERY_GAUGE_SLOTS:-10};
- local green_threshold=${BATTERY_GREEN_THRESHOLD:-6};
- local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-4};
+ local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))};
+ local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))};
local color_green=${BATTERY_COLOR_GREEN:-%F{green}};
local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}};
local color_red=${BATTERY_COLOR_RED:-%F{red}};
@@ -183,26 +183,35 @@ function battery_level_gauge() {
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'};
local battery_remaining_percentage=$(battery_pct);
+ local filled empty gauge_color
if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then
- local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots)));
- local empty=$(($gauge_slots - $filled));
+ filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 ));
+ empty=$(( $gauge_slots - $filled ));
- if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green;
- elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow;
- else local gauge_color=$color_red;
+ if [[ $filled -gt $green_threshold ]]; then
+ gauge_color=$color_green;
+ elif [[ $filled -gt $yellow_threshold ]]; then
+ gauge_color=$color_yellow;
+ else
+ gauge_color=$color_red;
fi
else
- local filled=$gauge_slots;
- local empty=0;
+ filled=$gauge_slots;
+ empty=0;
filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
fi
- local charging=' ' && battery_is_charging && charging=$charging_symbol;
+ local charging=' '
+ battery_is_charging && charging=$charging_symbol;
+ # Charging status and prefix
printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
- printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
+ # Filled slots
+ [[ $filled -gt 0 ]] && printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
+ # Empty slots
[[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty}
+ # Suffix
printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%}
}
From 39e61614f206f6a552f53c8d1a8b956d8c9ab32f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 13:49:04 +0100
Subject: [PATCH 132/343] Clean up Linux battery commands and syntax
---
plugins/battery/battery.plugin.zsh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 5322dd18a..c1037ad26 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -116,17 +116,17 @@ elif [[ "$OSTYPE" = freebsd* ]] ; then
elif [[ "$OSTYPE" = linux* ]] ; then
function battery_is_charging() {
- ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
+ ! acpi 2>/dev/null | command grep -q '^Battery.*Discharging'
}
function battery_pct() {
if (( $+commands[acpi] )) ; then
- echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"
+ acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]'
fi
}
function battery_pct_remaining() {
- if [ ! $(battery_is_charging) ] ; then
+ if ! battery_is_charging; then
battery_pct
else
echo "External Power"
@@ -134,15 +134,17 @@ elif [[ "$OSTYPE" = linux* ]] ; then
}
function battery_time_remaining() {
- if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
- echo $(acpi 2>/dev/null | cut -f3 -d ',')
+ if ! battery_is_charging; then
+ acpi 2>/dev/null | cut -f3 -d ','
fi
}
function battery_pct_prompt() {
- b=$(battery_pct_remaining)
- if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
- if [ $b -gt 50 ] ; then
+ local b=$(battery_pct_remaining)
+ if battery_is_charging; then
+ echo "∞"
+ else
+ if [[ $b -gt 50 ]]; then
color='green'
elif [ $b -gt 20 ] ; then
color='yellow'
@@ -150,8 +152,6 @@ elif [[ "$OSTYPE" = linux* ]] ; then
color='red'
fi
echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
- else
- echo "∞"
fi
}
From 5f6f7b6e8de8e6b64f07deb6b185535a8cdbe03e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 11 Feb 2020 14:17:46 +0100
Subject: [PATCH 133/343] Various syntax fixes and function naming equivalence
- Fix code style
- Fix local definitions
- Don't declare unnecessary variables
- Use `command` before grep
---
plugins/battery/battery.plugin.zsh | 134 ++++++++++++++---------------
1 file changed, 63 insertions(+), 71 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index c1037ad26..7c5bf6f82 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -11,22 +11,21 @@
# Modified to add support for FreeBSD #
###########################################
-if [[ "$OSTYPE" = darwin* ]] ; then
+if [[ "$OSTYPE" = darwin* ]]; then
- function battery_pct() {
- local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
- typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
- typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
- integer i=$(((currentcapacity/maxcapacity) * 100))
- echo $i
+ function battery_is_charging() {
+ ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes'
}
- function plugged_in() {
- [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
+ function battery_pct() {
+ local smart_battery_status="$(ioreg -rc AppleSmartBattery)"
+ local -F maxcapacity=$(command grep '^.*"MaxCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*"MaxCapacity"\ =\ //')
+ local -F currentcapacity=$(command grep '^.*"CurrentCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*CurrentCapacity"\ =\ //')
+ echo $(( (currentcapacity/maxcapacity) * 100 ))
}
function battery_pct_remaining() {
- if plugged_in ; then
+ if battery_is_charging; then
echo "External Power"
else
battery_pct
@@ -35,9 +34,9 @@ if [[ "$OSTYPE" = darwin* ]] ; then
function battery_time_remaining() {
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
- if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
- timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
- if [ $timeremaining -gt 720 ] ; then
+ if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then
+ timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
+ if [ $timeremaining -gt 720 ]; then
echo "::"
else
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
@@ -48,11 +47,11 @@ if [[ "$OSTYPE" = darwin* ]] ; then
}
function battery_pct_prompt () {
- if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+ if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then
b=$(battery_pct_remaining)
- if [ $b -gt 50 ] ; then
+ if [[ $b -gt 50 ]]; then
color='green'
- elif [ $b -gt 20 ] ; then
+ elif [[ $b -gt 20 ]]; then
color='yellow'
else
color='red'
@@ -63,24 +62,20 @@ if [[ "$OSTYPE" = darwin* ]] ; then
fi
}
- function battery_is_charging() {
- [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
- }
-
-elif [[ "$OSTYPE" = freebsd* ]] ; then
+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)"
+ if (( $+commands[sysctl] )); then
+ sysctl -n hw.acpi.battery.life
fi
}
function battery_pct_remaining() {
- if [ ! $(battery_is_charging) ] ; then
+ if ! battery_is_charging; then
battery_pct
else
echo "External Power"
@@ -88,39 +83,40 @@ elif [[ "$OSTYPE" = freebsd* ]] ; then
}
function battery_time_remaining() {
+ local remaining_time
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
+ if [[ $remaining_time -ge 0 ]]; then
+ ((hour = $remaining_time / 60 ))
+ ((minute = $remaining_time % 60 ))
+ printf %02d:%02d $hour $minute
fi
}
function battery_pct_prompt() {
+ local b color
b=$(battery_pct_remaining)
- if [ ! $(battery_is_charging) ] ; then
- if [ $b -gt 50 ] ; then
+ if battery_is_charging; then
+ echo "∞"
+ else
+ if [[ $b -gt 50 ]]; then
color='green'
- elif [ $b -gt 20 ] ; then
+ 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
+elif [[ "$OSTYPE" = linux* ]]; then
function battery_is_charging() {
! acpi 2>/dev/null | command grep -q '^Battery.*Discharging'
}
function battery_pct() {
- if (( $+commands[acpi] )) ; then
+ if (( $+commands[acpi] )); then
acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]'
fi
}
@@ -140,13 +136,14 @@ elif [[ "$OSTYPE" = linux* ]] ; then
}
function battery_pct_prompt() {
- local b=$(battery_pct_remaining)
+ local b color
+ b=$(battery_pct_remaining)
if battery_is_charging; then
echo "∞"
else
if [[ $b -gt 50 ]]; then
color='green'
- elif [ $b -gt 20 ] ; then
+ elif [[ $b -gt 20 ]]; then
color='yellow'
else
color='red'
@@ -157,53 +154,50 @@ elif [[ "$OSTYPE" = linux* ]] ; then
else
# Empty functions so we don't cause errors in prompts
- function battery_pct_remaining() {
- }
-
- function battery_time_remaining() {
- }
-
- function battery_pct_prompt() {
- }
+ function battery_is_charging { false }
+ function battery_pct \
+ battery_pct_remaining \
+ battery_time_remaining \
+ battery_pct_prompt { }
fi
function battery_level_gauge() {
- local gauge_slots=${BATTERY_GAUGE_SLOTS:-10};
- local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))};
- local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))};
- local color_green=${BATTERY_COLOR_GREEN:-%F{green}};
- local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}};
- local color_red=${BATTERY_COLOR_RED:-%F{red}};
- local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}};
- local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['};
- local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'};
- local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'};
- local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'};
- local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow};
- local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'};
+ local gauge_slots=${BATTERY_GAUGE_SLOTS:-10}
+ local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))}
+ local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))}
+ local color_green=${BATTERY_COLOR_GREEN:-%F{green}}
+ local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}}
+ local color_red=${BATTERY_COLOR_RED:-%F{red}}
+ local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}}
+ local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['}
+ local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'}
+ local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}
+ local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}
+ local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}
+ local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}
- local battery_remaining_percentage=$(battery_pct);
+ local battery_remaining_percentage=$(battery_pct)
local filled empty gauge_color
if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then
- filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 ));
- empty=$(( $gauge_slots - $filled ));
+ filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 ))
+ empty=$(( $gauge_slots - $filled ))
if [[ $filled -gt $green_threshold ]]; then
- gauge_color=$color_green;
+ gauge_color=$color_green
elif [[ $filled -gt $yellow_threshold ]]; then
- gauge_color=$color_yellow;
+ gauge_color=$color_yellow
else
- gauge_color=$color_red;
+ gauge_color=$color_red
fi
else
- filled=$gauge_slots;
- empty=0;
- filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
+ filled=$gauge_slots
+ empty=0
+ filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}
fi
local charging=' '
- battery_is_charging && charging=$charging_symbol;
+ battery_is_charging && charging=$charging_symbol
# Charging status and prefix
printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
@@ -214,5 +208,3 @@ function battery_level_gauge() {
# Suffix
printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%}
}
-
-
From b8b87629157b30fc00d0b4af62dd0cf422896346 Mon Sep 17 00:00:00 2001
From: Bruce Weirdan
Date: Thu, 24 Dec 2015 04:11:22 +0200
Subject: [PATCH 134/343] Report only active battery (#4726)
On a system with multiple batteries (like thinkpads) report percentage
and time remaining only for the active battery (the one being
discharged).
Ideally we should report all batteries, but acpi only shows time remaining
for the active battery. Also callers of these functions expect a single
return value. This is still better than reporting 596% remaining (like it
did on my laptop).
For the reference, the output of acpi command with multiple batteries looks
like this:
Battery 0: Unknown, 5%
Battery 1: Discharging, 86%, 03:14:04 remaining
---
plugins/battery/battery.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 7c5bf6f82..d1adcd0b6 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -117,7 +117,7 @@ elif [[ "$OSTYPE" = linux* ]]; then
function battery_pct() {
if (( $+commands[acpi] )); then
- acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]'
+ acpi 2>/dev/null | command grep -E '^Battery.*(Disc|C)harging' | cut -f2 -d ',' | tr -cd '[:digit:]'
fi
}
From 15a03744a9e87b8dd371a4fbac456a73d27d32d5 Mon Sep 17 00:00:00 2001
From: GregoireW
Date: Thu, 17 Oct 2019 11:30:24 +0200
Subject: [PATCH 135/343] Remove invalid batteries (#8275)
---
plugins/battery/battery.plugin.zsh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index d1adcd0b6..6fe801c9f 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -112,12 +112,12 @@ elif [[ "$OSTYPE" = freebsd* ]]; then
elif [[ "$OSTYPE" = linux* ]]; then
function battery_is_charging() {
- ! acpi 2>/dev/null | command grep -q '^Battery.*Discharging'
+ ! acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -q '^Battery.*Discharging'
}
function battery_pct() {
if (( $+commands[acpi] )); then
- acpi 2>/dev/null | command grep -E '^Battery.*(Disc|C)harging' | cut -f2 -d ',' | tr -cd '[:digit:]'
+ acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Disc|C)harging' | cut -f2 -d ',' | tr -cd '[:digit:]'
fi
}
@@ -131,7 +131,7 @@ elif [[ "$OSTYPE" = linux* ]]; then
function battery_time_remaining() {
if ! battery_is_charging; then
- acpi 2>/dev/null | cut -f3 -d ','
+ acpi 2>/dev/null | command grep -v "rate information unavailable" | cut -f3 -d ','
fi
}
From e178ae39b41e554722c205d107a664dced1761b9 Mon Sep 17 00:00:00 2001
From: Mazin Ahmed
Date: Wed, 12 Feb 2020 20:51:40 +0400
Subject: [PATCH 136/343] dotenv: prompt before executing dotenv file (#8606)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Marc Cornellà
---
plugins/dotenv/dotenv.plugin.zsh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index 89763d0ee..d4a6db8f8 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -1,5 +1,12 @@
source_env() {
if [[ -f $ZSH_DOTENV_FILE ]]; then
+ # confirm before sourcing .env file
+ local confirmation
+ echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
+ if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
+ return
+ fi
+
# test .env syntax
zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
From 3ec04997ebc413ddc95b7c11743b525d7fc7c4ab Mon Sep 17 00:00:00 2001
From: Henry Chang
Date: Sun, 26 Mar 2017 18:29:36 -0700
Subject: [PATCH 137/343] Add zsh-interactive-cd plugin
---
plugins/zsh-interactive-cd/README.md | 23 +++
.../zsh-interactive-cd.plugin.zsh | 147 ++++++++++++++++++
2 files changed, 170 insertions(+)
create mode 100644 plugins/zsh-interactive-cd/README.md
create mode 100644 plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
diff --git a/plugins/zsh-interactive-cd/README.md b/plugins/zsh-interactive-cd/README.md
new file mode 100644
index 000000000..c8337fbc8
--- /dev/null
+++ b/plugins/zsh-interactive-cd/README.md
@@ -0,0 +1,23 @@
+# zsh-interactive-cd
+
+This plugin adds a fish-like interactive tab completion for the `cd` command.
+
+To use it, add `zsh-interactive-cd` to the plugins array of your zshrc file:
+```zsh
+plugins=(... zsh-interactive-cd)
+```
+
+![demo](https://user-images.githubusercontent.com/1441704/74360670-cb202900-4dc5-11ea-9734-f60caf726e85.gif)
+
+## Usage
+
+Press tab for completion as usual, it'll launch fzf automatically. Check fzf’s [readme](https://github.com/junegunn/fzf#search-syntax) for more search syntax usage.
+
+## Requirements
+
+This plugin requires [fzf](https://github.com/junegunn/fzf). Install it by following
+its [installation instructions](https://github.com/junegunn/fzf#installation).
+
+## Author
+
+[Henry Chang](https://github.com/changyuheng)
diff --git a/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
new file mode 100644
index 000000000..0f15aeef0
--- /dev/null
+++ b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
@@ -0,0 +1,147 @@
+# Copyright (c) 2017 Henry Chang
+
+__zic_fzf_prog() {
+ [ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] \
+ && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
+}
+
+__zic_matched_subdir_list() {
+ local dir length seg starts_with_dir
+ if [[ "$1" == */ ]]; then
+ dir="$1"
+ if [[ "$dir" != / ]]; then
+ dir="${dir: : -1}"
+ fi
+ length=$(echo -n "$dir" | wc -c)
+ if [ "$dir" = "/" ]; then
+ length=0
+ fi
+ find -L "$dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null \
+ | cut -b $(( ${length} + 2 ))- | sed '/^$/d' | while read -r line; do
+ if [[ "${line[1]}" == "." ]]; then
+ continue
+ fi
+ echo "$line"
+ done
+ else
+ dir=$(dirname -- "$1")
+ length=$(echo -n "$dir" | wc -c)
+ if [ "$dir" = "/" ]; then
+ length=0
+ fi
+ seg=$(basename -- "$1")
+ starts_with_dir=$( \
+ find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
+ 2>/dev/null | cut -b $(( ${length} + 2 ))- | sed '/^$/d' \
+ | while read -r line; do
+ if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
+ continue
+ fi
+ if [[ "$line" == "$seg"* ]]; then
+ echo "$line"
+ fi
+ done
+ )
+ if [ -n "$starts_with_dir" ]; then
+ echo "$starts_with_dir"
+ else
+ find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
+ 2>/dev/null | cut -b $(( ${length} + 2 ))- | sed '/^$/d' \
+ | while read -r line; do
+ if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
+ continue
+ fi
+ if [[ "$line" == *"$seg"* ]]; then
+ echo "$line"
+ fi
+ done
+ fi
+ fi
+}
+
+_zic_list_generator() {
+ __zic_matched_subdir_list "${(Q)@[-1]}" | sort
+}
+
+_zic_complete() {
+ setopt localoptions nonomatch
+ local l matches fzf tokens base
+
+ l=$(_zic_list_generator $@)
+
+ if [ -z "$l" ]; then
+ zle ${__zic_default_completion:-expand-or-complete}
+ return
+ fi
+
+ fzf=$(__zic_fzf_prog)
+
+ if [ $(echo $l | wc -l) -eq 1 ]; then
+ matches=${(q)l}
+ else
+ matches=$(echo $l \
+ | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} \
+ --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS \
+ --bind 'shift-tab:up,tab:down'" ${=fzf} \
+ | while read -r item; do
+ echo -n "${(q)item} "
+ done)
+ fi
+
+ matches=${matches% }
+ if [ -n "$matches" ]; then
+ tokens=(${(z)LBUFFER})
+ base="${(Q)@[-1]}"
+ if [[ "$base" != */ ]]; then
+ if [[ "$base" == */* ]]; then
+ base="$(dirname -- "$base")"
+ if [[ ${base[-1]} != / ]]; then
+ base="$base/"
+ fi
+ else
+ base=""
+ fi
+ fi
+ LBUFFER="${tokens[1]} "
+ if [ -n "$base" ]; then
+ base="${(q)base}"
+ if [ "${tokens[2][1]}" = "~" ]; then
+ base="${base/#$HOME/~}"
+ fi
+ LBUFFER="${LBUFFER}${base}"
+ fi
+ LBUFFER="${LBUFFER}${matches}/"
+ fi
+ zle redisplay
+ typeset -f zle-line-init >/dev/null && zle zle-line-init
+}
+
+zic-completion() {
+ setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
+ local tokens cmd
+
+ tokens=(${(z)LBUFFER})
+ cmd=${tokens[1]}
+
+ if [[ "$LBUFFER" =~ "^\ *cd$" ]]; then
+ zle ${__zic_default_completion:-expand-or-complete}
+ elif [ "$cmd" = cd ]; then
+ _zic_complete ${tokens[2,${#tokens}]/#\~/$HOME}
+ else
+ zle ${__zic_default_completion:-expand-or-complete}
+ fi
+}
+
+[ -z "$__zic_default_completion" ] && {
+ binding=$(bindkey '^I')
+ # $binding[(s: :w)2]
+ # The command substitution and following word splitting to determine the
+ # default zle widget for ^I formerly only works if the IFS parameter contains
+ # a space via $binding[(w)2]. Now it specifically splits at spaces, regardless
+ # of IFS.
+ [[ $binding =~ 'undefined-key' ]] || __zic_default_completion=$binding[(s: :w)2]
+ unset binding
+}
+
+zle -N zic-completion
+bindkey '^I' zic-completion
From a6df94d2c677c6d28c5ee339975b7a56a2f67e21 Mon Sep 17 00:00:00 2001
From: Jonatan Ivanov
Date: Wed, 12 Feb 2020 12:52:47 -0800
Subject: [PATCH 138/343] gradle: run gradle command instead of alias (#8620)
- Similarly to the mvn plugin
- Without this fix, the shell crashes in some cases
---
plugins/gradle/gradle.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index 6be583179..c651b91ca 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -7,7 +7,7 @@ gradle-or-gradlew() {
echo "executing gradlew instead of gradle";
./gradlew "$@";
else
- gradle "$@";
+ command gradle "$@";
fi
}
From 634a50936a28ba3a57a02c92e7fe76da2d60ecf8 Mon Sep 17 00:00:00 2001
From: Maxime Richard
Date: Thu, 13 Feb 2020 18:10:59 +0100
Subject: [PATCH 139/343] dotenv: add ZSH_DOTENV_PROMPT config (#8624)
---
plugins/dotenv/README.md | 6 ++++++
plugins/dotenv/dotenv.plugin.zsh | 13 ++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md
index cac552485..dbc02bf61 100644
--- a/plugins/dotenv/README.md
+++ b/plugins/dotenv/README.md
@@ -32,6 +32,8 @@ PORT=3001
```
You can even mix both formats, although it's probably a bad idea.
+## Plugin options
+
### ZSH_DOTENV_FILE
You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`.
@@ -43,6 +45,10 @@ For example, this will make the plugin look for files named `.dotenv` and load t
ZSH_DOTENV_FILE=.dotenv
```
+### ZSH_DOTENV_PROMPT
+
+Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message.
+
## Version Control
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index d4a6db8f8..84815a416 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -1,10 +1,13 @@
source_env() {
if [[ -f $ZSH_DOTENV_FILE ]]; then
- # confirm before sourcing .env file
- local confirmation
- echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
- if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
- return
+
+ if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then
+ # confirm before sourcing file
+ local confirmation
+ echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
+ if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
+ return
+ fi
fi
# test .env syntax
From f17e0219fdd38d9fabce2d96d0d283d98122733f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 13 Feb 2020 18:33:24 +0100
Subject: [PATCH 140/343] dotenv: fix prompt newline
---
plugins/dotenv/dotenv.plugin.zsh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
index 84815a416..54036bee3 100644
--- a/plugins/dotenv/dotenv.plugin.zsh
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -1,11 +1,13 @@
source_env() {
if [[ -f $ZSH_DOTENV_FILE ]]; then
-
if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then
# confirm before sourcing file
local confirmation
+ # print same-line prompt and output newline character if necessary
echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
- if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
+ read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo
+ # only bail out if confirmation character is n
+ if [[ "$confirmation" = [nN] ]]; then
return
fi
fi
From 4fc570b0d4a14638322d904b48f237306ccf3adc Mon Sep 17 00:00:00 2001
From: Marco Seguri
Date: Thu, 13 Feb 2020 18:50:56 +0100
Subject: [PATCH 141/343] kubectl: avoid conflict with existing f aliases in
kca alias (#8625)
---
plugins/kubectl/kubectl.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index cc447b87e..92688c53c 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -14,7 +14,7 @@ fi
alias k=kubectl
# Execute a kubectl command against all namespaces
-alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f'
+alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
# Apply a YML file
alias kaf='kubectl apply -f'
From 52f9238b16ddc8a97690b49c8b395e9fe1169b62 Mon Sep 17 00:00:00 2001
From: Roey Darwish Dror
Date: Thu, 13 Feb 2020 19:57:52 +0200
Subject: [PATCH 142/343] fzf: support for NixOS and Void Linux (#8618)
---
plugins/fzf/fzf.plugin.zsh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh
index c8aefd7ab..53bdcbc97 100644
--- a/plugins/fzf/fzf.plugin.zsh
+++ b/plugins/fzf/fzf.plugin.zsh
@@ -10,6 +10,7 @@ function setup_using_base_dir() {
if [[ -z "${fzf_base}" ]]; then
fzfdirs=(
"${HOME}/.fzf"
+ "${HOME}/.nix-profile/share/fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
"/usr/local/share/examples/fzf"
@@ -31,8 +32,8 @@ function setup_using_base_dir() {
fi
if [[ -d "${fzf_base}" ]]; then
- # Fix fzf shell directory for Archlinux package
- if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
+ # Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages
+ if [[ ! -d "${fzf_base}/shell" ]]; then
fzf_shell="${fzf_base}"
else
fzf_shell="${fzf_base}/shell"
From 72168aec3da727c4af715f095d27d429106ea79f Mon Sep 17 00:00:00 2001
From: Manuel Silva
Date: Sun, 16 Feb 2020 04:26:20 +1100
Subject: [PATCH 143/343] cloudapp: fix copy-paste mistake in README (#8629)
---
plugins/cloudapp/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/cloudapp/README.md b/plugins/cloudapp/README.md
index 62975a631..6c7f9bc6c 100644
--- a/plugins/cloudapp/README.md
+++ b/plugins/cloudapp/README.md
@@ -5,7 +5,7 @@
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
```
-plugins=(... dash)
+plugins=(... cloudapp)
```
## Requirements
From aa4146a9a4b75bc998d74750b4f75131973ccf01 Mon Sep 17 00:00:00 2001
From: Roman
Date: Sat, 15 Feb 2020 18:28:02 +0100
Subject: [PATCH 144/343] git: add alias for git stash --include-untracked
(#8617)
---
plugins/git/README.md | 1 +
plugins/git/git.plugin.zsh | 1 +
2 files changed, 2 insertions(+)
diff --git a/plugins/git/README.md b/plugins/git/README.md
index 7878f747b..42a583de8 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -154,6 +154,7 @@ plugins=(... git)
| gstl | git stash list |
| gstp | git stash pop |
| gsts | git stash show --text |
+| gstu | git stash --include-untracked |
| gstall | git stash --all |
| gsu | git submodule update |
| gsw | git switch |
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index d8c4cffd1..380ab76d8 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -236,6 +236,7 @@ alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
+alias gstu='git stash --include-untracked'
alias gstall='git stash --all'
alias gsu='git submodule update'
alias gsw='git switch'
From 0bcecf2f636b8070639b6db44b8541015f574365 Mon Sep 17 00:00:00 2001
From: Harry
Date: Sat, 15 Feb 2020 19:19:57 +0100
Subject: [PATCH 145/343] dotnet: use official dotnet completion (#8518)
---
plugins/dotnet/README.md | 2 +-
plugins/dotnet/dotnet.plugin.zsh | 121 +++++--------------------------
2 files changed, 18 insertions(+), 105 deletions(-)
diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md
index a663fc88d..7554b4e3c 100644
--- a/plugins/dotnet/README.md
+++ b/plugins/dotnet/README.md
@@ -20,4 +20,4 @@ plugins=(... dotnet)
| ds | dotnet sln | Modify Visual Studio solution files. |
| da | dotnet add | Add a package or reference to a .NET project. |
| dp | dotnet pack | Create a NuGet package. |
-| dng | dotnet nuget | Provides additional NuGet commands. |
\ No newline at end of file
+| dng | dotnet nuget | Provides additional NuGet commands. |
diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh
index ed6c68e5d..6bd4b7af8 100644
--- a/plugins/dotnet/dotnet.plugin.zsh
+++ b/plugins/dotnet/dotnet.plugin.zsh
@@ -1,114 +1,27 @@
-# --------------------------------------------------------------------- #
-# Aliases and Completions for .NET Core (https://dotnet.microsoft.com/) #
-# Author: Shaun Tabone (https://github.com/xontab) #
-# --------------------------------------------------------------------- #
+# This scripts is copied from (MIT License):
+# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
-# Helper function to cache and load completions
-local cache_base_path="${ZSH_CACHE_DIR}/dotnet_"
-_dotnet_cache_completion() {
- local cache="${cache_base_path}$(echo $1)_completion"
- if [[ ! -f $cache ]]; then
- $2 $cache
- fi
+_dotnet_zsh_complete()
+{
+ local completions=("$(dotnet complete "$words")")
- [[ -f $cache ]] && cat $cache
+ # If the completion list is empty, just continue with filename selection
+ if [ -z "$completions" ]
+ then
+ _arguments '*::arguments: _normal'
+ return
+ fi
+
+ # This is not a variable assigment, don't remove spaces!
+ _values = "${(ps:\n:)completions}"
}
-_dotnet_cache_completion_cleanup() {
- local cache="${cache_base_path}$(echo $1)_completion"
- rm -f $cache
-}
+compdef _dotnet_zsh_complete dotnet
-# --------------------------------------------------------------------- #
-# dotnet new #
-# ALIAS: dn #
-# --------------------------------------------------------------------- #
-_dotnet_new_completion() {
- if [ $commands[dotnet] ]; then
- dotnet new -l | tail -n +21 | sed 's/ \+/:/g' | cut -d : -f 2 >$1
- fi
-}
-
-_dotnet_new_completion_cached() {
- _dotnet_cache_completion 'new' _dotnet_new_completion
-}
-
-_dotnet_cache_completion_cleanup 'new'
+# Aliases bellow are here for backwards compatibility
+# added by Shaun Tabone (https://github.com/xontab)
alias dn='dotnet new'
-
-# --------------------------------------------------------------------- #
-# dotnet #
-# --------------------------------------------------------------------- #
-_dotnet() {
- if [ $CURRENT -eq 2 ]; then
- _arguments \
- '--diagnostics[Enable diagnostic output.]' \
- '--help[Show command line help.]' \
- '--info[Display .NET Core information.]' \
- '--list-runtimes[Display the installed runtimes.]' \
- '--list-sdks[Display the installed SDKs.]' \
- '--version[Display .NET Core SDK version in use.]'
-
- _values \
- 'add[Add a package or reference to a .NET project.]' \
- 'build[Build a .NET project.]' \
- 'build-server[Interact with servers started by a build.]' \
- 'clean[Clean build outputs of a .NET project.]' \
- 'help[Show command line help.]' \
- 'list[List project references of a .NET project.]' \
- 'msbuild[Run Microsoft Build Engine (MSBuild) commands.]' \
- 'new[Create a new .NET project or file.]' \
- 'nuget[Provides additional NuGet commands.]' \
- 'pack[Create a NuGet package.]' \
- 'publish[Publish a .NET project for deployment.]' \
- 'remove[Remove a package or reference from a .NET project.]' \
- 'restore[Restore dependencies specified in a .NET project.]' \
- 'run[Build and run a .NET project output.]' \
- 'sln[Modify Visual Studio solution files.]' \
- 'store[Store the specified assemblies in the runtime package store.]' \
- 'test[Run unit tests using the test runner specified in a .NET project.]' \
- 'tool[Install or manage tools that extend the .NET experience.]' \
- 'vstest[Run Microsoft Test Engine (VSTest) commands.]' \
- 'dev-certs[Create and manage development certificates.]' \
- 'fsi[Start F# Interactive / execute F# scripts.]' \
- 'sql-cache[SQL Server cache command-line tools.]' \
- 'user-secrets[Manage development user secrets.]' \
- 'watch[Start a file watcher that runs a command when files change.]'
- return
- fi
-
- if [ $CURRENT -eq 3 ]; then
- case ${words[2]} in
- "new")
- compadd -X ".NET Installed Templates" $(_dotnet_new_completion_cached)
- return
- ;;
- "sln")
- _values \
- 'add[Add one or more projects to a solution file.]' \
- 'list[List all projects in a solution file.]' \
- 'remove[Remove one or more projects from a solution file.]'
- return
- ;;
- "nuget")
- _values \
- 'delete[Deletes a package from the server.]' \
- 'locals[Clears or lists local NuGet resources such as http requests cache, packages folder, plugin operations cache or machine-wide global packages folder.]' \
- 'push[Pushes a package to the server and publishes it.]'
- return
- ;;
- esac
- fi
-
- _arguments '*::arguments: _normal'
-}
-
-compdef _dotnet dotnet
-
-# --------------------------------------------------------------------- #
-# Other Aliases #
-# --------------------------------------------------------------------- #
alias dr='dotnet run'
alias dt='dotnet test'
alias dw='dotnet watch'
From fbbfd0f8a89dfca51bee7b36c774c718207c5bb1 Mon Sep 17 00:00:00 2001
From: Alexandre GOMES
Date: Mon, 17 Feb 2020 17:44:48 +0100
Subject: [PATCH 146/343] arcanist: add `arc diff --create` alias (#8610)
---
plugins/arcanist/arcanist.plugin.zsh | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/arcanist/arcanist.plugin.zsh b/plugins/arcanist/arcanist.plugin.zsh
index 3f4eb07f4..8918bffdd 100644
--- a/plugins/arcanist/arcanist.plugin.zsh
+++ b/plugins/arcanist/arcanist.plugin.zsh
@@ -9,6 +9,7 @@ alias arco='arc cover'
alias arci='arc commit'
alias ard='arc diff'
+alias ardc='arc diff --create'
alias ardnu='arc diff --nounit'
alias ardnupc='arc diff --nounit --plan-changes'
alias ardpc='arc diff --plan-changes'
From 1381da15a458112eace99a997b961b6e522c4a7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 17 Feb 2020 17:47:43 +0100
Subject: [PATCH 147/343] arcanist: document aliases
---
plugins/arcanist/README.md | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/plugins/arcanist/README.md b/plugins/arcanist/README.md
index f2ca8cf55..9c15f09b5 100644
--- a/plugins/arcanist/README.md
+++ b/plugins/arcanist/README.md
@@ -1,5 +1,29 @@
## arcanist
-**Maintainer:** [@emzar](https://github.com/emzar)
-
This plugin adds many useful aliases for [arcanist](https://github.com/phacility/arcanist).
+
+To use it, add `arcanist` to the plugins array of your zshrc file:
+
+```zsh
+plugins=(... arcanist)
+```
+
+## Aliases
+
+| Alias | Command |
+|---------|------------------------------------|
+| ara | `arc amend` |
+| arb | `arc branch` |
+| arco | `arc cover` |
+| arci | `arc commit` |
+| ard | `arc diff` |
+| ardc | `arc diff --create` |
+| ardnu | `arc diff --nounit` |
+| ardnupc | `arc diff --nounit --plan-changes` |
+| ardpc | `arc diff --plan-changes` |
+| are | `arc export` |
+| arh | `arc help` |
+| arl | `arc land` |
+| arli | `arc lint` |
+| arls | `arc list` |
+| arpa | `arc patch` |
From 47eae26bf6fb378c8186602eab4c998916ac5b34 Mon Sep 17 00:00:00 2001
From: Kshitij Nikhal
Date: Tue, 18 Feb 2020 03:20:54 -0600
Subject: [PATCH 148/343] web-search: add wolframalpha search engine (#8638)
---
plugins/web-search/README.md | 1 +
plugins/web-search/web-search.plugin.zsh | 2 ++
2 files changed, 3 insertions(+)
diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md
index d04042506..9c01f0724 100644
--- a/plugins/web-search/README.md
+++ b/plugins/web-search/README.md
@@ -39,6 +39,7 @@ Available search contexts are:
| `qwant` | `https://www.qwant.com/?q=` |
| `givero` | `https://www.givero.com/search?q=` |
| `stackoverflow` | `https://stackoverflow.com/search?q=` |
+| `wolframalpha` | `https://wolframalpha.com/input?i=` |
Also there are aliases for bang-searching DuckDuckGo:
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 5b76eeae2..f975bad7a 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -19,6 +19,7 @@ function web_search() {
qwant "https://www.qwant.com/?q="
givero "https://www.givero.com/search?q="
stackoverflow "https://stackoverflow.com/search?q="
+ wolframalpha "https://www.wolframalpha.com/input/?i="
)
# check whether the search engine is supported
@@ -55,6 +56,7 @@ alias goodreads='web_search goodreads'
alias qwant='web_search qwant'
alias givero='web_search givero'
alias stackoverflow='web_search stackoverflow'
+alias wolframalpha='web_search wolframalpha'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
From d49397a01d0cc704008d6f1089ef6a7270d17116 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 18 Feb 2020 19:14:30 +0100
Subject: [PATCH 149/343] af-magic: fix dashed separator sizing and refactor
Fixes #8081
---
themes/af-magic.zsh-theme | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 30e997f8c..4d1a40947 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -2,29 +2,28 @@
# Repo: https://github.com/andyfleming/oh-my-zsh
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme
-if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
-local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+
+# settings
+typeset +H return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+typeset +H my_gray="$FG[237]"
+typeset +H my_orange="$FG[214]"
+
+# separator dashes size
+function afmagic_dashes {
+ [[ -n "${VIRTUAL_ENV-}" && -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" && "$PS1" = \(* ]] \
+ && echo $(( COLUMNS - ${#VIRTUAL_ENV} - 3 )) \
+ || echo $COLUMNS
+}
# primary prompt
-PROMPT='$FG[237]${(l.COLUMNS..-.)}%{$reset_color%}
-$FG[032]%~\
-$(git_prompt_info)$(hg_prompt_info) \
-$FG[105]%(!.#.»)%{$reset_color%} '
-PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
+PS1='$FG[237]${(l.$(afmagic_dashes)..-.)}%{$reset_color%}
+$FG[032]%~$(git_prompt_info)$(hg_prompt_info) $FG[105]%(!.#.»)%{$reset_color%} '
+PS2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='${return_code}'
-
-# color vars
-eval my_gray='$FG[237]'
-eval my_orange='$FG[214]'
-
# right prompt
-if type "virtualenv_prompt_info" > /dev/null
-then
- RPROMPT="${RPROMPT}"'$FG[078]$(virtualenv_prompt_info)%{$reset_color%} $my_gray%n@%m%{$reset_color%}%'
-else
- RPROMPT="${RPROMPT}"'$my_gray%n@%m%{$reset_color%}%'
-fi
+(( $+functions[virtualenv_prompt_info] )) && RPS1+='$(virtualenv_prompt_info)'
+RPS1+=' $my_gray%n@%m%{$reset_color%}%'
# git settings
ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
@@ -37,3 +36,7 @@ ZSH_THEME_HG_PROMPT_PREFIX="$FG[075]($FG[078]"
ZSH_THEME_HG_PROMPT_CLEAN=""
ZSH_THEME_HG_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
+
+# virtualenv settings
+ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075]["
+ZSH_THEME_VIRTUALENV_PREFIX="]%{$reset_color%}"
From e8609b857caf730c626ab27910ece30420bc6693 Mon Sep 17 00:00:00 2001
From: Ujwal Dhakal
Date: Wed, 19 Feb 2020 01:50:52 +0545
Subject: [PATCH 150/343] git: add `grename` to rename a local branch and in
the origin remote (#8622)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Marc Cornellà
---
plugins/git/README.md | 357 +++++++++++++++++++------------------
plugins/git/git.plugin.zsh | 14 ++
2 files changed, 193 insertions(+), 178 deletions(-)
diff --git a/plugins/git/README.md b/plugins/git/README.md
index 42a583de8..009a74016 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -10,195 +10,196 @@ plugins=(... git)
## Aliases
-| Alias | Command |
-|:---------------------|:------------------------------------------------------------------------------------------------------------------------------|
-| g | git |
-| ga | git add |
-| gaa | git add --all |
-| gapa | git add --patch |
-| gau | git add --update |
-| gav | git add --verbose |
-| gap | git apply |
-| gb | git branch |
-| gba | git branch -a |
-| gbd | git branch -d |
+| Alias | Command |
+|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------|
+| g | git |
+| ga | git add |
+| gaa | git add --all |
+| gapa | git add --patch |
+| gau | git add --update |
+| gav | git add --verbose |
+| gap | git apply |
+| gb | git branch |
+| gba | git branch -a |
+| gbd | git branch -d |
| gbda | git branch --no-color --merged \| command grep -vE "^(\+|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
-| gbD | git branch -D |
-| gbl | git blame -b -w |
-| gbnm | git branch --no-merged |
-| gbr | git branch --remote |
-| gbs | git bisect |
-| gbsb | git bisect bad |
-| gbsg | git bisect good |
-| gbsr | git bisect reset |
-| gbss | git bisect start |
-| gc | git commit -v |
-| gc! | git commit -v --amend |
-| gcn! | git commit -v --no-edit --amend |
-| gca | git commit -v -a |
-| gca! | git commit -v -a --amend |
-| gcan! | git commit -v -a --no-edit --amend |
-| gcans! | git commit -v -a -s --no-edit --amend |
-| gcam | git commit -a -m |
-| gcsm | git commit -s -m |
-| gcb | git checkout -b |
-| gcf | git config --list |
-| gcl | git clone --recurse-submodules |
-| gclean | git clean -id |
-| gpristine | git reset --hard && git clean -dfx |
-| gcm | git checkout master |
-| gcd | git checkout develop |
-| gcmsg | git commit -m |
-| gco | git checkout |
-| gcount | git shortlog -sn |
-| gcp | git cherry-pick |
-| gcpa | git cherry-pick --abort |
-| gcpc | git cherry-pick --continue |
-| gcs | git commit -S |
-| gd | git diff |
-| gdca | git diff --cached |
-| gdcw | git diff --cached --word-diff |
-| gdct | git describe --tags $(git rev-list --tags --max-count=1) |
-| gds | git diff --staged |
-| gdt | git diff-tree --no-commit-id --name-only -r |
-| gdv | git diff -w $@ \| view - |
-| gdw | git diff --word-diff |
-| gf | git fetch |
-| gfa | git fetch --all --prune |
-| gfg | git ls-files \| grep |
-| gfo | git fetch origin |
-| gg | git gui citool |
-| gga | git gui citool --amend |
-| ggf | git push --force origin $(current_branch) |
-| ggfl | git push --force-with-lease origin $(current_branch) |
-| ggl | git pull origin $(current_branch) |
-| ggp | git push origin $(current_branch) |
-| ggpnp | ggl && ggp |
-| ggpull | git pull origin "$(git_current_branch)" |
-| ggpur | ggu |
-| ggpush | git push origin "$(git_current_branch)" |
-| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) |
-| ggu | git pull --rebase origin $(current_branch) |
-| gpsup | git push --set-upstream origin $(git_current_branch) |
-| ghh | git help |
-| gignore | git update-index --assume-unchanged |
-| gignored | git ls-files -v \| grep "^[[:lower:]]" |
-| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk |
-| gk | gitk --all --branches |
-| gke | gitk --all $(git log -g --pretty=%h) |
-| gl | git pull |
-| glg | git log --stat |
-| glgp | git log --stat -p |
-| glgg | git log --graph |
-| glgga | git log --graph --decorate --all |
-| glgm | git log --graph --max-count=10 |
-| glo | git log --oneline --decorate |
-| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' |
-| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat |
-| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' |
-| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short |
-| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all |
-| glog | git log --oneline --decorate --graph |
-| gloga | git log --oneline --decorate --graph --all |
-| glp | `_git_log_prettily` |
-| gm | git merge |
-| gmom | git merge origin/master |
-| gmt | git mergetool --no-prompt |
-| gmtvim | git mergetool --no-prompt --tool=vimdiff |
-| gmum | git merge upstream/master |
-| gma | git merge --abort |
-| gp | git push |
-| gpd | git push --dry-run |
-| gpf | git push --force-with-lease |
-| gpf! | git push --force |
-| gpoat | git push origin --all && git push origin --tags |
-| gpu | git push upstream |
-| gpv | git push -v |
-| gr | git remote |
-| gra | git remote add |
-| grb | git rebase |
-| grba | git rebase --abort |
-| grbc | git rebase --continue |
-| grbd | git rebase develop |
-| grbi | git rebase -i |
-| grbm | git rebase master |
-| grbs | git rebase --skip |
-| grev | git revert |
-| grh | git reset |
-| grhh | git reset --hard |
-| groh | git reset origin/$(git_current_branch) --hard |
-| grm | git rm |
-| grmc | git rm --cached |
-| grmv | git remote rename |
-| grrm | git remote remove |
-| grs | git restore |
-| grset | git remote set-url |
-| grss | git restore --source |
-| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" |
-| gru | git reset -- |
-| grup | git remote update |
-| grv | git remote -v |
-| gsb | git status -sb |
-| gsd | git svn dcommit |
-| gsh | git show |
-| gsi | git submodule init |
-| gsps | git show --pretty=short --show-signature |
-| gsr | git svn rebase |
-| gss | git status -s |
-| gst | git status |
-| gsta | git stash push |
-| gsta | git stash save |
-| gstaa | git stash apply |
-| gstc | git stash clear |
-| gstd | git stash drop |
-| gstl | git stash list |
-| gstp | git stash pop |
-| gsts | git stash show --text |
-| gstu | git stash --include-untracked |
-| gstall | git stash --all |
-| gsu | git submodule update |
-| gsw | git switch |
-| gswc | git switch -c |
-| gts | git tag -s |
-| gtv | git tag \| sort -V |
-| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl |
-| gunignore | git update-index --no-assume-unchanged |
-| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 |
-| gup | git pull --rebase |
-| gupv | git pull --rebase -v |
-| gupa | git pull --rebase --autostash |
-| gupav | git pull --rebase --autostash -v |
-| glum | git pull upstream master |
-| gwch | git whatchanged -p --abbrev-commit --pretty=medium |
-| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" |
+| gbD | git branch -D |
+| gbl | git blame -b -w |
+| gbnm | git branch --no-merged |
+| gbr | git branch --remote |
+| gbs | git bisect |
+| gbsb | git bisect bad |
+| gbsg | git bisect good |
+| gbsr | git bisect reset |
+| gbss | git bisect start |
+| gc | git commit -v |
+| gc! | git commit -v --amend |
+| gcn! | git commit -v --no-edit --amend |
+| gca | git commit -v -a |
+| gca! | git commit -v -a --amend |
+| gcan! | git commit -v -a --no-edit --amend |
+| gcans! | git commit -v -a -s --no-edit --amend |
+| gcam | git commit -a -m |
+| gcsm | git commit -s -m |
+| gcb | git checkout -b |
+| gcf | git config --list |
+| gcl | git clone --recurse-submodules |
+| gclean | git clean -id |
+| gpristine | git reset --hard && git clean -dfx |
+| gcm | git checkout master |
+| gcd | git checkout develop |
+| gcmsg | git commit -m |
+| gco | git checkout |
+| gcount | git shortlog -sn |
+| gcp | git cherry-pick |
+| gcpa | git cherry-pick --abort |
+| gcpc | git cherry-pick --continue |
+| gcs | git commit -S |
+| gd | git diff |
+| gdca | git diff --cached |
+| gdcw | git diff --cached --word-diff |
+| gdct | git describe --tags $(git rev-list --tags --max-count=1) |
+| gds | git diff --staged |
+| gdt | git diff-tree --no-commit-id --name-only -r |
+| gdv | git diff -w $@ \| view - |
+| gdw | git diff --word-diff |
+| gf | git fetch |
+| gfa | git fetch --all --prune |
+| gfg | git ls-files \| grep |
+| gfo | git fetch origin |
+| gg | git gui citool |
+| gga | git gui citool --amend |
+| ggf | git push --force origin $(current_branch) |
+| ggfl | git push --force-with-lease origin $(current_branch) |
+| ggl | git pull origin $(current_branch) |
+| ggp | git push origin $(current_branch) |
+| ggpnp | ggl && ggp |
+| ggpull | git pull origin "$(git_current_branch)" |
+| ggpur | ggu |
+| ggpush | git push origin "$(git_current_branch)" |
+| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) |
+| ggu | git pull --rebase origin $(current_branch) |
+| gpsup | git push --set-upstream origin $(git_current_branch) |
+| ghh | git help |
+| gignore | git update-index --assume-unchanged |
+| gignored | git ls-files -v \| grep "^[[:lower:]]" |
+| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk |
+| gk | gitk --all --branches |
+| gke | gitk --all $(git log -g --pretty=%h) |
+| gl | git pull |
+| glg | git log --stat |
+| glgp | git log --stat -p |
+| glgg | git log --graph |
+| glgga | git log --graph --decorate --all |
+| glgm | git log --graph --max-count=10 |
+| glo | git log --oneline --decorate |
+| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' |
+| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat |
+| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' |
+| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short |
+| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all |
+| glog | git log --oneline --decorate --graph |
+| gloga | git log --oneline --decorate --graph --all |
+| glp | `_git_log_prettily` |
+| gm | git merge |
+| gmom | git merge origin/master |
+| gmt | git mergetool --no-prompt |
+| gmtvim | git mergetool --no-prompt --tool=vimdiff |
+| gmum | git merge upstream/master |
+| gma | git merge --abort |
+| gp | git push |
+| gpd | git push --dry-run |
+| gpf | git push --force-with-lease |
+| gpf! | git push --force |
+| gpoat | git push origin --all && git push origin --tags |
+| gpu | git push upstream |
+| gpv | git push -v |
+| gr | git remote |
+| gra | git remote add |
+| grb | git rebase |
+| grba | git rebase --abort |
+| grbc | git rebase --continue |
+| grbd | git rebase develop |
+| grbi | git rebase -i |
+| grbm | git rebase master |
+| grbs | git rebase --skip |
+| grev | git revert |
+| grh | git reset |
+| grhh | git reset --hard |
+| groh | git reset origin/$(git_current_branch) --hard |
+| grm | git rm |
+| grmc | git rm --cached |
+| grmv | git remote rename |
+| grrm | git remote remove |
+| grs | git restore |
+| grset | git remote set-url |
+| grss | git restore --source |
+| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" |
+| gru | git reset -- |
+| grup | git remote update |
+| grv | git remote -v |
+| gsb | git status -sb |
+| gsd | git svn dcommit |
+| gsh | git show |
+| gsi | git submodule init |
+| gsps | git show --pretty=short --show-signature |
+| gsr | git svn rebase |
+| gss | git status -s |
+| gst | git status |
+| gsta | git stash push |
+| gsta | git stash save |
+| gstaa | git stash apply |
+| gstc | git stash clear |
+| gstd | git stash drop |
+| gstl | git stash list |
+| gstp | git stash pop |
+| gsts | git stash show --text |
+| gstu | git stash --include-untracked |
+| gstall | git stash --all |
+| gsu | git submodule update |
+| gsw | git switch |
+| gswc | git switch -c |
+| gts | git tag -s |
+| gtv | git tag \| sort -V |
+| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl |
+| gunignore | git update-index --no-assume-unchanged |
+| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 |
+| gup | git pull --rebase |
+| gupv | git pull --rebase -v |
+| gupa | git pull --rebase --autostash |
+| gupav | git pull --rebase --autostash -v |
+| glum | git pull upstream master |
+| gwch | git whatchanged -p --abbrev-commit --pretty=medium |
+| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" |
### Deprecated
These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support.
-| Alias | Command | Modification |
-| :----- | :----------------------------------------------------------------------------------| --------------------------------------------------------------------------------------------------- |
-| gap | git add --patch | new alias `gapa` |
-| gcl | git config --list | new alias `gcf` |
-| gdc | git diff --cached | new alias `gdca` |
-| gdt | git difftool | no replacement |
-| ggpull | git pull origin $(current_branch) | new alias `ggl` (`ggpull` still exists for now though) |
-| ggpur | git pull --rebase origin $(current_branch) | new alias `ggu` (`ggpur` still exists for now though) |
-| ggpush | git push origin $(current_branch) | new alias `ggp` (`ggpush` still exists for now though) |
-| gk | gitk --all --branches | now aliased to `gitk --all --branches` |
-| glg | git log --stat --max-count = 10 | now aliased to `git log --stat --color` |
-| glgg | git log --graph --max-count = 10 | now aliased to `git log --graph --color` |
-| gwc | git whatchanged -p --abbrev-commit --pretty = medium | new alias `gwch` |
+| Alias | Command | Modification |
+| :----- | :----------------------------------------------------- | :----------------------------------------------------- |
+| gap | `git add --patch` | new alias `gapa` |
+| gcl | `git config --list` | new alias `gcf` |
+| gdc | `git diff --cached` | new alias `gdca` |
+| gdt | `git difftool` | no replacement |
+| ggpull | `git pull origin $(current_branch)` | new alias `ggl` (`ggpull` still exists for now though) |
+| ggpur | `git pull --rebase origin $(current_branch)` | new alias `ggu` (`ggpur` still exists for now though) |
+| ggpush | `git push origin $(current_branch)` | new alias `ggp` (`ggpush` still exists for now though) |
+| gk | `gitk --all --branches` | now aliased to `gitk --all --branches` |
+| glg | `git log --stat --max-count = 10` | now aliased to `git log --stat --color` |
+| glgg | `git log --graph --max-count = 10` | now aliased to `git log --graph --color` |
+| gwc | `git whatchanged -p --abbrev-commit --pretty = medium` | new alias `gwch` |
## Functions
### Current
-| Command | Description |
-|:-----------------------|:----------------------------------------|
-| current_branch | Return the name of the current branch |
-| git_current_user_name | Returns the `user.name` config value |
-| git_current_user_email | Returns the `user.email` config value |
+| Command | Description |
+|:-----------------------|:---------------------------------------------------------|
+| `grename ` | Rename `old` branch to `new`, including in origin remote |
+| current_branch | Return the name of the current branch |
+| git_current_user_name | Returns the `user.name` config value |
+| git_current_user_email | Returns the `user.email` config value |
### Work in Progress (WIP)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 380ab76d8..ffb3e506a 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -256,3 +256,17 @@ alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
+
+function grename() {
+ if [[ -z "$1" || -z "$2" ]]; then
+ echo "Usage: $0 old_branch new_branch"
+ return 1
+ fi
+
+ # Rename branch locally
+ git branch -m "$1" "$2"
+ # Rename branch in origin remote
+ if git push origin :"$1"; then
+ git push --set-upstream origin "$2"
+ fi
+}
From de261bd29cb5920b9ad37e67fe5e29ae3c348cfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 18 Feb 2020 22:28:58 +0100
Subject: [PATCH 151/343] af-magic: fix virtualenv prompt suffix
---
themes/af-magic.zsh-theme | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 4d1a40947..148991fec 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -39,4 +39,4 @@ ZSH_THEME_HG_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
# virtualenv settings
ZSH_THEME_VIRTUALENV_PREFIX=" $FG[075]["
-ZSH_THEME_VIRTUALENV_PREFIX="]%{$reset_color%}"
+ZSH_THEME_VIRTUALENV_SUFFIX="]%{$reset_color%}"
From eeb49bf5b0b8b700713e5b91464003cc09d1b44d Mon Sep 17 00:00:00 2001
From: Sir Mobus Gochfulshigan Dorphin Esquire XXIII
Date: Tue, 18 Feb 2020 17:04:14 -0500
Subject: [PATCH 152/343] systemd: add prompt function to show systemd units'
status (#7657)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Marc Cornellà
---
plugins/systemd/README.md | 41 ++++++++++++++++++++++++++++++
plugins/systemd/systemd.plugin.zsh | 15 +++++++++++
2 files changed, 56 insertions(+)
diff --git a/plugins/systemd/README.md b/plugins/systemd/README.md
index d91329290..3fa1d2118 100644
--- a/plugins/systemd/README.md
+++ b/plugins/systemd/README.md
@@ -51,3 +51,44 @@ plugins=(... systemd)
You can use the above aliases as `--user` by using the prefix `scu` instead of `sc`.
For example: `scu-list-units` will be aliased to `systemctl --user list-units`.
+
+### Unit Status Prompt
+
+You can add a token to your prompt in a similar way to the gitfast plugin. To add the token
+to your prompt, drop `$(systemd_prompt_info [unit]...)` into your prompt (more than one unit
+may be specified).
+
+The plugin will add the following to your prompt for each `$unit`.
+```
+:
+```
+You can control these parts with the following variables:
+
+- ``: Set `$ZSH_THEME_SYSTEMD_PROMPT_PREFIX`.
+
+- ``: Set `$ZSH_THEME_SYSTEMD_PROMPT_SUFFIX`.
+
+- ``: name passed as parameter to the function. If you want it to be in ALL CAPS,
+ you can set the variable `$ZSH_THEME_SYSTEMD_PROMPT_CAPS` to a non-empty string.
+
+- ``: shown if the systemd unit is active.
+ Set `$ZSH_THEME_SYSTEMD_PROMPT_ACTIVE`.
+
+- ``: shown if the systemd unit is *not* active.
+ Set `$ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE`.
+
+For example, if your prompt contains `PROMPT='$(systemd_prompt_info dhcpd httpd)'` and you set the following variables:
+
+```
+ZSH_THEME_SYSTEMD_PROMPT_PREFIX="["
+ZSH_THEME_SYSTEMD_PROMPT_SUFFIX="]"
+ZSH_THEME_SYSTEMD_PROMPT_ACTIVE="+"
+ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE="X"
+ZSH_THEME_SYSTEMD_PROMPT_CAPS=1
+```
+
+If `dhcpd` is running, and `httpd` is not, then your prompt will look like this:
+
+```
+[DHCPD: +][HTTPD: X]
+```
diff --git a/plugins/systemd/systemd.plugin.zsh b/plugins/systemd/systemd.plugin.zsh
index 201ffd998..f2d1d6f1c 100644
--- a/plugins/systemd/systemd.plugin.zsh
+++ b/plugins/systemd/systemd.plugin.zsh
@@ -73,3 +73,18 @@ alias sc-mask-now="sc-mask --now"
alias scu-enable-now="scu-enable --now"
alias scu-disable-now="scu-disable --now"
alias scu-mask-now="scu-mask --now"
+
+function systemd_prompt_info {
+ local unit
+ for unit in $@; do
+ echo -n "$ZSH_THEME_SYSTEMD_PROMPT_PREFIX"
+ [[ -n "$ZSH_THEME_SYSTEMD_PROMPT_CAPS" ]] && echo "${(U)unit}:" || echo "$unit:"
+ if systemctl is-active $unit &>/dev/null; then
+ echo -n "$ZSH_THEME_SYSTEMD_PROMPT_ACTIVE"
+ else
+ echo -n "$ZSH_THEME_SYSTEMD_PROMPT_NOTACTIVE"
+ fi
+ echo -n "$ZSH_THEME_SYSTEMD_PROMPT_SUFFIX"
+ done
+}
+
From c1b798aff39942b2f23a0a5f2ef206ebc8ce4970 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 00:16:54 +0100
Subject: [PATCH 153/343] agnoster: fix bzr prompt with breezy installed
(#8646)
* Change indentation to 2 spaces in prompt_bzr function
* Check if in a bzr repository and optimize bzr calls in prompt_bzr
---
themes/agnoster.zsh-theme | 40 ++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 518a14a37..8c700d06a 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -140,24 +140,30 @@ prompt_git() {
}
prompt_bzr() {
- (( $+commands[bzr] )) || return
- if (bzr status >/dev/null 2>&1); then
- status_mod=`bzr status | head -n1 | grep "modified" | wc -m`
- status_all=`bzr status | head -n1 | wc -m`
- revision=`bzr log | head -n2 | tail -n1 | sed 's/^revno: //'`
- if [[ $status_mod -gt 0 ]] ; then
- prompt_segment yellow black
- echo -n "bzr@"$revision "✚ "
- else
- if [[ $status_all -gt 0 ]] ; then
- prompt_segment yellow black
- echo -n "bzr@"$revision
- else
- prompt_segment green black
- echo -n "bzr@"$revision
- fi
- fi
+ (( $+commands[bzr] )) || return
+
+ # Test if bzr repository in directory hierarchy
+ local dir="$PWD"
+ while [[ ! -d "$dir/.bzr" ]]; do
+ [[ "$dir" = "/" ]] && return
+ dir="${dir:h}"
+ done
+
+ local bzr_status status_mod status_all revision
+ if bzr_status=$(bzr status 2>&1); then
+ status_mod=$(echo -n "$bzr_status" | head -n1 | grep "modified" | wc -m)
+ status_all=$(echo -n "$bzr_status" | head -n1 | wc -m)
+ revision=$(bzr log -r-1 --log-format line | cut -d: -f1)
+ if [[ $status_mod -gt 0 ]] ; then
+ prompt_segment yellow black "bzr@$revision ✚"
+ else
+ if [[ $status_all -gt 0 ]] ; then
+ prompt_segment yellow black "bzr@$revision"
+ else
+ prompt_segment green black "bzr@$revision"
+ fi
fi
+ fi
}
prompt_hg() {
From 443ad8802415c111e8d59e110337e3fe12e2e698 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 16:53:10 +0100
Subject: [PATCH 154/343] avit: replace custom prompt functions with OMZ ones
Fixes #8637
---
themes/avit.zsh-theme | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index aec14e4a6..3179bd837 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -1,12 +1,12 @@
# AVIT ZSH Theme
PROMPT='
-$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
+$(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info)
%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
-RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
+RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
@@ -32,20 +32,6 @@ function _user_host() {
fi
}
-function _vi_status() {
- if {echo $fpath | grep -q "plugins/vi-mode"}; then
- echo "$(vi_mode_prompt_info)"
- fi
-}
-
-function _ruby_version() {
- if {echo $fpath | grep -q "plugins/rvm"}; then
- echo "%{$fg[grey]%}$(rvm_prompt_info)%{$reset_color%}"
- elif {echo $fpath | grep -q "plugins/rbenv"}; then
- echo "%{$fg[grey]%}$(rbenv_prompt_info)%{$reset_color%}"
- fi
-}
-
# Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() {
@@ -84,9 +70,9 @@ fi
MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}"
+# Git prompt settings
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
-
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%}✚ "
@@ -96,6 +82,10 @@ ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
+# Ruby prompt settings
+ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[grey]%}"
+ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$reset_color%}"
+
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
From 77813a330bbc716503dcc4d8d98b6d8ae6f74d03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 17:24:20 +0100
Subject: [PATCH 155/343] avit: clean up theme code
---
themes/avit.zsh-theme | 51 +++++++++++++++----------------------------
1 file changed, 17 insertions(+), 34 deletions(-)
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 3179bd837..4f82f3414 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -1,27 +1,20 @@
# AVIT ZSH Theme
+# settings
+typeset +H _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
+typeset +H _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
+typeset +H _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
+
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info)
-%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
+%{%F{%(!.red.white)}%}▶%{$resetcolor%} '
-PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
+PROMPT2='%{%F{%(!.red.white)}%}◀%{$reset_color%} '
RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
-local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
-local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
-local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
-
-function _current_dir() {
- local _max_pwd_length="65"
- if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
- echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
- else
- echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
- fi
-}
-
function _user_host() {
+ local me
if [[ -n $SSH_CONNECTION ]]; then
me="%n@%m"
elif [[ $LOGNAME != $USER ]]; then
@@ -35,39 +28,29 @@ function _user_host() {
# Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() {
-# Only proceed if there is actually a commit.
+ local last_commit now seconds_since_last_commit
+ local minutes hours commit_age
+ # Only proceed if there is actually a commit.
if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
now=$(date +%s)
seconds_since_last_commit=$((now-last_commit))
# Totals
minutes=$((seconds_since_last_commit / 60))
- hours=$((seconds_since_last_commit/3600))
+ hours=$((seconds_since_last_commit / 3600))
- # Sub-hours and sub-minutes
- days=$((seconds_since_last_commit / 86400))
- sub_hours=$((hours % 24))
- sub_minutes=$((minutes % 60))
-
- if [ $hours -ge 24 ]; then
- commit_age="${days}d"
- elif [ $minutes -gt 60 ]; then
- commit_age="${sub_hours}h${sub_minutes}m"
+ if [[ $hours -ge 24 ]]; then
+ commit_age="$(( hours / 24 ))d"
+ elif [[ $hours -gt 0 ]]; then
+ commit_age+="$(( hours % 24 ))h$(( minutes % 60 ))m"
else
commit_age="${minutes}m"
fi
- color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL
- echo "$color$commit_age%{$reset_color%}"
+ echo "${ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL}${commit_age}%{$reset_color%}"
fi
}
-if [[ $USER == "root" ]]; then
- CARETCOLOR="red"
-else
- CARETCOLOR="white"
-fi
-
MODE_INDICATOR="%{$fg_bold[yellow]%}❮%{$reset_color%}%{$fg[yellow]%}❮❮%{$reset_color%}"
# Git prompt settings
From d76258ff554ea58d9865b9864f5fff1dd8d2e4bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 18:19:46 +0100
Subject: [PATCH 156/343] avit: add years since last commit if appropriate
---
themes/avit.zsh-theme | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 4f82f3414..51701572b 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -29,7 +29,7 @@ function _user_host() {
# use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() {
local last_commit now seconds_since_last_commit
- local minutes hours commit_age
+ local minutes hours days years commit_age
# Only proceed if there is actually a commit.
if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
now=$(date +%s)
@@ -37,12 +37,16 @@ function _git_time_since_commit() {
# Totals
minutes=$((seconds_since_last_commit / 60))
- hours=$((seconds_since_last_commit / 3600))
+ hours=$((minutes / 60))
+ days=$((hours / 24))
+ years=$((days / 365))
- if [[ $hours -ge 24 ]]; then
- commit_age="$(( hours / 24 ))d"
+ if [[ $years -gt 0 ]]; then
+ commit_age="${years}y$((days % 365 ))d"
+ elif [[ $days -gt 0 ]]; then
+ commit_age="${days}d$((hours % 24))h"
elif [[ $hours -gt 0 ]]; then
- commit_age+="$(( hours % 24 ))h$(( minutes % 60 ))m"
+ commit_age+="${hours}h$(( minutes % 60 ))m"
else
commit_age="${minutes}m"
fi
From 6adad5c300a6bfde33b593489cc1c3b645b721e8 Mon Sep 17 00:00:00 2001
From: Willy Weiskopf
Date: Wed, 16 Jul 2014 22:21:09 -0600
Subject: [PATCH 157/343] Move random theme functionality into "random" theme
The statements for selecting a random theme in oh-my-zsh.sh and the themes
plugin are duplicate. Most people eventually settle on a theme, making those
lines in oh-my-zsh.sh superfluous. To address those, it may makes sense to put
the random theme functionality into a theme of its own (since themes are just
zsh scripts.
---
oh-my-zsh.sh | 25 ++++++-------------------
plugins/themes/themes.plugin.zsh | 24 +++++++++++-------------
themes/random.zsh-theme | 10 ++++++++++
3 files changed, 27 insertions(+), 32 deletions(-)
create mode 100644 themes/random.zsh-theme
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index c3fae6efb..30259372c 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -97,25 +97,12 @@ done
unset config_file
# Load the theme
-if [[ "$ZSH_THEME" == "random" ]]; then
- if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
- themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
+if [ ! "$ZSH_THEME" = "" ]; then
+ if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
+ source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
+ elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
+ source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
- themes=($ZSH/themes/*zsh-theme)
- fi
- N=${#themes[@]}
- ((N=(RANDOM%N)+1))
- RANDOM_THEME=${themes[$N]}
- source "$RANDOM_THEME"
- echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
-else
- if [ ! "$ZSH_THEME" = "" ]; then
- if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
- source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
- elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
- source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
- else
- source "$ZSH/themes/$ZSH_THEME.zsh-theme"
- fi
+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
fi
diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh
index 2cd0ee327..ac4ccc980 100644
--- a/plugins/themes/themes.plugin.zsh
+++ b/plugins/themes/themes.plugin.zsh
@@ -1,19 +1,17 @@
function theme
{
- if [ -z "$1" ] || [ "$1" = "random" ]; then
- themes=($ZSH/themes/*zsh-theme)
- N=${#themes[@]}
- ((N=(RANDOM%N)+1))
- RANDOM_THEME=${themes[$N]}
- source "$RANDOM_THEME"
- echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
+ if [ -z "$1" ]; then
+ 1="random"
+ fi
+
+ if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
+ then
+ source "$ZSH_CUSTOM/$1.zsh-theme"
+ elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
+ then
+ source "$ZSH_CUSTOM/themes/$1.zsh-theme"
else
- if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
- then
- source "$ZSH_CUSTOM/themes/$1.zsh-theme"
- else
- source "$ZSH/themes/$1.zsh-theme"
- fi
+ source "$ZSH/themes/$1.zsh-theme"
fi
}
diff --git a/themes/random.zsh-theme b/themes/random.zsh-theme
new file mode 100644
index 000000000..739567662
--- /dev/null
+++ b/themes/random.zsh-theme
@@ -0,0 +1,10 @@
+if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
+ themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
+else
+ themes=($ZSH/themes/*zsh-theme)
+fi
+N=${#themes[@]}
+((N=(RANDOM%N)+1))
+RANDOM_THEME=${themes[$N]}
+source "$RANDOM_THEME"
+echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
From b297bf92964e04e24f960f4e38acdb9b740d2d9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 18:42:05 +0100
Subject: [PATCH 158/343] Add themes in $ZSH_CUSTOM to the pool of candidates
Also add comments and unset leftover variables, and print only the
name of the theme loaded.
When looking for $ZSH_CUSTOM themes, the chosen algorithm is to add
the theme names to the pool disregarding the path, and then source
whatever theme is selected with the same logic as the init script,
which is to source first custom themes even if there is another
default theme of the same name.
Co-authored-by: Mihai Serban
---
themes/random.zsh-theme | 38 +++++++++++++++++++++++++++++++-------
1 file changed, 31 insertions(+), 7 deletions(-)
diff --git a/themes/random.zsh-theme b/themes/random.zsh-theme
index 739567662..92d2a6847 100644
--- a/themes/random.zsh-theme
+++ b/themes/random.zsh-theme
@@ -1,10 +1,34 @@
-if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
- themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
+# Make themes a unique array
+typeset -Ua themes
+
+if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDATES[@]} -gt 0 ]]; then
+ # Use ZSH_THEME_RANDOM_CANDIDATES if properly defined
+ themes=($ZSH_THEME_RANDOM_CANDIDATES)
else
- themes=($ZSH/themes/*zsh-theme)
+ # Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name (:t)
+ themes=(
+ "$ZSH_CUSTOM"/*.zsh-theme(N:t:r)
+ "$ZSH_CUSTOM"/themes/*.zsh-theme(N:t:r)
+ "$ZSH"/themes/*.zsh-theme(N:t:r)
+ )
fi
+
+# Choose a theme out of the pool of candidates
N=${#themes[@]}
-((N=(RANDOM%N)+1))
-RANDOM_THEME=${themes[$N]}
-source "$RANDOM_THEME"
-echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
+(( N = (RANDOM%N) + 1 ))
+RANDOM_THEME="${themes[$N]}"
+unset N themes
+
+# Source theme
+if [[ -f "$ZSH_CUSTOM/$RANDOM_THEME.zsh-theme" ]]; then
+ source "$ZSH_CUSTOM/$RANDOM_THEME.zsh-theme"
+elif [[ -f "$ZSH_CUSTOM/themes/$RANDOM_THEME.zsh-theme" ]]; then
+ source "$ZSH_CUSTOM/themes/$RANDOM_THEME.zsh-theme"
+elif [[ -f "$ZSH/themes/$RANDOM_THEME.zsh-theme" ]]; then
+ source "$ZSH/themes/$RANDOM_THEME.zsh-theme"
+else
+ echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' not found"
+ return 1
+fi
+
+echo "[oh-my-zsh] Random theme '${RANDOM_THEME}' loaded"
From f4b4a446aca37987bc2612d6115d156417628364 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 19:32:28 +0100
Subject: [PATCH 159/343] Polish themes plugin and error out if theme not found
---
plugins/themes/_theme | 3 ---
plugins/themes/themes.plugin.zsh | 29 ++++++++++++++++-------------
2 files changed, 16 insertions(+), 16 deletions(-)
delete mode 100644 plugins/themes/_theme
diff --git a/plugins/themes/_theme b/plugins/themes/_theme
deleted file mode 100644
index 8214ddb0d..000000000
--- a/plugins/themes/_theme
+++ /dev/null
@@ -1,3 +0,0 @@
-#compdef theme
-
-_arguments "1: :($(lstheme | tr "\n" " "))"
diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh
index ac4ccc980..1fbde5b64 100644
--- a/plugins/themes/themes.plugin.zsh
+++ b/plugins/themes/themes.plugin.zsh
@@ -1,24 +1,27 @@
-function theme
-{
- if [ -z "$1" ]; then
- 1="random"
- fi
+function theme {
+ : ${1:=random} # Use random theme if none provided
- if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
- then
+ if [[ -f "$ZSH_CUSTOM/$1.zsh-theme" ]]; then
source "$ZSH_CUSTOM/$1.zsh-theme"
- elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
- then
+ elif [[ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]]; then
source "$ZSH_CUSTOM/themes/$1.zsh-theme"
- else
+ elif [[ -f "$ZSH/themes/$1.zsh-theme" ]]; then
source "$ZSH/themes/$1.zsh-theme"
+ else
+ echo "$0: Theme '$1' not found"
+ return 1
fi
}
-function lstheme
-{
+function _theme {
+ _arguments "1: :($(lstheme))"
+}
+
+compdef _theme theme
+
+function lstheme {
# Resources:
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers
- print -l {$ZSH,$ZSH_CUSTOM}/themes/*.zsh-theme(N:t:r)
+ print "$ZSH_CUSTOM"/*.zsh-theme(N:t:r) {"$ZSH_CUSTOM","$ZSH"}/themes/*.zsh-theme(N:t:r)
}
From 3d4890dcc07478e7129de1e79afedafd3f08ffbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Wed, 19 Feb 2020 19:53:37 +0100
Subject: [PATCH 160/343] Add blacklist variable for random theme
Co-authored-by: Fran Garcia
---
themes/random.zsh-theme | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/themes/random.zsh-theme b/themes/random.zsh-theme
index 92d2a6847..43f6cbb60 100644
--- a/themes/random.zsh-theme
+++ b/themes/random.zsh-theme
@@ -5,19 +5,23 @@ if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = array && ${#ZSH_THEME_RANDOM_CANDIDA
# Use ZSH_THEME_RANDOM_CANDIDATES if properly defined
themes=($ZSH_THEME_RANDOM_CANDIDATES)
else
- # Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name (:t)
+ # Look for themes in $ZSH_CUSTOM and $ZSH and add only the theme name
themes=(
"$ZSH_CUSTOM"/*.zsh-theme(N:t:r)
"$ZSH_CUSTOM"/themes/*.zsh-theme(N:t:r)
"$ZSH"/themes/*.zsh-theme(N:t:r)
)
+ # Remove blacklisted themes from the list
+ for theme in ${ZSH_THEME_RANDOM_BLACKLIST[@]}; do
+ themes=("${(@)themes:#$theme}")
+ done
fi
# Choose a theme out of the pool of candidates
N=${#themes[@]}
(( N = (RANDOM%N) + 1 ))
RANDOM_THEME="${themes[$N]}"
-unset N themes
+unset N themes theme
# Source theme
if [[ -f "$ZSH_CUSTOM/$RANDOM_THEME.zsh-theme" ]]; then
From f9a2d8cae39a0fb42e22aa17222c7da7b44b7ede Mon Sep 17 00:00:00 2001
From: Andy Pickle <39109475+pickleat@users.noreply.github.com>
Date: Mon, 24 Feb 2020 13:13:16 -0600
Subject: [PATCH 161/343] vscode: add documentation for running in macOS
(#8674)
---
plugins/vscode/README.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index 2c6530650..469c57ea8 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -8,6 +8,15 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`
plugins=(... vscode)
```
+## Requirements
+
+To use VS Code in the terminal **in macOS**, first you need to install the `code` command in the PATH,
+otherwise you might receive this message: `zsh: command not found: code`.
+
+[As the docs say](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
+the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
+> Install 'code' command in PATH
+
## VS Code Insiders
🍏 **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.**
From 40b013f5f119be27bd2fdece431cf4979193bd25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 24 Feb 2020 20:25:27 +0100
Subject: [PATCH 162/343] lib: delete upgrade lock in upgrade_oh_my_zsh
Provides a different solution to #8332 and #8333
---
lib/functions.zsh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 61dfa4780..91e9cf895 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -3,11 +3,12 @@ function zsh_stats() {
}
function uninstall_oh_my_zsh() {
- env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
+ env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh"
}
function upgrade_oh_my_zsh() {
- env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
+ env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh"
+ rm -rf "$ZSH/log/update.lock"
}
function take() {
From 0e57142729656bd0bd81a39704328330f9db4557 Mon Sep 17 00:00:00 2001
From: Jonathan Chang <31893406+cccntu@users.noreply.github.com>
Date: Tue, 25 Feb 2020 03:39:10 +0800
Subject: [PATCH 163/343] installer: remove redundant cp command (#8668)
---
tools/install.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/install.sh b/tools/install.sh
index ae248be89..bdf9f18e9 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -129,10 +129,9 @@ setup_zshrc() {
echo "${GREEN}Using the Oh My Zsh template file and adding it to ~/.zshrc.${RESET}"
- cp "$ZSH/templates/zshrc.zsh-template" ~/.zshrc
sed "/^export ZSH=/ c\\
export ZSH=\"$ZSH\"
-" ~/.zshrc > ~/.zshrc-omztemp
+" "$ZSH/templates/zshrc.zsh-template" > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
echo
From 7290a08bf6098993b783877c8feab4c33cf49c38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 25 Feb 2020 11:54:52 +0100
Subject: [PATCH 164/343] battery: fix floating point output in macOS
Fixes #8676
---
plugins/battery/battery.plugin.zsh | 32 ++++++++++++++++--------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 6fe801c9f..857ab6e8c 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -21,7 +21,8 @@ if [[ "$OSTYPE" = darwin* ]]; then
local smart_battery_status="$(ioreg -rc AppleSmartBattery)"
local -F maxcapacity=$(command grep '^.*"MaxCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*"MaxCapacity"\ =\ //')
local -F currentcapacity=$(command grep '^.*"CurrentCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*CurrentCapacity"\ =\ //')
- echo $(( (currentcapacity/maxcapacity) * 100 ))
+ local -i pct=$(( (currentcapacity/maxcapacity) * 100 ))
+ echo $pct
}
function battery_pct_remaining() {
@@ -47,16 +48,17 @@ if [[ "$OSTYPE" = darwin* ]]; then
}
function battery_pct_prompt () {
+ local battery_pct color
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then
- b=$(battery_pct_remaining)
- if [[ $b -gt 50 ]]; then
+ battery_pct=$(battery_pct_remaining)
+ if [[ $battery_pct -gt 50 ]]; then
color='green'
- elif [[ $b -gt 20 ]]; then
+ elif [[ $battery_pct -gt 20 ]]; then
color='yellow'
else
color='red'
fi
- echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
else
echo "∞"
fi
@@ -93,19 +95,19 @@ elif [[ "$OSTYPE" = freebsd* ]]; then
}
function battery_pct_prompt() {
- local b color
- b=$(battery_pct_remaining)
+ local battery_pct color
+ battery_pct=$(battery_pct_remaining)
if battery_is_charging; then
echo "∞"
else
- if [[ $b -gt 50 ]]; then
+ if [[ $battery_pct -gt 50 ]]; then
color='green'
- elif [[ $b -gt 20 ]]; then
+ elif [[ $battery_pct -gt 20 ]]; then
color='yellow'
else
color='red'
fi
- echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
+ echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}"
fi
}
@@ -136,19 +138,19 @@ elif [[ "$OSTYPE" = linux* ]]; then
}
function battery_pct_prompt() {
- local b color
- b=$(battery_pct_remaining)
+ local battery_pct color
+ battery_pct=$(battery_pct_remaining)
if battery_is_charging; then
echo "∞"
else
- if [[ $b -gt 50 ]]; then
+ if [[ $battery_pct -gt 50 ]]; then
color='green'
- elif [[ $b -gt 20 ]]; then
+ elif [[ $battery_pct -gt 20 ]]; then
color='yellow'
else
color='red'
fi
- echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
+ echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}"
fi
}
From b72607bc8e83c9ffc02409ae8a7fed6a8866e022 Mon Sep 17 00:00:00 2001
From: Yahav Itzhak
Date: Tue, 25 Feb 2020 13:00:25 +0200
Subject: [PATCH 165/343] Add JFrog CLI plugin (#8250)
---
plugins/jfrog/README.md | 11 +++++++++++
plugins/jfrog/jfrog.plugin.zsh | 10 ++++++++++
2 files changed, 21 insertions(+)
create mode 100644 plugins/jfrog/README.md
create mode 100644 plugins/jfrog/jfrog.plugin.zsh
diff --git a/plugins/jfrog/README.md b/plugins/jfrog/README.md
new file mode 100644
index 000000000..1d858620b
--- /dev/null
+++ b/plugins/jfrog/README.md
@@ -0,0 +1,11 @@
+# JFrog CLI
+
+This plugin provides completion for [JFrog CLI](https://github.com/jfrog/jfrog-cli).
+
+JFrog CLI provides a simple interface that automates access to [Artifactory](https://jfrog.com/artifactory), [Xray](https://jfrog.com/xray), [Bintray](https://jfrog.com/bintray) and [Mission Control](https://jfrog.com/mission-control) through their respective REST APIs.
+
+To use it, add `jfrog` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... jfrog)
+```
diff --git a/plugins/jfrog/jfrog.plugin.zsh b/plugins/jfrog/jfrog.plugin.zsh
new file mode 100644
index 000000000..064ffa2db
--- /dev/null
+++ b/plugins/jfrog/jfrog.plugin.zsh
@@ -0,0 +1,10 @@
+_jfrog() {
+ local -a opts
+ opts=("${(@f)$(_CLI_ZSH_AUTOCOMPLETE_HACK=1 ${words[@]:0:#words[@]-1} --generate-bash-completion)}")
+ _describe 'values' opts
+ if [[ $compstate[nmatches] -eq 0 && $words[$CURRENT] != -* ]]; then
+ _files
+ fi
+}
+
+compdef _jfrog jfrog
\ No newline at end of file
From d959283898f4c969579346a6d3596d9dd8fa3532 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 25 Feb 2020 12:21:06 +0100
Subject: [PATCH 166/343] avit: fix prompt sequence (fixes #8678)
---
themes/avit.zsh-theme | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 51701572b..0261f0ff3 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -7,9 +7,9 @@ typeset +H _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
PROMPT='
$(_user_host)${_current_dir} $(git_prompt_info) $(ruby_prompt_info)
-%{%F{%(!.red.white)}%}▶%{$resetcolor%} '
+%{%(!.%F{red}.%F{white})%}▶%{$resetcolor%} '
-PROMPT2='%{%F{%(!.red.white)}%}◀%{$reset_color%} '
+PROMPT2='%{%(!.%F{red}.%F{white})%}◀%{$reset_color%} '
RPROMPT='$(vi_mode_prompt_info)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
From 3e9e385d98da148a7ad8e8d99da35ce6b7aae9ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 25 Feb 2020 15:41:17 +0100
Subject: [PATCH 167/343] battery: remove redundant grep calls in battery_pct
function
---
plugins/battery/battery.plugin.zsh | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 857ab6e8c..4c4d0d4fc 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -18,11 +18,10 @@ if [[ "$OSTYPE" = darwin* ]]; then
}
function battery_pct() {
- local smart_battery_status="$(ioreg -rc AppleSmartBattery)"
- local -F maxcapacity=$(command grep '^.*"MaxCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*"MaxCapacity"\ =\ //')
- local -F currentcapacity=$(command grep '^.*"CurrentCapacity"\ =\ ' <<< $smart_battery_status | sed -e 's/^.*CurrentCapacity"\ =\ //')
- local -i pct=$(( (currentcapacity/maxcapacity) * 100 ))
- echo $pct
+ local battery_status="$(ioreg -rc AppleSmartBattery)"
+ local -i capacity=$(sed -n -e '/MaxCapacity/s/^.*"MaxCapacity"\ =\ //p' <<< $battery_status)
+ local -i current=$(sed -n -e '/CurrentCapacity/s/^.*"CurrentCapacity"\ =\ //p' <<< $battery_status)
+ echo $(( current * 100 / capacity ))
}
function battery_pct_remaining() {
From 609890847d3e3b222431952ee7be99803bd16ccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Tue, 25 Feb 2020 22:23:37 +0100
Subject: [PATCH 168/343] npm: hardcode completion function and delete cached
one (#8679)
Fixes #8665
---
plugins/npm/npm.plugin.zsh | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index f62174a4f..87c68f3fb 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -1,14 +1,16 @@
(( $+commands[npm] )) && {
- __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion"
+ rm -f "${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion"
- if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
- npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null
- [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE
- fi
-
- [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE
-
- unset __NPM_COMPLETION_FILE
+ _npm_completion() {
+ local si=$IFS
+ compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+ COMP_LINE=$BUFFER \
+ COMP_POINT=0 \
+ npm completion -- "${words[@]}" \
+ 2>/dev/null)
+ IFS=$si
+ }
+ compdef _npm_completion npm
}
# Install dependencies globally
From 1a880fdb9b88c0c98a23d7b2ed2ddb42caef6662 Mon Sep 17 00:00:00 2001
From: Michael Dorst
Date: Tue, 25 Feb 2020 13:42:39 -0800
Subject: [PATCH 169/343] installer: add option to install without replacing
.zshrc (#8209)
* Add option to install OMZ without replacing .zshrc
tools/install.sh respects REPLACE_RC environment variable
--noreplace-rc flag sets REPLACE_RC='no'
* Change REPLACE_RC=no to KEEP_ZSHRC=yes
Change --noreplace-rc to --keep-zshrc
---
tools/install.sh | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/install.sh b/tools/install.sh
index bdf9f18e9..08f3db1e3 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -20,12 +20,14 @@
# BRANCH - branch to check out immediately after install (default: master)
#
# Other options:
-# CHSH - 'no' means the installer will not change the default shell (default: yes)
-# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes)
+# CHSH - 'no' means the installer will not change the default shell (default: yes)
+# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes)
+# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no)
#
# You can also pass some arguments to the install script to set some these options:
# --skip-chsh: has the same behavior as setting CHSH to 'no'
# --unattended: sets both CHSH and RUNZSH to 'no'
+# --keep-zshrc: sets KEEP_ZSHRC to 'yes'
# For example:
# sh install.sh --unattended
#
@@ -40,6 +42,7 @@ BRANCH=${BRANCH:-master}
# Other options
CHSH=${CHSH:-yes}
RUNZSH=${RUNZSH:-yes}
+KEEP_ZSHRC=${KEEP_ZSHRC:-no}
command_exists() {
@@ -111,6 +114,11 @@ setup_zshrc() {
# Must use this exact name so uninstall.sh can find it
OLD_ZSHRC=~/.zshrc.pre-oh-my-zsh
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
+ # Skip this if the user doesn't want to replace an existing .zshrc
+ if [ $KEEP_ZSHRC = yes ]; then
+ echo "${YELLOW}Found ~/.zshrc.${RESET} ${GREEN}Keeping...${RESET}"
+ return
+ fi
if [ -e "$OLD_ZSHRC" ]; then
OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"
if [ -e "$OLD_OLD_ZSHRC" ]; then
@@ -227,6 +235,7 @@ main() {
case $1 in
--unattended) RUNZSH=no; CHSH=no ;;
--skip-chsh) CHSH=no ;;
+ --keep-zshrc) KEEP_ZSHRC=yes ;;
esac
shift
done
From 01bfb57446fdc77e8b4ae696729688284392c0e6 Mon Sep 17 00:00:00 2001
From: wallace11 <11wallace11@gmail.com>
Date: Thu, 27 Feb 2020 00:59:59 +0900
Subject: [PATCH 170/343] zsh-interactive-cd: add vi-mode support (#8681)
---
plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
index 0f15aeef0..b0520c239 100644
--- a/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
+++ b/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
@@ -144,4 +144,5 @@ zic-completion() {
}
zle -N zic-completion
-bindkey '^I' zic-completion
+bindkey -M emacs '^I' zic-completion
+bindkey -M viins '^I' zic-completion
From 6cb8ff391d0258434485dbe246f9885ba85cf839 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 27 Feb 2020 15:21:10 +0100
Subject: [PATCH 171/343] vagrant: document aliases
---
plugins/vagrant/README.md | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/plugins/vagrant/README.md b/plugins/vagrant/README.md
index f6ea87b0e..331bfa143 100644
--- a/plugins/vagrant/README.md
+++ b/plugins/vagrant/README.md
@@ -8,3 +8,33 @@ To use it, add `vagrant` to the plugins array in your zshrc file:
plugins=(... vagrant)
```
+## Aliases
+
+| Alias | Command |
+|---------|------------------------------|
+| `vgi` | `vagrant init` |
+| `vup` | `vagrant up` |
+| `vd` | `vagrant destroy` |
+| `vdf` | `vagrant destroy -f` |
+| `vssh` | `vagrant ssh` |
+| `vsshc` | `vagrant ssh-config` |
+| `vrdp` | `vagrant rdp` |
+| `vh` | `vagrant halt` |
+| `vssp` | `vagrant suspend` |
+| `vst` | `vagrant status` |
+| `vre` | `vagrant resume` |
+| `vgs` | `vagrant global-status` |
+| `vpr` | `vagrant provision` |
+| `vr` | `vagrant reload` |
+| `vrp` | `vagrant reload --provision` |
+| `vp` | `vagrant push` |
+| `vsh` | `vagrant share` |
+| `vba` | `vagrant box add` |
+| `vbr` | `vagrant box remove` |
+| `vbl` | `vagrant box list` |
+| `vbo` | `vagrant box outdated` |
+| `vbu` | `vagrant box update` |
+| `vpli` | `vagrant plugin install` |
+| `vpll` | `vagrant plugin list` |
+| `vplun` | `vagrant plugin uninstall` |
+| `vplu` | `vagrant plugin update` |
From bccfe1389c97379388a148b3a48a63d7272ec017 Mon Sep 17 00:00:00 2001
From: Mauricio Wolff
Date: Fri, 28 Feb 2020 03:06:20 +1100
Subject: [PATCH 172/343] updater: add --autostash to git pull (#7172)
If I have custom configs (like theme customizations) I have to stash my changes and get them back after the update.
By adding the --autostash on upgrade.sh, if I have any changes not commited they'll be reapplied after the upgrade, allowing me to have temporary customizations without any harm to the upgrade process.
---
tools/upgrade.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 3005e6542..0dc84e214 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -38,7 +38,7 @@ if [ -n "$remote" ]; then
fi
printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh"
-if git pull --rebase --stat origin master
+if git pull --rebase --autostash --stat origin master
then
printf '%s' "$GREEN"
printf '%s\n' ' __ __ '
From 6b54302b90720437300967b3506bffe00a3e243c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20B=C4=9Blohl=C3=A1vek?=
Date: Fri, 20 Jan 2017 11:05:01 +0100
Subject: [PATCH 173/343] python: add alias to run the proper IPython based on
virtualenv
Current state: a user invokes `ipython` and is provided with the IPython
instance regarding the `$PATH`.
Proposed state: a user invokes `ipython` (which is a new alias in the
*python plugin*) and is provided with the proper IPython instance regarding
the currently activated virtualenv.
Example: the user's default Python is 2.7 with installed IPython 2.7. User
activates Python 3.5 virtualenv where he installs IPython 3.5. After
activating the environment, one expects `ipython` to run the version 3.5,
which does not happen by default. Instead, IPython 2.7 is used, which in
counter-intuitive and often causes problem.
Closes #5797
---
plugins/python/README.md | 1 +
plugins/python/python.plugin.zsh | 2 ++
2 files changed, 3 insertions(+)
diff --git a/plugins/python/README.md b/plugins/python/README.md
index 2d955c5cb..e391bcfd4 100644
--- a/plugins/python/README.md
+++ b/plugins/python/README.md
@@ -14,3 +14,4 @@ plugins=(... python)
| `pyfind` | Finds .py files recursively in the current directory |
| `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one |
| `pygrep ` | Looks for `text` in .py files |
+| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv |
diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
index f39cd80b7..62855fca2 100644
--- a/plugins/python/python.plugin.zsh
+++ b/plugins/python/python.plugin.zsh
@@ -14,3 +14,5 @@ function pyclean() {
# Grep among .py files
alias pygrep='grep -r --include="*.py"'
+# Run proper IPython regarding current virtualenv (if any)
+alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'"
From 011c7153d589b52eb1d48fdf22d4f1438449be2b Mon Sep 17 00:00:00 2001
From: Ciacho
Date: Wed, 27 Jan 2016 21:39:53 +0100
Subject: [PATCH 174/343] nmap: add alias for ICMP scan (#4807)
Closes #4807
---
plugins/nmap/README.md | 54 +++++++++++++++---------------------
plugins/nmap/nmap.plugin.zsh | 2 +-
2 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/plugins/nmap/README.md b/plugins/nmap/README.md
index 5cd646277..0a60068c2 100644
--- a/plugins/nmap/README.md
+++ b/plugins/nmap/README.md
@@ -1,37 +1,27 @@
-# Nmap aliases plugin
+# Nmap plugin
-Adds some useful aliases for nmap similar to the profiles in zenmap.
+Adds some useful aliases for [Nmap](https://nmap.org/) similar to the profiles in zenmap.
-Nmap options are:
- * -sS - TCP SYN scan
- * -v - verbose
- * -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5)
- * -sF - FIN scan (can sneak through non-stateful firewalls)
- * -PE - ICMP echo discovery probe
- * -PP - timestamp discovery probe
- * -PY - SCTP init ping
- * -g - use given number as source port
- * -A - enable OS detection, version detection, script scanning, and traceroute (aggressive)
- * -O - enable OS detection
- * -sA - TCP ACK scan
- * -F - fast scan
- * --script=vulscan - also access vulnerabilities in target
+To use it, add `nmap` to the plugins array in your zshrc file:
-## Aliases explained
+```zsh
+plugins=(... nmap)
+```
- * nmap_open_ports - Scan for open ports on target
- * nmap_list_interfaces - List all network interfaces on host where the command runs
- * nmap_slow - Slow scan that avoids to spam the targets logs
- * nmap_fin - Scan to see if hosts are up with TCP FIN scan
- * nmap_full - Aggressive full scan that scans all ports, tries to determine OS and service versions
- * nmap_check_for_firewall - TCP ACK scan to check for firewall existence
- * nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
- restrictions
- * nmap_fast - Fast scan of the top 300 popular ports
- * nmap_detect_versions - Detects versions of services and OS, runs on all ports
- * nmap_check_for_vulns - Uses vulscan script to check target services for vulnerabilities
- * nmap_full_udp - Same as full but via UDP
- * nmap_traceroute - Try to traceroute using the most common ports
- * nmap_full_with_scripts - Same as nmap_full but also runs all the scripts
- * nmap_web_safe_osscan - Little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking.
+## Aliases
+- `nmap_open_ports`: scan for open ports on target.
+- `nmap_list_interfaces`: list all network interfaces on host where the command runs.
+- `nmap_slow`: slow scan that avoids to spam the targets logs.
+- `nmap_fin`: scan to see if hosts are up with TCP FIN scan.
+- `nmap_full`: aggressive full scan that scans all ports, tries to determine OS and service versions.
+- `nmap_check_for_firewall`: TCP ACK scan to check for firewall existence.
+- `nmap_ping_through_firewall`: host discovery with SYN and ACK probes instead of just pings to avoid firewall restrictions.
+- `nmap_fast`: fast scan of the top 300 popular ports.
+- `nmap_detect_versions`: detects versions of services and OS, runs on all ports.
+- `nmap_check_for_vulns`: uses vulscan script to check target services for vulnerabilities.
+- `nmap_full_udp`: same as full but via UDP.
+- `nmap_traceroute`: try to traceroute using the most common ports.
+- `nmap_full_with_scripts`: same as nmap_full but also runs all the scripts.
+- `nmap_web_safe_osscan`: little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking.
+- `nmap_ping_scan`: ICMP scan for active hosts.
diff --git a/plugins/nmap/nmap.plugin.zsh b/plugins/nmap/nmap.plugin.zsh
index 8c691bdaa..406870f00 100644
--- a/plugins/nmap/nmap.plugin.zsh
+++ b/plugins/nmap/nmap.plugin.zsh
@@ -29,4 +29,4 @@ alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443
alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "
alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "
-
+alias nmap_ping_scan="nmap -n -sP"
From dbd2f77bd9c13f017550ee6dae37ff95a2c3d183 Mon Sep 17 00:00:00 2001
From: Julian Parsert
Date: Thu, 27 Feb 2020 17:28:08 +0000
Subject: [PATCH 175/343] norm: add hg prompt (#6725)
---
themes/norm.zsh-theme | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/themes/norm.zsh-theme b/themes/norm.zsh-theme
index 13077ccf5..bd7ca568a 100644
--- a/themes/norm.zsh-theme
+++ b/themes/norm.zsh-theme
@@ -1,4 +1,7 @@
-PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)%{$reset_color%}'
+PROMPT='%{$fg[yellow]%}λ %m %{$fg[green]%}%c %{$fg[yellow]%}→ $(git_prompt_info)$(hg_prompt_info)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="λ %{$fg[blue]%}git %{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
+ZSH_THEME_HG_PROMPT_PREFIX="λ %{$fg[blue]%}hg %{$fg[red]%}"
+ZSH_THEME_HG_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
+
From 573901dd46d657c4c3d14f6e03a85f1522fb299b Mon Sep 17 00:00:00 2001
From: Adrien Plazas
Date: Thu, 27 Feb 2020 18:45:53 +0100
Subject: [PATCH 176/343] jhbuild: add shell alias (#3707)
This adds "jhsh" as an alias for "jhbuild shell" to the JHBuild plugin.
---
plugins/jhbuild/jhbuild.plugin.zsh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/jhbuild/jhbuild.plugin.zsh b/plugins/jhbuild/jhbuild.plugin.zsh
index fed1bc9fc..05e56039d 100644
--- a/plugins/jhbuild/jhbuild.plugin.zsh
+++ b/plugins/jhbuild/jhbuild.plugin.zsh
@@ -23,6 +23,8 @@ alias jhu='jhbuild update'
alias jhuo='jhbuild updateone'
# Uninstall
alias jhun='jhbuild uninstall'
+# Shell
+alias jhsh='jhbuild shell'
From ee7a9f6fe679239f7c21f32df135f9c79b606336 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20Vaello=20Mart=C3=ADnez?=
Date: Thu, 30 Jun 2016 12:25:00 +0200
Subject: [PATCH 177/343] jhbuild: add some missing commands and update README
(#5195)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commands: make, tinderbox.
Closes #5195
Co-authored-by: Marc Cornellà
---
plugins/jhbuild/README.md | 34 ++++++++++++++++++++++++++++--
plugins/jhbuild/jhbuild.plugin.zsh | 14 ++++++------
2 files changed, 40 insertions(+), 8 deletions(-)
diff --git a/plugins/jhbuild/README.md b/plugins/jhbuild/README.md
index 910526966..3220e0daf 100644
--- a/plugins/jhbuild/README.md
+++ b/plugins/jhbuild/README.md
@@ -1,4 +1,34 @@
-## JHBuild
+# JHBuild
+
+This plugin adds some [JHBuild](https://developer.gnome.org/jhbuild/) aliases.
+
+To use it, add `jhbuild` to the plugins array of your zshrc file:
+
+```zsh
+plugins=(... jhbuild)
+```
+
**Maintainer:** [Miguel Vaello](https://github.com/miguxbe)
-This plugin adds some jhbuild aliases and increase the completion function provided by zsh.
+## Aliases
+
+| Alias | Command |
+|---------|---------------------------|
+| `jh` | `jhbuild` |
+| `jhb` | `jhbuild build` |
+| `jhbo` | `jhbuild buildone` |
+| `jhckb` | `jhbuild checkbranches` |
+| `jhckm` | `jhbuild checkmodulesets` |
+| `jhi` | `jhbuild info` |
+| `jhl` | `jhbuild list` |
+| `jhc` | `jhbuild clean` |
+| `jhco` | `jhbuild cleanone` |
+| `jhm` | `jhbuild make` |
+| `jhr` | `jhbuild run` |
+| `jhrd` | `jhbuild rdepends` |
+| `jhsd` | `jhbuild sysdeps` |
+| `jhu` | `jhbuild update` |
+| `jhuo` | `jhbuild updateone` |
+| `jhun` | `jhbuild uninstall` |
+| `jhsh` | `jhbuild shell` |
+| `jht` | `jhbuild tinderbox` |
diff --git a/plugins/jhbuild/jhbuild.plugin.zsh b/plugins/jhbuild/jhbuild.plugin.zsh
index 05e56039d..416745d27 100644
--- a/plugins/jhbuild/jhbuild.plugin.zsh
+++ b/plugins/jhbuild/jhbuild.plugin.zsh
@@ -1,5 +1,6 @@
-# Aliases
-#
+# JHBuild Aliases
+
+# Base
alias jh='jhbuild'
# Build
alias jhb='jhbuild build'
@@ -7,12 +8,14 @@ alias jhbo='jhbuild buildone'
# Checks
alias jhckb='jhbuild checkbranches'
alias jhckm='jhbuild checkmodulesets'
-# Info & list
+# Info & List
alias jhi='jhbuild info'
alias jhl='jhbuild list'
# Clean
alias jhc='jhbuild clean'
alias jhco='jhbuild cleanone'
+# Make
+alias jhm='jhbuild make'
# Run
alias jhr='jhbuild run'
# Depends
@@ -25,6 +28,5 @@ alias jhuo='jhbuild updateone'
alias jhun='jhbuild uninstall'
# Shell
alias jhsh='jhbuild shell'
-
-
-
+# Tinderbox
+alias jht='jhbuild tinderbox'
From 79fff1ee492a2c4d8ab09678bd5e7440cfbf03dd Mon Sep 17 00:00:00 2001
From: Guillermo del Fresno
Date: Thu, 27 Feb 2020 14:55:14 -0300
Subject: [PATCH 178/343] macports: add rdeps and rdependents completion
(#4717)
---
plugins/macports/_port | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/macports/_port b/plugins/macports/_port
index 06d7fb426..6a9ebe0c6 100644
--- a/plugins/macports/_port
+++ b/plugins/macports/_port
@@ -41,6 +41,8 @@ subcmds=(
'patch'
'pkg'
'provides'
+'rdependents'
+'rdeps'
'rpmpackage'
'search'
'selfupdate'
From 2c0315dba4297ec2e87d6f503a6d907c33f51958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 27 Feb 2020 19:26:03 +0100
Subject: [PATCH 179/343] ng: refactor README
---
plugins/ng/README.md | 37 +++++--------------------------------
1 file changed, 5 insertions(+), 32 deletions(-)
diff --git a/plugins/ng/README.md b/plugins/ng/README.md
index 94a450c18..29ac15aa4 100644
--- a/plugins/ng/README.md
+++ b/plugins/ng/README.md
@@ -1,37 +1,10 @@
-## NG Plugin
+# ng plugin
-This [ng plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ng)
- adds completion support for Angular's CLI (named ng).
+This plugin adds autocompletion support for [Angular's CLI](https://github.com/angular/angular-cli)
+(named `ng`).
-Ng is hosted on [ng home](https://github.com/catull/angular-cli)
-
-It is used to generate Angular 2 app "stubs", build those apps, configure them,
-test them, lint them etc.
-
-Ahem, "stubs" is not what Angular engineers refer to the items ng can generate
-for you.
-
-"Stubs" can be any one of:
-- class
-- component
-- directive
-- enum
-- module
-- pipe
-- route
-- service
-
-At the moment, `ng completion` creates a very rough completion for Zsh and
-Bash.
-
-It is missing most of the options and a few arguments.
-In future, this plugin may be shortened to simply being
+To use it, add `ng` to the plugins array of your zshrc file:
```zsh
-eval `ng completion`
+plugins=(... ng)
```
-
-There is hope this materialises in the 21st century.
-
-### CONTRIBUTOR
- - Carlo Dapor ([catull](https://github.com/catull))
From 368198b7616eb69b396de86d9ec4ff0f35bd72f0 Mon Sep 17 00:00:00 2001
From: Chai Feng
Date: Fri, 28 Feb 2020 05:47:06 +0800
Subject: [PATCH 180/343] Fix an issue with escape characters (#7979)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Francisco de Zuviría
---
plugins/copybuffer/copybuffer.plugin.zsh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh
index cc205d40f..483ed5a5f 100644
--- a/plugins/copybuffer/copybuffer.plugin.zsh
+++ b/plugins/copybuffer/copybuffer.plugin.zsh
@@ -1,9 +1,9 @@
# copy the active line from the command line buffer
-# onto the system clipboard (requires clipcopy plugin)
+# onto the system clipboard
copybuffer () {
if which clipcopy &>/dev/null; then
- echo $BUFFER | clipcopy
+ printf "%s" "$BUFFER" | clipcopy
else
echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly."
fi
From 57739cbcb64fb5d166f35b877ffb10b8120256b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Thu, 27 Feb 2020 23:24:23 +0100
Subject: [PATCH 181/343] lib: add support for clip.exe clipboard copy in WSL
---
lib/clipboard.zsh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
index 6102f3324..92959bc03 100644
--- a/lib/clipboard.zsh
+++ b/lib/clipboard.zsh
@@ -78,6 +78,9 @@ function detect-clipboard() {
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; }
+ elif [[ $(uname -r) = *icrosoft* ]]; then
+ function clipcopy() { clip.exe < "${1:-/dev/stdin}"; }
+ function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; }
else
function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift
From 2b499e1a9e8788d607768ecef67851e8234b72b3 Mon Sep 17 00:00:00 2001
From: j <74ef54cf@opayq.com>
Date: Sat, 12 Aug 2017 15:31:34 -0700
Subject: [PATCH 182/343] lib: add termux commands to clipboard.zsh (#6243)
Closes #6243
---
lib/clipboard.zsh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
index 92959bc03..808f2ea2d 100644
--- a/lib/clipboard.zsh
+++ b/lib/clipboard.zsh
@@ -75,6 +75,9 @@ function detect-clipboard() {
elif (( ${+commands[win32yank]} )); then
function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; }
function clippaste() { win32yank -o; }
+ elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then
+ function clipcopy() { termux-clipboard-set "${1:-/dev/stdin}"; }
+ function clippaste() { termux-clipboard-get; }
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; }
From 08b04f5df2b9a4747b8f8975785bdcd523d85445 Mon Sep 17 00:00:00 2001
From: mickk-on-cpp
Date: Fri, 28 Feb 2020 17:27:16 +0100
Subject: [PATCH 183/343] fancy-ctrl-z: ensure widgets are called with full
context (#4838)
This allows other plugins that hook e.g. accept-line to identify the
fancy-ctrl-z widget as the caller and take appropriate steps when
necessary.
See https://github.com/tarruda/zsh-autosuggestions/issues/82#issuecomment-181133379
---
plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
index 8ab297913..82b968894 100644
--- a/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
+++ b/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
@@ -1,10 +1,10 @@
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
- zle accept-line
+ zle accept-line -w
else
- zle push-input
- zle clear-screen
+ zle push-input -w
+ zle clear-screen -w
fi
}
zle -N fancy-ctrl-z
From 3e16d6434778ee9e1d7d5369c53d1e9c6b0517cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Ko=C5=A1=C4=8Do?=
<640131+s7anley@users.noreply.github.com>
Date: Fri, 28 Feb 2020 17:29:11 +0100
Subject: [PATCH 184/343] geeknote: update completion (#4986)
Fixes Completion only working for first parameter
---
plugins/geeknote/README.md | 17 ++-
plugins/geeknote/_geeknote | 267 ++++++++++++++++++++-----------------
2 files changed, 156 insertions(+), 128 deletions(-)
diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md
index 3f2353112..99c1fbf5b 100644
--- a/plugins/geeknote/README.md
+++ b/plugins/geeknote/README.md
@@ -1,12 +1,19 @@
-## ZSH-Geeknote
+ZSH-Geeknote
+============
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh.
Plugins provides:
-- auto completion of commands and their options
-- alias `gn`
+* auto completion of commands and their options
+* alias `gn`
-You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/).
+## Installation
-Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley))
+### oh-my-zsh
+This plugin is already bundled in oh-my-zsh. To enable just configure plugin definition
+
+ plugins=( ... geeknote ...)
+
+### Antigen
+Use [Antigen's](https://github.com/zsh-users/antigen) bundle command to install by adding `antigen bundle s7anley/zsh-geeknote` to your `.zshrc` along with your other plugins.
diff --git a/plugins/geeknote/_geeknote b/plugins/geeknote/_geeknote
index cf1a187d2..a34be59b1 100644
--- a/plugins/geeknote/_geeknote
+++ b/plugins/geeknote/_geeknote
@@ -1,136 +1,157 @@
#compdef geeknote
-# --------------- ------------------------------------------------------------
-# Name : _geeknote
-# Synopsis : zsh completion for geeknote
-# Author : Ján Koščo <3k.stanley@gmail.com>
-# HomePage : http://www.geeknote.me
-# Version : 0.1
-# Tag : [ shell, zsh, completion, evernote ]
-# Copyright : © 2014 by Ján Koščo,
-# Released under current GPL license.
-# --------------- ------------------------------------------------------------
+
+# Geeknote Autocomplete plugin for Zsh
+# Requires: Geeknote installed
+# Author : Ján Koščo (@s7anley)
+
+__login() {
+ # no arguments
+}
+
+__logout() {
+ _arguments \
+ '--force[Do not ask about logging out.]'
+}
+
+__settings() {
+ _arguments \
+ "--editor+[Set the editor, which use to edit and create notes.]::"
+}
+
+__create() {
+ _arguments \
+ '--title+[The note title.]::' \
+ '--content+[The note content.]::' \
+ '--tags+[One tag or the list of tags which will be added to the note.]::' \
+ '--notebook+[Set the notebook where to save note.]::' \
+ '--resource+[Add a resource to the note.]::'
+}
+
+__edit() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to edit.]::' \
+ '--title+[Set new title of the note.]::' \
+ '--content+[Set new content of the note.]::' \
+ '--tags+[Set new list o tags for the note.]::' \
+ '--notebook+[Assign new notebook for the note.]::' \
+ '--resource+[Add a resource to the note.]::'
+}
+
+__find() {
+ _arguments \
+ '--search+[Text to search.]::' \
+ '--tags+[Notes with which tag/tags to search.]::' \
+ '--notebook+[In which notebook search the note.]::' \
+ '--date+[Set date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy.]::' \
+ '--count+[How many notes show in the result list.]::' \
+ '--with-url[Add direct url of each note in results to Evernote web-version.]' \
+ '--content-search[Search by content, not by title.]' \
+ '--exact-entry[Search for exact entry of the request.]'
+}
+
+__show() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to show.]::' \
+ '--raw[Show the raw note body.]'
+}
+
+__remove() {
+ _arguments \
+ '--note+[The name or ID from the previous search of a note to remove.]::' \
+ '--force[Do not ask about removing.]'
+}
+
+__notebook-list() {
+ # no arguments
+}
+
+__notebook-create() {
+ _arguments \
+ '--title+[Set the title of new notebook.]::'
+}
+
+__notebook-edit() {
+ _arguments \
+ '--title+[Set the title of new notebook.]::' \
+ '--notebook+[The name of a notebook to rename.]::'
+}
+
+__tag-list() {
+ # no arguments
+}
+
+__tag-create() {
+ _arguments \
+ '--title+[Set the title of new tag.]::'
+}
+
+__tag-edit() {
+ _arguments \
+ '--tagname+[The name of a tag to rename.]::' \
+ '--title+[Set the new name of tag.]::'
+}
+
+__user() {
+ _arguments \
+ '--full[Show full information.]'
+}
local -a _1st_arguments
_1st_arguments=(
- 'login'
- 'logout'
- 'settings'
- 'create'
- 'edit'
- 'find'
- 'show'
- 'remove'
- 'notebook-list'
- 'notebook-create'
- 'notebook-edit'
- 'tag-list'
- 'tag-create'
- 'tag-edit'
- 'tag-remove'
- 'gnsync'
- 'user'
+ 'login':'Authorize in Evernote.'
+ 'logout':'Logout from Evernote.'
+ 'settings':'Show and edit current settings.'
+ 'create':'Create note in Evernote.'
+ 'edit':'Edit note in Evernote.'
+ 'find':'Search notes in Evernote.'
+ 'show':'Output note in the terminal.'
+ 'remove':'Remove note from Evernote.'
+ 'notebook-list':'Show the list of existing notebooks in your Evernote.'
+ 'notebook-create':'Create new notebook.'
+ 'notebook-edit':'Edit/rename notebook.'
+ 'tag-list':'Show the list of existing tags in your Evernote.'
+ 'tag-create':'Create new tag.'
+ 'tag-edit':'Edit/rename tag.'
+ 'user':'Show information about active user.'
)
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
- _describe -t commands "geeknote command" _1st_arguments
- return
+ _describe -t commands "geeknote command" _1st_arguments
+ return
fi
local -a _command_args
case "$words[1]" in
- user)
- _command_args=(
- '(--full)--full' \
- )
- ;;
- logout)
- _command_args=(
- '(--force)--force' \
- )
- ;;
- settings)
- _command_args=(
- '(--editor)--editor' \
- )
- ;;
- create)
- _command_args=(
- '(-t|--title)'{-t,--title}'[note title]' \
- '(-c|--content)'{-c,--content}'[note content]' \
- '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
- '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
- )
- ;;
- edit)
- _command_args=(
- '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
- '(-t|--title)'{-t,--title}'[note title]' \
- '(-c|--content)'{-c,--content}'[note content]' \
- '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
- '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
- )
- ;;
- remove)
- _command_args=(
- '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
- '(--force)--force' \
- )
- ;;
- show)
- _command_args=(
- '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
- )
- ;;
- find)
- _command_args=(
- '(-s|--search)'{-s,--search}'[text to search]' \
- '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \
- '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \
- '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \
- '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \
- '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \
- '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \
- '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \
- )
- ;;
- notebook-create)
- _command_args=(
- '(-t|--title)'{-t,--title}'[notebook title]' \
- )
- ;;
- notebook-edit)
- _command_args=(
- '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \
- '(-t|--title)'{-t,--title}'[new notebook title]' \
- )
- ;;
- notebook-remove)
- _command_args=(
- '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \
- '(--force)--force' \
- )
- ;;
- tag-create)
- _command_args=(
- '(-t|--title)'{-t,--title}'[title of tag]' \
- )
- ;;
- tag-edit)
- _command_args=(
- '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \
- '(-t|--title)'{-t,--title}'[new tag name]' \
- )
- ;;
- tag-remove)
- _command_args=(
- '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \
- '(--force)--force' \
- )
- ;;
- esac
-
-_arguments \
- $_command_args \
- && return 0
+ login)
+ __login ;;
+ logout)
+ __logout ;;
+ settings)
+ __settings ;;
+ create)
+ __create ;;
+ edit)
+ __edit ;;
+ find)
+ __find ;;
+ show)
+ __show ;;
+ remove)
+ __remove ;;
+ notebook-list)
+ __notebook-list ;;
+ notebook-create)
+ __notebook-create ;;
+ notebook-edit)
+ __notebook-edit ;;
+ tag-list)
+ __tag-list ;;
+ tag-create)
+ __tag-create ;;
+ tag-edit)
+ __tag-edit ;;
+ user)
+ __user ;;
+esac
From 888ab9091c4fb5bbadd1329524abfe9aa7a84451 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Fri, 28 Feb 2020 19:07:05 +0100
Subject: [PATCH 185/343] lib: add support for clippaste in WSL using
powershell
Source: https://github.com/microsoft/WSL/issues/4852#issuecomment-579616808
---
lib/clipboard.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh
index 808f2ea2d..122145f15 100644
--- a/lib/clipboard.zsh
+++ b/lib/clipboard.zsh
@@ -83,7 +83,7 @@ function detect-clipboard() {
function clippaste() { tmux save-buffer -; }
elif [[ $(uname -r) = *icrosoft* ]]; then
function clipcopy() { clip.exe < "${1:-/dev/stdin}"; }
- function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; }
+ function clippaste() { powershell.exe -noprofile -command Get-Clipboard; }
else
function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift
From 6f85dc2389b415011b844ff2a8cbd948be566ec3 Mon Sep 17 00:00:00 2001
From: Gustavo Maia
Date: Fri, 28 Feb 2020 15:23:36 -0300
Subject: [PATCH 186/343] kitchen: change sed regex in completion to capture
all commands (#5820)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Marc Cornellà
---
plugins/kitchen/_kitchen | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/kitchen/_kitchen b/plugins/kitchen/_kitchen
index 29a3125e4..d93d93d78 100644
--- a/plugins/kitchen/_kitchen
+++ b/plugins/kitchen/_kitchen
@@ -67,7 +67,7 @@ _kitchen() {
_kitchen_commands() {
local commands
- commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}")
+ commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ A-Z[].*# \(.*\)$/\1:\2/p')}")
_describe -t commands 'kitchen commands' commands
}
From 864b441688efee6573d233b21075a6f23a903097 Mon Sep 17 00:00:00 2001
From: Thomas Ruiz
Date: Fri, 28 Feb 2020 19:28:55 +0100
Subject: [PATCH 187/343] composer: keep composer autocompletion when using
global (#5933)
---
plugins/composer/composer.plugin.zsh | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
index 634961023..fb53da113 100644
--- a/plugins/composer/composer.plugin.zsh
+++ b/plugins/composer/composer.plugin.zsh
@@ -15,20 +15,16 @@ _composer_get_required_list () {
}
_composer () {
- local curcontext="$curcontext" state line
- typeset -A opt_args
- _arguments \
- '1: :->command'\
- '*: :->args'
+ local curcontext="$curcontext" state line
+ typeset -A opt_args
+ _arguments \
+ '*:: :->subcmds'
- case $state in
- command)
- compadd $(_composer_get_command_list)
- ;;
- *)
- compadd $(_composer_get_required_list)
- ;;
- esac
+ if (( CURRENT == 1 )) || ( ((CURRENT == 2)) && [ "$words[1]" = "global" ] ) ; then
+ compadd $(_composer_get_command_list)
+ else
+ compadd $(_composer_get_required_list)
+ fi
}
compdef _composer composer
From a2cad16790aeb7e775da47fd11f1f7cee1e03c90 Mon Sep 17 00:00:00 2001
From: Stephen Heuer
Date: Fri, 28 Feb 2020 12:50:17 -0600
Subject: [PATCH 188/343] lib: urlencode hostname in update_terminalapp_cwd
(#6245)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Apple's Terminal doesn't open a new tab in your current directory if your hostname has UTF-8 characters in it. Percent encoding the host in addition to the path in update_terminalapp_cwd appears to solve this issue.
Co-authored-by: Marc Cornellà
---
lib/termsupport.zsh | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index f5e367fcb..19fd57b9d 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -91,12 +91,13 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
function update_terminalapp_cwd() {
emulate -L zsh
- # Percent-encode the pathname.
- local URL_PATH="$(omz_urlencode -P $PWD)"
- [[ $? != 0 ]] && return 1
+ # Percent-encode the host and path names.
+ local URL_HOST URL_PATH
+ URL_HOST="$(omz_urlencode -P $HOST)" || return 1
+ URL_PATH="$(omz_urlencode -P $PWD)" || return 1
# Undocumented Terminal.app-specific control sequence
- printf '\e]7;%s\a' "file://$HOST$URL_PATH"
+ printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
From 5023a4787bee5da4a47a3155f3f7a3ee3cee155c Mon Sep 17 00:00:00 2001
From: Joshua Pratt
Date: Sat, 29 Feb 2020 05:59:33 +1100
Subject: [PATCH 189/343] stack: use builtin completion command (#6230)
---
plugins/stack/stack.plugin.zsh | 39 ++--------------------------------
1 file changed, 2 insertions(+), 37 deletions(-)
diff --git a/plugins/stack/stack.plugin.zsh b/plugins/stack/stack.plugin.zsh
index a149208d0..4e812880e 100644
--- a/plugins/stack/stack.plugin.zsh
+++ b/plugins/stack/stack.plugin.zsh
@@ -1,37 +1,2 @@
-function _stack_commands() {
- local ret=1 state
- _arguments ':subcommand:->subcommand' && ret=0
-
- case $state in
- subcommand)
- subcommands=(
- "build:Build the project(s) in this directory/configuration"
- "install:Build executables and install to a user path"
- "test:Build and test the project(s) in this directory/configuration"
- "bench:Build and benchmark the project(s) in this directory/configuration"
- "haddock:Generate haddocks for the project(s) in this directory/configuration"
- "new:Create a brand new project"
- "init:Initialize a stack project based on one or more stack packages"
- "solver:Use a dependency solver to try and determine missing extra-deps"
- "setup:Get the appropriate ghc for your project"
- "path:Print out handy path information"
- "unpack:Unpack one or more packages locally"
- "update:Update the package index"
- "upgrade:Upgrade to the latest stack (experimental)"
- "upload:Upload a package to Hackage"
- "dot:Visualize your project's dependency graph using Graphviz dot"
- "exec:Execute a command"
- "ghc:Run ghc"
- "ghci:Run ghci in the context of project(s)"
- "ide:Run ide-backend-client with the correct arguments"
- "runghc:Run runghc"
- "clean:Clean the local packages"
- "docker:Subcommands specific to Docker use"
- )
- _describe -t subcommands 'stack subcommands' subcommands && ret=0
- esac
-
- return ret
-}
-
-compdef _stack_commands stack
+autoload -U +X bashcompinit && bashcompinit
+source <(stack --bash-completion-script stack)
From c3984a775994645b8fb9ef7f714a92edb7baf5ac Mon Sep 17 00:00:00 2001
From: Ville Lautanala
Date: Fri, 28 Feb 2020 21:01:14 +0200
Subject: [PATCH 190/343] fasd: cache full fasd initialisation script (#6097)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Using `fasd —-init auto` will first detect terminal and then call
fasd again to generate the final initialisation script. Caching that gives a more significant performance boost.
---
plugins/fasd/fasd.plugin.zsh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh
index ec2e5183a..cdf99708c 100644
--- a/plugins/fasd/fasd.plugin.zsh
+++ b/plugins/fasd/fasd.plugin.zsh
@@ -1,7 +1,8 @@
if [ $commands[fasd] ]; then # check if fasd is installed
fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache"
if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
- fasd --init auto >| "$fasd_cache"
+ fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \
+ zsh-wcomp zsh-wcomp-install >| "$fasd_cache"
fi
source "$fasd_cache"
unset fasd_cache
From 389de86cf5e4976bdda4259b27987c44d401ae96 Mon Sep 17 00:00:00 2001
From: Sven Hergenhahn
Date: Fri, 28 Feb 2020 20:29:44 +0100
Subject: [PATCH 191/343] pass: update completion to upstream version
(675a002e) (#6475)
---
plugins/pass/_pass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/plugins/pass/_pass b/plugins/pass/_pass
index 5f3b8f541..75f3feb4f 100644
--- a/plugins/pass/_pass
+++ b/plugins/pass/_pass
@@ -10,6 +10,14 @@
# Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information.
+# If you use multiple repositories, you can configure completion like this:
+#
+# compdef _pass workpass
+# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
+# workpass() {
+# PASSWORD_STORE_DIR=$HOME/work/pass pass $@
+# }
+
# If you use multiple repositories, you can configure completion like this:
#
# compdef _pass workpass
From e61228282acced09d9b245b3fc337fd079dc26a8 Mon Sep 17 00:00:00 2001
From: Wenbing Li
Date: Fri, 28 Feb 2020 11:35:19 -0800
Subject: [PATCH 192/343] gradle: fix command option name in completion (#6586)
It should be `--rerun-tasks`, the original one miss a 's' at the end.
See https://docs.gradle.org/current/userguide/command_line_interface.html
---
plugins/gradle/gradle.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index c651b91ca..bba6ad4e9 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -83,7 +83,7 @@ function _gradle_arguments() {
'--quiet[Log errors only]' \
'--recompile-scripts[Forces scripts to be recompiled, bypassing caching]' \
'--refresh-dependencies[Refresh the state of dependencies]' \
- '--rerun-task[Specifies that any task optimization is ignored]' \
+ '--rerun-tasks[Specifies that any task optimization is ignored]' \
'--settings-file[Specifies the settings file]' \
'--stacktrace[Print out the stacktrace also for user exceptions]' \
'--status[Print Gradle Daemon status]' \
From f94e55a1a91492662e87ae6e96e3c36ae08d18dd Mon Sep 17 00:00:00 2001
From: Cody Fuller
Date: Fri, 28 Feb 2020 13:42:18 -0600
Subject: [PATCH 193/343] mix: add format option to completion (#7256)
---
plugins/mix/_mix | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index 61fa1cf25..c0fe68c91 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -34,6 +34,7 @@ _1st_arguments=(
'firmware:Nerves - Build a firmware image for the selected target platform'
'firmware.burn:Nerves - Writes the generated firmware image to an attached SDCard or file'
'firmware.image:Nerves - Create a firmware image file that can be copied byte-for-byte'
+ 'format:Formats the given files and patterns'
'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
@@ -92,7 +93,7 @@ __task_list ()
local expl
declare -a tasks
- tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test)
+ tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build format help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test)
_wanted tasks expl 'help' compadd $tasks
}
From dddbb5c9ebe0805750c0b8c0282ca86f1c6b1818 Mon Sep 17 00:00:00 2001
From: Michal Kielan
Date: Fri, 28 Feb 2020 11:51:38 -0800
Subject: [PATCH 194/343] mercurial: add hga alias to README (#7547)
---
plugins/mercurial/README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/mercurial/README.md b/plugins/mercurial/README.md
index f42212d68..68c7d0f43 100644
--- a/plugins/mercurial/README.md
+++ b/plugins/mercurial/README.md
@@ -26,6 +26,7 @@ Update .zshrc:
### What's inside?
#### Adds handy aliases:
###### general
+* `hga` - 'hg add`
* `hgc` - `hg commit`
* `hgb` - `hg branch`
* `hgba` - `hg branches`
From befdb4649b3894cb2c545182810f228e8cb721ae Mon Sep 17 00:00:00 2001
From: Gianluca Recchia
Date: Fri, 28 Feb 2020 21:00:44 +0100
Subject: [PATCH 195/343] gitignore: add newline to `gi` output (#7586)
* Add trailing new line at the end of output
* Double-quote variable expansion
---
plugins/gitignore/gitignore.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh
index 15e38d3b7..a687f5cce 100644
--- a/plugins/gitignore/gitignore.plugin.zsh
+++ b/plugins/gitignore/gitignore.plugin.zsh
@@ -1,4 +1,4 @@
-function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} }
+function gi() { curl -fLw '\n' https://www.gitignore.io/api/"${(j:,:)@}" }
_gitignoreio_get_command_list() {
curl -sfL https://www.gitignore.io/api/list | tr "," "\n"
From 1689e9bb907ab184d7418dd88bc2639a794c916d Mon Sep 17 00:00:00 2001
From: Alexander Schlarb <246386+alexander255@users.noreply.github.com>
Date: Fri, 28 Feb 2020 20:01:35 +0000
Subject: [PATCH 196/343] zsh_reload: respect `$ZDOTDIR` when searching for
`.zshrc` (#7706)
---
plugins/zsh_reload/zsh_reload.plugin.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index 51048ba9d..83f8da733 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -3,7 +3,7 @@ src() {
autoload -U compinit zrecompile
compinit -i -d "$cache/zcomp-$HOST"
- for f in ~/.zshrc "$cache/zcomp-$HOST"; do
+ for f in ${ZDOTDIR:-~}/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old
done
From 14b4f62e65b3d94c275ea8892f252deae9ce619a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sat, 29 Feb 2020 14:53:06 +0100
Subject: [PATCH 197/343] updater: fix --autostash argument. Works for git >
1.7.1
See https://github.com/ohmyzsh/ohmyzsh/pull/7172#issuecomment-592875226
---
tools/upgrade.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 0dc84e214..9ecaed2ef 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -38,7 +38,7 @@ if [ -n "$remote" ]; then
fi
printf "${BLUE}%s${NORMAL}\n" "Updating Oh My Zsh"
-if git pull --rebase --autostash --stat origin master
+if git -c rebase.autoStash=true pull --rebase --stat origin master
then
printf '%s' "$GREEN"
printf '%s\n' ' __ __ '
From 498cd722b39215be04468f291a23b6a76b75b095 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sat, 29 Feb 2020 14:56:37 +0100
Subject: [PATCH 198/343] Add git version requirement in documentation
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 187cceb7d..2ab859a6a 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi
* A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work.
* [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
-* `git` should be installed
+* `git` should be installed (recommended v1.7.2 or higher)
### Basic Installation
From b6f2cfdb93627ca82ced24aaddb122b3a76a2638 Mon Sep 17 00:00:00 2001
From: Vital Kolas
Date: Thu, 12 May 2016 10:40:24 +0300
Subject: [PATCH 199/343] Exclude .idea folder from grep search scope
---
lib/grep.zsh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index abc1650a1..886e36a8d 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -10,13 +10,13 @@ if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
-# ignore VCS folders (if the necessary grep flags are available)
-VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
+# ignore these folders (if the necessary grep flags are available)
+EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea}"
if grep-flag-available --exclude-dir=.cvs; then
- GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
+ GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS"
elif grep-flag-available --exclude=.cvs; then
- GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
+ GREP_OPTIONS+=" --exclude=$EXC_FOLDERS"
fi
# export grep settings
@@ -24,5 +24,5 @@ alias grep="grep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
-unset VCS_FOLDERS
+unset EXC_FOLDERS
unfunction grep-flag-available
From b4b50f20ac7a6645d04993ba8ca8695a41b8db7a Mon Sep 17 00:00:00 2001
From: Peter Vandenberk
Date: Wed, 10 Oct 2018 17:21:06 +0100
Subject: [PATCH 200/343] Also set options for egrep and fgrep
---
lib/grep.zsh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index 886e36a8d..bd9dad41f 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -19,8 +19,10 @@ elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$EXC_FOLDERS"
fi
-# export grep settings
+# export grep, egrep and fgrep settings
alias grep="grep $GREP_OPTIONS"
+alias egrep="egrep $GREP_OPTIONS"
+alias fgrep="fgrep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
From a8ed1c4e7ab7e7df3a1e903cde30f94bf6da3e39 Mon Sep 17 00:00:00 2001
From: Shi Yan
Date: Fri, 30 Nov 2018 15:44:41 +1100
Subject: [PATCH 201/343] Ignore .tox folder in grep
---
lib/grep.zsh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index bd9dad41f..09042e13b 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -11,7 +11,7 @@ if grep-flag-available --color=auto; then
fi
# ignore these folders (if the necessary grep flags are available)
-EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea}"
+EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS"
@@ -25,6 +25,5 @@ alias egrep="egrep $GREP_OPTIONS"
alias fgrep="fgrep $GREP_OPTIONS"
# clean up
-unset GREP_OPTIONS
-unset EXC_FOLDERS
+unset GREP_OPTIONS EXC_FOLDERS
unfunction grep-flag-available
From 57b178102c0016f5c433054ce981a80dd4b4b73f Mon Sep 17 00:00:00 2001
From: mattmc3
Date: Sat, 30 Nov 2019 13:49:23 -0500
Subject: [PATCH 202/343] Performance enhancement for lib/grep
- Use $ZSH_CACHE_DIR to store the grep alias with all the right features
- Expire the cache after 24 hours
- See issue #8444
---
lib/grep.zsh | 63 ++++++++++++++++++++++++++++++----------------------
1 file changed, 37 insertions(+), 26 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index 09042e13b..df9146aa4 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -1,29 +1,40 @@
-# is x grep argument available?
-grep-flag-available() {
- echo | grep $1 "" >/dev/null 2>&1
-}
+# see if we already cached the grep alias in past day
+_grep_alias_cache=("$ZSH_CACHE_DIR"/grep_alias.zsh(Nm-24))
+if (( $#_grep_alias_cache )); then
+ source "$ZSH_CACHE_DIR"/grep_alias.zsh
+else
+ # is x grep argument available?
+ grep-flag-available() {
+ echo | grep $1 "" >/dev/null 2>&1
+ }
-GREP_OPTIONS=""
+ GREP_OPTIONS=""
-# color grep results
-if grep-flag-available --color=auto; then
- GREP_OPTIONS+=" --color=auto"
+ # color grep results
+ if grep-flag-available --color=auto; then
+ GREP_OPTIONS+=" --color=auto"
+ fi
+
+ # ignore these folders (if the necessary grep flags are available)
+ EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
+
+ if grep-flag-available --exclude-dir=.cvs; then
+ GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS"
+ elif grep-flag-available --exclude=.cvs; then
+ GREP_OPTIONS+=" --exclude=$EXC_FOLDERS"
+ fi
+
+ {
+ # export grep, egrep and fgrep settings
+ echo alias grep="'grep $GREP_OPTIONS'"
+ echo alias egrep="'egrep $GREP_OPTIONS'"
+ echo alias fgrep="'fgrep $GREP_OPTIONS'"
+ } > "$ZSH_CACHE_DIR/grep_alias.zsh"
+
+ source "$ZSH_CACHE_DIR/grep_alias.zsh"
+
+ # clean up
+ unset GREP_OPTIONS EXC_FOLDERS
+ unfunction grep-flag-available
fi
-
-# ignore these folders (if the necessary grep flags are available)
-EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
-
-if grep-flag-available --exclude-dir=.cvs; then
- GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS"
-elif grep-flag-available --exclude=.cvs; then
- GREP_OPTIONS+=" --exclude=$EXC_FOLDERS"
-fi
-
-# export grep, egrep and fgrep settings
-alias grep="grep $GREP_OPTIONS"
-alias egrep="egrep $GREP_OPTIONS"
-alias fgrep="fgrep $GREP_OPTIONS"
-
-# clean up
-unset GREP_OPTIONS EXC_FOLDERS
-unfunction grep-flag-available
+unset _grep_alias_cache
From 8d814fdff6f57e83a2b0c9430f61f7093a95bd04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 1 Mar 2020 14:02:06 +0100
Subject: [PATCH 203/343] Fast algorithm to determine grep alias flags
This version tries whether grep supports all the flags together
and progressively checks older flags if the grep test fails.
This means only one grep call if all flags are supported, and
one additional call for every flag that's not supported, up to
a maximum of 3 calls.
---
lib/grep.zsh | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index df9146aa4..933de2990 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -4,37 +4,36 @@ if (( $#_grep_alias_cache )); then
source "$ZSH_CACHE_DIR"/grep_alias.zsh
else
# is x grep argument available?
- grep-flag-available() {
- echo | grep $1 "" >/dev/null 2>&1
+ grep-flags-available() {
+ echo | grep "$@" "" >/dev/null 2>&1
}
GREP_OPTIONS=""
- # color grep results
- if grep-flag-available --color=auto; then
- GREP_OPTIONS+=" --color=auto"
- fi
-
# ignore these folders (if the necessary grep flags are available)
EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
- if grep-flag-available --exclude-dir=.cvs; then
- GREP_OPTIONS+=" --exclude-dir=$EXC_FOLDERS"
- elif grep-flag-available --exclude=.cvs; then
- GREP_OPTIONS+=" --exclude=$EXC_FOLDERS"
+ if grep-flags-available --color=auto --exclude-dir=.cvs; then
+ GREP_OPTIONS+="--color=auto --exclude-dir=$EXC_FOLDERS"
+ elif grep-flags-available --color=auto --exclude=.cvs; then
+ GREP_OPTIONS+="--color=auto --exclude=$EXC_FOLDERS"
+ elif grep-flags-available --color=auto; then
+ GREP_OPTIONS+="--color=auto"
fi
{
- # export grep, egrep and fgrep settings
- echo alias grep="'grep $GREP_OPTIONS'"
- echo alias egrep="'egrep $GREP_OPTIONS'"
- echo alias fgrep="'fgrep $GREP_OPTIONS'"
+ if [[ -n "$GREP_OPTIONS" ]]; then
+ # export grep, egrep and fgrep settings
+ echo alias grep="'grep $GREP_OPTIONS'"
+ echo alias egrep="'egrep $GREP_OPTIONS'"
+ echo alias fgrep="'fgrep $GREP_OPTIONS'"
+ fi
} > "$ZSH_CACHE_DIR/grep_alias.zsh"
source "$ZSH_CACHE_DIR/grep_alias.zsh"
# clean up
unset GREP_OPTIONS EXC_FOLDERS
- unfunction grep-flag-available
+ unfunction grep-flags-available
fi
unset _grep_alias_cache
From dc190d872aa37dc0440284bee6c6bd7744007bf0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 1 Mar 2020 20:17:38 +0100
Subject: [PATCH 204/343] Refactor grep.zsh file
- Move grep-alias path to variable.
- Use <<< "" instead of piped echo to check grep flags.
- Remove check for --color only since it's the same release as --exclude.
---
lib/grep.zsh | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index 933de2990..1d94eb978 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -1,39 +1,37 @@
-# see if we already cached the grep alias in past day
-_grep_alias_cache=("$ZSH_CACHE_DIR"/grep_alias.zsh(Nm-24))
-if (( $#_grep_alias_cache )); then
- source "$ZSH_CACHE_DIR"/grep_alias.zsh
-else
- # is x grep argument available?
+__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias
+
+# See if there's a cache file modified in the last day
+__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1))
+if [[ -z "$__GREP_ALIAS_CACHES" ]]; then
grep-flags-available() {
- echo | grep "$@" "" >/dev/null 2>&1
+ command grep "$@" "" &>/dev/null <<< ""
}
- GREP_OPTIONS=""
-
- # ignore these folders (if the necessary grep flags are available)
+ # Ignore these folders (if the necessary grep flags are available)
EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}"
+ # Check for --exclude-dir, otherwise check for --exclude. If --exclude
+ # isn't available, --color won't be either (they were released at the same
+ # time (v2.5): http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
if grep-flags-available --color=auto --exclude-dir=.cvs; then
- GREP_OPTIONS+="--color=auto --exclude-dir=$EXC_FOLDERS"
+ GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS"
elif grep-flags-available --color=auto --exclude=.cvs; then
- GREP_OPTIONS+="--color=auto --exclude=$EXC_FOLDERS"
- elif grep-flags-available --color=auto; then
- GREP_OPTIONS+="--color=auto"
+ GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS"
fi
{
if [[ -n "$GREP_OPTIONS" ]]; then
# export grep, egrep and fgrep settings
- echo alias grep="'grep $GREP_OPTIONS'"
- echo alias egrep="'egrep $GREP_OPTIONS'"
- echo alias fgrep="'fgrep $GREP_OPTIONS'"
+ echo "alias grep='grep $GREP_OPTIONS'"
+ echo "alias egrep='egrep $GREP_OPTIONS'"
+ echo "alias fgrep='fgrep $GREP_OPTIONS'"
fi
- } > "$ZSH_CACHE_DIR/grep_alias.zsh"
+ } > "$__GREP_CACHE_FILE"
- source "$ZSH_CACHE_DIR/grep_alias.zsh"
-
- # clean up
+ # Clean up
unset GREP_OPTIONS EXC_FOLDERS
unfunction grep-flags-available
fi
-unset _grep_alias_cache
+
+source "$__GREP_CACHE_FILE"
+unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES
From 9ce7de9f16ba894423bc5105c7e959894ca2e751 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Sun, 1 Mar 2020 22:53:33 +0100
Subject: [PATCH 205/343] Document ZSH_THEME_RANDOM_BLACKLIST setting
---
README.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/README.md b/README.md
index 2ab859a6a..38cfd9f4e 100644
--- a/README.md
+++ b/README.md
@@ -133,6 +133,12 @@ ZSH_THEME_RANDOM_CANDIDATES=(
)
```
+If you only know which themes you don't like, you can add them similarly to a blacklist:
+
+```shell
+ZSH_THEME_RANDOM_BLACKLIST=(pygmalion tjkirch_mod)
+```
+
### FAQ
If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ).
From d3dfc1371693d2b64ccec249511ea9178b088015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?=
Date: Mon, 2 Mar 2020 12:35:58 +0100
Subject: [PATCH 206/343] lib: use grep-alias cache only if ZSH_CACHE_DIR is
writable
Fixes #8693
---
lib/grep.zsh | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/lib/grep.zsh b/lib/grep.zsh
index 1d94eb978..a725e0f26 100644
--- a/lib/grep.zsh
+++ b/lib/grep.zsh
@@ -2,7 +2,9 @@ __GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias
# See if there's a cache file modified in the last day
__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1))
-if [[ -z "$__GREP_ALIAS_CACHES" ]]; then
+if [[ -n "$__GREP_ALIAS_CACHES" ]]; then
+ source "$__GREP_CACHE_FILE"
+else
grep-flags-available() {
command grep "$@" "" &>/dev/null <<< ""
}
@@ -12,26 +14,28 @@ if [[ -z "$__GREP_ALIAS_CACHES" ]]; then
# Check for --exclude-dir, otherwise check for --exclude. If --exclude
# isn't available, --color won't be either (they were released at the same
- # time (v2.5): http://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
+ # time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
if grep-flags-available --color=auto --exclude-dir=.cvs; then
GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS"
elif grep-flags-available --color=auto --exclude=.cvs; then
GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS"
fi
- {
- if [[ -n "$GREP_OPTIONS" ]]; then
- # export grep, egrep and fgrep settings
- echo "alias grep='grep $GREP_OPTIONS'"
- echo "alias egrep='egrep $GREP_OPTIONS'"
- echo "alias fgrep='fgrep $GREP_OPTIONS'"
+ if [[ -n "$GREP_OPTIONS" ]]; then
+ # export grep, egrep and fgrep settings
+ alias grep="grep $GREP_OPTIONS"
+ alias egrep="egrep $GREP_OPTIONS"
+ alias fgrep="fgrep $GREP_OPTIONS"
+
+ # write to cache file if cache directory is writable
+ if [[ -w "$ZSH_CACHE_DIR" ]]; then
+ alias -L grep egrep fgrep >| "$__GREP_CACHE_FILE"
fi
- } > "$__GREP_CACHE_FILE"
+ fi
# Clean up
unset GREP_OPTIONS EXC_FOLDERS
unfunction grep-flags-available
fi
-source "$__GREP_CACHE_FILE"
unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES
From e42683b8c5e20ca3d9c0fde1cb748cd8c8169619 Mon Sep 17 00:00:00 2001
From: Dan D'Avella
Date: Mon, 2 Mar 2020 07:17:16 -0500
Subject: [PATCH 207/343] pip: add local Python package files to completion
(#7442)
---
plugins/pip/_pip | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index 607f68e58..a5adead4a 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -89,6 +89,7 @@ case "$words[1]" in
if [[ "$state" == packages ]]; then
_pip_all
_wanted piplist expl 'packages' compadd -a piplist
+ _files -g "*.(tar.gz|whl)"
fi ;;
uninstall)
_pip_installed
From 74420341df46fab5cf34f24917927d675d717102 Mon Sep 17 00:00:00 2001
From: Pavel Fokin
Date: Mon, 2 Mar 2020 14:20:28 +0200
Subject: [PATCH 208/343] minikube: cache command completions (#7446)
---
plugins/minikube/minikube.plugin.zsh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/plugins/minikube/minikube.plugin.zsh b/plugins/minikube/minikube.plugin.zsh
index d8ebe79af..f7b365c7f 100644
--- a/plugins/minikube/minikube.plugin.zsh
+++ b/plugins/minikube/minikube.plugin.zsh
@@ -1,6 +1,13 @@
# Autocompletion for Minikube.
#
+if (( $+commands[minikube] )); then
+ __MINICUBE_COMPLETION_FILE="${ZSH_CACHE_DIR}/minicube_completion"
-if [ $commands[minikube] ]; then
- source <(minikube completion zsh)
+ if [[ ! -f $__MINICUBE_COMPLETION_FILE ]]; then
+ minikube completion zsh >! $__MINICUBE_COMPLETION_FILE
+ fi
+
+ [[ -f $__MINICUBE_COMPLETION_FILE ]] && source $__MINICUBE_COMPLETION_FILE
+
+ unset __MINICUBE_COMPLETION_FILE
fi
From e65bce849580fbb96c436b1a2a3739cb8c27c299 Mon Sep 17 00:00:00 2001
From: "Pavel N. Krivitsky"
Date: Mon, 2 Mar 2020 23:30:52 +1100
Subject: [PATCH 209/343] shrink-path: add minimum length and ellipsis symbol
options (#7382)
* Added minimum length and ellipsis symbol options for the shrink-path plugin.
* Replaced tab indentation with space indentation for the shrink-path plugin.
* Added handling of multicharacter ellipsis, and updated documentation and README for the shrink-path plugin.
---
plugins/shrink-path/README.md | 8 ++++-
plugins/shrink-path/shrink-path.plugin.zsh | 37 +++++++++++++++++++---
2 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/plugins/shrink-path/README.md b/plugins/shrink-path/README.md
index b990aea91..54bc351d3 100644
--- a/plugins/shrink-path/README.md
+++ b/plugins/shrink-path/README.md
@@ -20,6 +20,8 @@ here are the results of calling `shrink_path