summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.txt2
-rw-r--r--README.md4
-rw-r--r--lib/compfix.zsh2
-rw-r--r--lib/functions.zsh6
-rw-r--r--lib/misc.zsh1
-rw-r--r--lib/termsupport.zsh2
-rw-r--r--oh-my-zsh.sh11
-rw-r--r--plugins/adb/_adb9
-rw-r--r--plugins/ansible/README.md34
-rw-r--r--plugins/ansible/ansible.plugin.zsh28
-rw-r--r--plugins/ant/README.md12
-rw-r--r--plugins/archlinux/README.md20
-rw-r--r--plugins/archlinux/archlinux.plugin.zsh33
-rw-r--r--plugins/asdf/asdf.plugin.zsh8
-rw-r--r--plugins/autojump/README.md11
-rw-r--r--plugins/autopep8/README.md8
-rw-r--r--plugins/autopep8/autopep8.plugin.zsh0
-rw-r--r--plugins/aws/README.md36
-rw-r--r--plugins/aws/aws.plugin.zsh97
-rw-r--r--plugins/battery/README.md13
-rw-r--r--plugins/bgnotify/bgnotify.plugin.zsh2
-rw-r--r--plugins/bower/README.md18
-rw-r--r--plugins/brew/README.md21
-rw-r--r--plugins/brew/brew.plugin.zsh2
-rw-r--r--plugins/bwana/README.md9
-rw-r--r--plugins/cabal/README.md9
-rw-r--r--plugins/cake/README.md15
-rw-r--r--plugins/capistrano/README.md14
-rw-r--r--plugins/capistrano/capistrano.plugin.zsh4
-rw-r--r--plugins/cargo/README.md4
-rw-r--r--plugins/catimg/README.md35
-rw-r--r--plugins/celery/README.md9
-rw-r--r--plugins/chruby/chruby.plugin.zsh8
-rw-r--r--plugins/chucknorris/README.md20
-rw-r--r--plugins/cloudfoundry/README.md58
-rw-r--r--plugins/cloudfoundry/cloudfoundry.plugin.zsh34
-rw-r--r--plugins/colorize/README.md18
-rw-r--r--plugins/colorize/colorize.plugin.zsh27
-rw-r--r--plugins/command-not-found/README.md32
-rw-r--r--plugins/command-not-found/command-not-found.plugin.zsh7
-rw-r--r--plugins/composer/README.md29
-rw-r--r--plugins/cpanm/README.md9
-rw-r--r--plugins/cpanm/_cpanm3
-rw-r--r--plugins/debian/README.md75
-rw-r--r--plugins/dircycle/README.md78
-rw-r--r--plugins/dircycle/dircycle.plugin.zsh21
-rw-r--r--plugins/dirhistory/README.md17
-rw-r--r--plugins/dirpersist/README.md9
-rw-r--r--plugins/django/README.md56
-rw-r--r--plugins/docker-compose/README.md29
-rw-r--r--plugins/docker/_docker8
-rw-r--r--plugins/doctl/README.md9
-rw-r--r--plugins/emacs/README.md30
-rw-r--r--plugins/emoji-clock/README.md14
-rw-r--r--plugins/encode64/README.md69
-rw-r--r--plugins/extract/README.md1
-rw-r--r--plugins/extract/_extract2
-rw-r--r--plugins/extract/extract.plugin.zsh2
-rw-r--r--plugins/fabric/README.md9
-rw-r--r--plugins/fabric/fabric.plugin.zsh1
-rw-r--r--plugins/fancy-ctrl-z/README.md6
-rw-r--r--plugins/fd/README.md13
-rw-r--r--plugins/fd/_fd83
-rw-r--r--plugins/fedora/README.md1
-rw-r--r--plugins/gem/README.md17
-rw-r--r--plugins/git-auto-fetch/README.md31
-rw-r--r--plugins/git-auto-fetch/git-auto-fetch.plugin.zsh27
-rw-r--r--plugins/git-flow-avh/README.md19
-rw-r--r--plugins/git-flow-avh/git-flow-avh.plugin.zsh22
-rw-r--r--plugins/git-hubflow/README.md24
-rw-r--r--plugins/git-hubflow/git-hubflow.plugin.zsh22
-rw-r--r--plugins/git/git.plugin.zsh11
-rw-r--r--plugins/gitfast/README.md138
-rw-r--r--plugins/gitignore/README.md17
-rw-r--r--plugins/go/README.md1
-rw-r--r--plugins/golang/README.md29
-rw-r--r--plugins/golang/golang.plugin.zsh80
-rw-r--r--plugins/gpg-agent/README.md8
-rw-r--r--plugins/gradle/README.md23
-rw-r--r--plugins/grails/README.md71
-rw-r--r--plugins/grunt/README.md37
-rw-r--r--plugins/gulp/README.md8
-rw-r--r--plugins/helm/README.md9
-rw-r--r--plugins/heroku/README.md9
-rw-r--r--plugins/homestead/README.md9
-rw-r--r--plugins/iterm2/README.md29
-rw-r--r--plugins/iwhois/README.md24
-rw-r--r--plugins/iwhois/iwhois.plugin.zsh3
-rw-r--r--plugins/jake-node/README.md9
-rw-r--r--plugins/jenv/README.md18
-rw-r--r--plugins/jenv/jenv.plugin.zsh2
-rw-r--r--plugins/jump/README.md19
-rw-r--r--plugins/jump/jump.plugin.zsh13
-rw-r--r--plugins/kate/README.md20
-rw-r--r--plugins/keychain/README.md45
-rw-r--r--plugins/keychain/keychain.plugin.zsh32
-rw-r--r--plugins/kitchen/README.md9
-rw-r--r--plugins/kops/README.md12
-rw-r--r--plugins/kops/kops.plugin.zsh6
-rw-r--r--plugins/kubectl/README.md91
-rw-r--r--plugins/kubectl/kubectl.plugin.zsh39
-rw-r--r--plugins/laravel/README.md40
-rw-r--r--plugins/laravel/laravel.plugin.zsh23
-rw-r--r--plugins/laravel4/README.md18
-rw-r--r--plugins/laravel5/README.md18
-rw-r--r--plugins/lighthouse/README.md26
-rw-r--r--plugins/lighthouse/lighthouse.plugin.zsh14
-rw-r--r--plugins/lol/README.md83
-rw-r--r--plugins/macports/README.md21
-rw-r--r--plugins/macports/macports.plugin.zsh4
-rw-r--r--plugins/man/README.md13
-rw-r--r--plugins/mercurial/mercurial.plugin.zsh1
-rw-r--r--plugins/minikube/README.md9
-rw-r--r--plugins/mix/README.md19
-rw-r--r--plugins/mix/_mix8
-rw-r--r--plugins/mosh/README.md9
-rw-r--r--plugins/mvn/README.md54
-rw-r--r--plugins/mvn/mvn.plugin.zsh549
-rw-r--r--plugins/nanoc/README.md20
-rw-r--r--plugins/nanoc/_nanoc68
-rw-r--r--plugins/nanoc/nanoc.plugin.zsh7
-rw-r--r--plugins/ng/ng.plugin.zsh6
-rw-r--r--plugins/node/README.md16
-rw-r--r--plugins/nvm/README.md9
-rw-r--r--plugins/nyan/README.md5
-rw-r--r--plugins/osx/README.md2
-rw-r--r--plugins/osx/osx.plugin.zsh2
-rw-r--r--plugins/osx/spotify11
-rw-r--r--plugins/otp/otp.plugin.zsh54
-rw-r--r--plugins/pep8/README.md8
-rw-r--r--plugins/per-directory-history/per-directory-history.zsh11
-rw-r--r--plugins/postgres/README.md22
-rw-r--r--plugins/pylint/README.md15
-rw-r--r--plugins/python/README.md16
-rw-r--r--plugins/python/python.plugin.zsh3
-rw-r--r--plugins/rake-fast/rake-fast.plugin.zsh2
-rw-r--r--plugins/react-native/README.md68
-rw-r--r--plugins/react-native/react-native.plugin.zsh17
-rw-r--r--plugins/ripgrep/README.md13
-rw-r--r--plugins/ripgrep/_ripgrep433
-rw-r--r--plugins/ros/README.mkd10
-rw-r--r--plugins/ros/_ros64
-rw-r--r--plugins/rsync/README.md16
-rw-r--r--plugins/ruby/README.md20
-rw-r--r--plugins/sbt/README.md32
-rw-r--r--plugins/scala/README.md15
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh47
-rw-r--r--plugins/stack/README.md9
-rw-r--r--plugins/sublime/sublime.plugin.zsh4
-rw-r--r--plugins/sudo/README.md57
-rw-r--r--plugins/suse/README.md90
-rw-r--r--plugins/suse/suse.plugin.zsh94
-rw-r--r--plugins/svcat/README.md9
-rw-r--r--plugins/svcat/svcat.plugin.zsh6
-rw-r--r--plugins/swiftpm/_swift147
-rw-r--r--plugins/symfony/README.md9
-rw-r--r--plugins/symfony2/README.md28
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh3
-rw-r--r--plugins/systemadmin/README.md51
-rw-r--r--plugins/systemadmin/systemadmin.plugin.zsh34
-rw-r--r--plugins/systemd/README.md53
-rw-r--r--plugins/terraform/terraform.plugin.zsh2
-rw-r--r--plugins/textmate/README.md16
-rw-r--r--plugins/themes/README.md18
-rw-r--r--plugins/themes/themes.plugin.zsh10
-rw-r--r--plugins/timer/README.md17
-rw-r--r--plugins/timer/timer.plugin.zsh29
-rw-r--r--plugins/tmux/README.md39
-rw-r--r--plugins/tmux/tmux.plugin.zsh2
-rw-r--r--plugins/tmuxinator/README.md19
-rw-r--r--plugins/transfer/transfer.plugin.zsh4
-rw-r--r--plugins/ubuntu/README.md52
-rw-r--r--plugins/ubuntu/readme.md21
-rw-r--r--plugins/vagrant/README.md10
-rw-r--r--plugins/vagrant/_vagrant9
-rw-r--r--plugins/vi-mode/vi-mode.plugin.zsh5
-rw-r--r--plugins/virtualenv/README.md15
-rw-r--r--plugins/vscode/README.md4
-rw-r--r--plugins/vscode/vscode.plugin.zsh4
-rw-r--r--plugins/vundle/README.md19
-rw-r--r--plugins/web-search/README.md52
-rw-r--r--plugins/web-search/web-search.plugin.zsh4
-rw-r--r--plugins/wp-cli/wp-cli.plugin.zsh2
-rw-r--r--plugins/yarn/README.md6
-rw-r--r--plugins/yarn/yarn.plugin.zsh6
-rw-r--r--plugins/yum/README.md27
-rw-r--r--plugins/z/z.sh6
-rw-r--r--templates/zshrc.zsh-template4
-rw-r--r--themes/agnoster.zsh-theme23
-rw-r--r--themes/amuse.zsh-theme2
-rw-r--r--themes/avit.zsh-theme2
-rw-r--r--themes/candy-kingdom.zsh-theme2
-rw-r--r--themes/dst.zsh-theme2
-rw-r--r--themes/dstufft.zsh-theme2
-rw-r--r--themes/fino-time.zsh-theme3
-rw-r--r--themes/fino.zsh-theme3
-rw-r--r--themes/gallifrey.zsh-theme9
-rw-r--r--themes/gentoo.zsh-theme2
-rw-r--r--themes/maran.zsh-theme2
-rw-r--r--themes/pygmalion-virtualenv.zsh-theme50
-rw-r--r--themes/tjkirch.zsh-theme2
-rw-r--r--themes/tjkirch_mod.zsh-theme2
-rwxr-xr-xtools/install.sh4
-rw-r--r--tools/upgrade.sh2
204 files changed, 4558 insertions, 711 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
index 7af38f217..4d465b1c3 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2009-2018 Robby Russell and contributors
+Copyright (c) 2009-2019 Robby Russell and contributors
See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/README.md b/README.md
index b3651a99c..511e6aeff 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,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://wiki.github.com/robbyrussell/oh-my-zsh/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/robbyrussell/oh-my-zsh/wiki/Themes) on the wiki. Check them out!
#### Selecting a Theme
@@ -238,7 +238,7 @@ We're on the social media.
## Merchandise
-We have [stickers](https://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](https://shop.planetargon.com/products/ohmyzsh-t-shirts) for you to show off your love of Oh My Zsh. Again, this will help you become the talk of the town!
+We have [stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town!
## License
diff --git a/lib/compfix.zsh b/lib/compfix.zsh
index 68decc1ed..b09b283f2 100644
--- a/lib/compfix.zsh
+++ b/lib/compfix.zsh
@@ -18,7 +18,7 @@ function handle_completion_insecurities() {
insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
# If no such directories exist, get us out of here.
- (( ! ${#insecure_dirs} )) && return
+ [[ -z "${insecure_dirs}" ]] && return
# List ownership and permissions of all insecure directories.
print "[oh-my-zsh] Insecure completion-dependent directories detected:"
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 4ef8920f6..9f8736bd7 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -79,7 +79,7 @@ function try_alias_value() {
# 0 if the variable exists, 3 if it was set
#
function default() {
- test `typeset +m "$1"` && return 0
+ (( $+parameters[$1] )) && return 0
typeset -g "$1"="$2" && return 3
}
@@ -93,8 +93,8 @@ function default() {
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
- env | grep -q "^$1=" && return 0
- export "$1=$2" && return 3
+ (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0
+ export "$1=$2" && return 3
}
diff --git a/lib/misc.zsh b/lib/misc.zsh
index f45c10757..b30822b50 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -23,7 +23,6 @@ env_default 'LESS' '-R'
## super user alias
alias _='sudo'
-alias please='sudo'
## more intelligent acking for ubuntu users
if which ack-grep &> /dev/null; then
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 87d55ee89..aa14f3f07 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -21,7 +21,7 @@ function title {
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
;;
- screen*)
+ screen*|tmux*)
print -Pn "\ek$1:q\e\\" # set screen hardstatus
;;
*)
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index d7c68d35c..e080257c1 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -44,6 +44,7 @@ is_plugin() {
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
+
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
@@ -51,6 +52,8 @@ for plugin ($plugins); do
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
+ else
+ echo "Warning: plugin $plugin not found"
fi
done
@@ -69,14 +72,12 @@ fi
if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
# If completion insecurities exist, warn the user
- if ! compaudit &>/dev/null; then
- handle_completion_insecurities
- fi
+ handle_completion_insecurities
# Load only from secure directories
- compinit -i -d "${ZSH_COMPDUMP}"
+ compinit -i -C -d "${ZSH_COMPDUMP}"
else
# If the user wants it, load from all found directories
- compinit -u -d "${ZSH_COMPDUMP}"
+ compinit -u -C -d "${ZSH_COMPDUMP}"
fi
# Load all of the plugins that were defined in ~/.zshrc
diff --git a/plugins/adb/_adb b/plugins/adb/_adb
index e3c20d751..78c457746 100644
--- a/plugins/adb/_adb
+++ b/plugins/adb/_adb
@@ -49,7 +49,12 @@ _arguments \
case "$state" in
specify_device)
_values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \
- {sub(/ +/," ",$0);gsub(":","\\:",$1); printf "%s[%s] ",$1, $NF}'):-""}
+ {sub(/ +/," ",$0); \
+ gsub(":","\\:",$1); \
+ for(i=1;i<=NF;i++) {
+ if($i ~ /model:/) { split($i,m,":") } \
+ else if($i ~ /product:/) { split($i,p,":") } } \
+ printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""}
return
;;
esac
@@ -59,4 +64,4 @@ if (( CURRENT == 1 )); then
return
fi
-_files \ No newline at end of file
+_files
diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md
new file mode 100644
index 000000000..e0e6a19bb
--- /dev/null
+++ b/plugins/ansible/README.md
@@ -0,0 +1,34 @@
+# ansible plugin
+
+## Introduction
+
+The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
+
+To use it, add `ansible` to the plugins array of your zshrc file:
+
+```
+plugins=(... ansible)
+```
+
+## Aliases
+
+| Command | Description |
+|:-------------------------------------------|:--------------------------------------------------------------------|
+| `ansible-version` / `aver` | Show the version on ansible installed in this host |
+| `ansible-role-init <role name>` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard |
+| `a` | command `ansible` |
+| `aconf` | command `ansible-config` |
+| `acon` | command `ansible-console` |
+| `ainv` | command `ansible-inventory` |
+| `aplaybook` | command `ansible-playbook` |
+| `ainv` | command `ansible-inventory` |
+| `adoc` | command `ansible-doc` |
+| `agal` | command `ansible-galaxy` |
+| `apull` | command `ansible-pull` |
+| `aval` | command `ansible-vault` |
+
+## Maintainer
+
+### [Deepankumar](https://github.com/deepan10)
+
+[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin)
diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh
new file mode 100644
index 000000000..f68ff23a5
--- /dev/null
+++ b/plugins/ansible/ansible.plugin.zsh
@@ -0,0 +1,28 @@
+# Functions
+function ansible-version(){
+ ansible --version
+}
+
+function ansible-role-init(){
+ if ! [ -z $1] ; then
+ echo "Ansible Role : $1 Creating...."
+ ansible-galaxy init $1
+ tree $1
+ else
+ echo "Usage : ansible-role-init <role name>"
+ echo "Example : ansible-role-init role1"
+ fi
+}
+
+# Alias
+alias a='ansible '
+alias aconf='ansible-config '
+alias acon='ansible-console '
+alias aver='ansible-version'
+alias arinit='ansible-role-init'
+alias aplaybook='ansible-playbook '
+alias ainv='ansible-inventory '
+alias adoc='ansible-doc '
+alias agal='ansible-galaxy '
+alias apull='ansible-pull '
+alias aval='ansible-vault' \ No newline at end of file
diff --git a/plugins/ant/README.md b/plugins/ant/README.md
new file mode 100644
index 000000000..5f88984ac
--- /dev/null
+++ b/plugins/ant/README.md
@@ -0,0 +1,12 @@
+# Ant
+
+This plugin provides completion for [Ant](https://ant.apache.org/).
+
+To use it add ant to the plugins array in your zshrc file.
+
+```bash
+plugins=(... ant)
+```
+
+It caches ant targets in a file named `.ant_targets`, you might want to add that to
+your `.gitignore` file.
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index 0d1fdea3a..7ebe8e53d 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -2,6 +2,26 @@
## Features
+#### YAY
+
+| Alias | Command | Description |
+|---------|------------------------------------|---------------------------------------------------------------------|
+| yaconf | yay -Pg | Print current configuration |
+| yain | yay -S | Install packages from the repositories |
+| yains | yay -U | Install a package from a local file |
+| yainsd | yay -S --asdeps | Install packages as dependencies of another package |
+| yaloc | yay -Qi | Display information about a package in the local database |
+| yalocs | yay -Qs | Search for packages in the local database |
+| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") |
+| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist |
+| yaorph | yay -Qtd | Remove orphans using yaourt |
+| yare | yay -R | Remove packages, keeping its settings and dependencies |
+| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies |
+| yarep | yay -Si | Display information about a package in the repositories |
+| yareps | yay -Ss | Search for packages in the repositories |
+| yaupg | yay -Syu | Sync with repositories before upgrading packages |
+| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation |
+
#### TRIZEN
| Alias | Command | Description |
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index ae80eb9f0..e0101c7eb 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -56,6 +56,35 @@ if (( $+commands[yaourt] )); then
fi
fi
+if (( $+commands[yay] )); then
+ alias yaconf='yay -Pg'
+ alias yaupg='yay -Syu'
+ alias yasu='yay -Syu --noconfirm'
+ alias yain='yay -S'
+ alias yains='yay -U'
+ alias yare='yay -R'
+ alias yarem='yay -Rns'
+ alias yarep='yay -Si'
+ alias yareps='yay -Ss'
+ alias yaloc='yay -Qi'
+ alias yalocs='yay -Qs'
+ alias yalst='yay -Qe'
+ alias yaorph='yay -Qtd'
+ alias yainsd='yay -S --asdeps'
+ alias yamir='yay -Syy'
+
+
+ if (( $+commands[abs] && $+commands[aur] )); then
+ alias yaupd='yay -Sy && sudo abs && sudo aur'
+ elif (( $+commands[abs] )); then
+ alias yaupd='yay -Sy && sudo abs'
+ elif (( $+commands[aur] )); then
+ alias yaupd='yay -Sy && sudo aur'
+ else
+ alias yaupd='yay -Sy'
+ fi
+fi
+
if (( $+commands[pacaur] )); then
alias paupg='pacaur -Syu'
alias pasu='pacaur -Syu --noconfirm'
@@ -95,6 +124,10 @@ elif (( $+commands[yaourt] )); then
function upgrade() {
yaourt -Syu
}
+elif (( $+commands[yay] )); then
+ function upgrade() {
+ yay -Syu
+ }
else
function upgrade() {
sudo pacman -Syu
diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
index 75395c718..38b225538 100644
--- a/plugins/asdf/asdf.plugin.zsh
+++ b/plugins/asdf/asdf.plugin.zsh
@@ -1,9 +1,11 @@
# Find where asdf should be installed
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
+ASDF_COMPLETIONS="$ASDF_DIR/completions"
# If not found, check for Homebrew package
-if [[ ! -d $ASDF_DIR ]] && (( $+commands[brew] )); then
+if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
ASDF_DIR="$(brew --prefix asdf)"
+ ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
fi
# Load command
@@ -11,7 +13,7 @@ if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
. "$ASDF_DIR/asdf.sh"
# Load completions
- if [[ -f "$ASDF_DIR/completions/asdf.bash" ]]; then
- . "$ASDF_DIR/completions/asdf.bash"
+ if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then
+ . "$ASDF_COMPLETIONS/asdf.bash"
fi
fi
diff --git a/plugins/autojump/README.md b/plugins/autojump/README.md
new file mode 100644
index 000000000..18ff793cd
--- /dev/null
+++ b/plugins/autojump/README.md
@@ -0,0 +1,11 @@
+# Autojump plugin
+
+This plugin loads the [autojump navigation tool](https://github.com/wting/autojump).
+
+To use it, add `autojump` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... autojump)
+```
+
+More info on the usage: https://github.com/wting/autojump
diff --git a/plugins/autopep8/README.md b/plugins/autopep8/README.md
new file mode 100644
index 000000000..02bbb9af4
--- /dev/null
+++ b/plugins/autopep8/README.md
@@ -0,0 +1,8 @@
+# autopep8 plugin
+
+This plugin adds completion for [autopep8](https://pypi.org/project/autopep8/), a tool that automatically formats Python code to conform to the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide.
+
+To use it, add autopep8 to the plugins array of your zshrc file:
+```
+plugins=(... autopep8)
+```
diff --git a/plugins/autopep8/autopep8.plugin.zsh b/plugins/autopep8/autopep8.plugin.zsh
deleted file mode 100644
index e69de29bb..000000000
--- a/plugins/autopep8/autopep8.plugin.zsh
+++ /dev/null
diff --git a/plugins/aws/README.md b/plugins/aws/README.md
new file mode 100644
index 000000000..a52024128
--- /dev/null
+++ b/plugins/aws/README.md
@@ -0,0 +1,36 @@
+# aws
+
+This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
+and a few utilities to manage AWS profiles and display them in the prompt.
+
+To use it, add `aws` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... aws)
+```
+
+## Plugin commands
+
+* `asp [<profile>]`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
+ It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI.
+ Run `asp` without arguments to clear the profile.
+
+* `agp`: gets the current value of `$AWS_PROFILE`.
+
+* `aws_change_access_key`: changes the AWS access key of a profile.
+
+* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`).
+ Used to provide completion for the `asp` function.
+
+## Plugin options
+
+* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT.
+
+## Theme
+
+The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays
+the current `$AWS_PROFILE`. It uses two variables to control how that is shown:
+
+- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
+
+- ZSH_THEME_AWS_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index 183b0f226..6de329bb8 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -1,51 +1,78 @@
-_homebrew-installed() {
- type brew &> /dev/null
- _xit=$?
- if [ $_xit -eq 0 ];then
- # ok , we have brew installed
- # speculatively we check default brew prefix
- if [ -h /usr/local/opt/awscli ];then
- _brew_prefix="/usr/local/opt/awscli"
- else
- # ok , it is not default prefix
- # this call to brew is expensive ( about 400 ms ), so at least let's make it only once
- _brew_prefix=$(brew --prefix awscli)
- fi
- return 0
- else
- return $_xit
- fi
-}
-
-_awscli-homebrew-installed() {
- [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null
-}
-
-export AWS_HOME=~/.aws
+# AWS profile selection
function agp {
- echo $AWS_DEFAULT_PROFILE
+ echo $AWS_PROFILE
}
function asp {
- local rprompt=${RPROMPT/<aws:$(agp)>/}
-
export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1
+ export AWS_EB_PROFILE=$1
- export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
+ if [[ -z "$1" ]]; then
+ echo AWS profile cleared.
+ fi
+}
+
+function aws_change_access_key {
+ if [[ -z "$1" ]] then
+ echo "usage: $0 <profile>"
+ return 1
+ fi
+
+ echo Insert the credentials when asked.
+ asp "$1"
+ aws iam create-access-key
+ aws configure --profile "$1"
+
+ echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\`
+ echo Your current keys are:
+ aws iam list-access-keys
}
function aws_profiles {
- reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
+ reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
}
-compctl -K aws_profiles asp
+compctl -K aws_profiles asp aws_change_access_key
+
+
+# AWS prompt
+
+function aws_prompt_info() {
+ [[ -z $AWS_PROFILE ]] && return
+ echo "${ZSH_THEME_AWS_PREFIX:=<aws:}${AWS_PROFILE}${ZSH_THEME_AWS_SUFFIX:=>}"
+}
+
+if [ "$SHOW_AWS_PROMPT" != false ]; then
+ export RPROMPT='$(aws_prompt_info)'"$RPROMPT"
+fi
+
+
+# Load awscli completions
+
+_awscli-homebrew-installed() {
+ # check if Homebrew is installed
+ (( $+commands[brew] )) || return 1
+
+ # speculatively check default brew prefix
+ if [ -h /usr/local/opt/awscli ]; then
+ _brew_prefix=/usr/local/opt/awscli
+ else
+ # ok, it is not in the default prefix
+ # this call to brew is expensive (about 400 ms), so at least let's make it only once
+ _brew_prefix=$(brew --prefix awscli)
+ fi
+}
+
+# get aws_zsh_completer.sh location from $PATH
+_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]"
-if which aws_zsh_completer.sh &>/dev/null; then
- _aws_zsh_completer_path=$(which aws_zsh_completer.sh 2>/dev/null)
-elif _homebrew-installed && _awscli-homebrew-installed; then
+# otherwise check if installed via Homebrew
+if [[ -z $_aws_zsh_completer_path ]] && _awscli-homebrew-installed; then
_aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
+else
+ _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh
fi
-[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
-unset _aws_zsh_completer_path
+[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path
+unset _aws_zsh_completer_path _brew_prefix
diff --git a/plugins/battery/README.md b/plugins/battery/README.md
new file mode 100644
index 000000000..b7a13a7ec
--- /dev/null
+++ b/plugins/battery/README.md
@@ -0,0 +1,13 @@
+# Battery Plugin
+
+This plugin adds some functions you can use to display battery information in your custom theme.
+
+To use, add `battery` to the list of plugins in your `.zshrc` file:
+
+`plugins=(... battery)`
+
+Then, add the `battery_pct_prompt` function to your custom theme. For example:
+
+```
+RPROMPT='$(battery_pct_prompt)'
+```
diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh
index 459f5214e..b3a6890b8 100644
--- a/plugins/bgnotify/bgnotify.plugin.zsh
+++ b/plugins/bgnotify/bgnotify.plugin.zsh
@@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle)
elif hash notify-send 2>/dev/null; then #ubuntu gnome!
notify-send "$1" "$2"
elif hash kdialog 2>/dev/null; then #ubuntu kde!
- kdialog -title "$1" --passivepopup "$2" 5
+ kdialog --title "$1" --passivepopup "$2" 5
elif hash notifu 2>/dev/null; then #cygwyn support!
notifu /m "$2" /p "$1"
fi
diff --git a/plugins/bower/README.md b/plugins/bower/README.md
new file mode 100644
index 000000000..743b6a0ea
--- /dev/null
+++ b/plugins/bower/README.md
@@ -0,0 +1,18 @@
+# Bower plugin
+
+This plugin adds completion for [Bower](https://bower.io/) and a few useful aliases for common Bower commands.
+
+To use it, add `bower` to the plugins array in your zshrc file:
+
+```
+plugins=(... bower)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|-----------------|--------------------------------------------------------|
+| bi | `bower install` | Installs the project dependencies listed in bower.json |
+| bl | `bower list` | List local packages and possible updates |
+| bs | `bower search` | Finds all packages or a specific package. |
+
diff --git a/plugins/brew/README.md b/plugins/brew/README.md
new file mode 100644
index 000000000..c129a7652
--- /dev/null
+++ b/plugins/brew/README.md
@@ -0,0 +1,21 @@
+# brew plugin
+
+The plugin adds several aliases for common [brew](https://brew.sh) commands.
+
+To use it, add `brew` to the plugins array of your zshrc file:
+```
+plugins=(... brew)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|--------|----------------------|---------------|
+| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
+| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
+| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
+| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
+| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. |
+| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |
+| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. |
+| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index 60b81f8ec..cfbaa3480 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -4,6 +4,8 @@ alias brewsp='brew list --pinned'
alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'
+alias bcubo='brew update && brew cask outdated'
+alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup'
if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
print -P '%F{yellow}'Oh My Zsh brew plugin:
diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md
new file mode 100644
index 000000000..8cbeaa32e
--- /dev/null
+++ b/plugins/bwana/README.md
@@ -0,0 +1,9 @@
+# Bwana
+
+This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/).
+
+To use it add bwana to the plugins array in your zshrc file.
+
+```bash
+plugins=(... bwana)
+```
diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md
new file mode 100644
index 000000000..b1106c40f
--- /dev/null
+++ b/plugins/cabal/README.md
@@ -0,0 +1,9 @@
+# Cabal
+
+This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It
+also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox.
+
+To use it, add cabal to the plugins array of your zshrc file:
+```
+plugins=(... cabal)
+```
diff --git a/plugins/cake/README.md b/plugins/cake/README.md
new file mode 100644
index 000000000..aad92a3ec
--- /dev/null
+++ b/plugins/cake/README.md
@@ -0,0 +1,15 @@
+# Cake
+
+This plugin provides completion for [CakePHP](https://cakephp.org/).
+
+To use it add cake to the plugins array in your zshrc file.
+
+```bash
+plugins=(... cake)
+```
+
+## Note
+
+This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory.
+It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your
+`.gitignore` files.
diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md
new file mode 100644
index 000000000..335b794fa
--- /dev/null
+++ b/plugins/capistrano/README.md
@@ -0,0 +1,14 @@
+# Capistrano
+
+This plugin provides completion for [Capistrano](https://capistranorb.com/).
+
+To use it add capistrano to the plugins array in your zshrc file.
+
+```bash
+plugins=(... capistrano)
+```
+
+For a working completion use the `capit` command instead of `cap`, because cap is a
+[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module).
+
+`capit` automatically runs cap with bundler if a Gemfile is found.
diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh
index 0b5559791..819572825 100644
--- a/plugins/capistrano/capistrano.plugin.zsh
+++ b/plugins/capistrano/capistrano.plugin.zsh
@@ -1,7 +1,7 @@
-# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work.
+# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
-func capit() {
+function capit() {
if [ -f Gemfile ]
then
bundle exec cap $*
diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md
index 5fa688d21..31bae4efe 100644
--- a/plugins/cargo/README.md
+++ b/plugins/cargo/README.md
@@ -1,6 +1,6 @@
# cargo
-This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo).
+This plugin adds completion for the Rust build tool [`Cargo`](https://github.com/rust-lang/cargo).
To use it, add `cargo` to the plugins array in your zshrc file:
@@ -8,4 +8,4 @@ To use it, add `cargo` to the plugins array in your zshrc file:
plugins=(... cargo)
```
-Updated on October 4th, 2016.
+Updated on March 3rd, 2019, from [Cargo 0.34.0](https://github.com/rust-lang/cargo/releases/tag/0.34.0).
diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md
new file mode 100644
index 000000000..2fc28a1c6
--- /dev/null
+++ b/plugins/catimg/README.md
@@ -0,0 +1,35 @@
+# catimg
+
+Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg)
+
+## Requirements
+
+- `convert` (ImageMagick)
+
+## Enabling the plugin
+
+1. Open your `.zshrc` file and add `catimg` in the plugins section:
+
+ ```zsh
+ plugins=(
+ # all your enabled plugins
+ catimg
+ )
+ ```
+
+2. Reload the source file or restart your Terminal session:
+
+ ```console
+ $ source ~/.zshrc
+ $
+ ```
+
+## Functions
+
+| Function | Description |
+| -------- | ---------------------------------------- |
+| `catimg` | Displays the given image on the terminal |
+
+## Usage examples
+
+[![asciicast](https://asciinema.org/a/204702.png)](https://asciinema.org/a/204702)
diff --git a/plugins/celery/README.md b/plugins/celery/README.md
new file mode 100644
index 000000000..d2597f702
--- /dev/null
+++ b/plugins/celery/README.md
@@ -0,0 +1,9 @@
+# Celery
+
+This plugin provides completion for [Celery](http://www.celeryproject.org/).
+
+To use it add celery to the plugins array in your zshrc file.
+
+```bash
+plugins=(... celery)
+```
diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
index 998d92098..f7fedb5f2 100644
--- a/plugins/chruby/chruby.plugin.zsh
+++ b/plugins/chruby/chruby.plugin.zsh
@@ -111,5 +111,11 @@ function chruby_prompt_info() {
}
# complete on installed rubies
-_chruby() { compadd $(chruby | tr -d '* ') }
+_chruby() {
+ compadd $(chruby | tr -d '* ')
+ local default_path='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
+ if PATH=${default_path} type ruby &> /dev/null; then
+ compadd system
+ fi
+}
compdef _chruby chruby
diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md
new file mode 100644
index 000000000..be7b97e24
--- /dev/null
+++ b/plugins/chucknorris/README.md
@@ -0,0 +1,20 @@
+# chucknorris
+
+Chuck Norris fortunes plugin for oh-my-zsh
+
+**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff)
+
+To use it add `chucknorris` to the plugins array in you zshrc file.
+
+```zsh
+plugins=(... chucknorris)
+```
+
+
+Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD.
+
+
+| Command | Description |
+| ----------- | ------------------------------- |
+| `chuck` | Print random Chuck Norris quote |
+| `chuck_cow` | Print quote in cowthink |
diff --git a/plugins/cloudfoundry/README.md b/plugins/cloudfoundry/README.md
new file mode 100644
index 000000000..89dd9d1ce
--- /dev/null
+++ b/plugins/cloudfoundry/README.md
@@ -0,0 +1,58 @@
+# Cloudfoundry Plugin
+
+This plugin is intended to offer a few simple aliases for regular users of the [Cloud Foundry Cli][1]. Most are just simple aliases that will save a bit of typing. Others include mini functions and or accept parameters. Take a look at the table below for details.
+
+| Alias | Command | Description |
+|----------|-----------------------------|--------------------------------------------------------------------------|
+| cfl | `cf login` | Login to Cloud Foundry |
+| cft | `cf target` | Target the cli at a specific Org/Space in Cloud Foundry |
+| cfa | `cf apps` | List all applications in the current Org/Space |
+| cfs | `cf services` | List all services in the current Org/Space |
+| cfm | `cf marketplace` | List the services available in the Marketplace |
+| cfp | `cf push` | Push your application code to Cloud Foundry |
+| cfcs | `cf create-service` | Create a service based on a Marketplace offering |
+| cfbs | `cf bind-service` | Bind an application to a service you created |
+| cfus | `cf unbind-service` | Unbind a service from an application |
+| cfds | `cf delete-service` | Delete a service you no longer have bound |
+| cfup | `cf cups` | Create a "user-provided-service" |
+| cflg | `cf logs` | Tail the logs of an application (requires <APP_NAME>) |
+| cfr | `cf routes` | List all the routes in the current Space |
+| cfe | `cf env` | Show the environment variables for an application (requires <APP_NAME>) |
+| cfsh | `cf ssh` | Attach to a running container (requires an <APP_NAME> etc.) |
+| cfsc | `cf scale` | Scale an application (requires an <APP_NAME> etc.) |
+| cfev | `cf events` | Show the application events (requires <APP_NAME>) |
+| cfdor | `cf delete-orphaned-routes` | Delete routes that are no longer bound to applications |
+| cfbpk | `cf buildpacks` | List the available buildpacks |
+| cfdm | `cf domains` | List the domains associates with this Cloud Foundry foundation |
+| cfsp | `cf spaces` | List all the Spaces in the current Org |
+| cfap | `cf app` | Show the details of a deployed application (requires <APP_NAME>) |
+| cfh. | `export CF_HOME=$PWD/.cf` | Set the current directory as CF_HOME |
+| cfh~ | `export CF_HOME=~/.cf` | Set the user's root directory as CF_HOME |
+| cfhu | `unset CF_HOME` | Unsets CF_HOME |
+| cfpm | `cf push -f` | Push an application using a manifest (requires <MANIFEST_FILE> location) |
+| cflr | `cf logs --recent` | Show the recent logs (requires <APP_NAME>) |
+| cfsrt | `cf start` | Start an application (requires <APP_NAME>) |
+| cfstp | `cf stop` | Stop an application (requires <APP_NAME>) |
+| cfstg | `cf restage` | Restage an application (requires <APP_NAME>) |
+| cfdel | `cf delete` | Delete an application (requires <APP_NAME>) |
+| cfsrtall | - | Start all apps that are currently in the "Stopped" state |
+| cfstpall | - | Stop all apps that are currently in the "Started" state |
+
+For help and advice on what any of the commands does, consult the built in `cf` help functions as follows:-
+
+```bash
+cf help # List the most popular and commonly used commands
+cf help -a # Complete list of all possible commands
+cf <COMMAND_NAME> --help # Help on a specific command including arguments and examples
+```
+
+Alternatively, seek out the [online documentation][3]. And don't forget, there are loads of great [community plugins for the cf-cli][4] command line tool that can greatly extend its power and usefulness.
+
+## Contributors
+
+Contributed to `oh_my_zsh` by [benwilcock][2].
+
+[1]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
+[2]: https://github.com/benwilcock
+[3]: https://docs.cloudfoundry.org/cf-cli/getting-started.html
+[4]: https://plugins.cloudfoundry.org/
diff --git a/plugins/cloudfoundry/cloudfoundry.plugin.zsh b/plugins/cloudfoundry/cloudfoundry.plugin.zsh
new file mode 100644
index 000000000..b6715787e
--- /dev/null
+++ b/plugins/cloudfoundry/cloudfoundry.plugin.zsh
@@ -0,0 +1,34 @@
+# Some Useful CloudFoundry Aliases & Functions
+alias cfl="cf login"
+alias cft="cf target"
+alias cfa="cf apps"
+alias cfs="cf services"
+alias cfm="cf marketplace"
+alias cfp="cf push"
+alias cfcs="cf create-service"
+alias cfbs="cf bind-service"
+alias cfus="cf unbind-service"
+alias cfds="cf delete-service"
+alias cfup="cf cups"
+alias cflg="cf logs"
+alias cfr="cf routes"
+alias cfe="cf env"
+alias cfsh="cf ssh"
+alias cfsc="cf scale"
+alias cfev="cf events"
+alias cfdor="cf delete-orphaned-routes"
+alias cfbpk="cf buildpacks"
+alias cfdm="cf domains"
+alias cfsp="cf spaces"
+function cfap() { cf app $1 }
+function cfh.() { export CF_HOME=$PWD/.cf }
+function cfh~() { export CF_HOME=~/.cf }
+function cfhu() { unset CF_HOME }
+function cfpm() { cf push -f $1 }
+function cflr() { cf logs $1 --recent }
+function cfsrt() { cf start $1 }
+function cfstp() { cf stop $1 }
+function cfstg() { cf restage $1 }
+function cfdel() { cf delete $1 }
+function cfsrtall() {cf apps | awk '/stopped/ { system("cf start " $1)}'}
+function cfstpall() {cf apps | awk '/started/ { system("cf stop " $1)}'}
diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md
new file mode 100644
index 000000000..c006071f9
--- /dev/null
+++ b/plugins/colorize/README.md
@@ -0,0 +1,18 @@
+# colorize
+
+With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats.
+
+To use it, add colorize to the plugins array of your zshrc file:
+```
+plugins=(... colorize)
+```
+
+## Usage
+
+* `ccat <file> [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.
+
+Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting 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.
+
+## Requirements
+
+You have to install Pygments first: [pygments.org](http://pygments.org/download/)
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index b97dffe43..8eede9a94 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -1,27 +1,26 @@
-# Plugin for highlighting file content
-# Plugin highlights file content based on the filename extension.
-# If no highlighting method supported for given extension then it tries
-# guess it by looking for file content.
-
-#easier alias to use plugin
+# easier alias to use the plugin
alias ccat='colorize_via_pygmentize'
colorize_via_pygmentize() {
- if [ ! -x "$(which pygmentize)" ]; then
- echo "package \'Pygments\' is not installed!"
- return -1
+ if ! (( $+commands[pygmentize] )); then
+ echo "package 'Pygments' is not installed!"
+ return 1
fi
+ # pygmentize stdin if no arguments passed
if [ $# -eq 0 ]; then
- pygmentize -g $@
+ pygmentize -g
+ return $?
fi
+ # guess lexer from file extension, or
+ # guess it from file contents if unsuccessful
+ local FNAME lexer
for FNAME in $@
do
- filename=$(basename "$FNAME")
- lexer=`pygmentize -N \"$filename\"`
- if [ "Z$lexer" != "Ztext" ]; then
- pygmentize -l $lexer "$FNAME"
+ lexer=$(pygmentize -N "$FNAME")
+ if [[ $lexer != text ]]; then
+ pygmentize -l "$lexer" "$FNAME"
else
pygmentize -g "$FNAME"
fi
diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md
new file mode 100644
index 000000000..1cf4ba66e
--- /dev/null
+++ b/plugins/command-not-found/README.md
@@ -0,0 +1,32 @@
+# command-not-found plugin
+
+This plugin uses the command-not-found package for zsh to provide suggested packages to be installed if a command cannot be found.
+
+To use it, add `command-not-found` to the plugins array of your zshrc file:
+
+```zsh
+plugins=(... command-not-found)
+```
+
+An example of how this plugin works in Ubuntu:
+```
+$ mutt
+The program 'mutt' can be found in the following packages:
+ * mutt
+ * mutt-kz
+ * mutt-patched
+Try: sudo apt install <selected package>
+```
+
+### Supported platforms
+
+It works out of the box with the command-not-found packages for:
+
+- [Ubuntu](https://www.porcheron.info/command-not-found-for-zsh/)
+- [Debian](https://packages.debian.org/search?keywords=command-not-found)
+- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found)
+- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found)
+- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound)
+- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found)
+
+You can add support for other platforms by submitting a Pull Request.
diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh
index ba1262de6..dd1186e44 100644
--- a/plugins/command-not-found/command-not-found.plugin.zsh
+++ b/plugins/command-not-found/command-not-found.plugin.zsh
@@ -31,3 +31,10 @@ if type brew &> /dev/null; then
eval "$(brew command-not-found-init)";
fi
fi
+
+# NixOS command-not-found support
+if [ -x /run/current-system/sw/bin/command-not-found ]; then
+ command_not_found_handler () {
+ /run/current-system/sw/bin/command-not-found $@
+ }
+fi
diff --git a/plugins/composer/README.md b/plugins/composer/README.md
new file mode 100644
index 000000000..2b4bae579
--- /dev/null
+++ b/plugins/composer/README.md
@@ -0,0 +1,29 @@
+# composer
+
+This plugin provides completion for [composer](https://getcomposer.org/), as well as aliases
+for frequent composer commands. It also adds Composer's global binaries to the PATH, using
+Composer if available.
+
+To use it add `composer` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... composer)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- |
+| `c` | composer | Starts composer |
+| `csu` | composer self-update | Updates composer to the latest version |
+| `cu` | composer update | Updates composer dependencies and `composer.lock` file |
+| `cr` | composer require | Adds new packages to `composer.json` |
+| `crm` | composer remove | Removes packages from `composer.json` |
+| `ci` | composer install | Resolves and installs dependencies from `composer.json` |
+| `ccp` | composer create-project | Create new project from an existing package |
+| `cdu` | composer dump-autoload | Updates the autoloader |
+| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) |
+| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory |
+| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory |
+| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory |
+| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory |
diff --git a/plugins/cpanm/README.md b/plugins/cpanm/README.md
new file mode 100644
index 000000000..3803e3e00
--- /dev/null
+++ b/plugins/cpanm/README.md
@@ -0,0 +1,9 @@
+# Cpanm
+
+This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)).
+
+To use it add cpanm to the plugins array in your zshrc file.
+
+ ```bash
+plugins=(... cpanm)
+```
diff --git a/plugins/cpanm/_cpanm b/plugins/cpanm/_cpanm
index 58451d35a..ff9ae1c15 100644
--- a/plugins/cpanm/_cpanm
+++ b/plugins/cpanm/_cpanm
@@ -6,9 +6,6 @@
#
# Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011)
#
-# The latest code is always located at:
-# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
-#
local arguments curcontext="$curcontext"
typeset -A opt_args
diff --git a/plugins/debian/README.md b/plugins/debian/README.md
new file mode 100644
index 000000000..a676674dc
--- /dev/null
+++ b/plugins/debian/README.md
@@ -0,0 +1,75 @@
+# debian
+
+This plugin provides debian related zsh aliases.
+To use it add `debian` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... debian)
+```
+
+## Common Aliases
+
+| Alias | Command | Description |
+| -------- | ------------------------------------------------------------------------------|--------------------------------------------------------------------------- |
+| `age` | apt-get | Command line tool for handling packages |
+| `api` | aptitude | Same functionality as `apt-get`, provides extra options while installation |
+| `acs` | apt-cache search | Command line tool for searching apt software package cache |
+| `aps` | aptitude search | Searches installed packages using aptitude |
+| `as` | aptitude -F \"* %p -> %d \n(%v/%V)\" \ -no-gui --disable-columns search | - |
+| `afs` | apt-file search --regexp | Search file in packages |
+| `asrc` | apt-get source | Fetch source packages through `apt-get` |
+| `app` | apt-cache policy | Displays priority of package sources |
+
+## Superuser Operations Aliases
+
+| Alias | Command | Description |
+| -------- | -------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------- |
+| `aac` | sudo $apt_pref autoclean | Clears out the local repository of retrieved package files |
+| `abd` | sudo $apt_pref build-dep | Installs all dependencies for building packages |
+| `ac` | sudo $apt_pref clean | Clears out the local repository of retrieved package files except lock files |
+| `ad` | sudo $apt_pref update | Updates the package lists for upgrades for packages |
+| `adg` | sudo $apt_pref update && sudo $apt_pref $apt_upgr | Update and upgrade packages |
+| `adu` | sudo $apt_pref update && sudo $apt_pref dist-upgrade | Smart upgrade that handles dependencies |
+| `afu` | sudo apt-file update | Update the files in packages |
+| `au` | sudo $apt_pref $apt_upgr | - |
+| `ai` | sudo $apt_pref install | Command-line tool to install package |
+| `ail` | sed -e 's/ */ /g' -e 's/ *//' &#124; cut -s -d ' ' -f 1 &#124; "' xargs sudo $apt_pref install | Install all packages given on the command line while using only the first word of each line |
+| `ap` | sudo $apt_pref purge | Removes packages along with configuration files |
+| `ar` | sudo $apt_pref remove | Removes packages, keeps the configuration files |
+| `ads` | sudo apt-get dselect-upgrade | Installs packages from list and removes all not in the list |
+| `dia` | sudo dpkg -i ./*.deb | Install all .deb files in the current directory |
+| `di` | sudo dpkg -i | Install all .deb files in the current directory |
+| `kclean` | sudo aptitude remove -P ?and(~i~nlinux-(ima&#124;hea) ?not(~n`uname -r`)) | Remove ALL kernel images and headers EXCEPT the one in use |
+
+- `$apt_pref` - Use apt or aptitude if installed, fallback is apt-get.
+- `$apt_upgr` - Use upgrade.
+
+## Aliases - Commands using `su`
+
+| Alias | Command |
+| -------- | ------------------------------------------------------------------------------|
+| `aac` | su -ls \'$apt_pref autoclean\' root |
+| `ac` | su -ls \'$apt_pref clean\' root |
+| `ad` | su -lc \'$apt_pref update\' root |
+| `adg` | su -lc \'$apt_pref update && aptitude $apt_upgr\' root |
+| `adu` | su -lc \'$apt_pref update && aptitude dist-upgrade\' root |
+| `afu` | su -lc "apt-file update |
+| `ag` | su -lc \'$apt_pref $apt_upgr\' root |
+| `dia` | su -lc "dpkg -i ./*.deb" root |
+
+## Miscellaneous Aliases
+
+| Alias | Command | Description |
+| -------- | -------------------------------------------------|---------------------------------------- |
+| `allpkgs`| aptitude search -F "%p" --disable-columns ~i | Display all installed packages |
+| `mydeb` | time dpkg-buildpackage -rfakeroot -us -uc | Create a basic .deb package |
+
+## Functions
+
+| Fucntion | Description |
+|-----------------------|-------------------------------------------------------------------------------|
+| `apt-copy` | Create a simple script that can be used to 'duplicate' a system |
+| `apt-history` | Displays apt history for a command |
+| `kerndeb` | Builds kernel packages |
+| `apt-list-packages` | List packages by size |
+
diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md
new file mode 100644
index 000000000..3ac162f05
--- /dev/null
+++ b/plugins/dircycle/README.md
@@ -0,0 +1,78 @@
+# dircycle
+
+Plugin for cycling through the directory stack
+
+This plugin enables directory navigation similar to using back and forward on browsers or common file explorers like Finder or Nautilus. It uses a small zle trick that lets you cycle through your directory stack left or right using <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> . This is useful when moving back and forth between directories in development environments, and can be thought of as kind of a nondestructive pushd/popd.
+
+## Enabling the plugin
+
+1. Open your `.zshrc` file and add `dircycle` in the plugins section:
+
+ ```zsh
+ plugins=(
+ # all your enabled plugins
+ dircycle
+ )
+ ```
+
+2. Reload the source file or restart your Terminal session:
+
+ ```console
+ $ source ~/.zshrc
+ $
+ ```
+
+## Usage Examples
+
+Say you opened these directories on the terminal:
+
+```console
+~$ cd Projects
+~/Projects$ cd Hacktoberfest
+~/Projects/Hacktoberfest$ cd oh-my-zsh
+~/Projects/Hacktoberfest/oh-my-zsh$ dirs -v
+0 ~/Projects/Hacktoberfest/oh-my-zsh
+1 ~/Projects/Hacktoberfest
+2 ~/Projects
+3 ~
+```
+
+By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
+
+And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
+
+Here's a example history table with the same accessed directories like above:
+
+| Current `$CWD` | Key press | New `$CWD` |
+| --------------- | ----------------------------------------------------- | --------------- |
+| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Hacktoberfest` |
+| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Projects` |
+| `Projects` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `~` |
+| `~` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `Projects` |
+| `Projects` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `Hacktoberfest` |
+| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `oh-my-zsh` |
+| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `~` |
+
+Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`.
+
+Here's an asciinema cast demonstrating the example above:
+
+[![asciicast](https://asciinema.org/a/204406.png)](https://asciinema.org/a/204406)
+
+## Functions
+
+| Function | Description |
+| -------------------- | --------------------------------------------------------------------------------------------------------- |
+| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
+| `insert-cycledright` | Change `$CWD` to the next known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
+
+## Rebinding keys
+
+You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> in `xterm-256color`:
+
+```zsh
+bindkey '^[[1;4D' insert-cycledleft
+bindkey '^[[1;4C' insert-cycledright
+```
+
+You can get the bindkey sequence by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>, then pressing the keyboard shortcut you want to use.
diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
index 8c58cab4c..bb69f6b3f 100644
--- a/plugins/dircycle/dircycle.plugin.zsh
+++ b/plugins/dircycle/dircycle.plugin.zsh
@@ -9,31 +9,36 @@
# pushd -N: start counting from right of `dirs' output
switch-to-dir () {
- [[ ${#dirstack} -eq 0 ]] && return
+ setopt localoptions nopushdminus
+ [[ ${#dirstack} -eq 0 ]] && return 1
while ! builtin pushd -q $1 &>/dev/null; do
# We found a missing directory: pop it out of the dir stack
builtin popd -q $1
# Stop trying if there are no more directories in the dir stack
- [[ ${#dirstack} -eq 0 ]] && break
+ [[ ${#dirstack} -eq 0 ]] && return 1
done
}
insert-cycledleft () {
- emulate -L zsh
- setopt nopushdminus
+ switch-to-dir +1 || return
- switch-to-dir +1
+ local fn
+ for fn (chpwd $chpwd_functions precmd $precmd_functions); do
+ (( $+functions[$fn] )) && $fn
+ done
zle reset-prompt
}
zle -N insert-cycledleft
insert-cycledright () {
- emulate -L zsh
- setopt nopushdminus
+ switch-to-dir -0 || return
- switch-to-dir -0
+ local fn
+ for fn (chpwd $chpwd_functions precmd $precmd_functions); do
+ (( $+functions[$fn] )) && $fn
+ done
zle reset-prompt
}
zle -N insert-cycledright
diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md
new file mode 100644
index 000000000..511f2be17
--- /dev/null
+++ b/plugins/dirhistory/README.md
@@ -0,0 +1,17 @@
+# Dirhistory plugin
+
+This plugin adds keyboard shortcuts for navigating directory history and hierarchy.
+
+To use it, add `dirhistory` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... dirhistory)
+```
+## Keyboard Shortcuts
+
+| Shortcut | Description |
+|-----------------------------------|-----------------------------------------------------------|
+| <kbd>alt</kbd> + <kbd>left</kbd> | Go to previous directory |
+| <kbd>alt</kbd> + <kbd>right</kbd> | Undo <kbd>alt</kbd> + <kbd>left</kbd> |
+| <kbd>alt</kbd> + <kbd>up</kbd> | Move into the parent directory |
+| <kbd>alt</kbd> + <kbd>down</kbd> | Move into the first child directory by alphabetical order |
diff --git a/plugins/dirpersist/README.md b/plugins/dirpersist/README.md
new file mode 100644
index 000000000..9880bc563
--- /dev/null
+++ b/plugins/dirpersist/README.md
@@ -0,0 +1,9 @@
+# Dirpersist plugin
+
+This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file.
+
+To use it, add `dirpersist` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... dirpersist)
+```
diff --git a/plugins/django/README.md b/plugins/django/README.md
new file mode 100644
index 000000000..415f6b7ea
--- /dev/null
+++ b/plugins/django/README.md
@@ -0,0 +1,56 @@
+# Django plugin
+
+This plugin adds completion and hints for the [Django Project](https://www.djangoproject.com/) `manage.py` commands
+and options.
+
+To use it, add `django` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... django)
+```
+
+## Usage
+
+```zsh
+$> python manage.py (press <TAB> here)
+```
+
+Would result in:
+
+```zsh
+cleanup -- remove old data from the database
+compilemessages -- compile .po files to .mo for use with gettext
+createcachetable -- creates table for SQL cache backend
+createsuperuser -- create a superuser
+dbshell -- run command-line client for the current database
+diffsettings -- display differences between the current settings and Django defaults
+dumpdata -- output contents of database as a fixture
+flush -- execute 'sqlflush' on the current database
+inspectdb -- output Django model module for tables in database
+loaddata -- install the named fixture(s) in the database
+makemessages -- pull out all strings marked for translation
+reset -- executes 'sqlreset' for the given app(s)
+runfcgi -- run this project as a fastcgi
+runserver -- start a lightweight web server for development
+...
+```
+
+If you want to see the options available for a specific command, try:
+
+```zsh
+$> python manage.py makemessages (press <TAB> here)
+```
+
+And that would result in:
+
+```zsh
+--all -a -- re-examine all code and templates
+--domain -d -- domain of the message files (default: "django")
+--extensions -e -- file extension(s) to examine (default: ".html")
+--help -- display help information
+--locale -l -- locale to process (default: all)
+--pythonpath -- directory to add to the Python path
+--settings -- python path to settings module
+...
+```
+
diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md
index d3fcb29fe..07a87bc81 100644
--- a/plugins/docker-compose/README.md
+++ b/plugins/docker-compose/README.md
@@ -1,4 +1,29 @@
-# Docker-compose plugin for oh my zsh
+# Docker-compose
-A copy of the completion script from the [docker-compose](https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose) git repo.
+This plugin provides completion for [docker-compose](https://docs.docker.com/compose/) as well as some
+aliases for frequent docker-compose commands.
+To use it, add docker-compose to the plugins array of your zshrc file:
+```
+plugins=(... docker-compose)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-----------|--------------------------|------------------------------------------------------------------|
+| dco | `docker-compose` | Docker-compose main command |
+| dcb | `docker-compose build` | Build containers |
+| dce | `docker-compose exec` | Execute command inside a container |
+| dcps | `docker-compose ps` | List containers |
+| dcrestart | `docker-compose restart` | Restart container |
+| dcrm | `docker-compose rm` | Remove container |
+| dcr | `docker-compose run` | Run a command in container |
+| dcstop | `docker-compose stop` | Stop a container |
+| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service |
+| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon |
+| dcdn | `docker-compose down` | Stop and remove containers |
+| dcl | `docker-compose logs` | Show logs of container |
+| dclf | `docker-compose logs -f` | Show logs and follow output |
+| dcpull | `docker-compose pull` | Pull image of a service |
+| dcstart | `docker-compose start` | Start a container |
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index 31b83c777..54b5e59c5 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -1,6 +1,6 @@
#compdef docker dockerd
#
-# zsh completion for docker (https://docker.com)
+# zsh completion for docker (http://docker.com)
#
# version: 0.3.0
# github: https://github.com/felixr/docker-zsh-completion
@@ -617,6 +617,7 @@ __docker_container_subcommand() {
"($help)*--dns=[Custom DNS servers]:DNS server: "
"($help)*--dns-option=[Custom DNS options]:DNS option: "
"($help)*--dns-search=[Custom DNS search domains]:DNS domains: "
+ "($help)*--domainname=[Container NIS domain name]:domainname:_hosts"
"($help)*"{-e=,--env=}"[Environment variables]:environment variable: "
"($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: "
"($help)*--env-file=[Read environment variables from a file]:environment file:_files"
@@ -2214,7 +2215,7 @@ __docker_stack_subcommand() {
_arguments $(__docker_arguments) \
$opts_help \
"($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \
- "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file]:compose file:_files -g \"*.(yml|yaml)\"" \
+ "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \
"($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \
"($help -):stack:__docker_complete_stacks" && ret=0
;;
@@ -2285,6 +2286,9 @@ __docker_swarm_subcommand() {
$opts_help \
"($help)--advertise-addr=[Advertised address]:ip\:port: " \
"($help)--data-path-addr=[Data path IP or interface]:ip " \
+ "($help)--data-path-port=[Data Path Port]:port " \
+ "($help)--default-addr-pool=[Default address pool]" \
+ "($help)--default-addr-pool-mask-length=[Default address pool subnet mask length]" \
"($help)--autolock[Enable manager autolocking]" \
"($help)--availability=[Availability of the node]:availability:(active drain pause)" \
"($help)--cert-expiry=[Validity period for node certificates]:duration: " \
diff --git a/plugins/doctl/README.md b/plugins/doctl/README.md
new file mode 100644
index 000000000..a81e90b0a
--- /dev/null
+++ b/plugins/doctl/README.md
@@ -0,0 +1,9 @@
+# Doctl
+
+This plugin provides completion for [Doctl](https://github.com/digitalocean/doctl).
+
+To use it add doctl to the plugins array in your zshrc file.
+
+```bash
+plugins=(... doctl)
+```
diff --git a/plugins/emacs/README.md b/plugins/emacs/README.md
new file mode 100644
index 000000000..c8e33b5ab
--- /dev/null
+++ b/plugins/emacs/README.md
@@ -0,0 +1,30 @@
+# Emacs plugin
+
+This plugin utilizes the Emacs daemon capability, allowing the user to quickly open frames, whether they are opened in a terminal via a ssh connection, or X frames opened on the same host. The plugin also provides some aliases for such operations.
+
+- You don't have the cost of starting Emacs all the time anymore
+- Opening a file is as fast as Emacs does not have anything else to do.
+- You can share opened buffered across opened frames.
+- Configuration changes made at runtime are applied to all frames.
+
+**NOTE:** requires Emacs 24 and newer.
+
+To use it, add emacs to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... emacs)
+```
+
+## Aliases
+
+The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that is just a wrapper around [`emacsclient`](https://www.emacswiki.org/emacs/EmacsClient).
+
+| Alias | Command | Description |
+|--------|----------------------------------------------------|----------------------------------------------------------------|
+| emacs | `$EMACS_LAUNCHER --no-wait` | Opens a temporary emacsclient frame |
+| e | `emacs` | Same as emacs alias |
+| te | `$EMACS_LAUNCHER -nw` | Open terminal emacsclient |
+| eeval | `$EMACS_LAUNCHER --eval` | Same as `M-x eval` but from outside Emacs |
+| eframe | `emacsclient --alternate-editor "" --create-frame` | Create new X frame |
+| efile | - | Print the path to the file open in the current buffer |
+| ecd | - | Print the directory of the file open in the the current buffer |
diff --git a/plugins/emoji-clock/README.md b/plugins/emoji-clock/README.md
new file mode 100644
index 000000000..4934f380b
--- /dev/null
+++ b/plugins/emoji-clock/README.md
@@ -0,0 +1,14 @@
+# emoji-clock
+
+The plugin displays current time as an emoji symbol with half hour accuracy.
+
+To use it, add `emoji-clock` to the plugins array of your zshrc file:
+```
+plugins=(... emoji-clock)
+```
+
+## Features
+
+| Function | Description |
+|-------------------|----------------------------------------------------------------------|
+| `emoji-clock` | Displays current time in clock emoji symbol with half hour accuracy |
diff --git a/plugins/encode64/README.md b/plugins/encode64/README.md
new file mode 100644
index 000000000..9850da85f
--- /dev/null
+++ b/plugins/encode64/README.md
@@ -0,0 +1,69 @@
+# encode64
+
+Alias plugin for encoding or decoding using `base64` command
+
+## Functions and Aliases
+
+| Function | Alias | Description |
+| ---------- | ----- | ------------------------------ |
+| `encode64` | `e64` | Encodes given data to base64 |
+| `decode64` | `d64` | Decodes given data from base64 |
+
+## Enabling plugin
+
+1. Edit your `.zshrc` file and add `encode64` to the list of plugins:
+
+ ```sh
+ plugins=(
+ # ...other enabled plugins
+ encode64
+ )
+ ```
+
+2. Restart your terminal session or reload configuration by running:
+
+ ```sh
+ source ~/.zshrc
+ ```
+
+## Usage and examples
+
+### Encoding
+
+- From parameter
+
+ ```console
+ $ encode64 "oh-my-zsh"
+ b2gtbXktenNo
+ $ e64 "oh-my-zsh"
+ b2gtbXktenNo
+ ```
+
+- From piping
+
+ ```console
+ $ echo "oh-my-zsh" | encode64
+ b2gtbXktenNo==
+ $ echo "oh-my-zsh" | e64
+ b2gtbXktenNo==
+ ```
+
+### Decoding
+
+- From parameter
+
+ ```console
+ $ decode64 b2gtbXktenNo
+ oh-my-zsh%
+ $ d64 b2gtbXktenNo
+ oh-my-zsh%
+ ```
+
+- From piping
+
+ ```console
+ $ echo "b2gtbXktenNoCg==" | decode64
+ oh-my-zsh
+ $ echo "b2gtbXktenNoCg==" | decode64
+ oh-my-zsh
+ ```
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index c6bdd36dd..83b878c32 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -19,6 +19,7 @@ plugins=(... extract)
| `7z` | 7zip file |
| `Z` | Z archive (LZW) |
| `apk` | Android app file |
+| `aar` | Android library file |
| `bz2` | Bzip2 file |
| `deb` | Debian package |
| `gz` | Gzip file |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 3baefa339..33d49fcc5 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|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|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 4c72ce870..5e9b9ff24 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -46,7 +46,7 @@ extract() {
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
- (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;;
+ (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
diff --git a/plugins/fabric/README.md b/plugins/fabric/README.md
new file mode 100644
index 000000000..cf0fa81f4
--- /dev/null
+++ b/plugins/fabric/README.md
@@ -0,0 +1,9 @@
+# Fabric
+
+This plugin provides completion for [Fabric](https://www.fabfile.org/).
+
+To use it add fabric to the plugins array in your zshrc file.
+
+```bash
+plugins=(... fabric)
+```
diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh
index aca411329..e69de29bb 100644
--- a/plugins/fabric/fabric.plugin.zsh
+++ b/plugins/fabric/fabric.plugin.zsh
@@ -1 +0,0 @@
-# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete.
diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md
index a7670fa2c..f1b1dfa5c 100644
--- a/plugins/fancy-ctrl-z/README.md
+++ b/plugins/fancy-ctrl-z/README.md
@@ -1,10 +1,10 @@
# Use Ctrl-Z to switch back to Vim
-I frequently need to execute random command in my shell. To achieve it I pause
+I frequently need to execute random commands in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
-The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back
+The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back
to Vim. I could not find a solution, so I developed one on my own that
-works wonderfully with ZSH
+works wonderfully with ZSH.
Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
diff --git a/plugins/fd/README.md b/plugins/fd/README.md
new file mode 100644
index 000000000..aabd624b8
--- /dev/null
+++ b/plugins/fd/README.md
@@ -0,0 +1,13 @@
+# fd
+
+This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
+
+To use it, add `fd` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... fd)
+```
+
+Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0).
+
+Updated on Febrary 13th, 2019.
diff --git a/plugins/fd/_fd b/plugins/fd/_fd
new file mode 100644
index 000000000..7d65c7856
--- /dev/null
+++ b/plugins/fd/_fd
@@ -0,0 +1,83 @@
+#compdef fd
+
+autoload -U is-at-least
+
+_fd() {
+ typeset -A opt_args
+ typeset -a _arguments_options
+ local ret=1
+
+ if is-at-least 5.2; then
+ _arguments_options=(-s -S -C)
+ else
+ _arguments_options=(-s -C)
+ fi
+
+ local context curcontext="$curcontext" state line
+ _arguments "${_arguments_options[@]}" \
+'-d+[Set maximum search depth (default: none)]' \
+'--max-depth=[Set maximum search depth (default: none)]' \
+'--maxdepth=[See --max-depth]' \
+'*-t+[Filter by type: file (f), directory (d), symlink (l),
+executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
+'*--type=[Filter by type: file (f), directory (d), symlink (l),
+executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
+'*-e+[Filter by file extension]' \
+'*--extension=[Filter by file extension]' \
+'-x+[Execute a command for each search result]' \
+'--exec=[Execute a command for each search result]' \
+'(-x --exec)-X+[Execute a command with all search results at once]' \
+'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \
+'*-E+[Exclude entries that match the given glob pattern]' \
+'*--exclude=[Exclude entries that match the given glob pattern]' \
+'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \
+'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \
+'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \
+'-j+[Set number of threads to use for searching & executing]' \
+'--threads=[Set number of threads to use for searching & executing]' \
+'*-S+[Limit results based on the size of files.]' \
+'*--size=[Limit results based on the size of files.]' \
+'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \
+'--changed-within=[Filter by file modification time (newer than)]' \
+'--changed-before=[Filter by file modification time (older than)]' \
+'*--search-path=[(hidden)]' \
+'-H[Search hidden files and directories]' \
+'--hidden[Search hidden files and directories]' \
+'-I[Do not respect .(git|fd)ignore files]' \
+'--no-ignore[Do not respect .(git|fd)ignore files]' \
+'--no-ignore-vcs[Do not respect .gitignore files]' \
+'*-u[Alias for no-ignore and/or hidden]' \
+'-s[Case-sensitive search (default: smart case)]' \
+'--case-sensitive[Case-sensitive search (default: smart case)]' \
+'-i[Case-insensitive search (default: smart case)]' \
+'--ignore-case[Case-insensitive search (default: smart case)]' \
+'-F[Treat the pattern as a literal string]' \
+'--fixed-strings[Treat the pattern as a literal string]' \
+'-a[Show absolute instead of relative paths]' \
+'--absolute-path[Show absolute instead of relative paths]' \
+'-L[Follow symbolic links]' \
+'--follow[Follow symbolic links]' \
+'-p[Search full path (default: file-/dirname only)]' \
+'--full-path[Search full path (default: file-/dirname only)]' \
+'-0[Separate results by the null character]' \
+'--print0[Separate results by the null character]' \
+'--show-errors[Enable display of filesystem errors]' \
+'-h[Prints help information]' \
+'--help[Prints help information]' \
+'-V[Prints version information]' \
+'--version[Prints version information]' \
+'::pattern -- the search pattern, a regular expression (optional):_files' \
+'::path -- the root directory for the filesystem search (optional):_files' \
+&& ret=0
+
+}
+
+(( $+functions[_fd_commands] )) ||
+_fd_commands() {
+ local commands; commands=(
+
+ )
+ _describe -t commands 'fd commands' commands "$@"
+}
+
+_fd "$@"
diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md
new file mode 100644
index 000000000..6594799b3
--- /dev/null
+++ b/plugins/fedora/README.md
@@ -0,0 +1 @@
+The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.
diff --git a/plugins/gem/README.md b/plugins/gem/README.md
new file mode 100644
index 000000000..decd87ba3
--- /dev/null
+++ b/plugins/gem/README.md
@@ -0,0 +1,17 @@
+# Gem plugin
+
+This plugin adds completions and aliases for [Gem](https://rubygems.org/). The completions include the common `gem` subcommands as well as the installed gems in the current directory.
+
+To use it, add `gem` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... gem)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|----------------------|-------------------------------|--------------------------------------------|
+| gemb | `gem build *.gemspec` | Build a gem from a gemspec |
+| gemp | `gem push *.gem` | Push a gem up to the gem server |
+| gemy [gem] [version] | `gem yank [gem] -v [version]` | Remove a pushed gem version from the index |
diff --git a/plugins/git-auto-fetch/README.md b/plugins/git-auto-fetch/README.md
new file mode 100644
index 000000000..35f3c2f71
--- /dev/null
+++ b/plugins/git-auto-fetch/README.md
@@ -0,0 +1,31 @@
+# Git auto-fetch
+
+Automatically fetches all changes from all remotes while you are working in git-initialized directory.
+
+#### Usage
+
+Add `git-auto-fetch` to the plugins array in your zshrc file:
+
+```shell
+plugins=(... git-auto-fetch)
+```
+
+Every time you launch a command in your shell all remotes will be fetched in background.
+By default autofetch will be triggered only if last fetch was done at least 60 seconds ago.
+You can change fetch interval in your .zshrc:
+```
+GIT_AUTO_FETCH_INTERVAL=1200 #in seconds
+```
+Log of `git fetch --all` will be saved into `.git/FETCH_LOG`
+
+
+#### Toggle auto fetch per folder
+If you are using mobile connection or for any other reason you can disable git-auto-fetch for any folder:
+
+```shell
+$ cd to/your/project
+$ git-auto-fetch
+disabled
+$ git-auto-fetch
+enabled
+```
diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
new file mode 100644
index 000000000..1d20bc04b
--- /dev/null
+++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh
@@ -0,0 +1,27 @@
+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` &&
+ [[ ! -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 &>! $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"
+
+ (rm $guard 2>/dev/null &&
+ echo "${fg_bold[green]}enabled${reset_color}") ||
+ (touch $guard &&
+ echo "${fg_bold[red]}disabled${reset_color}")
+}
+
+eval "override-git-auto-fetch-$(declare -f zle-line-init)"
+
+function zle-line-init () {
+ git-fetch-all
+ override-git-auto-fetch-zle-line-init
+}
+zle -N zle-line-init
diff --git a/plugins/git-flow-avh/README.md b/plugins/git-flow-avh/README.md
new file mode 100644
index 000000000..0768d93ea
--- /dev/null
+++ b/plugins/git-flow-avh/README.md
@@ -0,0 +1,19 @@
+# git-flow (AVH Edition) plugin
+
+This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh).
+The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/).
+
+To use it, add `git-flow-avh` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... git-flow-avh)
+```
+
+## Requirements
+
+1. The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow)
+ separately.
+
+2. You have to use zsh's git completion instead of the git project's git completion. This is typically
+ done by default so you don't need to do anything else. If you installed git with Homebrew you
+ might have to uninstall the git completion it's bundled with.
diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh
index db8b5ff89..860ca55c5 100644
--- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh
+++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh
@@ -1,25 +1,3 @@
-#!zsh
-#
-# Installation
-# ------------
-#
-# To achieve git-flow completion nirvana:
-#
-# 0. Update your zsh's git-completion module to the newest version.
-# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git
-#
-# 1. Install this file. Either:
-#
-# a. Place it in your .zshrc:
-#
-# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
-# your .zshrc:
-#
-# source ~/.git-flow-completion.zsh
-#
-# c. Or, use this file as a oh-my-zsh plugin.
-#
-
_git-flow ()
{
local curcontext="$curcontext" state line
diff --git a/plugins/git-hubflow/README.md b/plugins/git-hubflow/README.md
new file mode 100644
index 000000000..dada60d78
--- /dev/null
+++ b/plugins/git-hubflow/README.md
@@ -0,0 +1,24 @@
+# git-hubflow plugin
+
+This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some
+aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the
+original gitflow extension for git.
+
+The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately.
+
+To use it, add `git-hubflow` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... git-hubflow)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|------------------|------------------------------------------------------------------|
+| ghf | `git hf` | Print command overview |
+| ghff | `git hf feature` | Manage your feature branches |
+| ghfr | `git hf release` | Manage your release branches |
+| ghfh | `git hf hotfix` | Manage your hotfix branches |
+| ghfs | `git hf support` | Manage your support branches |
+| ghfu | `git hf update` | Pull upstream changes down into your master and develop branches |
diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh
index 8d968229f..05479f7e6 100644
--- a/plugins/git-hubflow/git-hubflow.plugin.zsh
+++ b/plugins/git-hubflow/git-hubflow.plugin.zsh
@@ -1,25 +1,3 @@
-#!zsh
-#
-# Installation
-# ------------
-#
-# To achieve git-hubflow completion nirvana:
-#
-# 0. Update your zsh's git-completion module to the newest version.
-# From here: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git
-#
-# 1. Install this file. Either:
-#
-# a. Place it in your .zshrc:
-#
-# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in
-# your .zshrc:
-#
-# source ~/.git-hubflow-completion.zsh
-#
-# c. Or, use this file as an oh-my-zsh plugin.
-#
-
alias ghf='git hf'
alias ghff='git hf feature'
alias ghfr='git hf release'
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 45a706173..6fc9b078b 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -112,8 +112,8 @@ ggf() {
git push --force origin "${b:=$1}"
}
ggfl() {
-[[ "$#" != 1 ]] && local b="$(git_current_branch)"
-git push --force-with-lease origin "${b:=$1}"
+ [[ "$#" != 1 ]] && local b="$(git_current_branch)"
+ git push --force-with-lease origin "${b:=$1}"
}
compdef _git ggf=git-checkout
@@ -155,10 +155,10 @@ compdef _git ggu=git-checkout
alias ggpur='ggu'
compdef _git ggpur=git-checkout
-alias ggpull='git pull origin $(git_current_branch)'
+alias ggpull='git pull origin "$(git_current_branch)"'
compdef _git ggpull=git-checkout
-alias ggpush='git push origin $(git_current_branch)'
+alias ggpush='git push origin "$(git_current_branch)"'
compdef _git ggpush=git-checkout
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
@@ -220,12 +220,13 @@ alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset'
alias grhh='git reset --hard'
+alias groh='git reset origin/$(git_current_branch) --hard'
alias grm='git rm'
alias grmc='git rm --cached'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
-alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
+alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
diff --git a/plugins/gitfast/README.md b/plugins/gitfast/README.md
new file mode 100644
index 000000000..c3073709e
--- /dev/null
+++ b/plugins/gitfast/README.md
@@ -0,0 +1,138 @@
+# Gitfast plugin
+
+This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version..
+
+To use it, add `gitfast` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... gitfast)
+```
+
+## Aliases
+
+| Alias | Command |
+| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
+| g | `git` |
+| ga | `git add` |
+| gaa | `git add --all` |
+| gapa | `git add --patch` |
+| gau | `git add --update` |
+| 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` |
+| 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` |
+| gca | `git commit -v -a` |
+| gca! | `git commit -v -a --amend` |
+| gcam | `git commit -a -m` |
+| gcan! | `git commit -v -a --no-edit --amend` |
+| gcans! | `git commit -v -a -s --no-edit --amend` |
+| gcb | `git checkout -b` |
+| gcd | `git checkout develop` |
+| gcf | `git config --list` |
+| gcl | `git clone --recursive` |
+| gclean | `git clean -fd` |
+| gcm | `git checkout master` |
+| gcmsg | `git commit -m` |
+| gcn! | `git commit -v --no-edit --amend` |
+| 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` |
+| gcsm | `git commit -s -m` |
+| gd | `git diff` |
+| gdca | `git diff --cached` |
+| gdct | `` git describe --tags `git rev-list --tags --max-count=1` `` |
+| gdt | `git diff-tree --no-commit-id --name-only -r` |
+| gdw | `git diff --word-diff` |
+| gf | `git fetch` |
+| gfa | `git fetch --all --prune` |
+| gfo | `git fetch origin` |
+| gg | `git gui citool` |
+| gga | `git gui citool --amend` |
+| 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)` |
+| 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` |
+| glgg | `git log --graph` |
+| glgga | `git log --graph --decorate --all` |
+| glgm | `git log --graph --max-count=10` |
+| glgp | `git log --stat -p` |
+| glo | `git log --oneline --decorate` |
+| glog | `git log --oneline --decorate --graph` |
+| gloga | `git log --oneline --decorate --graph --all` |
+| glol | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit` |
+| glola | `git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --all` |
+| glp | `_git_log_prettily` |
+| glum | `git pull upstream master` |
+| 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` |
+| gp | `git push` |
+| gpd | `git push --dry-run` |
+| gpoat | `git push origin --all && git push origin --tags` |
+| gpristine | `git reset --hard && git clean -dfx` |
+| gpsup | `git push --set-upstream origin $(git_current_branch)` |
+| 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` |
+| grbi | `git rebase -i` |
+| grbm | `git rebase master` |
+| grbs | `git rebase --skip` |
+| grh | `git reset HEAD` |
+| grhh | `git reset HEAD --hard` |
+| grmv | `git remote rename` |
+| grrm | `git remote remove` |
+| grset | `git remote set-url` |
+| 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` |
+| 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 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` |
+| gsu | `git submodule update` |
+| gts | `git tag -s` |
+| gtv | `git tag | sort -V` |
+| 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` |
+| 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 -m "--wip-- [skip ci]"` |
diff --git a/plugins/gitignore/README.md b/plugins/gitignore/README.md
new file mode 100644
index 000000000..753dd31fd
--- /dev/null
+++ b/plugins/gitignore/README.md
@@ -0,0 +1,17 @@
+# gitignore
+
+This plugin enables you the use of [gitignore.io](https://www.gitignore.io/) from the command line. You need an active internet connection.
+
+To use it, add `gitignore` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... gitignore)
+```
+
+## Plugin commands
+
+* `gi list`: List all the currently supported gitignore.io templates.
+
+* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files.
+
+* `gi [TEMPLATENAME] >> .gitignore`: Appending programming language settings to your projects .gitignore.
diff --git a/plugins/go/README.md b/plugins/go/README.md
new file mode 100644
index 000000000..6ce6f4ee2
--- /dev/null
+++ b/plugins/go/README.md
@@ -0,0 +1 @@
+The go plugin is deprecated. Use the [golang plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/golang) instead.
diff --git a/plugins/golang/README.md b/plugins/golang/README.md
new file mode 100644
index 000000000..72845b2a1
--- /dev/null
+++ b/plugins/golang/README.md
@@ -0,0 +1,29 @@
+# Golang plugin
+
+This plugin adds completion for the [Go Programming Language](https://golang.org/),
+as well as some aliases for common Golang commands.
+
+To use it, add `golang` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... golang)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| ------- | ----------------------- | ------------------------------------------------------------- |
+| gob | `go build` | Build your code |
+| goc | `go clean` | Removes object files from package source directories |
+| god | `go doc` | Prints documentation comments |
+| gof | `go fmt` | Gofmt formats (aligns and indents) Go programs. |
+| gofa | `go fmt ./...` | Run go fmt for all packages in current directory, recursively |
+| gog | `go get` | Downloads packages and then installs them to $GOPATH |
+| goi | `go install` | Compiles and installs packages to $GOPATH |
+| gol | `go list` | Lists Go packages |
+| gop | `cd $GOPATH` | Takes you to $GOPATH |
+| gopb | `cd $GOPATH/bin` | Takes you to $GOPATH/bin |
+| gops | `cd $GOPATH/src` | Takes you to $GOPATH/src |
+| gor | `go run` | Compiles and runs your code |
+| got | `go test` | Runs tests |
+| gov | `go vet` | Vet examines Go source code and reports suspicious constructs |
diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
index 919c98629..47b10988e 100644
--- a/plugins/golang/golang.plugin.zsh
+++ b/plugins/golang/golang.plugin.zsh
@@ -28,6 +28,7 @@ __go_tool_complete() {
'help[display help]'
'install[compile and install packages and dependencies]'
'list[list packages]'
+ 'mod[modules maintenance]'
'run[compile and run Go program]'
'test[test packages]'
'tool[run specified go tool]'
@@ -83,7 +84,7 @@ __go_tool_complete() {
"-x[print remove commands as it executes them]" \
"*:importpaths:__go_packages"
;;
- fix|fmt|list|vet)
+ fix|fmt|vet)
_alternative ':importpaths:__go_packages' ':files:_path_files -g "*.go"'
;;
install)
@@ -124,8 +125,84 @@ __go_tool_complete() {
"-memprofilerate[set heap profiling rate]:number" \
"*:args:{ _alternative ':importpaths:__go_packages' ':files:_path_files -g \"*.go\"' }"
;;
+ list)
+ _arguments -s -w : \
+ "-f[alternative format for the list]:format" \
+ "-json[print data in json format]" \
+ "-compiled[set CompiledGoFiles to the Go source files presented to the compiler]" \
+ "-deps[iterate over not just the named packages but also all their dependencies]" \
+ "-e[change the handling of erroneous packages]" \
+ "-export[set the Export field to the name of a file containing up-to-date export information for the given package]" \
+ "-find[identify the named packages but not resolve their dependencies]" \
+ "-test[report not only the named packages but also their test binaries]" \
+ "-m[list modules instead of packages]" \
+ "-u[adds information about available upgrades]" \
+ "-versions[set the Module's Versions field to a list of all known versions of that module]:number" \
+ "*:importpaths:__go_packages"
+ ;;
+ mod)
+ typeset -a mod_commands
+ mod_commands+=(
+ 'download[download modules to local cache]'
+ 'edit[edit go.mod from tools or scripts]'
+ 'graph[print module requirement graph]'
+ 'init[initialize new module in current directory]'
+ 'tidy[add missing and remove unused modules]'
+ 'vendor[make vendored copy of dependencies]'
+ 'verify[verify dependencies have expected content]'
+ 'why[explain why packages or modules are needed]'
+ )
+ if (( CURRENT == 3 )); then
+ _values 'go mod commands' ${mod_commands[@]} "help[display help]"
+ return
+ fi
+ case ${words[3]} in
+ help)
+ _values 'go mod commands' ${mod_commands[@]}
+ ;;
+ download)
+ _arguments -s -w : \
+ "-json[print a sequence of JSON objects standard output]" \
+ "*:flags"
+ ;;
+ edit)
+ _arguments -s -w : \
+ "-fmt[reformat the go.mod file]" \
+ "-module[change the module's path]" \
+ "-replace[=old{@v}=new{@v} add a replacement of the given module path and version pair]:name" \
+ "-dropreplace[=old{@v}=new{@v} drop a replacement of the given module path and version pair]:name" \
+ "-go[={version} set the expected Go language version]:number" \
+ "-print[print the final go.mod in its text format]" \
+ "-json[print the final go.mod file in JSON format]" \
+ "*:flags"
+ ;;
+ graph)
+ ;;
+ init)
+ ;;
+ tidy)
+ _arguments -s -w : \
+ "-v[print information about removed modules]" \
+ "*:flags"
+ ;;
+ vendor)
+ _arguments -s -w : \
+ "-v[print the names of vendored]" \
+ "*:flags"
+ ;;
+ verify)
+ ;;
+ why)
+ _arguments -s -w : \
+ "-m[treats the arguments as a list of modules and finds a path to any package in each of the modules]" \
+ "-vendor[exclude tests of dependencies]" \
+ "*:importpaths:__go_packages"
+ ;;
+ esac
+ ;;
help)
_values "${commands[@]}" \
+ 'environment[show Go environment variables available]' \
'gopath[GOPATH environment variable]' \
'packages[description of package lists]' \
'remote[remote import path syntax]' \
@@ -188,6 +265,7 @@ alias gofa='go fmt ./...'
alias gog='go get'
alias goi='go install'
alias gol='go list'
+alias gom='go mod'
alias gop='cd $GOPATH'
alias gopb='cd $GOPATH/bin'
alias gops='cd $GOPATH/src'
diff --git a/plugins/gpg-agent/README.md b/plugins/gpg-agent/README.md
new file mode 100644
index 000000000..a9711f923
--- /dev/null
+++ b/plugins/gpg-agent/README.md
@@ -0,0 +1,8 @@
+# gpg-agent
+
+Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running.
+
+To use it, add gpg-agent to the plugins array of your zshrc file:
+```
+plugins=(... gpg-agent)
+```
diff --git a/plugins/gradle/README.md b/plugins/gradle/README.md
new file mode 100644
index 000000000..215503c81
--- /dev/null
+++ b/plugins/gradle/README.md
@@ -0,0 +1,23 @@
+## Gradle Plugin
+
+This plugin adds completions and aliases for [Gradle](https://gradle.org/).
+
+To use it, add `gradle` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... gradle)
+```
+
+## Usage
+
+This plugin creates an alias `gradle` which is used to determine whether the current working directory has a gradlew file. If gradlew is present it will be used otherwise `gradle` is used directly. Gradle tasks can be executed directly without regard for whether it is `gradle` or `gradlew`
+
+Examples:
+```zsh
+gradle test
+gradle build
+```
+
+## Completion
+
+The completion provided for this plugin caches the parsed tasks into a file named `.gradletasknamecache` in the current working directory, so you might want to add that to your `.gitignore` file so that it's not accidentally committed.
diff --git a/plugins/grails/README.md b/plugins/grails/README.md
new file mode 100644
index 000000000..64b4a9f07
--- /dev/null
+++ b/plugins/grails/README.md
@@ -0,0 +1,71 @@
+# Grails plugin
+
+This plugin adds completion for the [Grails 2 CLI](https://grails.github.io/grails2-doc/2.5.x/guide/commandLine.html)
+
+To use it, add `grails` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... grails)
+```
+
+It looks for scripts in the following paths:
+
+- `$GRAILS_HOME/scripts`
+- `~/.grails/scripts`
+- `./scripts`
+- `./plugins/*/scripts`
+
+## Grails Commands
+- `add-proxy`
+- `alias`
+- `bootstrap`
+- `bug-report`
+- `clean`
+- `clean-all`
+- `clear-proxy`
+- `compile`
+- `console`
+- `create-app`
+- `create-controller`
+- `create-domain-class`
+- `create-filters`
+- `create-integration-test`
+- `create-multi-project-build`
+- `create-plugin`
+- `create-pom`
+- `create-script`
+- `create-service`
+- `create-tag-lib`
+- `create-unit-test`
+- `dependency-report`
+- `doc`
+- `help`
+- `init`
+- `install-app-templates`
+- `install-dependency`
+- `install-plugin`
+- `install-templates`
+- `integrate-with`
+- `interactive`
+- `list-plugin-updates`
+- `list-plugins`
+- `migrate-docs`
+- `package`
+- `package-plugin`
+- `plugin-info`
+- `refresh-dependencies`
+- `remove-proxy`
+- `run-app`
+- `run-script`
+- `run-war`
+- `set-grails-version`
+- `set-proxy`
+- `set-version`
+- `shell`
+- `stats`
+- `stop-app`
+- `test-app`
+- `uninstall-plugin`
+- `url-mappings-report`
+- `war`
+- `wrapper`
diff --git a/plugins/grunt/README.md b/plugins/grunt/README.md
new file mode 100644
index 000000000..a69a9b7fc
--- /dev/null
+++ b/plugins/grunt/README.md
@@ -0,0 +1,37 @@
+# grunt plugin
+
+This plugin adds completions for [grunt](https://github.com/gruntjs/grunt).
+
+To use it, add `grunt` to the plugins array of your `.zshrc` file:
+```zsh
+plugins=(... grunt)
+```
+
+## Enable caching
+
+If you want to use the cache, set the following in your `.zshrc`:
+```zsh
+zstyle ':completion:*' use-cache yes
+```
+
+## Settings
+
+* Show grunt file path:
+ ```zsh
+ zstyle ':completion::complete:grunt::options:' show_grunt_path yes
+ ```
+* Cache expiration days (default: 7):
+ ```zsh
+ zstyle ':completion::complete:grunt::options:' expire 1
+ ```
+* Not update options cache if target gruntfile is changed.
+ ```zsh
+ zstyle ':completion::complete:grunt::options:' no_update_options yes
+ ```
+
+Note that if you change the zstyle settings, you should delete the cache file and restart zsh.
+
+```zsh
+$ rm ~/.zcompcache/grunt
+$ exec zsh
+```
diff --git a/plugins/gulp/README.md b/plugins/gulp/README.md
new file mode 100644
index 000000000..4ed2b99b3
--- /dev/null
+++ b/plugins/gulp/README.md
@@ -0,0 +1,8 @@
+# gulp plugin
+
+This plugin adds autocompletion for your [`gulp`](https://gulpjs.com/) tasks. It grabs all available tasks from the `gulpfile.js` in the current directory.
+
+To use it, add `gulp` to the plugins array of your `.zshrc` file:
+```
+plugins=(... gulp)
+```
diff --git a/plugins/helm/README.md b/plugins/helm/README.md
new file mode 100644
index 000000000..49844c78f
--- /dev/null
+++ b/plugins/helm/README.md
@@ -0,0 +1,9 @@
+# Helm plugin
+
+This plugin adds completion for [Helm](https://helm.sh/), the Kubernetes package manager.
+
+To use it, add `helm` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... helm)
+```
diff --git a/plugins/heroku/README.md b/plugins/heroku/README.md
new file mode 100644
index 000000000..2bf92c9de
--- /dev/null
+++ b/plugins/heroku/README.md
@@ -0,0 +1,9 @@
+# Heroku
+
+This plugin provides completion for the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
+
+To use it add heroku to the plugins array in your zshrc file:
+
+```bash
+plugins=(... heroku)
+```
diff --git a/plugins/homestead/README.md b/plugins/homestead/README.md
new file mode 100644
index 000000000..476302371
--- /dev/null
+++ b/plugins/homestead/README.md
@@ -0,0 +1,9 @@
+# Homestead
+
+This plugin provides completion for [Homestead](https://laravel.com/docs/homestead).
+
+To use it add homestead to the plugins array in your zshrc file.
+
+```bash
+plugins=(... homestead)
+```
diff --git a/plugins/iterm2/README.md b/plugins/iterm2/README.md
new file mode 100644
index 000000000..50cdebf5e
--- /dev/null
+++ b/plugins/iterm2/README.md
@@ -0,0 +1,29 @@
+# iTerm2 plugin
+
+This plugin adds a few functions that are useful when using [iTerm2](https://www.iterm2.com/).
+
+To use it, add _iterm2_ to the plugins array of your zshrc file:
+```
+plugins=(... iterm2)
+```
+
+## Plugin commands
+
+* `_iterm2_command <iterm2-command>`
+ executes an arbitrary iTerm2 command via an escape code sequence.
+ See https://iterm2.com/documentation-escape-codes.html for all supported commands.
+
+* `iterm2_profile <profile-name>`
+ changes the current terminal window's profile (colors, fonts, settings, etc).
+ `profile-name` is the name of another iTerm2 profile. The profile name can contain spaces.
+
+* `iterm2_tab_color <red> <green> <blue>`
+ changes the color of iTerm2's currently active tab.
+ `red`/`green`/`blue` are on the range 0-255.
+
+* `iterm2_tab_color_reset`
+ resets the color of iTerm2's current tab back to default.
+
+## Contributors
+
+- [Aviv Rosenberg](https://github.com/avivrosenberg)
diff --git a/plugins/iwhois/README.md b/plugins/iwhois/README.md
new file mode 100644
index 000000000..1626b8524
--- /dev/null
+++ b/plugins/iwhois/README.md
@@ -0,0 +1,24 @@
+# iwhois
+
+Provides a whois command with a more accurate and up-to-date list of whois servers
+using CNAMES, via [whois.geek.nz](https://github.com/iwantmyname/whois.geek.nz).
+
+To use it, add iwhois to the plugins array of your zshrc file:
+```
+plugins=(... iwhois)
+```
+
+### Usage
+
+The plugin defines the function `iwhois` that takes a domain name as an argument:
+
+```
+$ iwhois github.com
+ Domain Name: GITHUB.COM
+ Registry Domain ID: 1264983250_DOMAIN_COM-VRSN
+ Registrar WHOIS Server: whois.markmonitor.com
+ Registrar URL: http://www.markmonitor.com
+ Updated Date: 2017-06-26T16:02:39Z
+ Creation Date: 2007-10-09T18:20:50Z
+ ...
+```
diff --git a/plugins/iwhois/iwhois.plugin.zsh b/plugins/iwhois/iwhois.plugin.zsh
index 38790bf28..22a75eec1 100644
--- a/plugins/iwhois/iwhois.plugin.zsh
+++ b/plugins/iwhois/iwhois.plugin.zsh
@@ -1,6 +1,3 @@
-# provide a whois command with a more accurate and up to date list of whois
-# servers using CNAMES via whois.geek.nz
-
function iwhois() {
resolver="whois.geek.nz"
tld=`echo ${@: -1} | awk -F "." '{print $NF}'`
diff --git a/plugins/jake-node/README.md b/plugins/jake-node/README.md
new file mode 100644
index 000000000..78ca8d85f
--- /dev/null
+++ b/plugins/jake-node/README.md
@@ -0,0 +1,9 @@
+# Jake
+
+This plugin provides completion for [Jake](http://jakejs.com/).
+
+To use it add jake-node to the plugins array in your zshrc file.
+
+```bash
+plugins=(... jake-node)
+```
diff --git a/plugins/jenv/README.md b/plugins/jenv/README.md
index 8899d21ae..c043c626e 100644
--- a/plugins/jenv/README.md
+++ b/plugins/jenv/README.md
@@ -1,9 +1,9 @@
# jenv plugin
[jenv](https://www.jenv.be/) is a Java version manager similiar to [rbenv](https://github.com/rbenv/rbenv)
-and [pyenv]|(https://github.com/yyuu/pyenv).
+and [pyenv](https://github.com/yyuu/pyenv).
-This plugin initializes jenv and adds provides the jenv_prompt_info function to add Java
+This plugin initializes jenv and provides the `jenv_prompt_info` function to add Java
version information to prompts.
To use, add `jenv` to your plugins array in your zshrc file:
@@ -11,3 +11,17 @@ To use, add `jenv` to your plugins array in your zshrc file:
```zsh
plugins=(... jenv)
```
+
+## Theme example
+
+You can modify your `$PROMPT` or `$RPROMPT` variables to run `jenv_prompt_info`.
+
+For example:
+```
+PROMPT="%~$ "
+RPROMPT='$(jenv_prompt_info)'
+```
+changes your prompt to:
+```
+~/java/project$ ▋ oracle64-1.6.0.39
+```
diff --git a/plugins/jenv/jenv.plugin.zsh b/plugins/jenv/jenv.plugin.zsh
index 14c586be9..2eda8037b 100644
--- a/plugins/jenv/jenv.plugin.zsh
+++ b/plugins/jenv/jenv.plugin.zsh
@@ -1,4 +1,4 @@
-jenvdirs=("$HOME/.jenv" "/usr/local/jenv" "/opt/jenv")
+jenvdirs=("$HOME/.jenv" "/usr/local" "/usr/local/jenv" "/opt/jenv")
FOUND_JENV=0
for jenvdir in $jenvdirs; do
diff --git a/plugins/jump/README.md b/plugins/jump/README.md
new file mode 100644
index 000000000..ed6415289
--- /dev/null
+++ b/plugins/jump/README.md
@@ -0,0 +1,19 @@
+# Jump plugin
+
+This plugin allows to easily jump around the file system by manually adding marks.
+Those marks are stored as symbolic links in the directory `$MARKPATH` (default `$HOME/.marks`)
+
+To use it, add `jump` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... jump)
+```
+
+## Commands
+
+| Command | Description |
+|----------------------|-------------------------------------------------------------------------------------------------|
+| `jump <mark-name>` | Jump to the given mark |
+| `mark [mark-name]` | Create a mark with the given name or with the name of the current directory if none is provided |
+| `unmark <mark-name>` | Remove the given mark |
+| `marks` | List the existing marks and the directories they point to |
diff --git a/plugins/jump/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index 168dfaba2..d161a6da0 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -19,7 +19,7 @@ mark() {
MARK="$1"
fi
if read -q \?"Mark $PWD as ${MARK}? (y/n) "; then
- mkdir -p "$MARKPATH"; ln -s "$PWD" "$MARKPATH/$MARK"
+ mkdir -p "$MARKPATH"; ln -sfn "$PWD" "$MARKPATH/$MARK"
fi
}
@@ -28,11 +28,18 @@ unmark() {
}
marks() {
+ local 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
local markname="$fg[cyan]${link:t}$reset_color"
local markpath="$fg[blue]$(readlink $link)$reset_color"
- printf "%s\t" $markname
- printf -- "-> %s \t\n" $markpath
+ printf -- "$printf_markname_template" "$markname"
+ printf -- "-> %s\n" "$markpath"
done
}
diff --git a/plugins/kate/README.md b/plugins/kate/README.md
new file mode 100644
index 000000000..aa2eaa3cc
--- /dev/null
+++ b/plugins/kate/README.md
@@ -0,0 +1,20 @@
+# Kate plugin
+
+This plugin adds aliases for the [Kate editor](https://kate-editor.org).
+
+To use it, add kate to the plugins array of your zshrc file:
+```
+plugins=(... kate)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|------------------------|---------------------|
+| kate | `kate >/dev/null 2>&1` | Start kate silently |
+
+## Functions
+
+| Function | Description |
+|------------|------------------------------------------|
+| `kt <dir>` | Change to directory and start kate there |
diff --git a/plugins/keychain/README.md b/plugins/keychain/README.md
new file mode 100644
index 000000000..c603f6790
--- /dev/null
+++ b/plugins/keychain/README.md
@@ -0,0 +1,45 @@
+# keychain plugin
+
+This plugin starts automatically [`keychain`](https://www.funtoo.org/Keychain)
+to set up and load whichever credentials you want for both gpg and ssh
+connections.
+
+To enable it, add `keychain` to your plugins:
+
+```zsh
+plugins=(... keychain)
+```
+
+**NOTE**: It is HIGHLY recommended to also enable the `gpg-agent` plugin.
+
+## Instructions
+
+**IMPORTANT: put these settings _before_ the line that sources oh-my-zsh**
+
+**To adjust the agents** that keychain manages, use the `agents` style as
+shown below. By default, only the `gpg` agent is managed.
+
+```zsh
+zstyle :omz:plugins:keychain agents gpg,ssh
+```
+
+To **load multiple identities** use the `identities` style, For example:
+
+```zsh
+zstyle :omz:plugins:keychain identities id_ed25519 id_github 2C5879C2
+```
+
+**To pass additional options** to the `keychain` program, use the
+`options` style; for example:
+
+```zsh
+zstyle :omz:plugins:keychain options --quiet
+```
+
+## Credits
+
+Based on code from the `ssh-agent` plugin.
+
+## References
+
+- [Keychain](https://www.funtoo.org/Keychain)
diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh
new file mode 100644
index 000000000..af34793e7
--- /dev/null
+++ b/plugins/keychain/keychain.plugin.zsh
@@ -0,0 +1,32 @@
+function _start_agent() {
+ local agents
+ local -a identities
+ local -a options
+ local _keychain_env_sh
+ local _keychain_env_sh_gpg
+
+ # load agents to start.
+ zstyle -s :omz:plugins:keychain agents agents
+
+ # load identities to manage.
+ zstyle -a :omz:plugins:keychain identities identities
+
+ # load additional options
+ zstyle -a :omz:plugins:keychain options options
+
+ # start keychain...
+ keychain ${^options:-} --agents ${agents:-gpg} ${^identities}
+
+ # Get the filenames to store/lookup the environment from
+ _keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh"
+ _keychain_env_sh_gpg="$HOME/.keychain/$SHORT_HOST-sh-gpg"
+
+ # Source environment settings.
+ [ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh"
+ [ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg"
+}
+
+_start_agent
+
+# tidy up after ourselves
+unfunction _start_agent
diff --git a/plugins/kitchen/README.md b/plugins/kitchen/README.md
new file mode 100644
index 000000000..89a6d7002
--- /dev/null
+++ b/plugins/kitchen/README.md
@@ -0,0 +1,9 @@
+# kitchen plugin
+
+This plugin adds completion support for the [Test Kitchen](https://kitchen.ci).
+
+To use it, add `kitchen` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... kitchen)
+```
diff --git a/plugins/kops/README.md b/plugins/kops/README.md
new file mode 100644
index 000000000..5d9b5f8d6
--- /dev/null
+++ b/plugins/kops/README.md
@@ -0,0 +1,12 @@
+# kops
+
+This plugin provides completion for [kops](https://github.com/kubernetes/kops) (Kubernetes Operations),
+the command line interface to get a production grade Kubernetes cluster up and running.
+
+To use it, add `kops` to the plugins array in your zshrc file.
+
+```
+plugins=(... kops)
+```
+
+**Author:** [@nmrony](https://github.com/nmrony)
diff --git a/plugins/kops/kops.plugin.zsh b/plugins/kops/kops.plugin.zsh
index f707f3aff..0c38ce2df 100644
--- a/plugins/kops/kops.plugin.zsh
+++ b/plugins/kops/kops.plugin.zsh
@@ -1,9 +1,3 @@
-# Autocompletion for kops (Kubernetes Operations),
-# the command line interface to get a production grade
-# Kubernetes cluster up and running
-
-# Author: https://github.com/nmrony
-
if [ $commands[kops] ]; then
source <(kops completion zsh)
fi
diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md
new file mode 100644
index 000000000..3343f0195
--- /dev/null
+++ b/plugins/kubectl/README.md
@@ -0,0 +1,91 @@
+# Kubectl plugin
+
+This plugin adds completion for the [Kubernetes cluster manager](https://kubernetes.io/docs/reference/kubectl/kubectl/),
+as well as some aliases for common kubectl commands.
+
+To use it, add `kubectl` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... kubectl)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------|
+| k | `kubectl` | The kubectl command |
+| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
+| kaf | `kubectl apply -f` | Apply a YML file |
+| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
+| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
+| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
+| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig |
+| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig |
+| kccc | `kubectl config current-context` | Display the current-context |
+| | | **General aliases** |
+| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
+| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
+| | | **Pod management** |
+| kgp | `kubectl get pods` | List all pods in ps output format |
+| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes |
+| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included |
+| kep | `kubectl edit pods` | Edit pods from the default editor |
+| kdp | `kubectl describe pods` | Describe all pods |
+| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
+| kgpl | `kgp -l` | Get pod by label. Example: `kgpl "app=myapp" -n myns` |
+| | | **Service management** |
+| kgs | `kubectl get svc` | List all services in ps output format |
+| kgsw | `kgs --watch` | After listing all services, watch for changes |
+| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information |
+| kes | `kubectl edit svc` | Edit services(svc) from the default editor |
+| kds | `kubectl describe svc` | Describe all services in detail |
+| kdels | `kubectl delete svc` | Delete all services matching passed argument |
+| | | **Ingress management** |
+| kgi | `kubectl get ingress` | List ingress resources in ps output format |
+| kei | `kubectl edit ingress` | Edit ingress resource from the default editor |
+| kdi | `kubectl describe ingress` | Describe ingress resource in detail |
+| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument |
+| | | **Namespace management** |
+| kgns | `kubectl get namespaces` | List the current namespaces in a cluster |
+| kcn | `kubectl config set-context ...` | Change current namespace |
+| kens | `kubectl edit namespace` | Edit namespace resource from the default editor |
+| kdns | `kubectl describe namespace` | Describe namespace resource in detail |
+| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace |
+| | | **ConfigMap management** |
+| kgcm | `kubectl get configmaps` | List the configmaps in ps output format |
+| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor |
+| kdcm | `kubectl describe configmap` | Describe configmap resource in detail |
+| kdelcm | `kubectl delete configmap` | Delete the configmap |
+| | | **Secret management** |
+| kgsec | `kubectl get secret` | Get secret for decoding |
+| kdsec | `kubectl describe secret` | Describe secret resource in detail |
+| kdelsec | `kubectl delete secret` | Delete the secret |
+| | | **Deployment management** |
+| kgd | `kubectl get deployment` | Get the deployment |
+| kgdw | `kgd --watch` | After getting the deployment, watch for changes |
+| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information |
+| ked | `kubectl edit deployment` | Edit deployment resource from the default editor |
+| kdd | `kubectl describe deployment` | Describe deployment resource in detail |
+| kdeld | `kubectl delete deployment` | Delete the deployment |
+| ksd | `kubectl scale deployment` | Scale a deployment |
+| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment |
+| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime |
+| | | **Rollout management** |
+| kgrs | `kubectl get rs` | To see the ReplicaSet `rs` created by the deployment |
+| krh | `kubectl rollout history` | Check the revisions of this deployment |
+| kru | `kubectl rollout undo` | Rollback to the previous revision |
+| | | **Port forwarding** |
+| kpf | `kubectl port-forward` | Forward one or more local ports to a pod |
+| | | **Tools for accessing all information** |
+| kga | `kubectl get all` | List all resources in ps format |
+| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
+| | | **Logs** |
+| kl | `kubectl logs` | Print the logs for a container or resource |
+| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
+| | | **File copy** |
+| kcp | `kubectl cp` | Copy files and directories to and from containers |
+| | | **Node management** |
+| kgno | `kubectl get nodes` | List the nodes in ps output format |
+| keno | `kubectl edit node` | Edit nodes resource from the default editor |
+| kdno | `kubectl describe node` | Describe node resource in detail |
+| kdelno | `kubectl delete node` | Delete the node |
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 680ec1a8c..ab7a1a0a4 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -13,6 +13,9 @@ fi
# This command is used a LOT both below and in daily life
alias k=kubectl
+# Execute a kubectl command against all namespaces
+alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f'
+
# Apply a YML file
alias kaf='kubectl apply -f'
@@ -25,17 +28,25 @@ alias kcsc='kubectl config set-context'
alias kcdc='kubectl config delete-context'
alias kccc='kubectl config current-context'
+# General aliases
+alias kdel='kubectl delete'
+alias kdelf='kubectl delete -f'
+
# Pod management.
alias kgp='kubectl get pods'
+alias kgpw='kgp --watch'
+alias kgpwide='kgp -o wide'
alias kep='kubectl edit pods'
alias kdp='kubectl describe pods'
alias kdelp='kubectl delete pods'
# get pod by label: kgpl "app=myapp" -n myns
-alias kgpl='function _kgpl(){ label=$1; shift; kgp -l $label $*; };_kgpl'
+alias kgpl='kgp -l'
# Service management.
alias kgs='kubectl get svc'
+alias kgsw='kgs --watch'
+alias kgswide='kgs -o wide'
alias kes='kubectl edit svc'
alias kds='kubectl describe svc'
alias kdels='kubectl delete svc'
@@ -46,6 +57,19 @@ alias kei='kubectl edit ingress'
alias kdi='kubectl describe ingress'
alias kdeli='kubectl delete ingress'
+# Namespace management
+alias kgns='kubectl get namespaces'
+alias kens='kubectl edit namespace'
+alias kdns='kubectl describe namespace'
+alias kdelns='kubectl delete namespace'
+alias kcn='kubectl config set-context $(kubectl config current-context) --namespace'
+
+# ConfigMap management
+alias kgcm='kubectl get configmaps'
+alias kecm='kubectl edit configmap'
+alias kdcm='kubectl describe configmap'
+alias kdelcm='kubectl delete configmap'
+
# Secret management
alias kgsec='kubectl get secret'
alias kdsec='kubectl describe secret'
@@ -53,11 +77,16 @@ alias kdelsec='kubectl delete secret'
# Deployment management.
alias kgd='kubectl get deployment'
+alias kgdw='kgd --watch'
+alias kgdwide='kgd -o wide'
alias ked='kubectl edit deployment'
alias kdd='kubectl describe deployment'
alias kdeld='kubectl delete deployment'
alias ksd='kubectl scale deployment'
alias krsd='kubectl rollout status deployment'
+kres(){
+ kubectl set env $@ REFRESHED_AT=$(date +%Y%m%d%H%M%S)
+}
# Rollout management.
alias kgrs='kubectl get rs'
@@ -65,7 +94,11 @@ alias krh='kubectl rollout history'
alias kru='kubectl rollout undo'
# Port forwarding
-alias kpf="k port-forward"
+alias kpf="kubectl port-forward"
+
+# Tools for accessing all information
+alias kga='kubectl get all'
+alias kgaa='kubectl get all --all-namespaces'
# Logs
alias kl='kubectl logs'
@@ -78,4 +111,4 @@ alias kcp='kubectl cp'
alias kgno='kubectl get nodes'
alias keno='kubectl edit node'
alias kdno='kubectl describe node'
-alias kdelno='kubectl delete node' \ No newline at end of file
+alias kdelno='kubectl delete node'
diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md
new file mode 100644
index 000000000..44798b68d
--- /dev/null
+++ b/plugins/laravel/README.md
@@ -0,0 +1,40 @@
+# Laravel
+
+This plugin adds aliases and autocompletion for Laravel [Artisan](https://laravel.com/docs/artisan) and [Bob](http://daylerees.github.io/laravel-bob/) command-line interfaces.
+
+```
+plugins=(... laravel)
+```
+
+| Alias | Description |
+|:-:|:-:|
+| `artisan` | `php artisan` |
+| `pas` | `php artisan serve` |
+
+## Database
+
+| Alias | Description |
+|:-:|:-:|
+| `pam` | `php artisan migrate` |
+| `pamf` | `php artisan migrate:fresh` |
+| `pamfs` | `php artisan migrate:fresh --seed` |
+| `pamr` | `php artisan migrate:rollback` |
+| `pads` | `php artisan db:seed` |
+
+## Makers
+
+| Alias | Description |
+|:-:|:-:|
+| `pamm` | `php artisan make:model` |
+| `pamc` | `php artisan make:controller` |
+| `pams` | `php artisan make:seeder` |
+| `pamt` | `php artisan make:test` |
+
+## Clears
+
+| Alias | Description |
+|:-:|:-:|
+| `pacac` | `php artisan cache:clear` |
+| `pacoc` | `php artisan config:clear` |
+| `pavic` | `php artisan view:clear` |
+| `paroc` | `php artisan route:clear` |
diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh
index ed932ee89..7ddfd85ba 100644
--- a/plugins/laravel/laravel.plugin.zsh
+++ b/plugins/laravel/laravel.plugin.zsh
@@ -1,3 +1,26 @@
#!zsh
alias artisan='php artisan'
alias bob='php artisan bob::build'
+
+# Development
+alias pas='php artisan serve'
+
+# Database
+alias pam='php artisan migrate'
+alias pamf='php artisan migrate:fresh'
+alias pamfs='php artisan migrate:fresh --seed'
+alias pamr='php artisan migrate:rollback'
+alias pads='php artisan db:seed'
+
+# Makers
+alias pamm='php artisan make:model'
+alias pamc='php artisan make:controller'
+alias pams='php artisan make:seeder'
+alias pamt='php artisan make:test'
+
+
+# Clears
+alias pacac='php artisan cache:clear'
+alias pacoc='php artisan config:clear'
+alias pavic='php artisan view:clear'
+alias paroc='php artisan route:clear'
diff --git a/plugins/laravel4/README.md b/plugins/laravel4/README.md
new file mode 100644
index 000000000..c945601f7
--- /dev/null
+++ b/plugins/laravel4/README.md
@@ -0,0 +1,18 @@
+# Laravel 4 plugin
+
+This plugin adds some aliases for common [Laravel 4](https://laravel.com/docs/4.2) commands.
+
+To use it, add `laravel4` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... laravel4)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-----------|-------------------------------------------|-------------------------------------------------------------|
+| la4 | `php artisan` | Main Artisan command |
+| la4dump | `php artisan dump-autoload` | Regenerate framework autoload files |
+| la4cache | `php artisan cache:clear` | Flush the application cache |
+| la4routes | `php artisan routes` | List all registered routes |
diff --git a/plugins/laravel5/README.md b/plugins/laravel5/README.md
new file mode 100644
index 000000000..933342a9e
--- /dev/null
+++ b/plugins/laravel5/README.md
@@ -0,0 +1,18 @@
+# Laravel 5 plugin
+
+This plugin adds some aliases for common [Laravel 5](https://laravel.com/docs) commands.
+
+To use it, add `laravel5` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... laravel5)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-----------|------------------------------|----------------------------------------------------|
+| la5 | `php artisan` | Main Artisan command |
+| la5cache | `php artisan cache:clear` | Flush the application cache |
+| la5routes | `php artisan route:list` | List all registered routes |
+| la5vendor | `php artisan vendor:publish` | Publish any publishable assets from vendor package |
diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md
new file mode 100644
index 000000000..0db29b4e5
--- /dev/null
+++ b/plugins/lighthouse/README.md
@@ -0,0 +1,26 @@
+# Lighthouse plugin
+
+This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/).
+
+To use it, add `lighthouse` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... lighthouse)
+```
+
+## Commands
+
+* `open_lighthouse_ticket <issue>` (alias: `lho`):
+
+ Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url`
+ file in your directory with the URL to the individual project.
+
+ Example:
+ ```zsh
+ $ cat .lighthouse-url
+ https://rails.lighthouseapp.com/projects/8994
+
+ $ lho 23
+ Opening ticket #23
+ # The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23
+ ```
diff --git a/plugins/lighthouse/lighthouse.plugin.zsh b/plugins/lighthouse/lighthouse.plugin.zsh
index 4a47b6010..3fca2bf4f 100644
--- a/plugins/lighthouse/lighthouse.plugin.zsh
+++ b/plugins/lighthouse/lighthouse.plugin.zsh
@@ -1,16 +1,12 @@
-# To use: add a .lighthouse file into your directory with the URL to the
-# individual project. For example:
-# https://rails.lighthouseapp.com/projects/8994
-# Example usage: https://screencast.com/t/ZDgwNDUwNT
open_lighthouse_ticket () {
if [ ! -f .lighthouse-url ]; then
echo "There is no .lighthouse-url file in the current directory..."
- return 0;
- else
- lighthouse_url=$(cat .lighthouse-url);
- echo "Opening ticket #$1";
- open_command "$lighthouse_url/tickets/$1";
+ return 0
fi
+
+ lighthouse_url=$(cat .lighthouse-url)
+ echo "Opening ticket #$1"
+ open_command "$lighthouse_url/tickets/$1"
}
alias lho='open_lighthouse_ticket'
diff --git a/plugins/lol/README.md b/plugins/lol/README.md
new file mode 100644
index 000000000..b0e54f575
--- /dev/null
+++ b/plugins/lol/README.md
@@ -0,0 +1,83 @@
+# lol
+
+Plugin for adding catspeak aliases, because why not
+
+## Enabling the plugin
+
+1. Open your `.zshrc` file and add `lol` in the plugins section:
+
+ ```zsh
+ plugins=(
+ # all your enabled plugins
+ lol
+ )
+ ```
+
+2. Reload the source file or restart your Terminal session:
+
+ ```console
+ $ source ~/.zshrc
+ $
+ ```
+
+## Aliases
+
+| Alias | Command |
+| ------------ | ---------------------------------------------------------------- |
+| `:3` | `echo` |
+| `alwayz` | `tail -f` |
+| `bringz` | `git pull` |
+| `btw` | `nice` |
+| `byes` | `exit` |
+| `chicken` | `git add` |
+| `cya` | `reboot` |
+| `donotwant` | `rm` |
+| `dowant` | `cp` |
+| `gimmeh` | `touch` |
+| `gtfo` | `mv` |
+| `hackzor` | `git init` |
+| `hai` | `cd` |
+| `icanhas` | `mkdir` |
+| `ihasbucket` | `df -h` |
+| `iminurbase` | `finger` |
+| `inur` | `locate` |
+| `invisible` | `cat` |
+| `iz` | `ls` |
+| `kthxbai` | `halt` |
+| `letcat` | `git checkout` |
+| `moar` | `more` |
+| `nomnom` | `killall` |
+| `nomz` | `ps aux` |
+| `nowai` | `chmod` |
+| `oanward` | `git commit -m` |
+| `obtw` | `nohup` |
+| `onoz` | `cat /var/log/errors.log` |
+| `ooanward` | `git commit -am` |
+| `plz` | `pwd` |
+| `pwned` | `ssh` |
+| `rtfm` | `man` |
+| `rulz` | `git push` |
+| `tldr` | `less` |
+| `violenz` | `git rebase` |
+| `visible` | `echo` |
+| `wtf` | `dmesg` |
+| `yolo` | `git commit -m "$(curl -s https://whatthecommit.com/index.txt)"` |
+
+## Usage Examples
+
+```sh
+# mkdir new-directory
+icanhas new-directory
+
+# killall firefox
+nomnom firefox
+
+# chmod u=r,go= some.file
+nowai u=r,go= some.file
+
+# ssh root@catserver.org
+pwned root@catserver.org
+
+# git commit -m "$(curl -s https://whatthecommit.com/index.txt)"
+yolo
+```
diff --git a/plugins/macports/README.md b/plugins/macports/README.md
new file mode 100644
index 000000000..ded823f3f
--- /dev/null
+++ b/plugins/macports/README.md
@@ -0,0 +1,21 @@
+# Macports plugin
+
+This plugin adds completion for the package manager [Macports](https://macports.com/),
+as well as some aliases for common Macports commands.
+
+To use it, add `macports` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... macports)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|------------------------------------|--------------------------------------------------------------|
+| pc | `sudo port clean --all installed` | Clean up intermediate installation files for installed ports |
+| pi | `sudo port install` | Install package given as argument |
+| psu | `sudo port selfupdate` | Update ports tree with MacPorts repository |
+| puni | `sudo port uninstall inactive` | Uninstall inactive ports |
+| puo | `sudo port upgrade outdated` | Upgrade ports with newer versions available |
+| pup | `psu && puo` | Update ports tree, then upgrade ports to newest versions |
diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh
index 277352e32..d1fde30d4 100644
--- a/plugins/macports/macports.plugin.zsh
+++ b/plugins/macports/macports.plugin.zsh
@@ -1,8 +1,6 @@
-#Aliases
alias pc="sudo port clean --all installed"
-alias pi="sudo port install $1"
+alias pi="sudo port install"
alias psu="sudo port selfupdate"
alias puni="sudo port uninstall inactive"
alias puo="sudo port upgrade outdated"
alias pup="psu && puo"
-
diff --git a/plugins/man/README.md b/plugins/man/README.md
new file mode 100644
index 000000000..4601252c0
--- /dev/null
+++ b/plugins/man/README.md
@@ -0,0 +1,13 @@
+# Man plugin
+
+This plugin adds a shortcut to insert man before the previous command.
+
+To use it, add `man` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... man)
+```
+# Keyboard Shortcuts
+| Shortcut | Description |
+|-----------------------------------|------------------------------------------------------------------------|
+| <kbd>Esc</kbd> + man | add man before the previous command to see the manual for this command |
diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
index 3ae59496e..58bc571a0 100644
--- a/plugins/mercurial/mercurial.plugin.zsh
+++ b/plugins/mercurial/mercurial.plugin.zsh
@@ -1,4 +1,5 @@
# Mercurial
+alias hga='hg add'
alias hgc='hg commit'
alias hgb='hg branch'
alias hgba='hg branches'
diff --git a/plugins/minikube/README.md b/plugins/minikube/README.md
new file mode 100644
index 000000000..eb2dd9b46
--- /dev/null
+++ b/plugins/minikube/README.md
@@ -0,0 +1,9 @@
+# minikube
+
+This plugin provides completion for [minikube](https://github.com/kubernetes/minikube).
+
+To use it, add `minikube` to the plugins array in your zshrc file.
+
+```
+plugins=(... minikube)
+```
diff --git a/plugins/mix/README.md b/plugins/mix/README.md
new file mode 100644
index 000000000..878f370f2
--- /dev/null
+++ b/plugins/mix/README.md
@@ -0,0 +1,19 @@
+# Mix plugin
+
+This plugin adds completions for the [Elixir's Mix build tool](https://hexdocs.pm/mix/Mix.html).
+
+To use it, add `mix` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... mix)
+```
+## Supported Task Types
+
+| Task Type | Documentation |
+|-------------------------|----------------------------------------------------------|
+| Elixir | [Elixir Lang](https://elixir-lang.org/) |
+| Phoenix v1.2.1 and below| [Phoenix](https://hexdocs.pm/phoenix/1.2.1/Phoenix.html) |
+| Phoenix v1.3.0 and above| [Phoenix](https://hexdocs.pm/phoenix/Phoenix.html) |
+| Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) |
+| Hex | [Hex](https://hex.pm/) |
+| Nerves | [Nerves](https://nerves-project.org/) |
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index ecbe7e2d3..61fa1cf25 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -31,6 +31,9 @@ _1st_arguments=(
'ecto.migrations:Displays the up / down migration status'
'ecto.rollback:Reverts applied migrations'
'escript.build:Builds an escript for the project'
+ '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'
'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
@@ -48,6 +51,11 @@ _1st_arguments=(
'local.phoenix:Updates Phoenix locally'
'local.phx:Updates the Phoenix project generator locally'
'local.rebar:Install rebar locally'
+ 'nerves.artifact:Create an artifact for a specified Nerves package'
+ 'nerves.artifact.get:Nerves get artifacts'
+ 'nerves.info:Prints Nerves system information'
+ 'nerves.new:Create a new Nerves application'
+ 'nerves.release.init:Prepare a new Nerves project for use with releases'
'new:Create a new Elixir project'
'phoenix.digest:Digests and compress static files'
'phoenix.gen.channel:Generates a Phoenix channel'
diff --git a/plugins/mosh/README.md b/plugins/mosh/README.md
new file mode 100644
index 000000000..4bbecf478
--- /dev/null
+++ b/plugins/mosh/README.md
@@ -0,0 +1,9 @@
+# Mosh Plugin
+
+This plugin allows SSH tab completion for [mosh](https://mosh.org/) hostnames.
+
+To use it, add `mosh` to the plugins array in your zshrc file:
+
+```
+plugins=(... mosh)
+```
diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md
index 986ac84a4..88f5be8ba 100644
--- a/plugins/mvn/README.md
+++ b/plugins/mvn/README.md
@@ -1,7 +1,7 @@
-## Introduction
+# mvn plugin
-The [mvn plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn) provides many
-[useful aliases](#aliases) as well as completion for the `mvn` command.
+The mvn plugin provides many [useful aliases](#aliases) as well as completion for
+the [Apache Maven](https://maven.apache.org/) command (`mvn`).
Enable it by adding `mvn` to the plugins array in your zshrc file:
```zsh
@@ -10,25 +10,49 @@ plugins=(... mvn)
## Aliases
+The plugin aliases mvn to a function that calls `mvnw` (the [Maven Wrapper](https://github.com/takari/maven-wrapper))
+if it's found, or the mvn command otherwise.
+
| Alias | Command |
|:---------------------|:------------------------------------------------|
-| `mvncie` | `mvn clean install eclipse:eclipse` |
+| `mvn!` | `mvn -f <root>/pom.xml` |
+| `mvnag` | `mvn archetype:generate` |
+| `mvnboot` | `mvn spring-boot:run` |
+| `mvnc` | `mvn clean` |
+| `mvncd` | `mvn clean deploy` |
+| `mvnce` | `mvn clean eclipse:clean eclipse:eclipse` |
| `mvnci` | `mvn clean install` |
+| `mvncie` | `mvn clean install eclipse:eclipse` |
+| `mvncini` | `mvn clean initialize` |
| `mvncist` | `mvn clean install -DskipTests` |
| `mvncisto` | `mvn clean install -DskipTests --offline` |
-| `mvne` | `mvn eclipse:eclipse` |
-| `mvncv` | `mvn clean verify` |
-| `mvnd` | `mvn deploy` |
-| `mvnp` | `mvn package` |
-| `mvnc` | `mvn clean` |
| `mvncom` | `mvn compile` |
+| `mvncp` | `mvn clean package` |
| `mvnct` | `mvn clean test` |
-| `mvnt` | `mvn test` |
-| `mvnag` | `mvn archetype:generate` |
-| `mvn-updates` | `mvn versions:display-dependency-updates` |
-| `mvntc7` | `mvn tomcat7:run` |
-| `mvnjetty` | `mvn jetty:run` |
+| `mvncv` | `mvn clean verify` |
+| `mvncvst` | `mvn clean verify -DskipTests` |
+| `mvnd` | `mvn deploy` |
+| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
| `mvndt` | `mvn dependency:tree` |
+| `mvne` | `mvn eclipse:eclipse` |
+| `mvnjetty` | `mvn jetty:run` |
+| `mvnp` | `mvn package` |
| `mvns` | `mvn site` |
| `mvnsrc` | `mvn dependency:sources` |
-| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
+| `mvnt` | `mvn test` |
+| `mvntc` | `mvn tomcat:run` |
+| `mvntc7` | `mvn tomcat7:run` |
+| `mvn-updates` | `mvn versions:display-dependency-updates` |
+
+## mvn-color
+
+It's a function that wraps the mvn command to colorize it's output. You can use it in place
+of the `mvn` command. For example: instead of `mvn test`, use `mvn-color test`.
+
+Since [Maven 3.5.0](https://maven.apache.org/docs/3.5.0/release-notes.html) the mvn command
+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).
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 74583c6dc..01aef814d 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -1,292 +1,325 @@
-# mvn-color based on https://gist.github.com/1027800
-BOLD=$(tput bold)
-UNDERLINE_ON=$(tput smul)
-UNDERLINE_OFF=$(tput rmul)
-TEXT_BLACK=$(tput setaf 0)
-TEXT_RED=$(tput setaf 1)
-TEXT_GREEN=$(tput setaf 2)
-TEXT_YELLOW=$(tput setaf 3)
-TEXT_BLUE=$(tput setaf 4)
-TEXT_MAGENTA=$(tput setaf 5)
-TEXT_CYAN=$(tput setaf 6)
-TEXT_WHITE=$(tput setaf 7)
-BACKGROUND_BLACK=$(tput setab 0)
-BACKGROUND_RED=$(tput setab 1)
-BACKGROUND_GREEN=$(tput setab 2)
-BACKGROUND_YELLOW=$(tput setab 3)
-BACKGROUND_BLUE=$(tput setab 4)
-BACKGROUND_MAGENTA=$(tput setab 5)
-BACKGROUND_CYAN=$(tput setab 6)
-BACKGROUND_WHITE=$(tput setab 7)
-RESET_FORMATTING=$(tput sgr0)
-
-# if found a ./mvnw file execute it otherwise execute orignal mvn
+# Calls ./mvnw if found, otherwise execute the original mvn
mvn-or-mvnw() {
- if [ -f ./mvnw ] ; then
- echo "executing mvnw instead of mvn"
- ./mvnw "$@";
+ if [ -x ./mvnw ]; then
+ echo "executing mvnw instead of mvn"
+ ./mvnw "$@"
else
- mvn "$@";
+ command mvn "$@"
fi
}
-# Wrapper function for Maven's mvn command.
+# Wrapper function for Maven's mvn command. Based on https://gist.github.com/1027800
mvn-color() {
- (
- # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
- unset LANG
- LC_CTYPE=C mvn "$@" | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
- -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
- -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
- -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
- -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g"
-
- # Make sure formatting is reset
- echo -ne "${RESET_FORMATTING}"
- )
-}
+ local BOLD=$(echoti bold)
+ local TEXT_RED=$(echoti setaf 1)
+ local TEXT_GREEN=$(echoti setaf 2)
+ local TEXT_YELLOW=$(echoti setaf 3)
+ local TEXT_BLUE=$(echoti setaf 4)
+ local TEXT_WHITE=$(echoti setaf 7)
+ local RESET_FORMATTING=$(echoti sgr0)
+ (
+ # Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
+ unset LANG
+ LC_CTYPE=C mvn "$@" | sed \
+ -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
+ -e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_WHITE}${BOLD}\1${RESET_FORMATTING}\2/g" \
+ -e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
+ -e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
+ -e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
+ -e "s/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/${BOLD}${TEXT_GREEN}Tests run: \1${RESET_FORMATTING}, Failures: ${BOLD}${TEXT_RED}\2${RESET_FORMATTING}, Errors: ${BOLD}${TEXT_RED}\3${RESET_FORMATTING}, Skipped: ${BOLD}${TEXT_YELLOW}\4${RESET_FORMATTING}/g"
-# Override the mvn command with the colorized one.
-#alias mvn="mvn-color"
+ # Make sure formatting is reset
+ echo -ne "${RESET_FORMATTING}"
+ )
+}
-# either use orignal mvn oder the mvn wrapper
+# either use orignal mvn or the mvn wrapper
alias mvn="mvn-or-mvnw"
+# Run mvn against the pom found in a project's root directory (assumes a git repo)
+alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml'
+
# aliases
-alias mvncie='mvn clean install eclipse:eclipse'
+alias mvnag='mvn archetype:generate'
+alias mvnboot='mvn spring-boot:run'
+alias mvnc='mvn clean'
+alias mvncd='mvn clean deploy'
+alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnci='mvn clean install'
+alias mvncie='mvn clean install eclipse:eclipse'
+alias mvncini='mvn clean initialize'
alias mvncist='mvn clean install -DskipTests'
alias mvncisto='mvn clean install -DskipTests --offline'
-alias mvne='mvn eclipse:eclipse'
-alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
-alias mvncv='mvn clean verify'
-alias mvnd='mvn deploy'
-alias mvnp='mvn package'
-alias mvnc='mvn clean'
alias mvncom='mvn compile'
+alias mvncp='mvn clean package'
alias mvnct='mvn clean test'
-alias mvnt='mvn test'
-alias mvnag='mvn archetype:generate'
-alias mvn-updates='mvn versions:display-dependency-updates'
-alias mvntc7='mvn tomcat7:run'
-alias mvntc='mvn tomcat:run'
-alias mvnjetty='mvn jetty:run'
-alias mvnboot='mvn spring-boot:run'
+alias mvncv='mvn clean verify'
+alias mvncvst='mvn clean verify -DskipTests'
+alias mvnd='mvn deploy'
+alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
alias mvndt='mvn dependency:tree'
+alias mvne='mvn eclipse:eclipse'
+alias mvnjetty='mvn jetty:run'
+alias mvnp='mvn package'
alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources'
-alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
+alias mvnt='mvn test'
+alias mvntc='mvn tomcat:run'
+alias mvntc7='mvn tomcat7:run'
+alias mvn-updates='mvn versions:display-dependency-updates'
+
+
+function listMavenCompletions {
+ local file new_file
+ local -a profiles POM_FILES
+ # Root POM
+ POM_FILES=(~/.m2/settings.xml)
-function listMavenCompletions {
- reply=(
- # common lifecycle
- clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
+ # POM in the current directory
+ if [[ -f pom.xml ]]; then
+ local file=pom.xml
+ POM_FILES+=("${file:A}")
+ fi
+
+ # Look for POM files in parent directories
+ while [[ -n "$file" ]] && grep -q "<parent>" "$file"; do
+ # look for a new relativePath for parent pom.xml
+ new_file=$(grep -e "<relativePath>.*</relativePath>" "$file" | sed -e 's/.*<relativePath>\(.*\)<\/relativePath>.*/\1/')
+
+ # if <parent> is present but not defined, assume ../pom.xml
+ if [[ -z "$new_file" ]]; then
+ new_file="../pom.xml"
+ fi
+
+ # if file doesn't exist break
+ file="${file:h}/${new_file}"
+ if ! [[ -e "$file" ]]; then
+ break
+ fi
+
+ POM_FILES+=("${file:A}")
+ done
+
+ # Get profiles from found files
+ for file in $POM_FILES; do
+ [[ -e $file ]] || continue
+ profiles+=($(sed 's/<!--.*-->//' "$file" | sed '/<!--/,/-->/d' | grep -e "<profile>" -A 1 | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'))
+ done
- # common plugins
- deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
+ reply=(
+ # common lifecycle
+ clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site
- # deploy
- deploy:deploy-file
- # failsafe
- failsafe:integration-test failsafe:verify
- # install
- install:install-file install:help
- # site
- site:site site:deploy site:run site:stage site:stage-deploy site:attach-descriptor site:jar site:effective-site
- # surefire
- surefire:test
+ # integration testing
+ pre-integration-test integration-test
- # checkstyle
- checkstyle:checkstyle checkstyle:check checkstyle:checkstyle-aggregate
- # javadoc
- javadoc:javadoc javadoc:test-javadoc javadoc:javadoc-no-fork javadoc:test-javadoc-no-fork javadoc:aggregate javadoc:test-aggregate javadoc:jar javadoc:test-jar javadoc:aggregate-jar javadoc:test-aggregate-jar javadoc:fix javadoc:test-fix javadoc:resource-bundle javadoc:test-resource-bundle
- # jxr
- jxr:jxr jxr:aggregate jxr:test-jxr jxr:test-aggregate
- # pmd
- pmd:pmd pmd:cpd pmd:check pmd:cpd-check
+ # common plugins
+ deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
- # ant
- ant:ant ant:clean
- # antrun
- antrun:run
- # archetype
- archetype:generate archetype:create-from-project archetype:crawl
- # assembly
- assembly:single assembly:assembly
- # dependency
- dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:analyze-duplicate dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:display-ancestors dependency:get dependency:go-offline dependency:list dependency:list-repositories dependency:properties dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
- # enforcer
- enforcer:enforce enforcer:display-info
- # gpg
- gpg:sign gpg:sign-and-deploy-file
- # help
- help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system
- # release
- release:clean release:prepare release:prepare-with-pom release:rollback release:perform release:stage release:branch release:update-versions
- # jgitflow
- jgitflow:feature-start jgitflow:feature-finish jgitflow:release-start jgitflow:release-finish jgitflow:hotfix-start jgitflow:hotfix-finish jgitflow:build-number
- # repository
- repository:bundle-create repository:bundle-pack
- # source
- source:aggregate source:jar source:jar-no-fork source:test-jar source:test-jar-no-fork
+ # deploy
+ deploy:deploy-file
+ # failsafe
+ failsafe:integration-test failsafe:verify
+ # install
+ install:install-file install:help
+ # site
+ site:site site:deploy site:run site:stage site:stage-deploy site:attach-descriptor site:jar site:effective-site
+ # surefire
+ surefire:test
- # eclipse
- eclipse:clean eclipse:eclipse
- # idea
- idea:clean idea:idea
+ # checkstyle
+ checkstyle:checkstyle checkstyle:check checkstyle:checkstyle-aggregate
+ # javadoc
+ javadoc:javadoc javadoc:test-javadoc javadoc:javadoc-no-fork javadoc:test-javadoc-no-fork javadoc:aggregate javadoc:test-aggregate javadoc:jar javadoc:test-jar javadoc:aggregate-jar javadoc:test-aggregate-jar javadoc:fix javadoc:test-fix javadoc:resource-bundle javadoc:test-resource-bundle
+ # jxr
+ jxr:jxr jxr:aggregate jxr:test-jxr jxr:test-aggregate
+ # pmd
+ pmd:pmd pmd:cpd pmd:check pmd:cpd-check
- # jetty
- jetty:run jetty:run-exploded
- # cargo
- cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help
- # jboss
- jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy
- # tomcat
- tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy
- # tomcat6
- tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
- # tomcat7
- tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
- # tomee
- tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
- # spring-boot
- spring-boot:run spring-boot:repackage
- # exec
- exec:exec exec:java
- # versions
- versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert
- # scm
- scm:add scm:bootstrap scm:branch scm:changelog scm:check-local-modification scm:checkin scm:checkout scm:diff scm:edit scm:export scm:list scm:remove scm:status scm:tag scm:unedit scm:update scm:update-subprojects scm:validate
- # buildnumber
- buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset
+ # ant
+ ant:ant ant:clean
+ # antrun
+ antrun:run
+ # archetype
+ archetype:generate archetype:create-from-project archetype:crawl
+ # assembly
+ assembly:single assembly:assembly
+ # dependency
+ dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:analyze-duplicate dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:display-ancestors dependency:get dependency:go-offline dependency:list dependency:list-repositories dependency:properties dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
+ # enforcer
+ enforcer:enforce enforcer:display-info
+ # gpg
+ gpg:sign gpg:sign-and-deploy-file
+ # help
+ help:active-profiles help:all-profiles help:describe help:effective-pom help:effective-settings help:evaluate help:expressions help:system
+ # release
+ release:clean release:prepare release:prepare-with-pom release:rollback release:perform release:stage release:branch release:update-versions
+ # jgitflow
+ jgitflow:feature-start jgitflow:feature-finish jgitflow:release-start jgitflow:release-finish jgitflow:hotfix-start jgitflow:hotfix-finish jgitflow:build-number
+ # repository
+ repository:bundle-create repository:bundle-pack
+ # source
+ source:aggregate source:jar source:jar-no-fork source:test-jar source:test-jar-no-fork
- # war
- war:war war:exploded war:inplace war:manifest
- # ear
- ear:ear ear:generate-application-xml
- # ejb
- ejb:ejb
- # android
- android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices
- # nexus
- nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download
- # repository
- repository:bundle-create repository:bundle-pack repository:help
+ # eclipse
+ eclipse:clean eclipse:eclipse
+ # idea
+ idea:clean idea:idea
- # sonar
- sonar:sonar
- # license
- license:format license:check
- # hibernate3
- hibernate3:hbm2ddl hibernate3:help
- # liquibase
- liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback
- # flyway
- flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate
- # gwt
- gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test
- # asciidoctor
- asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip
- # compiler
- compiler:compile compiler:testCompile
- # resources
- resources:resources resources:testResources resources:copy-resources
- # verifier
- verifier:verify
- # jar
- jar:jar jar:test-jar
- # rar
- rar:rar
- # acr
- acr:acr
- # shade
- shade:shade
- # changelog
- changelog:changelog changelog:dev-activity changelog:file-activity
- # changes
- changes:announcement-mail changes:announcement-generate changes:changes-check changes:changes-validate changes:changes-report changes:jira-report changes:trac-report changes:github-report
- # doap
- doap:generate
- # docck
- docck:check
- # jdeps
- jdeps:jdkinternals jdeps:test-jdkinternals
- # linkcheck
- linkcheck:linkcheck
- # project-info-reports
- project-info-reports:cim project-info-reports:dependencies project-info-reports:dependency-convergence project-info-reports:dependency-info project-info-reports:dependency-management project-info-reports:distribution-management project-info-reports:help project-info-reports:index project-info-reports:issue-tracking project-info-reports:license project-info-reports:mailing-list project-info-reports:modules project-info-reports:plugin-management project-info-reports:plugins project-info-reports:project-team project-info-reports:scm project-info-reports:summary
- # surefire-report
- surefire-report:failsafe-report-only surefire-report:report surefire-report:report-only
- # invoker
- invoker:install invoker:integration-test invoker:verify invoker:run
- # jarsigner
- jarsigner:sign jarsigner:verify
- # patch
- patch:apply
- # pdf
- pdf:pdf
- # plugin
- plugin:descriptor plugin:report plugin:updateRegistry plugin:addPluginArtifactMetadata plugin:helpmojo
- # remote-resources
- remote-resources:bundle remote-resources:process
- # scm-publish
- scm-publish:help scm-publish:publish-scm scm-publish:scmpublish
- # stage
- stage:copy
- # toolchain
- toolchain:toolchain
-
- # 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="
+ # jetty
+ jetty:run jetty:run-exploded
+ # cargo
+ cargo:start cargo:run cargo:stop cargo:deploy cargo:undeploy cargo:help
+ # jboss
+ jboss:start jboss:stop jboss:deploy jboss:undeploy jboss:redeploy
+ # tomcat
+ tomcat:start tomcat:stop tomcat:deploy tomcat:undeploy tomcat:redeploy
+ # tomcat6
+ tomcat6:run tomcat6:run-war tomcat6:run-war-only tomcat6:stop tomcat6:deploy tomcat6:undeploy
+ # tomcat7
+ tomcat7:run tomcat7:run-war tomcat7:run-war-only tomcat7:deploy
+ # tomee
+ tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
+ # spring-boot
+ spring-boot:run spring-boot:repackage
+ # exec
+ exec:exec exec:java
+ # versions
+ versions:display-dependency-updates versions:display-plugin-updates versions:display-property-updates versions:update-parent versions:update-properties versions:update-child-modules versions:lock-snapshots versions:unlock-snapshots versions:resolve-ranges versions:set versions:use-releases versions:use-next-releases versions:use-latest-releases versions:use-next-snapshots versions:use-latest-snapshots versions:use-next-versions versions:use-latest-versions versions:commit versions:revert
+ # scm
+ scm:add scm:bootstrap scm:branch scm:changelog scm:check-local-modification scm:checkin scm:checkout scm:diff scm:edit scm:export scm:list scm:remove scm:status scm:tag scm:unedit scm:update scm:update-subprojects scm:validate
+ # buildnumber
+ buildnumber:create buildnumber:create-timestamp buildnumber:help buildnumber:hgchangeset
- # arguments
- -am --also-make
- -amd --also-make-dependents-am
- -B --batch-mode
- -b --builder
- -C --strict-checksums
- -c --lax-checksums
- -cpu --check-plugin-updates
- -D --define
- -e --errors
- -emp --encrypt-master-password
- -ep --encrypt-password
- -f --file
- -fae --fail-at-end
- -ff --fail-fast
- -fn --fail-never
- -gs --global-settings
- -gt --global-toolchains
- -h --help
- -l --log-file
- -llr --legacy-local-repository
- -N --non-recursive
- -npr --no-plugin-registry
- -npu --no-plugin-updates
- -nsu --no-snapshot-updates
- -o --offline
- -P --activate-profiles
- -pl --projects
- -q --quiet
- -rf --resume-from
- -s --settings
- -t --toolchains
- -T --threads
- -U --update-snapshots
- -up --update-plugins
- -v --version
- -V --show-version
- -X --debug
+ # war
+ war:war war:exploded war:inplace war:manifest
+ # ear
+ ear:ear ear:generate-application-xml
+ # ejb
+ ejb:ejb
+ # android
+ android:apk android:apklib android:deploy android:deploy-dependencies android:dex android:emulator-start android:emulator-stop android:emulator-stop-all android:generate-sources android:help android:instrument android:manifest-update android:pull android:push android:redeploy android:run android:undeploy android:unpack android:version-update android:zipalign android:devices
+ # nexus
+ nexus:staging-list nexus:staging-close nexus:staging-drop nexus:staging-release nexus:staging-build-promotion nexus:staging-profiles-list nexus:settings-download
+ # repository
+ repository:bundle-create repository:bundle-pack repository:help
- cli:execute cli:execute-phase
- archetype:generate generate-sources
- cobertura:cobertura
- -Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi)
- -Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi)
- );
+ # sonar
+ sonar:sonar
+ # license
+ license:format license:check
+ # hibernate3
+ hibernate3:hbm2ddl hibernate3:help
+ # liquibase
+ liquibase:changelogSync liquibase:changelogSyncSQL liquibase:clearCheckSums liquibase:dbDoc liquibase:diff liquibase:dropAll liquibase:help liquibase:migrate liquibase:listLocks liquibase:migrateSQL liquibase:releaseLocks liquibase:rollback liquibase:rollbackSQL liquibase:status liquibase:tag liquibase:update liquibase:updateSQL liquibase:updateTestingRollback
+ # flyway
+ flyway:clean flyway:history flyway:init flyway:migrate flyway:status flyway:validate
+ # gwt
+ gwt:browser gwt:clean gwt:compile gwt:compile-report gwt:css gwt:debug gwt:eclipse gwt:eclipseTest gwt:generateAsync gwt:help gwt:i18n gwt:mergewebxml gwt:resources gwt:run gwt:sdkInstall gwt:source-jar gwt:soyc gwt:test
+ # asciidoctor
+ asciidoctor:process-asciidoc asciidoctor:auto-refresh asciidoctor:http asciidoctor:zip
+ # compiler
+ compiler:compile compiler:testCompile
+ # resources
+ resources:resources resources:testResources resources:copy-resources
+ # verifier
+ verifier:verify
+ # jar
+ jar:jar jar:test-jar
+ # rar
+ rar:rar
+ # acr
+ acr:acr
+ # shade
+ shade:shade
+ # changelog
+ changelog:changelog changelog:dev-activity changelog:file-activity
+ # changes
+ changes:announcement-mail changes:announcement-generate changes:changes-check changes:changes-validate changes:changes-report changes:jira-report changes:trac-report changes:github-report
+ # doap
+ doap:generate
+ # docck
+ docck:check
+ # jdeps
+ jdeps:jdkinternals jdeps:test-jdkinternals
+ # linkcheck
+ linkcheck:linkcheck
+ # project-info-reports
+ project-info-reports:cim project-info-reports:dependencies project-info-reports:dependency-convergence project-info-reports:dependency-info project-info-reports:dependency-management project-info-reports:distribution-management project-info-reports:help project-info-reports:index project-info-reports:issue-tracking project-info-reports:license project-info-reports:mailing-list project-info-reports:modules project-info-reports:plugin-management project-info-reports:plugins project-info-reports:project-team project-info-reports:scm project-info-reports:summary
+ # surefire-report
+ surefire-report:failsafe-report-only surefire-report:report surefire-report:report-only
+ # invoker
+ invoker:install invoker:integration-test invoker:verify invoker:run
+ # jarsigner
+ jarsigner:sign jarsigner:verify
+ # patch
+ patch:apply
+ # pdf
+ pdf:pdf
+ # plugin
+ plugin:descriptor plugin:report plugin:updateRegistry plugin:addPluginArtifactMetadata plugin:helpmojo
+ # remote-resources
+ remote-resources:bundle remote-resources:process
+ # scm-publish
+ scm-publish:help scm-publish:publish-scm scm-publish:scmpublish
+ # stage
+ stage:copy
+ # toolchain
+ toolchain:toolchain
+
+ # 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="
+
+ # arguments
+ -am --also-make
+ -amd --also-make-dependents-am
+ -B --batch-mode
+ -b --builder
+ -C --strict-checksums
+ -c --lax-checksums
+ -cpu --check-plugin-updates
+ -D --define
+ -e --errors
+ -emp --encrypt-master-password
+ -ep --encrypt-password
+ -f --file
+ -fae --fail-at-end
+ -ff --fail-fast
+ -fn --fail-never
+ -gs --global-settings
+ -gt --global-toolchains
+ -h --help
+ -l --log-file
+ -llr --legacy-local-repository
+ -N --non-recursive
+ -npr --no-plugin-registry
+ -npu --no-plugin-updates
+ -nsu --no-snapshot-updates
+ -o --offline
+ -P --activate-profiles
+ -pl --projects
+ -q --quiet
+ -rf --resume-from
+ -s --settings
+ -t --toolchains
+ -T --threads
+ -U --update-snapshots
+ -up --update-plugins
+ -v --version
+ -V --show-version
+ -X --debug
+
+ cli:execute cli:execute-phase
+ archetype:generate generate-sources
+ cobertura:cobertura
+ -Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi)
+ -Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi)
+
+ $profiles
+ )
}
-compctl -K listMavenCompletions mvn
+compctl -K listMavenCompletions mvn mvnw
+compctl -K listMavenCompletions mvn-color
compctl -K listMavenCompletions mvn-or-mvnw
-
diff --git a/plugins/nanoc/README.md b/plugins/nanoc/README.md
new file mode 100644
index 000000000..d5d437d8a
--- /dev/null
+++ b/plugins/nanoc/README.md
@@ -0,0 +1,20 @@
+# Nanoc plugin
+
+This plugin adds some aliases and autocompletion for common [Nanoc](https://nanoc.ws) commands.
+
+To use it, add `nanoc` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... nanoc)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|-----------------------|-----------------------------------------------------------------------------------|
+| n | `nanoc` | Main Nanoc command |
+| nco | `nanoc compile` | Compile all items of the current site |
+| ncs | `nanoc create-site` | Create a new site at the given path. The site will use the filesystem data source |
+| nd | `nanoc deploy` | Deploy the compiled site to the destination (specified with `--target`) |
+| np | `nanoc prune` | Remove files not managed by Nanoc from the output directory |
+| nv | `nanoc view` | Start the static web server (on port 3000 and all IP addresses, unless specified) |
diff --git a/plugins/nanoc/_nanoc b/plugins/nanoc/_nanoc
index fde07c3fc..a6a4792ad 100644
--- a/plugins/nanoc/_nanoc
+++ b/plugins/nanoc/_nanoc
@@ -1,28 +1,21 @@
#compdef nanoc
#autoload
-# nanoc zsh completion - based on the homebrew zsh completion
# requires the 'nanoc' gem to be installed
local -a _1st_arguments
_1st_arguments=(
- 'autocompile:start the autocompiler'
+ 'check:run issue checks'
'compile:compile items of this site'
- 'create-item:create an item'
- 'create-layout:create a layout'
'create-site:create a site'
'deploy:deploy the compiled site'
'help:show help'
'prune:remove files not managed by nanoc from the output directory'
+ 'shell:open a shell on the Nanoc environment'
'show-data:show data in this site'
'show-plugins:show all available plugins'
'show-rules:describe the rules for each item'
- 'update:update the data stored by the data source to a newer version'
- 'validate-css:validate the site’s CSS'
- 'validate-html:validate the site’s HTML'
- 'validate-links:validate links in site'
'view:start the web server that serves static files'
- 'watch:start the watcher'
)
local expl
@@ -31,13 +24,68 @@ local -a pkgs installed_pkgs
_arguments \
'(--color)--color[enable color]' \
'(--debug)--debug[enable debugging]' \
+ '(--env)--env[set environment]' \
'(--help)--help[show the help message and quit]' \
'(--no-color)--no-color[disable color]' \
- '(--verbose)--verbose[make nanoc output more detailed]' \
+ '(--verbose)--verbose[make output more detailed]' \
'(--version)--version[show version information and quit]' \
'(--warn)--warn[enable warnings]' \
'*:: :->subcmds' && return 0
+case "$state" in
+ subcmds)
+ case $words[1] in
+ check)
+ _arguments \
+ '(--preprocess)--preprocess[run preprocessor]'
+ ;;
+
+ compile)
+ _arguments \
+ '(--diff)--diff[generate diff]'
+ ;;
+
+ compile)
+ _arguments \
+ '(--diff)--diff[generate diff]'
+ ;;
+
+ create-site)
+ _arguments \
+ '(--force)--force[force creation of new site]'
+ ;;
+
+ deploy)
+ _arguments \
+ '(--target)--target[specify the location to deploy to (default: `default`)]' \
+ '(--no-check)--no-check[do not run the issue checks marked for deployment]' \
+ '(--list)--list[list available locations to deploy to]' \
+ '(--list-deployers)--list-deployers[list available deployers]' \
+ '(--dry-run)--dry-run[show what would be deployed]'
+ ;;
+
+ prune)
+ _arguments \
+ '(--yes)--yes[confirm deletion]' \
+ '(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]'
+ ;;
+
+ shell)
+ _arguments \
+ '(--preprocess)--preprocess[run preprocessor]'
+ ;;
+
+ view)
+ _arguments \
+ '(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \
+ '(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \
+ '(--port)--port[specify the port to listen on (default: 3000]' \
+ '(--live-reload)--live-reload[reload on changes]'
+ ;;
+ esac
+ ;;
+esac
+
if (( CURRENT == 1 )); then
_describe -t commands "nanoc subcommand" _1st_arguments
return
diff --git a/plugins/nanoc/nanoc.plugin.zsh b/plugins/nanoc/nanoc.plugin.zsh
index 5a5064613..05272ed66 100644
--- a/plugins/nanoc/nanoc.plugin.zsh
+++ b/plugins/nanoc/nanoc.plugin.zsh
@@ -1,9 +1,6 @@
alias n='nanoc'
-alias na='nanoc autocompile'
alias nco='nanoc compile'
-alias nci='nanoc create_item'
-alias ncl='nanoc create_layout'
-alias ncs='nanoc create_site'
+alias ncs='nanoc create-site'
alias nd='nanoc deploy'
+alias np='nanoc prune'
alias nv='nanoc view'
-alias nw='nanoc watch'
diff --git a/plugins/ng/ng.plugin.zsh b/plugins/ng/ng.plugin.zsh
index 2488bc230..b802bf617 100644
--- a/plugins/ng/ng.plugin.zsh
+++ b/plugins/ng/ng.plugin.zsh
@@ -1,5 +1,5 @@
-ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help'
+ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test update v version -h --help'
_ng_completion () {
local words cword opts
@@ -55,6 +55,10 @@ _ng_completion () {
t | test )
opts='--browsers --colors --config-file --environment --filter --host --launch --log-level --module --path --port --query --reporter --server --silent --test-page --test-port --watch -H -c -cf -e -f -m -r -s -tp -w'
;;
+
+ update )
+ opts='--all --dryRun --force --from --migrate-only --next --registry --to -d'
+ ;;
v | version )
opts='--verbose'
diff --git a/plugins/node/README.md b/plugins/node/README.md
new file mode 100644
index 000000000..c392dc0bf
--- /dev/null
+++ b/plugins/node/README.md
@@ -0,0 +1,16 @@
+# node plugin
+
+To use it, add `node` to the plugins array of your zshrc file:
+```zsh
+plugins=(... node)
+```
+
+This plugin adds `node-docs` function that open specific section in [Node.js](https://nodejs.org) documentation (depending on the installed version).
+For example:
+
+```zsh
+# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html
+$ node-docs fs
+# Opens https://nodejs.org/docs/latest-v10.x/api/path.html
+$ node-docs path
+```
diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md
new file mode 100644
index 000000000..079cf0009
--- /dev/null
+++ b/plugins/nvm/README.md
@@ -0,0 +1,9 @@
+# nvm plugin
+
+This plugin adds autocompletions for [nvm](https://github.com/creationix/nvm) — a Node.js version manager.
+It also automatically sources nvm, so you don't need to do it manually in your `.zshrc`.
+
+To use it, add `nvm` to the plugins array of your zshrc file:
+```zsh
+plugins=(... nvm)
+```
diff --git a/plugins/nyan/README.md b/plugins/nyan/README.md
new file mode 100644
index 000000000..592941824
--- /dev/null
+++ b/plugins/nyan/README.md
@@ -0,0 +1,5 @@
+# Nyan plugin
+
+This plugin adds a command to display [Nyan Cat](https://en.wikipedia.org/wiki/Nyan_Cat) right inside your terminal.
+
+**Plugin is deprecated**. Check [official repo](https://github.com/klange/nyancat) for more information. \ No newline at end of file
diff --git a/plugins/osx/README.md b/plugins/osx/README.md
index 7c75c65f5..3559dee02 100644
--- a/plugins/osx/README.md
+++ b/plugins/osx/README.md
@@ -56,6 +56,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| `man-preview` | Open a specified man page in Preview app |
| `showfiles` | Show hidden files |
| `hidefiles` | Hide the hidden files |
-| `itunes` | Control iTunes. User `itunes -h` for usage details |
+| `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 |
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index 6a4b6eec4..a1c73a184 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -284,6 +284,6 @@ alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true &&
alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Remove .DS_Store files recursively in a directory, default .
-rmdsstore() {
+function rmdsstore() {
find "${@:-.}" -type f -name .DS_Store -delete
}
diff --git a/plugins/osx/spotify b/plugins/osx/spotify
index 2ab98d3a0..b4215dbe7 100644
--- a/plugins/osx/spotify
+++ b/plugins/osx/spotify
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
function spotify() {
-# Copyright (c) 2012--2017 Harish Narayanan <mail@harishnarayanan.org>
+# Copyright (c) 2012--2018 Harish Narayanan <mail@harishnarayanan.org>
#
# Contains numerous helpful contributions from Jorge Colindres, Thomas
# Pritchard, iLan Epstein, Gabriele Bonetti, Sean Heller, Eric Martin
@@ -134,8 +134,13 @@ showStatus () {
if [ $# = 0 ]; then
showHelp;
else
+ if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then
+ echo "The Spotify application must be installed."
+ exit 1
+ fi
+
if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then
- osascript -e 'tell application "Spotify" to activate'
+ osascript -e 'tell application "Spotify" to activate' || exit 1
sleep 2
fi
fi
@@ -160,7 +165,7 @@ while [ $# -gt 0 ]; do
showAPIHelp;
exit 1;
fi
- SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n");
+ SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r');
SPOTIFY_PLAY_URI="";
getAccessToken() {
diff --git a/plugins/otp/otp.plugin.zsh b/plugins/otp/otp.plugin.zsh
new file mode 100644
index 000000000..4bce34fd3
--- /dev/null
+++ b/plugins/otp/otp.plugin.zsh
@@ -0,0 +1,54 @@
+export OTP_HOME=~/.otp
+mkdir -p $OTP_HOME
+
+function ot () {
+ if ! command -v oathtool > /dev/null 2>&1; then
+ echo "Note: you need to install oathtool or oath-toolkit, depending on your OS or distribution."
+ return 1
+ fi
+
+ if ! command -v gpg > /dev/null 2>&1; then
+ echo "Note: you need to install gpg and create an ID using 'gpg --gen-key', unless you have one already."
+ 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
+
+ if [[ "x$1" == "x" ]]; then
+ echo "usage: otpw <profile.name>"
+ 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
+ fi
+}
+
+function otp_add_device () {
+ if [[ "x$1" == "x" ]] then
+ echo "usage: otp_add <profile.name>"
+ return 1
+ else
+ echo "Enter an email address attached to your GPG private key, then paste the secret configuration key followed by ^D"
+
+ rm -f $OTP_HOME/$1.otp.asc
+ gpg --armor --encrypt --output $OTP_HOME/$1.otp.asc /dev/stdin
+ fi
+}
+
+function otp_devices () {
+ reply=($(find $OTP_HOME -name \*.otp.asc | xargs basename -s .otp.asc))
+}
+
+compctl -K otp_devices ot
diff --git a/plugins/pep8/README.md b/plugins/pep8/README.md
new file mode 100644
index 000000000..a9a4f1cd0
--- /dev/null
+++ b/plugins/pep8/README.md
@@ -0,0 +1,8 @@
+# pep8 plugin
+
+This plugin adds completion for [pep8](https://pep8.readthedocs.io/en/release-1.7.x/#), a tool to check your Python code against some of the style conventions in [PEP 8](http://www.python.org/dev/peps/pep-0008/).
+
+To use it, add pep8 to the plugins array of your zshrc file:
+```
+plugins=(... pep8)
+```
diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh
index 53ad963e7..41de2f91d 100644
--- a/plugins/per-directory-history/per-directory-history.zsh
+++ b/plugins/per-directory-history/per-directory-history.zsh
@@ -26,7 +26,7 @@
#
# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
# [2]: http://dieter.plaetinck.be/per_directory_bash
-# [3]: https://www.zsh.org/mla/users/1997/msg00226.html
+# [3]: http://www.zsh.org/mla/users/1997/msg00226.html
#
################################################################################
#
@@ -109,8 +109,13 @@ function _per-directory-history-change-directory() {
}
function _per-directory-history-addhistory() {
- print -Sr -- "${1%%$'\n'}"
- fc -p $_per_directory_history_directory
+ # respect hist_ignore_space
+ if [[ -o hist_ignore_space ]] && [[ "$1" == \ * ]]; then
+ true
+ else
+ print -Sr -- "${1%%$'\n'}"
+ fc -p $_per_directory_history_directory
+ fi
}
diff --git a/plugins/postgres/README.md b/plugins/postgres/README.md
new file mode 100644
index 000000000..59445f31c
--- /dev/null
+++ b/plugins/postgres/README.md
@@ -0,0 +1,22 @@
+# Postgres plugin
+
+This plugin adds some aliases for useful Postgres commands.
+
+:warning: this plugin works exclusively with Postgres installed via Homebrew on OSX
+because Postgres paths are hardcoded to `/usr/local/var/postgres`.
+
+To use it, add `postgres` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... postgres)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------------|---------------------------------------------------------------------------------|-------------------------------------------------------------|
+| startpost | `pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start` | Start postgres server |
+| stoppost | `pg_ctl -D /usr/local/var/postgres stop -s -m fast` | Stop postgres server |
+| restartpost | `stoppost && sleep 1 && startpost` | Restart (calls stop, then start) |
+| reloadpost | `pg_ctl reload -D /usr/local/var/postgres -s` | Reload postgres configuration (some setting require restart)|
+| statuspost | `pg_ctl status -D /usr/local/var/postgres -s` | Check startus of postgres server (running, stopped) |
diff --git a/plugins/pylint/README.md b/plugins/pylint/README.md
new file mode 100644
index 000000000..8c1de88ba
--- /dev/null
+++ b/plugins/pylint/README.md
@@ -0,0 +1,15 @@
+# pylint
+
+This plugin adds code analysis for python through [Pylint](https://www.pylint.org/).
+
+To use it, add `pylint` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... pylint)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| -------------| -------------------- | -------------------------------------------------------------------------------------------------------------------------|
+| pylint-quick | `pylint --reports=n` | Displays a set of reports each one focusing on a particular aspect of the project, default set `no` for multiple reports | |
diff --git a/plugins/python/README.md b/plugins/python/README.md
new file mode 100644
index 000000000..2d955c5cb
--- /dev/null
+++ b/plugins/python/README.md
@@ -0,0 +1,16 @@
+# python plugin
+
+The plugin adds several aliases for useful [python](https://www.python.org/) commands.
+
+To use it, add `python` to the plugins array of your zshrc file:
+```
+plugins=(... python)
+```
+
+## Aliases
+
+| Command | Description |
+|------------------|---------------------------------------------------------------------------------|
+| `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 <text>` | Looks for `text` in .py files |
diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
index a10c06fd3..f754ea261 100644
--- a/plugins/python/python.plugin.zsh
+++ b/plugins/python/python.plugin.zsh
@@ -1,12 +1,13 @@
# Find python file
alias pyfind='find . -name "*.py"'
-# Remove python compiled byte-code in either current directory or in a
+# Remove python compiled byte-code and mypy cache in either current directory or in a
# list of specified 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
}
# Grep among .py files
diff --git a/plugins/rake-fast/rake-fast.plugin.zsh b/plugins/rake-fast/rake-fast.plugin.zsh
index ca80d86e1..19dab154b 100644
--- a/plugins/rake-fast/rake-fast.plugin.zsh
+++ b/plugins/rake-fast/rake-fast.plugin.zsh
@@ -20,7 +20,7 @@ _tasks_changed () {
}
_rake_generate () {
- rake --silent --tasks | cut -d " " -f 2 > .rake_tasks
+ rake --silent --tasks | cut -d " " -f 2 | sed 's/\[.*\]//g' > .rake_tasks
}
_rake () {
diff --git a/plugins/react-native/README.md b/plugins/react-native/README.md
index ebe1be0e0..0cfaa36b4 100644
--- a/plugins/react-native/README.md
+++ b/plugins/react-native/README.md
@@ -11,29 +11,45 @@ plugins=(... react-native)
## Aliases
-| Alias | React Native command |
-| :------------ | :------------------------------------------------- |
-| **rn** | `react-native` |
-| **rns** | `react-native start` |
-| **rnlink** | `react-native link` |
-| _App testing_ |
-| **rnand** | `react-native run-android` |
-| **rnios** | `react-native run-ios` |
-| **rnios4s** | `react-native run-ios --simulator "iPhone 4s"` |
-| **rnios5** | `react-native run-ios --simulator "iPhone 5"` |
-| **rnios5s** | `react-native run-ios --simulator "iPhone 5s"` |
-| **rnios6** | `react-native run-ios --simulator "iPhone 6"` |
-| **rnios6s** | `react-native run-ios --simulator "iPhone 6s"` |
-| **rnios7** | `react-native run-ios --simulator "iPhone7"` |
-| **rnios7p** | `react-native run-ios --simulator "iPhone 7 Plus"` |
-| **rnios8** | `react-native run-ios --simulator "iPhone 8"` |
-| **rnios8p** | `react-native run-ios --simulator "iPhone 8 Plus"` |
-| **rniosse** | `react-native run-ios --simulator "iPhone SE"` |
-| **rniosx** | `react-native run-ios --simulator "iPhone X"` |
-| **rniosxs** | `react-native run-ios --simulator "iPhone XS"` |
-| **rniosxsm** | `react-native run-ios --simulator "iPhone XS Max"` |
-| **rniosxr** | `react-native run-ios --simulator "iPhone XR"` |
-
-| _Logging_ |
-| **rnland** | `react-native log-android` |
-| **rnlios** | `react-native log-ios` |
+| Alias | React Native command |
+| :------------ | :------------------------------------------------- |
+| **rn** | `react-native` |
+| **rns** | `react-native start` |
+| **rnlink** | `react-native link` |
+| _App testing_ |
+| **rnand** | `react-native run-android` |
+| **rnios** | `react-native run-ios` |
+| **rnios4s** | `react-native run-ios --simulator "iPhone 4s"` |
+| **rnios5** | `react-native run-ios --simulator "iPhone 5"` |
+| **rnios5s** | `react-native run-ios --simulator "iPhone 5s"` |
+| **rnios6** | `react-native run-ios --simulator "iPhone 6"` |
+| **rnios6s** | `react-native run-ios --simulator "iPhone 6s"` |
+| **rnios7** | `react-native run-ios --simulator "iPhone7"` |
+| **rnios7p** | `react-native run-ios --simulator "iPhone 7 Plus"` |
+| **rnios8** | `react-native run-ios --simulator "iPhone 8"` |
+| **rnios8p** | `react-native run-ios --simulator "iPhone 8 Plus"` |
+| **rniosse** | `react-native run-ios --simulator "iPhone SE"` |
+| **rniosx** | `react-native run-ios --simulator "iPhone X"` |
+| **rniosxs** | `react-native run-ios --simulator "iPhone XS"` |
+| **rniosxsm** | `react-native run-ios --simulator "iPhone XS Max"` |
+| **rniosxr** | `react-native run-ios --simulator "iPhone XR"` |
+| _iPads_ | |
+| **rnipad2** | `react-native run-ios --simulator "iPad 2"` |
+| **rnipadr** | `react-native run-ios --simulator "iPad Retina"` |
+| **rnipada** | 'react-native run-ios --simulator "iPad Air"' |
+| **rnipada2** | 'react-native run-ios --simulator "iPad Air 2"' |
+| **rnipad5** | 'react-native run-ios --simulator "iPad (5th generation)"' |
+| **rnipad9** | 'react-native run-ios --simulator "iPad Pro (9.7-inch)"' |
+| **rnipad12** | 'react-native run-ios --simulator "iPad Pro (12.9-inch)"' |
+| **rnipad122** | 'react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"' |
+| **rnipad10** | 'react-native run-ios --simulator "iPad Pro (10.5-inch)"' |
+| **rnipad6** | 'react-native run-ios --simulator "iPad Pro (6th generation)"' |
+| **rnipad11** | 'react-native run-ios --simulator "iPad Pro (11-inch)"' |
+| **rnipad123** | 'react-native run-ios --simulator "iPad Pro (12.9-inch) (3rd generation)"' |
+| _Apple TVs_ | |
+| **rnatv** | `react-native run-ios --simulator "Apple TV"` |
+| **rnatv4k** | `react-native run-ios --simulator "Apple TV 4K"` |
+| **rnatv4k1080**| `react-native run-ios --simulator "Apple TV 4K (at 1080p)"` |
+| _Logging_ |
+| **rnland** | `react-native log-android` |
+| **rnlios** | `react-native log-ios` |
diff --git a/plugins/react-native/react-native.plugin.zsh b/plugins/react-native/react-native.plugin.zsh
index 220aa2dce..a4092a694 100644
--- a/plugins/react-native/react-native.plugin.zsh
+++ b/plugins/react-native/react-native.plugin.zsh
@@ -19,5 +19,22 @@ alias rniosxs='react-native run-ios --simulator "iPhone XS"'
alias rniosxsm='react-native run-ios --simulator "iPhone XS Max"'
alias rniosxr='react-native run-ios --simulator "iPhone XR"'
+alias rnipad2='react-native run-ios --simulator "iPad 2"'
+alias rnipadr='react-native run-ios --simulator "iPad Retina"'
+alias rnipada='react-native run-ios --simulator "iPad Air"'
+alias rnipada2='react-native run-ios --simulator "iPad Air 2"'
+alias rnipad5='react-native run-ios --simulator "iPad (5th generation)"'
+alias rnipad9='react-native run-ios --simulator "iPad Pro (9.7-inch)"'
+alias rnipad12='react-native run-ios --simulator "iPad Pro (12.9-inch)"'
+alias rnipad122='react-native run-ios --simulator "iPad Pro (12.9-inch) (2nd generation)"'
+alias rnipad10='react-native run-ios --simulator "iPad Pro (10.5-inch)"'
+alias rnipad6='react-native run-ios --simulator "iPad Pro (6th generation)"'
+alias rnipad11='react-native run-ios --simulator "iPad Pro (11-inch)"'
+alias rnipad123='react-native run-ios --simulator "iPad Pro (12.9-inch) (3rd generation)"'
+
+alias rnatv='react-native run-ios --simulator "Apple TV"'
+alias rnatv4k='react-native run-ios --simulator "Apple TV 4K"'
+alias rnatv4k1080='react-native run-ios --simulator "Apple TV 4K (at 1080p)"'
+
alias rnland='react-native log-android'
alias rnlios='react-native log-ios'
diff --git a/plugins/ripgrep/README.md b/plugins/ripgrep/README.md
new file mode 100644
index 000000000..794b105ee
--- /dev/null
+++ b/plugins/ripgrep/README.md
@@ -0,0 +1,13 @@
+# ripgrep
+
+This plugin adds completion for the text search tool [`ripgrep`](https://github.com/BurntSushi/ripgrep), also known as `rg`.
+
+To use it, add `ripgrep` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... ripgrep)
+```
+
+Completion is taken from the ripgrep release [`0.10.0`](https://github.com/BurntSushi/ripgrep/releases/tag/0.10.0).
+
+Updated on September 27th, 2018.
diff --git a/plugins/ripgrep/_ripgrep b/plugins/ripgrep/_ripgrep
new file mode 100644
index 000000000..53f135dde
--- /dev/null
+++ b/plugins/ripgrep/_ripgrep
@@ -0,0 +1,433 @@
+#compdef rg
+
+##
+# zsh completion function for ripgrep
+#
+# Originally based on code from the zsh-users project — see copyright notice
+# below.
+
+_rg() {
+ local curcontext=$curcontext no='!' descr ret=1
+ local -a context line state state_descr args tmp suf
+ local -A opt_args
+
+ # ripgrep has many options which negate the effect of a more common one — for
+ # example, `--no-column` to negate `--column`, and `--messages` to negate
+ # `--no-messages`. There are so many of these, and they're so infrequently
+ # used, that some users will probably find it irritating if they're completed
+ # indiscriminately, so let's not do that unless either the current prefix
+ # matches one of those negation options or the user has the `complete-all`
+ # style set. Note that this prefix check has to be updated manually to account
+ # for all of the potential negation options listed below!
+ if
+ # We also want to list all of these options during testing
+ [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] ||
+ # (--[imnp]* => --ignore*, --messages, --no-*, --pcre2-unicode)
+ [[ $PREFIX$SUFFIX == --[imnp]* ]] ||
+ zstyle -t ":complete:$curcontext:*" complete-all
+ then
+ no=
+ fi
+
+ # We make heavy use of argument groups here to prevent the option specs from
+ # growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip
+ # them out below if necessary. This makes the exclusions inaccurate on those
+ # older versions, but oh well — it's not that big a deal
+ args=(
+ + '(exclusive)' # Misc. fully exclusive options
+ '(: * -)'{-h,--help}'[display help information]'
+ '(: * -)'{-V,--version}'[display version information]'
+
+ + '(buffered)' # buffering options
+ '--line-buffered[force line buffering]'
+ $no"--no-line-buffered[don't force line buffering]"
+ '--block-buffered[force block buffering]'
+ $no"--no-block-buffered[don't force block buffering]"
+
+ + '(case)' # Case-sensitivity options
+ {-i,--ignore-case}'[search case-insensitively]'
+ {-s,--case-sensitive}'[search case-sensitively]'
+ {-S,--smart-case}'[search case-insensitively if pattern is all lowercase]'
+
+ + '(context-a)' # Context (after) options
+ '(context-c)'{-A+,--after-context=}'[specify lines to show after each match]:number of lines'
+
+ + '(context-b)' # Context (before) options
+ '(context-c)'{-B+,--before-context=}'[specify lines to show before each match]:number of lines'
+
+ + '(context-c)' # Context (combined) options
+ '(context-a context-b)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines'
+
+ + '(column)' # Column options
+ '--column[show column numbers for matches]'
+ $no"--no-column[don't show column numbers for matches]"
+
+ + '(count)' # Counting options
+ {-c,--count}'[only show count of matching lines for each file]'
+ '--count-matches[only show count of individual matches for each file]'
+
+ + '(encoding)' # Encoding options
+ {-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings'
+ $no'--no-encoding[use default text encoding]'
+
+ + file # File-input options
+ '(1)*'{-f+,--file=}'[specify file containing patterns to search for]: :_files'
+
+ + '(file-match)' # Files with/without match options
+ '(stats)'{-l,--files-with-matches}'[only show names of files with matches]'
+ '(stats)--files-without-match[only show names of files without matches]'
+
+ + '(file-name)' # File-name options
+ {-H,--with-filename}'[show file name for matches]'
+ "--no-filename[don't show file name for matches]"
+
+ + '(file-system)' # File system options
+ "--one-file-system[don't descend into directories on other file systems]"
+ $no'--no-one-file-system[descend into directories on other file systems]'
+
+ + '(fixed)' # Fixed-string options
+ {-F,--fixed-strings}'[treat pattern as literal string instead of regular expression]'
+ $no"--no-fixed-strings[don't treat pattern as literal string]"
+
+ + '(follow)' # Symlink-following options
+ {-L,--follow}'[follow symlinks]'
+ $no"--no-follow[don't follow symlinks]"
+
+ + glob # File-glob options
+ '*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob'
+ '*--iglob=[include/exclude files matching specified case-insensitive glob]:glob'
+
+ + '(heading)' # Heading options
+ '(pretty-vimgrep)--heading[show matches grouped by file name]'
+ "(pretty-vimgrep)--no-heading[don't show matches grouped by file name]"
+
+ + '(hidden)' # Hidden-file options
+ '--hidden[search hidden files and directories]'
+ $no"--no-hidden[don't search hidden files and directories]"
+
+ + '(ignore)' # Ignore-file options
+ "(--no-ignore-global --no-ignore-parent --no-ignore-vcs)--no-ignore[don't respect ignore files]"
+ $no'(--ignore-global --ignore-parent --ignore-vcs)--ignore[respect ignore files]'
+
+ + '(ignore-global)' # Global ignore-file options
+ "--no-ignore-global[don't respect global ignore files]"
+ $no'--ignore-global[respect global ignore files]'
+
+ + '(ignore-parent)' # Parent ignore-file options
+ "--no-ignore-parent[don't respect ignore files in parent directories]"
+ $no'--ignore-parent[respect ignore files in parent directories]'
+
+ + '(ignore-vcs)' # VCS ignore-file options
+ "--no-ignore-vcs[don't respect version control ignore files]"
+ $no'--ignore-vcs[respect version control ignore files]'
+
+ + '(json)' # JSON options
+ '--json[output results in JSON Lines format]'
+ $no"--no-json[don't output results in JSON Lines format]"
+
+ + '(line-number)' # Line-number options
+ {-n,--line-number}'[show line numbers for matches]'
+ {-N,--no-line-number}"[don't show line numbers for matches]"
+
+ + '(line-terminator)' # Line-terminator options
+ '--crlf[use CRLF as line terminator]'
+ $no"--no-crlf[don't use CRLF as line terminator]"
+ '(text)--null-data[use NUL as line terminator]'
+
+ + '(max-depth)' # Directory-depth options
+ '--max-depth=[specify max number of directories to descend]:number of directories'
+ '!--maxdepth=:number of directories'
+
+ + '(messages)' # Error-message options
+ '(--no-ignore-messages)--no-messages[suppress some error messages]'
+ $no"--messages[don't suppress error messages affected by --no-messages]"
+
+ + '(messages-ignore)' # Ignore-error message options
+ "--no-ignore-messages[don't show ignore-file parse error messages]"
+ $no'--ignore-messages[show ignore-file parse error messages]'
+
+ + '(mmap)' # mmap options
+ '--mmap[search using memory maps when possible]'
+ "--no-mmap[don't search using memory maps]"
+
+ + '(multiline)' # Multiline options
+ {-U,--multiline}'[permit matching across multiple lines]'
+ $no'(multiline-dotall)--no-multiline[restrict matches to at most one line each]'
+
+ + '(multiline-dotall)' # Multiline DOTALL options
+ '(--no-multiline)--multiline-dotall[allow "." to match newline (with -U)]'
+ $no"(--no-multiline)--no-multiline-dotall[don't allow \".\" to match newline (with -U)]"
+
+ + '(only)' # Only-match options
+ {-o,--only-matching}'[show only matching part of each line]'
+
+ + '(passthru)' # Pass-through options
+ '(--vimgrep)--passthru[show both matching and non-matching lines]'
+ '!(--vimgrep)--passthrough'
+
+ + '(pcre2)' # PCRE2 options
+ {-P,--pcre2}'[enable matching with PCRE2]'
+ $no'(pcre2-unicode)--no-pcre2[disable matching with PCRE2]'
+
+ + '(pcre2-unicode)' # PCRE2 Unicode options
+ $no'(--no-pcre2 --no-pcre2-unicode)--pcre2-unicode[enable PCRE2 Unicode mode (with -P)]'
+ '(--no-pcre2 --pcre2-unicode)--no-pcre2-unicode[disable PCRE2 Unicode mode (with -P)]'
+
+ + '(pre)' # Preprocessing options
+ '(-z --search-zip)--pre=[specify preprocessor utility]:preprocessor utility:_command_names -e'
+ $no'--no-pre[disable preprocessor utility]'
+
+ + pre-glob # Preprocessing glob options
+ '*--pre-glob[include/exclude files for preprocessing with --pre]'
+
+ + '(pretty-vimgrep)' # Pretty/vimgrep display options
+ '(heading)'{-p,--pretty}'[alias for --color=always --heading -n]'
+ '(heading passthru)--vimgrep[show results in vim-compatible format]'
+
+ + regexp # Explicit pattern options
+ '(1 file)*'{-e+,--regexp=}'[specify pattern]:pattern'
+
+ + '(replace)' # Replacement options
+ {-r+,--replace=}'[specify string used to replace matches]:replace string'
+
+ + '(sort)' # File-sorting options
+ '(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:((
+ none\:"no sorting"
+ path\:"sort by file path"
+ modified\:"sort by last modified time"
+ accessed\:"sort by last accessed time"
+ created\:"sort by creation time"
+ ))'
+ '(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:((
+ none\:"no sorting"
+ path\:"sort by file path"
+ modified\:"sort by last modified time"
+ accessed\:"sort by last accessed time"
+ created\:"sort by creation time"
+ ))'
+ '!(threads)--sort-files[sort results by file path (disables parallelism)]'
+
+ + '(stats)' # Statistics options
+ '(--files file-match)--stats[show search statistics]'
+ $no"--no-stats[don't show search statistics]"
+
+ + '(text)' # Binary-search options
+ {-a,--text}'[search binary files as if they were text]'
+ $no"(--null-data)--no-text[don't search binary files as if they were text]"
+
+ + '(threads)' # Thread-count options
+ '(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads'
+
+ + '(trim)' # Trim options
+ '--trim[trim any ASCII whitespace prefix from each line]'
+ $no"--no-trim[don't trim ASCII whitespace prefix from each line]"
+
+ + type # Type options
+ '*'{-t+,--type=}'[only search files matching specified type]: :_rg_types'
+ '*--type-add=[add new glob for specified file type]: :->typespec'
+ '*--type-clear=[clear globs previously defined for specified file type]: :_rg_types'
+ # This should actually be exclusive with everything but other type options
+ '(: *)--type-list[show all supported file types and their associated globs]'
+ '*'{-T+,--type-not=}"[don't search files matching specified file type]: :_rg_types"
+
+ + '(word-line)' # Whole-word/line match options
+ {-w,--word-regexp}'[only show matches surrounded by word boundaries]'
+ {-x,--line-regexp}'[only show matches surrounded by line boundaries]'
+
+ + '(zip)' # Compression options
+ '(--pre)'{-z,--search-zip}'[search in compressed files]'
+ $no"--no-search-zip[don't search in compressed files]"
+
+ + misc # Other options — no need to separate these at the moment
+ '(-b --byte-offset)'{-b,--byte-offset}'[show 0-based byte offset for each matching line]'
+ '--color=[specify when to use colors in output]:when:((
+ never\:"never use colors"
+ auto\:"use colors or not based on stdout, TERM, etc."
+ always\:"always use colors"
+ ansi\:"always use ANSI colors (even on Windows)"
+ ))'
+ '*--colors=[specify color and style settings]: :->colorspec'
+ '--context-separator=[specify string used to separate non-continuous context lines in output]:separator'
+ '--debug[show debug messages]'
+ '--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)'
+ "(1 stats)--files[show each file that would be searched (but don't search)]"
+ '*--ignore-file=[specify additional ignore file]:ignore file:_files'
+ '(-v --invert-match)'{-v,--invert-match}'[invert matching]'
+ '(-M --max-columns)'{-M+,--max-columns=}'[specify max length of lines to print]:number of bytes'
+ '(-m --max-count)'{-m+,--max-count=}'[specify max number of matches per file]:number of matches'
+ '--max-filesize=[specify size above which files should be ignored]:file size (bytes)'
+ "--no-config[don't load configuration files]"
+ '(-0 --null)'{-0,--null}'[print NUL byte after file names]'
+ '--path-separator=[specify path separator to use when printing file names]:separator'
+ '(-q --quiet)'{-q,--quiet}'[suppress normal output]'
+ '--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)'
+ '*'{-u,--unrestricted}'[reduce level of "smart" searching]'
+
+ + operand # Operands
+ '(--files --type-list file regexp)1: :_guard "^-*" pattern'
+ '(--type-list)*: :_files'
+ )
+
+ # This is used with test_complete.sh to verify that there are no options
+ # listed in the help output that aren't also defined here
+ [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && {
+ print -rl - $args
+ return 0
+ }
+
+ # Strip out argument groups where unsupported (see above)
+ [[ $ZSH_VERSION == (4|5.<0-3>)(.*)# ]] &&
+ args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} )
+
+ _arguments -C -s -S : $args && ret=0
+
+ case $state in
+ colorspec)
+ if [[ ${IPREFIX#--*=}$PREFIX == [^:]# ]]; then
+ suf=( -qS: )
+ tmp=(
+ 'column:specify coloring for column numbers'
+ 'line:specify coloring for line numbers'
+ 'match:specify coloring for match text'
+ 'path:specify coloring for file names'
+ )
+ descr='color/style type'
+ elif [[ ${IPREFIX#--*=}$PREFIX == (column|line|match|path):[^:]# ]]; then
+ suf=( -qS: )
+ tmp=(
+ 'none:clear color/style for type'
+ 'bg:specify background color'
+ 'fg:specify foreground color'
+ 'style:specify text style'
+ )
+ descr='color/style attribute'
+ elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:(bg|fg):[^:]# ]]; then
+ tmp=( black blue green red cyan magenta yellow white )
+ descr='color name or r,g,b'
+ elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:style:[^:]# ]]; then
+ tmp=( {,no}bold {,no}intense {,no}underline )
+ descr='style name'
+ else
+ _message -e colorspec 'no more arguments'
+ fi
+
+ (( $#tmp )) && {
+ compset -P '*:'
+ _describe -t colorspec $descr tmp $suf && ret=0
+ }
+ ;;
+
+ typespec)
+ if compset -P '[^:]##:include:'; then
+ _sequence -s , _rg_types && ret=0
+ # @todo This bit in particular could be better, but it's a little
+ # complex, and attempting to solve it seems to run us up against a crash
+ # bug — zsh # 40362
+ elif compset -P '[^:]##:'; then
+ _message 'glob or include directive' && ret=1
+ elif [[ ! -prefix *:* ]]; then
+ _rg_types -qS : && ret=0
+ fi
+ ;;
+ esac
+
+ return ret
+}
+
+# Complete encodings
+_rg_encodings() {
+ local -a expl
+ local -aU _encodings
+
+ # This is impossible to read, but these encodings rarely if ever change, so it
+ # probably doesn't matter. They are derived from the list given here:
+ # https://encoding.spec.whatwg.org/#concept-encoding-get
+ _encodings=(
+ {{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean}
+ logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian}
+ 866 ibm{819,866} csibm866
+ big5{,-hkscs} {cn-,cs}big5 x-x-big5
+ cp{819,866,125{0..8}} x-cp125{0..8}
+ csiso2022{jp,kr} csiso8859{6,8}{e,i}
+ csisolatin{{1..6},9} csisolatin{arabic,cyrillic,greek,hebrew}
+ ecma-{114,118} asmo-708 elot_928 sun_eu_greek
+ euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese
+ {,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312
+ iso-2022-{cn,cn-ext,jp,kr}
+ iso8859{,-}{{1..11},13,14,15}
+ iso-8859-{{1..11},{6,8}-{e,i},13,14,15,16} iso_8859-{{1..9},15}
+ iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989
+ iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157}
+ koi{,8,8-r,8-ru,8-u,8_r} cskoi8r
+ ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987
+ latin{1..6} l{{1..6},9}
+ shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932
+ utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8
+ windows-{31j,874,949,125{0..8}} dos-874 tis-620 ansi_x3.4-1968
+ x-user-defined auto
+ )
+
+ _wanted encodings expl encoding compadd -a "$@" - _encodings
+}
+
+# Complete file types
+_rg_types() {
+ local -a expl
+ local -aU _types
+
+ _types=( ${(@)${(f)"$( _call_program types rg --type-list )"}%%:*} )
+
+ _wanted types expl 'file type' compadd -a "$@" - _types
+}
+
+_rg "$@"
+
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the zsh-users nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+# Completion script for ripgrep
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+# * arcizan <ghostrevery@gmail.com>
+# * MaskRay <i@maskray.me>
+#
+# ------------------------------------------------------------------------------
+
+# Local Variables:
+# mode: shell-script
+# coding: utf-8-unix
+# indent-tabs-mode: nil
+# sh-indentation: 2
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
diff --git a/plugins/ros/README.mkd b/plugins/ros/README.mkd
new file mode 100644
index 000000000..83573e499
--- /dev/null
+++ b/plugins/ros/README.mkd
@@ -0,0 +1,10 @@
+# Roswell Plugin
+
+This plugin adds completions and aliases for [Roswell](https://github.com/roswell/roswell/).
+
+To use it, add `ros` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... ros)
+```
+
diff --git a/plugins/ros/_ros b/plugins/ros/_ros
new file mode 100644
index 000000000..6a04d3c8f
--- /dev/null
+++ b/plugins/ros/_ros
@@ -0,0 +1,64 @@
+#compdef ros
+#autoload
+
+# roswell zsh completion, based on gem completion
+
+local -a _1st_arguments
+_1st_arguments=(
+'run: Run repl'
+'install:Install a given implementation or a system for roswell environment'
+'update:Update installed systems.'
+'build:Make executable from script.'
+'use:Change default implementation.'
+'init:a new ros script, optionally based on a template.'
+'fmt:Indent lisp source.'
+'list:Information'
+'template:[WIP] Manage templates'
+'delete:Delete installed implementations'
+'config:Get and set options'
+'version:Show the roswell version information'
+"help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic."
+)
+
+#local expl
+
+_arguments \
+ '(--version)'--version'[Print version information and quit]' \
+ '(-w --wrap)'{-w,--wrap}'[\[CODE\] Run roswell with a shell wrapper CODE]' \
+ '(-m --image)'{-m,--image}'[\[IMAGE\] continue from Lisp image IMAGE]' \
+ '(-M --module)'{-M,--module}'[\[NAME\] Execute ros script found in ROSWELLPATH. (pythons -m)]' \
+ '(-L --lisp)'{-L,--lisp}'[\[NAME\] Run roswell with a lisp impl NAME\[/VERSION\].]' \
+ '(-l --load)'{-l,--load}'[\[FILE\] load lisp FILE while building]' \
+ '(-S --source-registry)'{-S,--source-registry}'[\[X\] override source registry of asdf systems]' \
+ '(-s --system --load-system)'{-s,--system,--load-system}'[\[SYSTEM\] load asdf SYSTEM while building]' \
+ '(-p --package)'{-p,--package}'[\[PACKAGE\] change current package to \[PACKAGE\]]' \
+ '(-sp --system-package)'{-sp,--system-package}'[\[SP\] combination of -s \[SP\] and -p \[SP\]]' \
+ '(-e --eval)'{-e,--eval}'[\[FORM\] evaluate \[FORM\] while building]' \
+ '--require'--require'[\[MODULE\] require \[MODULE\] while building]' \
+ '(-q --quit)'{-q,--quit}'[quit lisp here]' \
+ '(-r --restart)'{-r,--restart}'[\[FUNC\] restart from build by calling (\[FUNC\])]' \
+ '(-E --entry)'{-E,--entry}'[\[FUNC\] restart from build by calling (\[FUNC\] argv)]' \
+ '(-i --init)'{-i,--init}'[\[FORM\] evaluate \[FORM\] after restart]' \
+ '(-ip --print)'{-ip,--print}'[\[FORM\] evaluate and princ \[FORM\] after restart]' \
+ '(-iw --write)'{-iw,--write}'[\[FORM\] evaluate and write \[FORM\] after restart]' \
+ '(-F --final)'{-F,--final}'[\[FORM\] evaluate \[FORM\] before dumping IMAGE]' \
+ '(\+R --no-rc)'{\+R,--no-rc}'[skip /etc/rosrc, ~/.roswell/init.lisp]' \
+ '(-A --asdf)'{-A,--asdf}'[use new asdf]' \
+ '(\+Q --no-quicklisp)'{\+Q,--no-quicklisp}'[do not use quicklisp]' \
+ '(-v --verbose)'{-v,--verbose}'[be quite noisy while building]' \
+ '--quiet'--quiet'[be quite quiet while building default]' \
+ '--test'--test'[for test purpose]' \
+ '*:: :->subcmds' && return 0
+
+
+if (( CURRENT == 1 )); then
+ _describe -t commands "ros subcommand" _1st_arguments
+ return
+fi
+
+# _files
+case "$words[1]" in
+ -l|--load)
+ _files
+ ;;
+esac
diff --git a/plugins/rsync/README.md b/plugins/rsync/README.md
new file mode 100644
index 000000000..032ee7f3b
--- /dev/null
+++ b/plugins/rsync/README.md
@@ -0,0 +1,16 @@
+# rsync
+
+This plugin adds aliases for frequent [rsync](https://rsync.samba.org/) commands.
+
+To use it add `rsync` to the plugins array in you zshrc file.
+
+```zsh
+plugins=(... rsync)
+```
+
+| Alias | Command |
+| ------------------- | ------------------------------------------------ |
+| *rsync-copy* | `rsync -avz --progress -h` |
+| *rsync-move* | `rsync -avz --progress -h --remove-source-files` |
+| *rsync-update* | `rsync -avzu --progress -h` |
+| *rsync-synchronize* | `rsync -avzu --delete --progress -h` |
diff --git a/plugins/ruby/README.md b/plugins/ruby/README.md
new file mode 100644
index 000000000..ad2755bbf
--- /dev/null
+++ b/plugins/ruby/README.md
@@ -0,0 +1,20 @@
+# Ruby plugin
+
+This plugin adds aliases for common commands used in dealing with [Ruby](https://www.ruby-lang.org/en/) and [gem packages](https://rubygems.org/).
+
+To use it, add `ruby` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... ruby)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|----------------------------------------|------------------------------------------------------|
+| rb | `ruby` | The Ruby command |
+| sgem | `sudo gem` | Run sudo gem on the system ruby, not the active ruby |
+| rfind | `find . -name "*.rb" \| xargs grep -n` | Find ruby file |
+| gin | `gem install` | Install a gem into the local repository |
+| gun | `gem uninstall` | Uninstall gems from the local repository |
+| gli | `gem list` | Display gems installed locally |
diff --git a/plugins/sbt/README.md b/plugins/sbt/README.md
new file mode 100644
index 000000000..f1a5753b9
--- /dev/null
+++ b/plugins/sbt/README.md
@@ -0,0 +1,32 @@
+# sbt plugin
+
+This plugin adds completion for the [sbt, the interactive build tool](https://scala-sbt.org/),
+as well as some aliases for common sbt commands.
+
+To use it, add `sbt` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... sbt)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|-----------------------|--------------------------------------------------------------|
+| sbc | `sbt compile` | Compiles the main sources |
+| 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 |
+| 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 |
+| sbp | `sbt publish` | Publishes artifacts to the repository |
+| sbpl | `sbt publish-local` | 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 |
+| 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/scala/README.md b/plugins/scala/README.md
new file mode 100644
index 000000000..957261d9e
--- /dev/null
+++ b/plugins/scala/README.md
@@ -0,0 +1,15 @@
+## Scala plugin
+
+Completion script for [scala and scalac](https://www.scala-lang.org/) commands.
+
+To use it, add `scala` to the plugins array of your zshrc file:
+```
+plugins=(... scala)
+```
+
+## Aliases
+
+| Command | Description |
+|------------------|---------------------------------------------------------------------------------|
+| `scala` | Run code in the Scala language |
+| `scalac` | Compiler for the Scala language |
diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
index fe4946c6d..a7a4ee33a 100644
--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
@@ -2,20 +2,51 @@ typeset _agent_forwarding _ssh_env_cache
function _start_agent() {
local lifetime
- local -a identities
-
- # start ssh-agent and setup environment
zstyle -s :omz:plugins:ssh-agent lifetime lifetime
+ # start ssh-agent and setup environment
+ echo starting ssh-agent...
ssh-agent -s ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' >! $_ssh_env_cache
chmod 600 $_ssh_env_cache
. $_ssh_env_cache > /dev/null
+}
- # load identies
+function _add_identities() {
+ local id line sig
+ local -a identities loaded_sigs loaded_ids not_loaded
zstyle -a :omz:plugins:ssh-agent identities identities
- echo starting ssh-agent...
- ssh-add $HOME/.ssh/${^identities}
+ # check for .ssh folder presence
+ if [[ ! -d $HOME/.ssh ]]; then
+ return
+ fi
+
+ # add default keys if no identities were set up via zstyle
+ # this is to mimic the call to ssh-add with no identities
+ if [[ ${#identities} -eq 0 ]]; then
+ # key list found on `ssh-add` man page's DESCRIPTION section
+ for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do
+ # check if file exists
+ [[ -f "$HOME/.ssh/$id" ]] && identities+=$id
+ done
+ fi
+
+ # get list of loaded identities' signatures and filenames
+ for line in ${(f)"$(ssh-add -l)"}; do
+ loaded_sigs+=${${(z)line}[2]}
+ loaded_ids+=${${(z)line}[3]}
+ done
+
+ # add identities if not already loaded
+ for id in $identities; do
+ # check for filename match, otherwise try for signature match
+ if [[ ${loaded_ids[(I)$HOME/.ssh/$id]} -le 0 ]]; then
+ sig="$(ssh-keygen -lf "$HOME/.ssh/$id" | awk '{print $2}')"
+ [[ ${loaded_sigs[(I)$sig]} -le 0 ]] && not_loaded+="$HOME/.ssh/$id"
+ fi
+ done
+
+ [[ -n "$not_loaded" ]] && ssh-add ${^not_loaded}
}
# Get the filename to store/lookup the environment from
@@ -42,6 +73,8 @@ else
_start_agent
fi
+_add_identities
+
# tidy up after ourselves
unset _agent_forwarding _ssh_env_cache
-unfunction _start_agent
+unfunction _start_agent _add_identities
diff --git a/plugins/stack/README.md b/plugins/stack/README.md
new file mode 100644
index 000000000..da73444ad
--- /dev/null
+++ b/plugins/stack/README.md
@@ -0,0 +1,9 @@
+# Stack
+
+This plugin provides completion for [Stack](https://haskellstack.org).
+
+To use it add stack to the plugins array in your zshrc file.
+
+```bash
+plugins=(... stack)
+```
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index f5bb070ab..485028d9f 100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -42,8 +42,8 @@ elif [[ "$OSTYPE" = darwin* ]]; then
fi
done
elif [[ "$OSTYPE" = 'cygwin' ]]; then
- local sublime_cygwin_paths
- sublime_cygwin_paths=(
+ local _sublime_cygwin_paths
+ _sublime_cygwin_paths=(
"$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe"
"$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe"
)
diff --git a/plugins/sudo/README.md b/plugins/sudo/README.md
new file mode 100644
index 000000000..ebfdfd10d
--- /dev/null
+++ b/plugins/sudo/README.md
@@ -0,0 +1,57 @@
+# sudo
+
+Easily prefix your current or previous commands with `sudo` by pressing <kbd>esc</kbd> twice
+
+## Enabling the plugin
+
+1. Open your `.zshrc` file and add `sudo` in the plugins section:
+
+ ```zsh
+ plugins=(
+ # all your enabled plugins
+ sudo
+ )
+ ```
+
+2. Reload the source file or restart your Terminal session:
+
+ ```console
+ $ source ~/.zshrc
+ $
+ ```
+
+## Usage examples
+
+### Current typed commands
+
+Say you have typed a long command and forgot to add `sudo` in front:
+
+```console
+$ apt-get install build-essential
+```
+
+By pressing the <kbd>esc</kbd> key twice, you will have the same command with `sudo` prefixed without typing:
+
+```console
+$ sudo apt-get install build-essential
+```
+
+### Previous executed commands
+
+Say you want to delete a system file and denied:
+
+```console
+$ rm some-system-file.txt
+-su: some-system-file.txt: Permission denied
+$
+```
+
+By pressing the <kbd>esc</kbd> key twice, you will have the same command with `sudo` prefixed without typing:
+
+```console
+$ rm some-system-file.txt
+-su: some-system-file.txt: Permission denied
+$ sudo rm some-system-file.txt
+Password:
+$
+```
diff --git a/plugins/suse/README.md b/plugins/suse/README.md
new file mode 100644
index 000000000..b9b069574
--- /dev/null
+++ b/plugins/suse/README.md
@@ -0,0 +1,90 @@
+# suse
+
+**Maintainer**: [r-darwish](https://github.com/r-darwish)
+
+ Alias for Zypper according to the official Zypper's alias
+
+ To use it add `suse` to the plugins array in you zshrc file.
+
+```zsh
+plugins=(... suse)
+```
+
+## Main commands
+
+| Alias | Commands | Description |
+| ---------------- | ----------------------------- | -------------------------------------------------------------- |
+| z | `sudo zypper` | call zypper |
+| zh | `zypper -h` | print help |
+| zhse | `zypper -h se` | print help for the search command |
+| zlicenses | `zypper licenses` | prints a report about licenses and EULAs of installed packages |
+| zps | `sudo zypper ps` | list process using deleted files |
+| zshell | `sudo zypper shell` | open a zypper shell session |
+| zsource-download | `sudo zypper source-download` | download source rpms for all installed packages |
+| ztos | `zypper tos` | shows the ID string of the target operating system |
+| zvcmp | `zypper vcmp` | tell whether version1 is older or newer than version2 |
+
+## Packages commands
+
+| Alias | Commands | Description |
+| ----- | ----------------- | ------------------------------------------------------------------ |
+| zin | `sudo zypper in` | install packages |
+| zinr | `sudo zypper inr` | install newly added packages recommended by already installed ones |
+| zrm | `sudo zypper rm` | remove packages |
+| zsi | `sudo zypper si` | install source of a package |
+| zve | `sudo zypper ve` | verify dependencies of installed packages |
+
+## Updates commands
+
+| Alias | Commands | Description |
+| ------ | ------------------- | ---------------------- |
+| zdup | `sudo zypper dup` | upgrade packages |
+| zlp | `zypper lp` | list necessary patches |
+| zlu | `zypper lu` | list updates |
+| zpchk | `sudo zypper pchk` | check for patches |
+| zup | `sudo zypper up` | update packages |
+| zpatch | `sudo zypper patch` | install patches |
+
+## Request commands
+
+| Alias | Commands | Description |
+| ------------- | -------------------------- | ---------------------------------------------------- |
+| zif | `zypper if` | display info about packages |
+| zpa | `zypper pa` | list packages |
+| zpatch-info | `zypper patch-info` | display info about patches |
+| zpattern-info | `zypper pattern-info` | display info about patterns |
+| zproduct-info | `zypper product-info` | display info about products |
+| zpch | `zypper pch` | list all patches |
+| zpd | `zypper pd` | list products |
+| zpt | `zypper pt` | list patterns |
+| zse | `zypper se` | search for packages |
+| zwp | `zypper wp` | list all packages providing the specified capability |
+
+## Repositories commands
+
+| Alias | Commands | Description |
+| ----- | ------------------- | ---------------------------------------- |
+| zar | `sudo zypper ar` | add a repository |
+| zcl | `sudo zypper clean` | clean cache |
+| zlr | `zypper lr` | list repositories |
+| zmr | `sudo zypper mr` | modify repositories |
+| znr | `sudo zypper nr` | rename repositories (for the alias only) |
+| zref | `sudo zypper ref` | refresh repositories |
+| zrr | `sudo zypper rr` | remove repositories |
+
+## Services commands
+| Alias | Commands | Description |
+| ----- | ------------------ | -------------------------------------------------------------- |
+| zas | `sudo zypper as` | adds a service specified by URI to the system |
+| zms | `sudo zypper ms` | modify properties of specified services |
+| zrefs | `sudo zypper refs` | refreshing a service mean executing the service's special task |
+| zrs | `sudo zypper rs` | remove specified repository index service from the system |
+| zls | `zypper ls` | list services defined on the system |
+
+## Package Locks Management commands
+| Alias | Commands | Description |
+| ----- | ---------------- | ----------------------------------- |
+| zal | `sudo zypper al` | add a package lock |
+| zcl | `sudo zypper cl` | remove unused locks |
+| zll | `zypper ll` | list currently active package locks |
+| zrl | `sudo zypper rl` | remove specified package lock |
diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh
index f7215528b..dcfeccb03 100644
--- a/plugins/suse/suse.plugin.zsh
+++ b/plugins/suse/suse.plugin.zsh
@@ -1,61 +1,59 @@
-#Alias for Zypper according to the official Zypper's alias
-
#Main commands
-alias z='sudo zypper' #call zypper
-alias zh='sudo zypper -h' #print help
-alias zhse='sudo zypper -h se' #print help for the search command
-alias zlicenses='sudo zypper licenses' #prints a report about licenses and EULAs of installed packages
-alias zps='sudo zypper ps' #list process using deleted files
-alias zshell='sudo zypper shell' #open a zypper shell session
-alias zsource-download='sudo zypper source-download' #download source rpms for all installed packages
-alias ztos='sudo zypper tos' #shows the ID string of the target operating system
-alias zvcmp='sudo zypper vcmp' #tell whether version1 is older or newer than version2
+alias z='sudo zypper'
+alias zh='zypper -h'
+alias zhse='zypper -h se'
+alias zlicenses='zypper licenses'
+alias zps='sudo zypper ps'
+alias zshell='sudo zypper shell'
+alias zsource-download='sudo zypper source-download'
+alias ztos='zypper tos'
+alias zvcmp='zypper vcmp'
#Packages commands
-alias zin='sudo zypper in' #install packages
-alias zinr='sudo zypper inr' #install newly added packages recommended by already installed ones
-alias zrm='sudo zypper rm' #remove packages
-alias zsi='sudo zypper si' #install source of a package
-alias zve='sudo zypper ve' #verify dependencies of installed packages
+alias zin='sudo zypper in'
+alias zinr='sudo zypper inr'
+alias zrm='sudo zypper rm'
+alias zsi='sudo zypper si'
+alias zve='sudo zypper ve'
#Updates commands
-alias zdup='sudo zypper dup' #upgrade packages
-alias zlp='sudo zypper lp' #list necessary patchs
-alias zlu='sudo zypper lu' #list updates
-alias zpchk='sudo zypper pchk' #check for patches
-alias zup='sudo zypper up' #update packages
-alias zpatch='sudo zypper patch' #install patches
+alias zdup='sudo zypper dup'
+alias zlp='zypper lp'
+alias zlu='zypper lu'
+alias zpchk='sudo zypper pchk'
+alias zup='sudo zypper up'
+alias zpatch='sudo zypper patch'
#Request commands
-alias zif='sudo zypper if' #display info about packages
-alias zpa='sudo zypper pa' #list packages
-alias zpatch-info='sudo zypper patch-info' #display info about patches
-alias zpattern-info='sudo zypper patch-info' #display info about patterns
-alias zproduct-info='sudo zypper patch-info' #display info about products
-alias zpch='sudo zypper pch' #list all patches
-alias zpd='sudo zypper pd' #list products
-alias zpt='sudo zypper pt' #list patterns
-alias zse='sudo zypper se' #search for packages
-alias zwp='sudo zypper wp' #list all packages providing the specified capability
+alias zif='zypper if'
+alias zpa='zypper pa'
+alias zpatch-info='zypper patch-info'
+alias zpattern-info='zypper pattern-info'
+alias zproduct-info='zypper product-info'
+alias zpch='zypper pch'
+alias zpd='zypper pd'
+alias zpt='zypper pt'
+alias zse='zypper se'
+alias zwp='zypper wp'
#Repositories commands
-alias zar='sudo zypper ar' #add a repository
-alias zcl='sudo zypper clean' #clean cache
-alias zlr='sudo zypper lr' #list repositories
-alias zmr='sudo zypper mr' #modify repositories
-alias znr='sudo zypper nr' #rename repositories (for the alias only)
-alias zref='sudo zypper ref' #refresh repositories
-alias zrr='sudo zypper rr' #remove repositories
+alias zar='sudo zypper ar'
+alias zcl='sudo zypper clean'
+alias zlr='zypper lr'
+alias zmr='sudo zypper mr'
+alias znr='sudo zypper nr'
+alias zref='sudo zypper ref'
+alias zrr='sudo zypper rr'
#Services commands
-alias zas='sudo zypper as' #adds a service specified by URI to the system
-alias zms='sudo zypper ms' #modify properties of specified services
-alias zrefs='sudo zypper refs' #refreshing a service mean executing the service's special task
-alias zrs='sudo zypper rs' #remove specified repository index service from the system
-alias zls='sudo zypper ls' #list services defined on the system
+alias zas='sudo zypper as'
+alias zms='sudo zypper ms'
+alias zrefs='sudo zypper refs'
+alias zrs='sudo zypper rs'
+alias zls='zypper ls'
#Package Locks Management commands
-alias zal='sudo zypper al' #add a package lock
-alias zcl='sudo zypper cl' #Remove unused locks
-alias zll='sudo zypper ll' #list currently active package locks
-alias zrl='sudo zypper rl' #remove specified package lock
+alias zal='sudo zypper al'
+alias zcl='sudo zypper cl'
+alias zll='zypper ll'
+alias zrl='sudo zypper rl'
diff --git a/plugins/svcat/README.md b/plugins/svcat/README.md
new file mode 100644
index 000000000..0bc60b117
--- /dev/null
+++ b/plugins/svcat/README.md
@@ -0,0 +1,9 @@
+# svcat
+
+This plugin provides completion for the [Kubernetes service catalog cli](https://github.com/kubernetes-incubator/service-catalog).
+
+To use it, add `svcat` to the plugins array in your zshrc file.
+
+```
+plugins=(... svcat)
+```
diff --git a/plugins/svcat/svcat.plugin.zsh b/plugins/svcat/svcat.plugin.zsh
new file mode 100644
index 000000000..f90e7d8d6
--- /dev/null
+++ b/plugins/svcat/svcat.plugin.zsh
@@ -0,0 +1,6 @@
+# Autocompletion for svcat.
+#
+
+if [ $commands[svcat] ]; then
+ source <(svcat completion zsh)
+fi
diff --git a/plugins/swiftpm/_swift b/plugins/swiftpm/_swift
index 901b5d9e2..bed6e13a7 100644
--- a/plugins/swiftpm/_swift
+++ b/plugins/swiftpm/_swift
@@ -72,14 +72,16 @@ _swift_build() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
"--disable-prefetching[]"
+ "--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
"--version[]"
"--destination[]: :_files"
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
- "--no-static-swift-stdlib[Do not link Swift stdlib statically]"
+ "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
- "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]"
+ "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
"--build-tests[Build both source and test targets]"
"--product[Build the specified product]:Build the specified product: "
"--target[Build the specified target]:Build the specified target: "
@@ -106,14 +108,16 @@ _swift_run() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
"--disable-prefetching[]"
+ "--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
"--version[]"
"--destination[]: :_files"
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
- "--no-static-swift-stdlib[Do not link Swift stdlib statically]"
+ "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
- "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]"
+ "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
"--skip-build[Skip building the executable product]"
)
_arguments $arguments && return
@@ -136,14 +140,16 @@ _swift_package() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
"--disable-prefetching[]"
+ "--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
"--version[]"
"--destination[]: :_files"
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
- "--no-static-swift-stdlib[Do not link Swift stdlib statically]"
+ "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
- "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]"
+ "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
'(-): :->command'
'(-)*:: :->arg'
)
@@ -152,135 +158,133 @@ _swift_package() {
(command)
local modes
modes=(
+ 'edit:Put a package in editable mode'
+ 'clean:Delete build artifacts'
+ 'init:Initialize a new package'
+ 'dump-package:Print parsed Package.swift as JSON'
+ 'describe:Describe the current package'
+ 'unedit:Remove a package from editable mode'
'update:Update package dependencies'
- 'show-dependencies:Print the resolved dependency graph'
- 'resolve:Resolve package dependencies'
- 'fetch:'
'completion-tool:Completion tool (for shell completions)'
- 'edit:Put a package in editable mode'
'tools-version:Manipulate tools version of the current package'
- 'describe:Describe the current package'
- 'clean:Delete build artifacts'
'reset:Reset the complete cache/build directory'
- 'unedit:Remove a package from editable mode'
+ 'resolve:Resolve package dependencies'
'generate-xcodeproj:Generates an Xcode project'
- 'init:Initialize a new package'
- 'dump-package:Print parsed Package.swift as JSON'
+ 'fetch:'
+ 'show-dependencies:Print the resolved dependency graph'
)
_describe "mode" modes
;;
(arg)
case ${words[1]} in
- (update)
- _swift_package_update
+ (edit)
+ _swift_package_edit
;;
- (show-dependencies)
- _swift_package_show-dependencies
+ (clean)
+ _swift_package_clean
;;
- (resolve)
- _swift_package_resolve
+ (init)
+ _swift_package_init
;;
- (fetch)
- _swift_package_fetch
+ (dump-package)
+ _swift_package_dump-package
+ ;;
+ (describe)
+ _swift_package_describe
+ ;;
+ (unedit)
+ _swift_package_unedit
+ ;;
+ (update)
+ _swift_package_update
;;
(completion-tool)
_swift_package_completion-tool
;;
- (edit)
- _swift_package_edit
- ;;
(tools-version)
_swift_package_tools-version
;;
- (describe)
- _swift_package_describe
- ;;
- (clean)
- _swift_package_clean
- ;;
(reset)
_swift_package_reset
;;
- (unedit)
- _swift_package_unedit
+ (resolve)
+ _swift_package_resolve
;;
(generate-xcodeproj)
_swift_package_generate-xcodeproj
;;
- (init)
- _swift_package_init
+ (fetch)
+ _swift_package_fetch
;;
- (dump-package)
- _swift_package_dump-package
+ (show-dependencies)
+ _swift_package_show-dependencies
;;
esac
;;
esac
}
-_swift_package_update() {
+_swift_package_edit() {
arguments=(
+ ":The name of the package to edit:_swift_dependency"
+ "--revision[The revision to edit]:The revision to edit: "
+ "--branch[The branch to create]:The branch to create: "
+ "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files"
)
_arguments $arguments && return
}
-_swift_package_show-dependencies() {
+_swift_package_clean() {
arguments=(
- "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}"
)
_arguments $arguments && return
}
-_swift_package_resolve() {
+_swift_package_init() {
arguments=(
- ":The name of the package to resolve:_swift_dependency"
- "--version[The version to resolve at]:The version to resolve at: "
- "--branch[The branch to resolve at]:The branch to resolve at: "
- "--revision[The revision to resolve at]:The revision to resolve at: "
+ "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}"
)
_arguments $arguments && return
}
-_swift_package_fetch() {
+_swift_package_dump-package() {
arguments=(
)
_arguments $arguments && return
}
-_swift_package_completion-tool() {
+_swift_package_describe() {
arguments=(
- ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}"
+ "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}"
)
_arguments $arguments && return
}
-_swift_package_edit() {
+_swift_package_unedit() {
arguments=(
- ":The name of the package to edit:_swift_dependency"
- "--revision[The revision to edit]:The revision to edit: "
- "--branch[The branch to create]:The branch to create: "
- "--path[Create or use the checkout at this path]:Create or use the checkout at this path:_files"
+ ":The name of the package to unedit:_swift_dependency"
+ "--force[Unedit the package even if it has uncommited and unpushed changes.]"
)
_arguments $arguments && return
}
-_swift_package_tools-version() {
+_swift_package_update() {
arguments=(
- "--set[Set tools version of package to the given value]:Set tools version of package to the given value: "
- "--set-current[Set tools version of package to the current tools version in use]"
)
_arguments $arguments && return
}
-_swift_package_describe() {
+_swift_package_completion-tool() {
arguments=(
- "--type[json|text]: :{_values '' 'text[describe using text format]' 'json[describe using JSON format]'}"
+ ": :{_values '' 'generate-bash-script[generate Bash completion script]' 'generate-zsh-script[generate Bash completion script]' 'list-dependencies[list all dependencies' names]' 'list-executables[list all executables' names]'}"
)
_arguments $arguments && return
}
-_swift_package_clean() {
+_swift_package_tools-version() {
arguments=(
+ "--set[Set tools version of package to the given value]:Set tools version of package to the given value: "
+ "--set-current[Set tools version of package to the current tools version in use]"
)
_arguments $arguments && return
}
@@ -291,10 +295,12 @@ _swift_package_reset() {
_arguments $arguments && return
}
-_swift_package_unedit() {
+_swift_package_resolve() {
arguments=(
- ":The name of the package to unedit:_swift_dependency"
- "--force[Unedit the package even if it has uncommited and unpushed changes.]"
+ ":The name of the package to resolve:_swift_dependency"
+ "--version[The version to resolve at]:The version to resolve at: "
+ "--branch[The branch to resolve at]:The branch to resolve at: "
+ "--revision[The revision to resolve at]:The revision to resolve at: "
)
_arguments $arguments && return
}
@@ -304,19 +310,21 @@ _swift_package_generate-xcodeproj() {
"--xcconfig-overrides[Path to xcconfig file]:Path to xcconfig file:_files"
"--enable-code-coverage[Enable code coverage in the generated project]"
"--output[Path where the Xcode project should be generated]:Path where the Xcode project should be generated:_files"
+ "--legacy-scheme-generator[Use the legacy scheme generator]"
+ "--watch[Watch for changes to the Package manifest to regenerate the Xcode project]"
)
_arguments $arguments && return
}
-_swift_package_init() {
+_swift_package_fetch() {
arguments=(
- "--type[empty|library|executable|system-module]: :{_values '' 'empty[generates an empty project]' 'library[generates project for a dynamic library]' 'executable[generates a project for a cli executable]' 'system-module[generates a project for a system module]'}"
)
_arguments $arguments && return
}
-_swift_package_dump-package() {
+_swift_package_show-dependencies() {
arguments=(
+ "--format[text|dot|json|flatlist]: :{_values '' 'text[list dependencies using text format]' 'dot[list dependencies using dot format]' 'json[list dependencies using JSON format]'}"
)
_arguments $arguments && return
}
@@ -338,19 +346,22 @@ _swift_test() {
"--build-path[Specify build/cache directory ]:Specify build/cache directory :_files"
"(--chdir -C)"{--chdir,-C}"[]: :_files"
"--package-path[Change working directory before any other operation]:Change working directory before any other operation:_files"
+ "--sanitize[Turn on runtime checks for erroneous behavior]: :{_values '' 'address[enable Address sanitizer]' 'thread[enable Thread sanitizer]'}"
"--disable-prefetching[]"
+ "--skip-update[Skip updating dependencies from their remote during a resolution]"
"--disable-sandbox[Disable using the sandbox when executing subprocesses]"
"--version[]"
"--destination[]: :_files"
"(--verbose -v)"{--verbose,-v}"[Increase verbosity of informational output]"
- "--no-static-swift-stdlib[Do not link Swift stdlib statically]"
+ "--no-static-swift-stdlib[Do not link Swift stdlib statically \[default\]]"
"--static-swift-stdlib[Link Swift stdlib statically]"
- "--enable-build-manifest-caching[Enable llbuild manifest caching [Experimental]]"
+ "--enable-build-manifest-caching[Enable llbuild manifest caching \[Experimental\]]"
"--skip-build[Skip building the test target]"
"(--list-tests -l)"{--list-tests,-l}"[Lists test methods in specifier format]"
"--generate-linuxmain[Generate LinuxMain.swift entries for the package]"
"--parallel[Run the tests in parallel.]"
"(--specifier -s)"{--specifier,-s}"[]: : "
+ "--xunit-output[]: :_files"
"--filter[Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>]:Run test cases matching regular expression, Format: <test-target>.<test-case> or <test-target>.<test-case>/<test>: "
)
_arguments $arguments && return
diff --git a/plugins/symfony/README.md b/plugins/symfony/README.md
new file mode 100644
index 000000000..c58f64fdd
--- /dev/null
+++ b/plugins/symfony/README.md
@@ -0,0 +1,9 @@
+# Symfony
+
+This plugin provides completion for [Symfony](https://symfony.com/).
+
+To use it add symfony to the plugins array in your zshrc file.
+
+```bash
+plugins=(... symfony)
+```
diff --git a/plugins/symfony2/README.md b/plugins/symfony2/README.md
new file mode 100644
index 000000000..2946d0937
--- /dev/null
+++ b/plugins/symfony2/README.md
@@ -0,0 +1,28 @@
+# Symfony2
+
+This plugin provides completion for [Symfony 2](https://symfony.com/), as well as aliases for frequent Symfony commands.
+
+To use it add symfony2 to the plugins array in your zshrc file.
+
+```bash
+plugins=(... symfony2)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|---------------|------------------------------|-------------------------------|
+| `sf` | php app/console | Start the symfony console |
+| `sfcl` | sf cache:clear | Clear the cache |
+| `sfsr` | sf server:run | Run the dev server |
+| `sfcw` | sf cache:warmup | Use the Bundles warmer |
+| `sfroute` | sf debug:router | Show the different routes |
+| `sfcontainer` | sf debug:contaner | List the different services |
+| `sfgb` | sf generate:bundle | Generate a bundle |
+| `sfgc` | sf generate:controller | Generate a controller |
+| `sfgcom` | sf generate:command | Generate a command |
+| `sfge` | sf doctrine:generate:entity | Generate an entity |
+| `sfsu` | sf doctrine:schema:update | Update the schema in Database |
+| `sfdc` | sf doctrine:database:create | Create the Database |
+| `sfdev` | sf --env=dev | Update environment to `dev` |
+| `sfprod` | sf --env=prod | Update environment to `prod` |
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
index 0b608fe2a..1498e8d02 100644
--- a/plugins/symfony2/symfony2.plugin.zsh
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -25,7 +25,10 @@ alias sfcw='sf cache:warmup'
alias sfroute='sf debug:router'
alias sfcontainer='sf debug:container'
alias sfgb='sf generate:bundle'
+alias sfgc='sf generate:controller'
+alias sfgcom='sf generate:command'
alias sfge='sf doctrine:generate:entity'
alias sfsu='sf doctrine:schema:update'
+alias sfdc='sf doctrine:database:create'
alias sfdev='sf --env=dev'
alias sfprod='sf --env=prod'
diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md
new file mode 100644
index 000000000..edca4d87d
--- /dev/null
+++ b/plugins/systemadmin/README.md
@@ -0,0 +1,51 @@
+# Systemadmin plugin
+
+This plugin adds a series of aliases and functions which make a System Administrator's life easier.
+
+To use it, add `systemadmin` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... systemadmin)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|---------|------------------------------------------------------------------------|--------------------------------------------------------------------|
+| ping | `ping -c 5` | Sends only 5 ICMP Messages |
+| clr | `clear; echo Currently logged in on $TTY, as $USER in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory |
+| path | `print -l $path` | Displays PATH with each entry on a separate line |
+| mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output |
+| psmem | `ps -e -orss=,args= \| sort -b -k1,1n` | Display the processes using the most memory |
+| psmem10 | `ps -e -orss=,args= \| sort -b -k1,1n \| head -10` | Display the top 10 processes using the most memory |
+| pscpu | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr` | Display the top processes using the most CPU |
+| pscpu10 | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr \| head -10` | Display the top 10 processes using the most CPU |
+| hist10 | `print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10` | Display the top 10 most used commands in the history |
+
+## Functions
+
+| Function | Description |
+|-------------|-----------------------------------------------------------------------------------------------------------------------|
+| dls | List only directories in the current directory |
+| psgrep | List all processes that match the pattern input after the command |
+| killit | Kills any process that matches a regular expression passed to it |
+| tree | List contents of directories in a tree-like format (if tree isn't installed) |
+| sortcons | Sort connections by state |
+| con80 | View all 80 Port Connections |
+| sortconip | On the connected IP sorted by the number of connections |
+| req20 | List the top 20 requests on port 80 |
+| http20 | List the top 20 connections to port 80 based on tcpdump data |
+| timewait20 | List the top 20 time_wait connections |
+| syn20 | List the top 20 SYN connections |
+| port_pro | Output all processes according to the port number |
+| accessip10 | List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified |
+| visitpage20 | List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified |
+| consume100 | List the 100 most time-consuming Page lists (more than 60 seconds) as well as the corresponding number of occurrences |
+| webtraffic | List website traffic statistics in GB from tne nginx/access.log file or another log file if specified |
+| c404 | List statistics on 404 connections in the nginx/access.log file or another log file if specified |
+| httpstatus | List statistics based on http status in the nginx/access.log file or another log file if specified |
+| d0 | Delete 0 byte files recursively in the current directory or another if specified |
+| geteip | Gather information regarding an external IP address using [icanhazip.com](https://icanhazip.com) |
+| getip | Determine the local IP Address with `ip addr` or `ifconfig` |
+| clrz | Clear zombie processes |
+| conssec | Show number of concurrent connections per second based on ngnix/access.log file or another log file if specified |
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
index a74f818dd..bdc2219fa 100644
--- a/plugins/systemadmin/systemadmin.plugin.zsh
+++ b/plugins/systemadmin/systemadmin.plugin.zsh
@@ -12,14 +12,6 @@
#
# ------------------------------------------------------------------------------
-function retval() {
- if [[ -z $1 ]];then
- echo '.'
- else
- echo $1
- fi
-}
-
function retlog() {
if [[ -z $1 ]];then
echo '/var/log/nginx/access.log'
@@ -29,8 +21,8 @@ function retlog() {
}
alias ping='ping -c 5'
-alias clr='clear;echo "Currently logged in on $(tty), as $USER in directory $PWD."'
-alias path='echo -e ${PATH//:/\\n}'
+alias clr='clear; echo Currently logged in on $TTY, as $USER in directory $PWD.'
+alias path='print -l $path'
alias mkdir='mkdir -pv'
# get top process eating memory
alias psmem='ps -e -orss=,args= | sort -b -k1,1n'
@@ -43,10 +35,10 @@ alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
# directory LS
dls () {
- ls -l | grep "^d" | awk '{ print $9 }' | tr -d "/"
+ print -l *(/)
}
psgrep() {
- ps aux | grep "$(retval $1)" | grep -v grep
+ ps aux | grep "${1:-.}" | grep -v grep
}
# Kills any process that matches a regexp passed to it
killit() {
@@ -54,10 +46,10 @@ killit() {
}
# list contents of directories in a tree-like format
-if [ -z "\${which tree}" ]; then
- tree () {
- find $@ -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
- }
+if ! (( $+commands[tree] )); then
+ tree () {
+ find $@ -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
+ }
fi
# Sort connection state
@@ -97,7 +89,7 @@ syn20() {
# Printing process according to the port number
port_pro() {
- netstat -ntlp | grep "$(retval $1)" | awk '{print $7}' | cut -d/ -f1
+ netstat -ntlp | grep "${1:-.}" | awk '{print $7}' | cut -d/ -f1
}
# top10 of gain access to the ip address
@@ -134,7 +126,7 @@ httpstatus() {
# Delete 0 byte file
d0() {
- find "$(retval $1)" -type f -size 0 -exec rm -rf {} \;
+ find "${1:-.}" -type f -size 0 -exec rm -rf {} \;
}
# gather external ip address
@@ -142,12 +134,12 @@ geteip() {
curl -s -S https://icanhazip.com
}
-# determine local IP address
+# determine local IP address(es)
getip() {
if (( ${+commands[ip]} )); then
- ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}'
+ ip addr | awk '/inet /{print $2}' | command grep -v 127.0.0.1
else
- ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
+ ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1
fi
}
diff --git a/plugins/systemd/README.md b/plugins/systemd/README.md
new file mode 100644
index 000000000..d91329290
--- /dev/null
+++ b/plugins/systemd/README.md
@@ -0,0 +1,53 @@
+# Systemd plugin
+
+The systemd plugin provides many useful aliases for systemd.
+
+To use it, add systemd to the plugins array of your zshrc file:
+```
+plugins=(... systemd)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|:-----------------------|:-----------------------------------|:-----------------------------------------------------------------|
+| `sc-list-units` | `systemctl list-units` | List all units systemd has in memory |
+| `sc-is-active` | `systemctl is-active` | Show whether a unit is active |
+| `sc-status` | `systemctl status` | Show terse runtime status information about one or more units |
+| `sc-show` | `systemctl show` | Show properties of units, jobs, or the manager itself |
+| `sc-help` | `systemctl help` | Show man page of units |
+| `sc-list-unit-files` | `systemctl list-unit-files` | List unit files installed on the system |
+| `sc-is-enabled` | `systemctl is-enabled` | Checks whether any of the specified unit files are enabled |
+| `sc-list-jobs` | `systemctl list-jobs` | List jobs that are in progress |
+| `sc-show-environment` | `systemctl show-environment` | Dump the systemd manager environment block |
+| `sc-cat` | `systemctl cat` | Show backing files of one or more units |
+| `sc-list-timers` | `systemctl list-timers` | List timer units currently in memory |
+| **Aliases with sudo** |
+| `sc-start` | `sudo systemctl start` | Start Unit(s) |
+| `sc-stop` | `sudo systemctl stop` | Stop Unit(s) |
+| `sc-reload` | `sudo systemctl reload` | Reload Unit(s) |
+| `sc-restart` | `sudo systemctl restart` | Restart Unit(s) |
+| `sc-try-restart` | `sudo systemctl try-restart` | Restart Unit(s) |
+| `sc-isolate` | `sudo systemctl isolate` | Start a unit and its dependencies and stop all others |
+| `sc-kill` | `sudo systemctl kill` | Kill unit(s) |
+| `sc-reset-failed` | `sudo systemctl reset-failed` | Reset the "failed" state of the specified units, |
+| `sc-enable` | `sudo systemctl enable` | Enable unit(s) |
+| `sc-disable` | `sudo systemctl disable` | Disable unit(s) |
+| `sc-reenable` | `sudo systemctl reenable` | Reenable unit(s) |
+| `sc-preset` | `sudo systemctl preset` | Reset the enable/disable status one or more unit files |
+| `sc-mask` | `sudo systemctl mask` | Mask unit(s) |
+| `sc-unmask` | `sudo systemctl unmask` | Unmask unit(s) |
+| `sc-link` | `sudo systemctl link` | Link a unit file into the unit file search path |
+| `sc-load` | `sudo systemctl load` | Load unit(s) |
+| `sc-cancel` | `sudo systemctl cancel` | Cancel job(s) |
+| `sc-set-environment` | `sudo systemctl set-environment` | Set one or more systemd manager environment variables |
+| `sc-unset-environment` | `sudo systemctl unset-environment` | Unset one or more systemd manager environment variables |
+| `sc-edit` | `sudo systemctl edit` | Edit a drop-in snippet or a whole replacement file with `--full` |
+| `sc-enable-now` | `sudo systemctl enable --now` | Enable and start unit(s) |
+| `sc-disable-now` | `sudo systemctl disable --now` | Disable and stop unit(s) |
+| `sc-mask-now` | `sudo systemctl mask --now` | Mask and stop unit(s) |
+
+### User aliases
+
+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`.
diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh
index b170f73a6..d727c1ee0 100644
--- a/plugins/terraform/terraform.plugin.zsh
+++ b/plugins/terraform/terraform.plugin.zsh
@@ -1,4 +1,6 @@
function tf_prompt_info() {
+ # dont show 'default' workspace in home dir
+ [[ "$PWD" == ~ ]] && return
# check if in terraform dir
if [ -d .terraform ]; then
workspace=$(terraform workspace show 2> /dev/null) || return
diff --git a/plugins/textmate/README.md b/plugins/textmate/README.md
new file mode 100644
index 000000000..9fd342135
--- /dev/null
+++ b/plugins/textmate/README.md
@@ -0,0 +1,16 @@
+# TextMate plugin
+
+The plugin adds a function for the [TextMate](https://macromates.com) editor.
+
+To use it, add `textmate` to the plugins array of your zshrc file:
+```
+plugins=(... textmate)
+```
+
+## Function
+
+The `tm` function provides the following options:
+
+- No arguments: Run `mate` in the current directory.
+- Argument that is a directory: Run `mate` in the given directory and cd to it.
+- Other arguments: Pass all arguments to `mate`. This allows for easy opening of multiple files.
diff --git a/plugins/themes/README.md b/plugins/themes/README.md
new file mode 100644
index 000000000..408e357e0
--- /dev/null
+++ b/plugins/themes/README.md
@@ -0,0 +1,18 @@
+# Themes Plugin
+
+This plugin allows you to change ZSH theme on the go.
+
+To use it, add `themes` to the plugins array in your zshrc file:
+
+```
+plugins=(... themes)
+```
+
+## Usage
+
+`theme <theme_name>` - Changes the ZSH theme to specified theme.
+
+`theme ` - Changes the ZSH theme to some random theme.
+
+`lstheme ` - Lists installed ZSH themes.
+
diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh
index 7519b0253..2cd0ee327 100644
--- a/plugins/themes/themes.plugin.zsh
+++ b/plugins/themes/themes.plugin.zsh
@@ -8,9 +8,9 @@ function theme
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
- if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
+ if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
then
- source "$ZSH_CUSTOM/$1.zsh-theme"
+ source "$ZSH_CUSTOM/themes/$1.zsh-theme"
else
source "$ZSH/themes/$1.zsh-theme"
fi
@@ -19,6 +19,8 @@ function theme
function lstheme
{
- cd $ZSH/themes
- ls *zsh-theme | sed 's,\.zsh-theme$,,'
+ # 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)
}
diff --git a/plugins/timer/README.md b/plugins/timer/README.md
new file mode 100644
index 000000000..321307e59
--- /dev/null
+++ b/plugins/timer/README.md
@@ -0,0 +1,17 @@
+This plugin allows to display command's execution time in a very nonintrusive way.
+
+Timer can be tuned by these two variables:
+* `TIMER_PRECISION` allows to control number of decimal places (default `1`)
+* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`)
+
+Sample session:
+
+ me@here:~$ sleep 1 /1.0s
+ me@here:~$ sleep 73 /1m13.0s
+ me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s]
+ me@here:~$ head -c50 < /dev/urandom | hexdump
+ 0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab
+ 0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb
+ 0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db
+ 0000030 09 37
+ 0000032 [0.02s]
diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh
new file mode 100644
index 000000000..231134e7d
--- /dev/null
+++ b/plugins/timer/timer.plugin.zsh
@@ -0,0 +1,29 @@
+__timer_current_time() {
+ perl -MTime::HiRes=time -e'print time'
+}
+
+__timer_format_duration() {
+ local mins=$(printf '%.0f' $(($1 / 60)))
+ local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
+ local duration_str=$(echo "${mins}m${secs}s")
+ local format="${TIMER_FORMAT:-/%d}"
+ echo "${format//\%d/${duration_str#0m}}"
+}
+
+__timer_save_time_preexec() {
+ __timer_cmd_start_time=$(__timer_current_time)
+}
+
+__timer_display_timer_precmd() {
+ if [ -n "${__timer_cmd_start_time}" ]; then
+ local cmd_end_time=$(__timer_current_time)
+ local tdiff=$((cmd_end_time - __timer_cmd_start_time))
+ unset __timer_cmd_start_time
+ local tdiffstr=$(__timer_format_duration ${tdiff})
+ local cols=$((COLUMNS - ${#tdiffstr} - 1))
+ echo -e "\033[1A\033[${cols}C ${tdiffstr}"
+ fi
+}
+
+preexec_functions+=(__timer_save_time_preexec)
+precmd_functions+=(__timer_display_timer_precmd)
diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md
new file mode 100644
index 000000000..427119d3d
--- /dev/null
+++ b/plugins/tmux/README.md
@@ -0,0 +1,39 @@
+# tmux
+
+This plugin provides aliases for [tmux](http://tmux.github.io/), the terminal multiplexer.
+To use it add `tmux` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... tmux)
+```
+
+The plugin also supports the following -
+- determines if tmux is installed or not, if not, prompts user to install tmux
+- determines if the terminal supports the 256 colors or not, sets the appropriate configuration variable
+- sets the correct local config file to use
+
+## Aliases
+
+| Alias | Command | Description |
+| ------ | -----------------------|---------------------------------------------------------- |
+| `ta` | tmux attach -t | Attach new tmux session to already running named session |
+| `tad` | tmux attach -d -t | Detach named tmux session |
+| `ts` | tmux new-session -s | Create a new named tmux session |
+| `tl` | tmux list-sessions | Displays a list of running tmux sessions |
+| `tksv` | tmux kill-server | Terminate all running tmux sessions |
+| `tkss` | tmux kill-session -t | Terminate named running tmux session |
+| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session |
+
+
+## Configuration Variables
+
+| Variable | Description |
+|-------------------------------------|-------------------------------------------------------------------------------|
+| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
+| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) |
+| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
+| `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` |
diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh
index 7ddf42099..2f3c3e79d 100644
--- a/plugins/tmux/tmux.plugin.zsh
+++ b/plugins/tmux/tmux.plugin.zsh
@@ -36,7 +36,7 @@ alias tkss='tmux kill-session -t'
: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
# Determine if the terminal supports 256 colors
-if [[ $(tput colors) == 256 ]]; then
+if [[ $terminfo[colors] == 256 ]]; then
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITH_256COLOR
else
export ZSH_TMUX_TERM=$ZSH_TMUX_FIXTERM_WITHOUT_256COLOR
diff --git a/plugins/tmuxinator/README.md b/plugins/tmuxinator/README.md
new file mode 100644
index 000000000..994d8d46d
--- /dev/null
+++ b/plugins/tmuxinator/README.md
@@ -0,0 +1,19 @@
+# Tmuxinator plugin
+
+This plugin provides completion for [tmuxinator](https://github.com/tmuxinator/tmuxinator),
+as well as aliases for frequent tmuxinator commands.
+
+To use it add `tmuxinator` to the plugins array in your zshrc file.
+
+```zsh
+plugins=(... tmuxinator)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| ------ | ---------------- | ------------------------ |
+| `txs ` | tmuxinator start | Start Tmuxinator |
+| `txo ` | tmuxinator open | Open project for editing |
+| `txn ` | tmuxinator new | Create project |
+| `txl ` | tmuxinator list | List projects |
diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh
index 7a7cd85ec..db744b0cd 100644
--- a/plugins/transfer/transfer.plugin.zsh
+++ b/plugins/transfer/transfer.plugin.zsh
@@ -61,7 +61,9 @@ transfer() {
# cat output link
cat $tmpfile
+ # add newline
+ echo
# cleanup
rm -f $tmpfile
-} \ No newline at end of file
+}
diff --git a/plugins/ubuntu/README.md b/plugins/ubuntu/README.md
new file mode 100644
index 000000000..caa6a90b4
--- /dev/null
+++ b/plugins/ubuntu/README.md
@@ -0,0 +1,52 @@
+# Ubuntu plugin
+
+This plugin adds completions and aliases for [Ubuntu](https://www.ubuntu.com/).
+
+To use it, add `ubuntu` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... ubuntu)
+```
+
+## Aliases
+
+Commands that use `$APT` will use apt if installed or defer to apt-get otherwise.
+
+| Alias | Command | Description |
+|---------|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
+| acs | `apt-cache search` | Search the apt-cache with the specified criteria |
+| acp | `apt-cache policy` | Display the package source priorities |
+| afs | `apt-file search --regexp` | Perform a regular expression apt-file search |
+| afu | `sudo apt-file update` | Generates or updates the apt-file package database |
+| ag | `sudo $APT` | Run apt-get with sudo |
+| aga | `sudo $APT autoclean` | Clears out the local reposityory of retrieved package files that can no longer be downloaded |
+| agb | `sudo $APT build-dep <source_pkg>` | Installs/Removes packages to satisfy the dependencies of a specified build pkg |
+| agc | `sudo $APT clean` | Clears out the local repository of retrieved package files leaving everything from the lock files |
+| agd | `sudo $APT dselect-upgrade` | Follows dselect choices for package installation |
+| agi | `sudo $APT install <pkg>` | Install the specified package |
+| agli | `apt list --installed` | List the installed packages |
+| aglu | `sudo apt-get -u upgrade --assume-no` | Run an apt-get upgrade assuming no to all prompts |
+| agp | `sudo $APT purge <pkg>` | Remove a package including any configuration files |
+| agr | `sudo $APT remove <pkg>` | Remove a package |
+| ags | `$APT source <pkg>` | Fetch the source for the specified package |
+| agu | `sudo $APT update` | Update package list |
+| agud | `sudo $APT update && sudo $APT dist-upgrade` | Update packages list and perform a distribution upgrade |
+| agug | `sudo $APT upgrade` | Upgrade available packages |
+| agar | `sudo $APT autoremove` | Remove automatically installed packages no longer needed |
+| aguu | `sudo $APT update && sudo $APT upgrade` | Update packages list and upgrade available packages |
+| allpkgs | `dpkg --get-selections \| grep -v deinstall` | Print all installed packages |
+| kclean | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` |Remove ALL kernel images and headers EXCEPT the one in use |
+| mydeb | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package |
+| ppap | `sudo ppa-purge <ppa>` | Remove the specified PPA |
+
+
+## Functions
+
+| Function | Usage |Description |
+|-------------------|---------------------------------------|--------------------------------------------------------------------------|
+| aar | `aar ppa:xxxxxx/xxxxxx [packagename]` | apt-add-repository with automatic install/upgrade of the desired package |
+| apt-history | `apt-history <action>` | Prints the Apt history of the specified action |
+| apt-list-packages | `apt-list-packages` | List packages by size |
+| kerndeb | `kerndeb` | Kernel-package building shortcut |
+
+
diff --git a/plugins/ubuntu/readme.md b/plugins/ubuntu/readme.md
deleted file mode 100644
index 99d62a6f7..000000000
--- a/plugins/ubuntu/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-This plugin was created because the aliases in the debian plugin are inconsistent and hard to remember. Also this apt-priority detection that switched between apt-get and aptitude was dropped to keep it simpler. This plugin uses apt-get for everything but a few things that are only possible with aptitude I guess. Ubuntu does not have aptitude installed by default.
-
-acs = Apt-Cache Search
-acp = Apt-Cache Policy
-
-ag = sudo Apt-Get
-agi = sudo Apt-Get Install
-agd = sudo Apt-Get Dselect-upgrade
-By now you already can guess almost all aliases
-
-There are two exeptions since ...
-agu = sudo Apt-Get Update - we have ...
-agug = sudo Apt-Get UpGrade - as the exceptional 4 letter alias for a single command.
-
-afs = Apt-File Search --regexp - this has the regexp switch on without being represented in the alias, I guess this makes sense since the debian plugin has it, I never used that command.
-
-Then there are the 2 other 4 letter aliases for combined commands, that are straight forward and easy to remember.
-aguu = sudo Apt-Get Update && sudo apt-get Upgrade - better then adg or not?
-agud = sudo Apt-Get Update && sudo apt-get full-upgrade
-
-For a full list aliases and the functions just watch the plugins code https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/ubuntu/ubuntu.plugin.zsh, look at the comments if you want to switch from the debian plugin. Ubuntu, Mint and & co users will like the new aar function to install packages from ppas with a single command.
diff --git a/plugins/vagrant/README.md b/plugins/vagrant/README.md
new file mode 100644
index 000000000..f6ea87b0e
--- /dev/null
+++ b/plugins/vagrant/README.md
@@ -0,0 +1,10 @@
+# Vagrant plugin
+
+This plugin adds autocompletion for [Vagrant](https://www.vagrantup.com/) commands, task names, box names and built-in handy documentation.
+
+To use it, add `vagrant` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... vagrant)
+```
+
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index a32347daa..2efb4473d 100644
--- a/plugins/vagrant/_vagrant
+++ b/plugins/vagrant/_vagrant
@@ -6,6 +6,7 @@
local -a _1st_arguments
_1st_arguments=(
'box:Box commands'
+ 'cloud:Manages everything related to Vagrant Cloud'
'connect:Connects to a remotely shared Vagrant environment'
'destroy:Destroys the vagrant environment'
'docker-logs:Outputs the logs from the Docker container'
@@ -18,11 +19,12 @@ _1st_arguments=(
'login:Authenticates against a Vagrant Cloud server to access protected boxes'
'package:Packages a vagrant environment for distribution'
'plugin:Plugin commands'
+ 'port:Displays information about guest port mappings'
'provision:Run the provisioner'
'push:Deploys code in this environment to a configured destination'
'rdp:Connects to machine via RDP'
'reload:Reload the vagrant environment'
- 'resume:Resumes a suspend vagrant environment'
+ 'resume:Resumes a suspended vagrant environment'
'rsync:Syncs rsync synced folders to remote machine'
'rsync-auto:Syncs rsync synced folders automatically when files change'
'share:Shares your Vagrant environment with anyone in the world'
@@ -33,6 +35,7 @@ _1st_arguments=(
'suspend:Suspends the currently running vagrant environment'
'snapshot:Used to manage snapshots with the guest machine'
'up:Creates the vagrant environment'
+ 'validate:Validates the Vagrantfile'
'version:Prints current and latest Vagrant version'
'--help:[TASK] Describe available tasks or one specific task'
'--version:Prints the Vagrant version information'
@@ -54,7 +57,7 @@ __task_list ()
local expl
declare -a tasks
- tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
+ tasks=(box destroy halt init package port provision reload resume ssh ssh_config status suspend up version)
_wanted tasks expl 'help' compadd $tasks
}
@@ -123,7 +126,7 @@ case $state in
(box)
__vagrant-box
;;
- (up|provision|package|destroy|reload|ssh|ssh-config|halt|resume|status)
+ (up|provision|port|package|destroy|reload|ssh|ssh-config|halt|resume|status)
_arguments ':feature:__vm_list'
esac
;;
diff --git a/plugins/vi-mode/vi-mode.plugin.zsh b/plugins/vi-mode/vi-mode.plugin.zsh
index 6cadd166a..93964594b 100644
--- a/plugins/vi-mode/vi-mode.plugin.zsh
+++ b/plugins/vi-mode/vi-mode.plugin.zsh
@@ -4,11 +4,6 @@ function zle-keymap-select() {
zle -R
}
-# Ensures that MODE_INDITCATOR is displayed on terminal start up.
-function zle-line-init() {
- zle reset-prompt
-}
-
# Ensure that the prompt is redrawn when the terminal size changes.
TRAPWINCH() {
zle && { zle -R; zle reset-prompt }
diff --git a/plugins/virtualenv/README.md b/plugins/virtualenv/README.md
new file mode 100644
index 000000000..e0b8c2c82
--- /dev/null
+++ b/plugins/virtualenv/README.md
@@ -0,0 +1,15 @@
+# virtualenv
+
+The plugin displays information of the created virtual container and allows background theming.
+
+To use it, add `virtualenv` to the plugins array of your zshrc file:
+```
+plugins=(... virtualenv)
+```
+
+The plugin creates a `virtualenv_prompt_info` function that you can use in your theme, which displays
+the basename of the current `$VIRTUAL_ENV`. It uses two variables to control how that is shown:
+
+- `ZSH_THEME_VIRTUALENV_PREFIX`: sets the prefix of the VIRTUAL_ENV. Defaults to `[`.
+
+- `ZSH_THEME_VIRTUALENV_SUFFIX`: sets the suffix of the VIRTUAL_ENV. Defaults to `]`.
diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index ef1fdea30..8ee45525a 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -25,7 +25,7 @@ plugins=(... vscode)
| Alias | Command | Description |
| ----------------------- | ---------------------------------------------------------------- | --------------------------------- |
-| vsce `dir` | code --extensions-dir `dir` | Set the root path for extensions. |
+| vsced `dir` | code --extensions-dir `dir` | Set the root path for extensions. |
| vscie `id or vsix-path` | code --install-extension `extension-id> or <extension-vsix-path` | Installs an extension. |
| vscue `id or vsix-path` | code --uninstall-extension `id or vsix-path` | Uninstalls an extension. |
@@ -35,4 +35,4 @@ plugins=(... vscode)
| ------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| vscv | code --verbose | Print verbose output (implies --wait). |
| vscl `level` | code --log `level` | Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'. |
-| vsced | code --disable-extensions | Disable all installed extensions. |
+| vscde | code --disable-extensions | Disable all installed extensions. |
diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
index d0aad3b33..902c23ecf 100644
--- a/plugins/vscode/vscode.plugin.zsh
+++ b/plugins/vscode/vscode.plugin.zsh
@@ -10,10 +10,10 @@ alias vscr='code --reuse-window'
alias vscw='code --wait'
alias vscu='code --user-data-dir'
-alias vsce='code --extensions-dir'
+alias vsced='code --extensions-dir'
alias vscie='code --install-extension'
alias vscue='code --uninstall-extension'
alias vscv='code --verbose'
alias vscl='code --log'
-alias vsced='code --disable-extensions' \ No newline at end of file
+alias vscde='code --disable-extensions'
diff --git a/plugins/vundle/README.md b/plugins/vundle/README.md
new file mode 100644
index 000000000..499038562
--- /dev/null
+++ b/plugins/vundle/README.md
@@ -0,0 +1,19 @@
+# Vundle plugin
+
+This plugin adds functions to control [vundle](https://github.com/VundleVim/Vundle.vim) plug-in manager for vim.
+
+To use it, add `vundle` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... vundle)
+```
+
+## Functions
+
+| Function | Usage | Description |
+|---------------|-----------------|----------------------------------------------------------------------------|
+| vundle-init | `vundle-init` | Install vundle by cloning git repository into ~/.vim folder |
+| vundle | `vundle` | Install plugins set in .vimrc (equals `:PluginInstall`) |
+| vundle-update | `vundle-update` | Update plugins set in .vimrc (equals `:PluginInstall!`) |
+| vundle-clean | `vundle-clean` | Delete plugins that have been removed from .vimrc (equals `:PluginClean!`) |
+
diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md
new file mode 100644
index 000000000..d04042506
--- /dev/null
+++ b/plugins/web-search/README.md
@@ -0,0 +1,52 @@
+# web-search plugin
+
+This plugin adds aliases for searching with Google, Wiki, Bing, YouTube and other popular services.
+
+Open your `~/.zshrc` file and enable the `web-search` plugin:
+
+```zsh
+plugins=( ... web-search)
+```
+
+## Usage
+
+You can use the `web-search` plugin in these two forms:
+
+* `web_search <context> <term> [more terms if you want]`
+* `<context> <term> [more terms if you want]`
+
+For example, these two are equivalent:
+
+```zsh
+$ web_search google oh-my-zsh
+$ google oh-my-zsh
+```
+
+Available search contexts are:
+
+| Context | URL |
+|-----------------------|------------------------------------------|
+| `bing` | `https://www.bing.com/search?q=` |
+| `google` | `https://www.google.com/search?q=` |
+| `yahoo` | `https://search.yahoo.com/search?p=` |
+| `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=` |
+| `sp` or `startpage` | `https://www.startpage.com/do/search?q=` |
+| `yandex` | `https://yandex.ru/yandsearch?text=` |
+| `github` | `https://github.com/search?q=` |
+| `baidu` | `https://www.baidu.com/s?wd=` |
+| `ecosia` | `https://www.ecosia.org/search?q=` |
+| `goodreads` | `https://www.goodreads.com/search?q=` |
+| `qwant` | `https://www.qwant.com/?q=` |
+| `givero` | `https://www.givero.com/search?q=` |
+| `stackoverflow` | `https://stackoverflow.com/search?q=` |
+
+Also there are aliases for bang-searching DuckDuckGo:
+
+| Context | Bang |
+|-----------|-------|
+| `wiki` | `!w` |
+| `news` | `!n` |
+| `youtube` | `!yt` |
+| `map` | `!m` |
+| `image` | `!i` |
+| `ducky` | `!` |
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 863384223..5b76eeae2 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -17,6 +17,8 @@ function web_search() {
ecosia "https://www.ecosia.org/search?q="
goodreads "https://www.goodreads.com/search?q="
qwant "https://www.qwant.com/?q="
+ givero "https://www.givero.com/search?q="
+ stackoverflow "https://stackoverflow.com/search?q="
)
# check whether the search engine is supported
@@ -51,6 +53,8 @@ alias baidu='web_search baidu'
alias ecosia='web_search ecosia'
alias goodreads='web_search goodreads'
alias qwant='web_search qwant'
+alias givero='web_search givero'
+alias stackoverflow='web_search stackoverflow'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
diff --git a/plugins/wp-cli/wp-cli.plugin.zsh b/plugins/wp-cli/wp-cli.plugin.zsh
index 45fac0761..97bed406e 100644
--- a/plugins/wp-cli/wp-cli.plugin.zsh
+++ b/plugins/wp-cli/wp-cli.plugin.zsh
@@ -109,7 +109,7 @@ alias wptm='wp theme mod'
alias wptp='wp theme path'
alias wpts='wp theme search'
alias wptst='wp theme status'
-alias wptu='wp theme updatet'
+alias wptu='wp theme update'
# Transient
diff --git a/plugins/yarn/README.md b/plugins/yarn/README.md
index c4e6d6da5..671a272d9 100644
--- a/plugins/yarn/README.md
+++ b/plugins/yarn/README.md
@@ -19,13 +19,19 @@ plugins=(... yarn)
| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) |
| yb | `yarn build` | Run the build script defined in `package.json` |
| ycc | `yarn cache clean` | Clean yarn's global cache of packages |
+| yga | `yarn global add` | Install packages globally on your operating system |
+| ygls | `yarn global list` | Lists global installed packages |
+| ygrm | `yarn global remove` | Remove global installed packages from your OS |
| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version |
| 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` |
| 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 |
| yrm | `yarn remove` | Remove installed packages |
| yrun | `yarn run` | Run a defined package script |
+| ys | `yarn serve` | Start the dev server |
| yst | `yarn start` | Run the start script defined in `package.json` |
| yt | `yarn test` | Run the test script defined in `package.json` |
| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache |
diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh
index fe752357f..9ed8322cd 100644
--- a/plugins/yarn/yarn.plugin.zsh
+++ b/plugins/yarn/yarn.plugin.zsh
@@ -4,13 +4,19 @@ alias yad="yarn add --dev"
alias yap="yarn add --peer"
alias yb="yarn build"
alias ycc="yarn cache clean"
+alias yga="yarn global add"
+alias ygls="yarn global list"
+alias ygrm="yarn global remove"
alias ygu="yarn global upgrade"
alias yh="yarn help"
+alias yi="yarn init"
alias yin="yarn install"
alias yls="yarn list"
alias yout="yarn outdated"
+alias yp="yarn pack"
alias yrm="yarn remove"
alias yrun="yarn run"
+alias ys="yarn serve"
alias yst="yarn start"
alias yt="yarn test"
alias yuc="yarn global upgrade && yarn cache clean"
diff --git a/plugins/yum/README.md b/plugins/yum/README.md
new file mode 100644
index 000000000..8043421d8
--- /dev/null
+++ b/plugins/yum/README.md
@@ -0,0 +1,27 @@
+# Yum plugin
+
+This plugin adds useful aliases for common [Yum](http://yum.baseurl.org/) commands.
+
+To use it, add `yum` to the plugins array in your zshrc file:
+
+```
+plugins=(... yum)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|-------|-----------------------------------|------------------------------|
+| ys | `yum search` | Search package |
+| yp | `yum info` | Show package info |
+| yl | `yum list` | List packages |
+| ygl | `yum grouplist` | List package groups |
+| yli | `yum list installed` | Print all installed packages |
+| ymc | `yum makecache` | Rebuild the yum package list |
+| yu | `sudo yum update` | Upgrade packages |
+| yi | `sudo yum install` | Install package |
+| ygi | `sudo yum groupinstall` | Install package group |
+| yr | `sudo yum remove` | Remove package |
+| ygr | `sudo yum groupremove` | Remove pagage group |
+| yrl | `sudo yum remove --remove-leaves` | Remove package and leaves |
+| yc | `sudo yum clean all` | Clean yum cache |
diff --git a/plugins/z/z.sh b/plugins/z/z.sh
index 4fc75dc6a..5fe6d5266 100644
--- a/plugins/z/z.sh
+++ b/plugins/z/z.sh
@@ -222,10 +222,16 @@ if type compctl >/dev/null 2>&1; then
if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
_z_precmd() {
(_z --add "${PWD:a}" &)
+ # Reference $RANDOM to refresh its value inside the subshell
+ # Otherwise, multiple runs get the same value
+ : $RANDOM
}
else
_z_precmd() {
(_z --add "${PWD:A}" &)
+ # Reference $RANDOM to refresh its value inside the subshell
+ # Otherwise, multiple runs get the same value
+ : $RANDOM
}
fi
[[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index 7cd2a873b..abd2c8812 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -62,9 +62,7 @@ ZSH_THEME="robbyrussell"
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
-plugins=(
- git
-)
+plugins=(git)
source $ZSH/oh-my-zsh.sh
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index d1a69c560..3c30a9e11 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -89,13 +89,16 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
- prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
+ prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
fi
}
# Git: branch/detached head, dirty status
prompt_git() {
(( $+commands[git] )) || return
+ if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then
+ return
+ fi
local PL_BRANCH_CHAR
() {
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
@@ -212,8 +215,8 @@ prompt_virtualenv() {
# - am I root
# - are there background jobs?
prompt_status() {
- local symbols
- symbols=()
+ local -a symbols
+
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
@@ -221,11 +224,25 @@ prompt_status() {
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
}
+#AWS Profile:
+# - display current AWS_PROFILE name
+# - displays yellow on red if profile name contains 'production' or
+# ends in '-prod'
+# - displays black on green otherwise
+prompt_aws() {
+ [[ -z "$AWS_PROFILE" ]] && return
+ case "$AWS_PROFILE" in
+ *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;;
+ *) prompt_segment green black "AWS: $AWS_PROFILE" ;;
+ esac
+}
+
## Main prompt
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
+ prompt_aws
prompt_context
prompt_dir
prompt_git
diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme
index 4e7361ced..d3f15ace5 100644
--- a/themes/amuse.zsh-theme
+++ b/themes/amuse.zsh-theme
@@ -9,7 +9,7 @@ rbenv_version() {
}
PROMPT='
-%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
+%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
$ '
# Must use Powerline font, for \uE0A0 to render.
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index cf439f757..aec14e4a6 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -63,7 +63,7 @@ function _git_time_since_commit() {
sub_hours=$((hours % 24))
sub_minutes=$((minutes % 60))
- if [ $hours -gt 24 ]; then
+ if [ $hours -ge 24 ]; then
commit_age="${days}d"
elif [ $minutes -gt 60 ]; then
commit_age="${sub_hours}h${sub_minutes}m"
diff --git a/themes/candy-kingdom.zsh-theme b/themes/candy-kingdom.zsh-theme
index 9d2103926..30ce785c0 100644
--- a/themes/candy-kingdom.zsh-theme
+++ b/themes/candy-kingdom.zsh-theme
@@ -17,7 +17,7 @@ function box_name {
}
PROMPT='
-%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
+%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
diff --git a/themes/dst.zsh-theme b/themes/dst.zsh-theme
index 3e2539d57..6b2f8767d 100644
--- a/themes/dst.zsh-theme
+++ b/themes/dst.zsh-theme
@@ -11,6 +11,6 @@ function prompt_char {
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
)
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info)
-%_ $(prompt_char) '
+$(prompt_char) '
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
diff --git a/themes/dstufft.zsh-theme b/themes/dstufft.zsh-theme
index 5a23fcea5..39ce69819 100644
--- a/themes/dstufft.zsh-theme
+++ b/themes/dstufft.zsh-theme
@@ -9,7 +9,7 @@ function virtualenv_info {
}
PROMPT='
-%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info)
+%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)
$(virtualenv_info)$(prompt_char) '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
diff --git a/themes/fino-time.zsh-theme b/themes/fino-time.zsh-theme
index c1a48d02a..9caebc69e 100644
--- a/themes/fino-time.zsh-theme
+++ b/themes/fino-time.zsh-theme
@@ -30,11 +30,10 @@ if type rvm-prompt &>/dev/null; then
rvm_ruby='using%{$FG[243]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
fi
-local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
-PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}${rvm_ruby} %D - %*
+PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${rvm_ruby} %D - %*
╰─$(virtualenv_info)$(prompt_char) "
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
index 71ed6bbbc..28d6cc2ec 100644
--- a/themes/fino.zsh-theme
+++ b/themes/fino.zsh-theme
@@ -29,12 +29,11 @@ else
fi
fi
-local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
local prompt_char='$(prompt_char)'
-PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env}
+PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}${git_info} %{$FG[239]%}${ruby_env}
╰─${prompt_char}%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme
index 252566f06..768547064 100644
--- a/themes/gallifrey.zsh-theme
+++ b/themes/gallifrey.zsh-theme
@@ -1,8 +1,11 @@
-# ZSH Theme - Preview: https://flic.kr/p/ZFvivf
-local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+# ZSH Theme - Preview: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#gallifrey
+return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+host_color="%(!.%{$fg[red]%}.%{$fg[green]%})"
-PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b '
+PROMPT="${host_color}%m%{$reset_color%} %2~ \$(git_prompt_info)%{$reset_color%}%B»%b "
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
+
+unset return_code host_color
diff --git a/themes/gentoo.zsh-theme b/themes/gentoo.zsh-theme
index ee205d248..5f2427c7a 100644
--- a/themes/gentoo.zsh-theme
+++ b/themes/gentoo.zsh-theme
@@ -2,7 +2,7 @@ function prompt_char {
if [ $UID -eq 0 ]; then echo "#"; else echo $; fi
}
-PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)%_$(prompt_char)%{$reset_color%} '
+PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(git_prompt_info)$(prompt_char)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "
diff --git a/themes/maran.zsh-theme b/themes/maran.zsh-theme
index 6fba04688..fddb7bc30 100644
--- a/themes/maran.zsh-theme
+++ b/themes/maran.zsh-theme
@@ -1,6 +1,6 @@
# Theme with full path names and hostname
# Handy if you work on different servers all the time;
-PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%} $(git_prompt_info) %(!.#.$) '
+PROMPT='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[yellow]%}%M:%{$fg[green]%}%/%{$reset_color%}$(git_prompt_info) %(!.#.$) '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}git:("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
diff --git a/themes/pygmalion-virtualenv.zsh-theme b/themes/pygmalion-virtualenv.zsh-theme
new file mode 100644
index 000000000..ea28e125a
--- /dev/null
+++ b/themes/pygmalion-virtualenv.zsh-theme
@@ -0,0 +1,50 @@
+# Yay! High voltage and arrows!
+
+
+function _virtualenv_prompt_info {
+ if [[ -n "$(whence virtualenv_prompt_info)" ]]; then
+ if [ -n "$(whence pyenv_prompt_info)" ]; then
+ if [ "$1" = "inline" ]; then
+ ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=%{$fg[blue]%}"::%{$fg[red]%}"
+ ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX=""
+ virtualenv_prompt_info
+ fi
+ [ "$(pyenv_prompt_info)" = "${PYENV_PROMPT_DEFAULT_VERSION}" ] && virtualenv_prompt_info
+ else
+ virtualenv_prompt_info
+ fi
+ fi
+}
+
+prompt_setup_pygmalion(){
+ ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
+ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
+ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
+ ZSH_THEME_GIT_PROMPT_CLEAN=""
+
+ base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}'
+ post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} '
+
+ 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)
+}
+
+prompt_pygmalion_precmd(){
+ local gitinfo=$(git_prompt_info)
+ local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g")
+ local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")"
+ local prompt_length=${#exp_nocolor}
+
+ local nl=""
+
+ if [[ $prompt_length -gt 40 ]]; then
+ nl=$'\n%{\r%}';
+ fi
+ PROMPT="$base_prompt$gitinfo$nl$post_prompt"
+}
+
+prompt_setup_pygmalion
+
+
diff --git a/themes/tjkirch.zsh-theme b/themes/tjkirch.zsh-theme
index 446cde724..c51609860 100644
--- a/themes/tjkirch.zsh-theme
+++ b/themes/tjkirch.zsh-theme
@@ -10,6 +10,6 @@ function prompt_char {
PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%}
)
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info)
-%_$(prompt_char) '
+$(prompt_char) '
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
diff --git a/themes/tjkirch_mod.zsh-theme b/themes/tjkirch_mod.zsh-theme
index 1b206a7e1..2dd060ea1 100644
--- a/themes/tjkirch_mod.zsh-theme
+++ b/themes/tjkirch_mod.zsh-theme
@@ -8,6 +8,6 @@ function prompt_char {
}
PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%}
-)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %_$(prompt_char) '
+)%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) $(prompt_char) '
RPROMPT='%{$fg[green]%}[%*]%{$reset_color%}'
diff --git a/tools/install.sh b/tools/install.sh
index 0cc020053..e2b33f640 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -79,7 +79,7 @@ main() {
mv -f ~/.zshrc-omztemp ~/.zshrc
# If this user's login shell is not already "zsh", attempt to switch.
- TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
+ TEST_CURRENT_SHELL=$(basename "$SHELL")
if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
# If this platform provides a "chsh" command (not Cygwin), do it, man!
if hash chsh >/dev/null 2>&1; then
@@ -105,7 +105,7 @@ main() {
echo ''
echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
echo ''
- echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.'
+ echo 'p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh.'
echo ''
printf "${NORMAL}"
env zsh -l
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index 25b2de27a..d234c7f88 100644
--- a/tools/upgrade.sh
+++ b/tools/upgrade.sh
@@ -33,7 +33,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/"
+ 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