summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/adb/_adb9
-rw-r--r--plugins/asdf/asdf.plugin.zsh8
-rw-r--r--plugins/aws/aws.plugin.zsh2
-rw-r--r--plugins/brew/README.md2
-rw-r--r--plugins/brew/brew.plugin.zsh2
-rw-r--r--plugins/cake/README.md15
-rw-r--r--plugins/debian/README.md75
-rw-r--r--plugins/docker/_docker8
-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/_fab (renamed from plugins/fabric/_fabric)0
-rw-r--r--plugins/fabric/fabric.plugin.zsh0
-rw-r--r--plugins/git/git.plugin.zsh8
-rw-r--r--plugins/golang/golang.plugin.zsh1
-rw-r--r--plugins/jenv/jenv.plugin.zsh2
-rw-r--r--plugins/jump/jump.plugin.zsh11
-rw-r--r--plugins/keychain/README.md45
-rw-r--r--plugins/keychain/keychain.plugin.zsh32
-rw-r--r--plugins/kubectl/README.md2
-rw-r--r--plugins/kubectl/kubectl.plugin.zsh4
-rw-r--r--plugins/laravel/README.md45
-rw-r--r--plugins/laravel/laravel.plugin.zsh23
-rw-r--r--plugins/mvn/README.md54
-rw-r--r--plugins/mvn/mvn.plugin.zsh549
-rw-r--r--plugins/osx/osx.plugin.zsh2
-rw-r--r--plugins/osx/spotify11
-rw-r--r--plugins/ros/README.mkd10
-rw-r--r--plugins/ros/_ros64
-rw-r--r--plugins/ssh-agent/ssh-agent.plugin.zsh47
-rw-r--r--plugins/svcat/README.md9
-rw-r--r--plugins/svcat/svcat.plugin.zsh6
-rw-r--r--plugins/timer/README.md17
-rw-r--r--plugins/timer/timer.plugin.zsh29
-rw-r--r--plugins/tmux/tmux.plugin.zsh2
-rw-r--r--plugins/transfer/README.md4
-rw-r--r--plugins/transfer/transfer.plugin.zsh10
-rw-r--r--plugins/vagrant/_vagrant7
-rw-r--r--plugins/web-search/web-search.plugin.zsh2
-rw-r--r--plugins/z/z.sh6
40 files changed, 800 insertions, 328 deletions
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/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/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index f78e96ce3..af27e669a 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -35,7 +35,7 @@ function asp {
}
function aws_profiles {
- reply=($(grep profile "${AWS_CONFIG_FILE:-$HOME/.aws/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
diff --git a/plugins/brew/README.md b/plugins/brew/README.md
index aab55ea39..c129a7652 100644
--- a/plugins/brew/README.md
+++ b/plugins/brew/README.md
@@ -17,3 +17,5 @@ plugins=(... brew)
| 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/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/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/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/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/_fabric b/plugins/fabric/_fab
index 9628e1224..9628e1224 100644
--- a/plugins/fabric/_fabric
+++ b/plugins/fabric/_fab
diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/plugins/fabric/fabric.plugin.zsh
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 45a706173..12400ede4 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)'
diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
index 919c98629..8284ab83c 100644
--- a/plugins/golang/golang.plugin.zsh
+++ b/plugins/golang/golang.plugin.zsh
@@ -126,6 +126,7 @@ __go_tool_complete() {
;;
help)
_values "${commands[@]}" \
+ 'environment[show Go environment variables available]' \
'gopath[GOPATH environment variable]' \
'packages[description of package lists]' \
'remote[remote import path syntax]' \
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/jump.plugin.zsh b/plugins/jump/jump.plugin.zsh
index a19a86022..d161a6da0 100644
--- a/plugins/jump/jump.plugin.zsh
+++ b/plugins/jump/jump.plugin.zsh
@@ -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/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/kubectl/README.md b/plugins/kubectl/README.md
index a93a9339e..b30f90548 100644
--- a/plugins/kubectl/README.md
+++ b/plugins/kubectl/README.md
@@ -46,6 +46,7 @@ plugins=(... kubectl)
| 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 |
@@ -67,6 +68,7 @@ plugins=(... kubectl)
| 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 |
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 4cfe3f45b..d388d6543 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -59,6 +59,7 @@ 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'
@@ -80,6 +81,9 @@ 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'
diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md
index 067c1e9fb..44798b68d 100644
--- a/plugins/laravel/README.md
+++ b/plugins/laravel/README.md
@@ -1,19 +1,40 @@
-# Laravel plugin
+# 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.
-**NOTE:** completion might not work for recent Laravel versions since it hasn't been updated since 2012.
-In that case, check out plugins `laravel4` and `laravel5`.
-
-To use it, add `laravel` to the plugins array in your zshrc file:
-
-```zsh
+```
plugins=(... laravel)
```
-## Aliases
+| 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 | Command | Description |
-|-----------|--------------------------|----------------------|
-| artisan | `php artisan` | Main Artisan command |
-| bob | `php artisan bob::build` | Main Bob command |
+| 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/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 f367fecce..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 an executable ./mvnw file execute it otherwise execute orignal mvn
+# Calls ./mvnw if found, otherwise execute the original mvn
mvn-or-mvnw() {
- if [ -x ./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/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/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/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/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/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/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/transfer/README.md b/plugins/transfer/README.md
index 37c7ca2f7..5fa064445 100644
--- a/plugins/transfer/README.md
+++ b/plugins/transfer/README.md
@@ -1,9 +1,5 @@
# `transfer` plugin
-**NOTICE: The `transfer` plugin is deprecated and will be removed soon, since the [transfer.sh](https://transfer.sh) service will be shutdown on 30th November 30th, 2018. Please move your files to an alternative file sharing service provider.**
-
-----
-
[`transfer.sh`](https://transfer.sh) is an easy to use file sharing service from the command line
## Usage
diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh
index 8fd09ef04..db744b0cd 100644
--- a/plugins/transfer/transfer.plugin.zsh
+++ b/plugins/transfer/transfer.plugin.zsh
@@ -12,14 +12,6 @@
# Modified to use tar command instead of zip
#
-echo -ne '\e[1;33m'
-cat <<-EOF
- [oh-my-zsh] WARNING: The 'transfer' plugin is deprecated and will be removed after
- [oh-my-zsh] transfer.sh shuts down on November 30th. We suggest you stop using the
- [oh-my-zsh] plugin and find an alternative file hosting service.
-EOF
-echo -ne '\e[0m'
-
curl --version 2>&1 > /dev/null
if [ $? -ne 0 ]; then
echo "Could not find curl."
@@ -69,6 +61,8 @@ transfer() {
# cat output link
cat $tmpfile
+ # add newline
+ echo
# cleanup
rm -f $tmpfile
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index a99a8f0e7..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,6 +19,7 @@ _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'
@@ -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/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 863384223..18cc0614a 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -17,6 +17,7 @@ function web_search() {
ecosia "https://www.ecosia.org/search?q="
goodreads "https://www.goodreads.com/search?q="
qwant "https://www.qwant.com/?q="
+ stackoverflow "https://stackoverflow.com/search?q="
)
# check whether the search engine is supported
@@ -51,6 +52,7 @@ alias baidu='web_search baidu'
alias ecosia='web_search ecosia'
alias goodreads='web_search goodreads'
alias qwant='web_search qwant'
+alias stack='web_search stackoverflow'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
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]}" ]] || {