summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md123
-rw-r--r--LICENSE.txt2
-rw-r--r--README.md49
-rw-r--r--custom/themes/example.zsh-theme1
-rw-r--r--lib/completion.zsh5
-rw-r--r--lib/functions.zsh6
-rw-r--r--lib/git.zsh14
-rw-r--r--lib/history.zsh55
-rw-r--r--lib/misc.zsh4
-rw-r--r--oh-my-zsh.sh12
-rw-r--r--plugins/adb/README.md2
-rw-r--r--plugins/adb/_adb16
-rw-r--r--plugins/archlinux/README.md33
-rw-r--r--plugins/archlinux/archlinux.plugin.zsh70
-rw-r--r--plugins/asdf/asdf.plugin.zsh5
-rw-r--r--plugins/autoenv/autoenv.plugin.zsh2
-rw-r--r--plugins/autojump/autojump.plugin.zsh2
-rw-r--r--plugins/aws/aws.plugin.zsh30
-rw-r--r--plugins/battery/battery.plugin.zsh2
-rw-r--r--plugins/bgnotify/README.md2
-rw-r--r--plugins/brew/brew.plugin.zsh2
-rw-r--r--plugins/bundler/bundler.plugin.zsh1
-rw-r--r--plugins/cargo/_cargo5
-rw-r--r--plugins/cask/README.md12
-rw-r--r--plugins/chruby/chruby.plugin.zsh22
-rw-r--r--plugins/chucknorris/LICENSE2
-rw-r--r--plugins/chucknorris/fortunes/chucknorris2545
-rw-r--r--plugins/colored-man-pages/colored-man-pages.plugin.zsh2
-rw-r--r--plugins/colorize/colorize.plugin.zsh5
-rw-r--r--plugins/composer/composer.plugin.zsh5
-rw-r--r--plugins/copydir/README.md10
-rw-r--r--plugins/copyfile/README.md10
-rw-r--r--plugins/debian/debian.plugin.zsh4
-rw-r--r--plugins/dircycle/dircycle.plugin.zsh2
-rw-r--r--plugins/dirhistory/dirhistory.plugin.zsh57
-rw-r--r--plugins/django/django.plugin.zsh1
-rw-r--r--plugins/docker-compose/_docker-compose38
-rw-r--r--plugins/docker-compose/docker-compose.plugin.zsh2
-rw-r--r--plugins/docker-machine/README.md19
-rw-r--r--plugins/docker-machine/docker-machine.plugin.zsh33
-rw-r--r--plugins/docker/README.md2
-rw-r--r--plugins/docker/_docker1963
-rw-r--r--plugins/dotenv/README.md34
-rw-r--r--plugins/dotenv/dotenv.plugin.zsh10
-rw-r--r--plugins/droplr/README.md2
-rw-r--r--plugins/eecms/eecms.plugin.zsh20
-rw-r--r--plugins/emacs/emacs.plugin.zsh2
-rw-r--r--plugins/emotty/emotty.plugin.zsh5
-rw-r--r--plugins/extract/extract.plugin.zsh2
-rw-r--r--plugins/fasd/fasd.plugin.zsh2
-rw-r--r--plugins/fedora/README.md3
l---------[-rw-r--r--]plugins/fedora/fedora.plugin.zsh17
-rw-r--r--plugins/git-flow/git-flow.plugin.zsh4
-rw-r--r--plugins/git-prompt/gitstatus.py2
-rw-r--r--plugins/git/git.plugin.zsh16
-rw-r--r--plugins/github/_hub2
-rw-r--r--plugins/github/github.plugin.zsh6
-rw-r--r--plugins/gitignore/gitignore.plugin.zsh4
-rw-r--r--plugins/gnu-utils/gnu-utils.plugin.zsh2
-rw-r--r--plugins/gpg-agent/gpg-agent.plugin.zsh49
-rw-r--r--plugins/gradle/gradle.plugin.zsh106
-rw-r--r--plugins/hanami/README.md32
-rw-r--r--plugins/hanami/hanami.plugin.zsh19
-rw-r--r--plugins/helm/helm.plugin.zsh7
-rw-r--r--plugins/heroku/_heroku55
-rw-r--r--plugins/history-substring-search/history-substring-search.zsh2
-rw-r--r--plugins/iterm2/iterm2.plugin.zsh68
-rw-r--r--plugins/jira/README.md1
-rw-r--r--plugins/jira/_jira1
-rw-r--r--plugins/jira/jira.plugin.zsh26
-rw-r--r--plugins/kops/kops.plugin.zsh9
-rw-r--r--plugins/kube-ps1/README.md76
-rw-r--r--plugins/kube-ps1/kube-ps1.zsh123
-rw-r--r--plugins/kubectl/kubectl.plugin.zsh55
-rw-r--r--plugins/laravel5/laravel5.plugin.zsh2
-rw-r--r--plugins/last-working-dir/last-working-dir.plugin.zsh6
-rw-r--r--plugins/lol/lol.plugin.zsh1
-rw-r--r--plugins/minikube/minikube.plugin.zsh6
-rw-r--r--plugins/mix-fast/mix-fast.plugin.zsh2
-rw-r--r--plugins/mix/_mix33
-rw-r--r--plugins/mvn/README.md1
-rw-r--r--plugins/mvn/mvn.plugin.zsh188
-rw-r--r--plugins/node/node.plugin.zsh2
-rw-r--r--plugins/npm/npm.plugin.zsh11
-rw-r--r--plugins/npx/README.md17
-rw-r--r--plugins/npx/npx.plugin.zsh7
-rw-r--r--plugins/oc/oc.plugin.zsh7
-rw-r--r--plugins/osx/README.md27
-rw-r--r--plugins/osx/osx.plugin.zsh278
-rw-r--r--plugins/osx/spotify438
-rw-r--r--plugins/pip/_pip1
-rw-r--r--plugins/pyenv/pyenv.plugin.zsh60
-rw-r--r--plugins/rails/_rails3
-rw-r--r--plugins/rails/rails.plugin.zsh8
-rw-r--r--plugins/rbenv/rbenv.plugin.zsh3
-rw-r--r--plugins/react-native/README.md35
-rw-r--r--plugins/react-native/_react-native17
-rw-r--r--plugins/react-native/react-native.plugin.zsh9
-rw-r--r--plugins/ruby/ruby.plugin.zsh8
-rw-r--r--plugins/rust/_rust67
-rw-r--r--plugins/scala/_scala4
-rw-r--r--plugins/shrink-path/shrink-path.plugin.zsh5
-rw-r--r--plugins/sublime/README.md4
-rw-r--r--plugins/sublime/sublime.plugin.zsh48
-rw-r--r--plugins/suse/suse.plugin.zsh4
-rw-r--r--plugins/swiftpm/README.md22
-rw-r--r--plugins/swiftpm/swiftpm.plugin.zsh8
-rw-r--r--plugins/symfony2/symfony2.plugin.zsh2
-rw-r--r--plugins/terraform/README.md14
-rw-r--r--plugins/terraform/_terraform192
-rw-r--r--plugins/terraform/terraform.plugin.zsh7
-rw-r--r--plugins/ubuntu/readme.md4
-rw-r--r--plugins/ubuntu/ubuntu.plugin.zsh81
-rw-r--r--plugins/vagrant/_vagrant4
-rw-r--r--plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh7
-rw-r--r--plugins/wd/README.md23
-rw-r--r--plugins/wd/_wd.sh21
-rwxr-xr-xplugins/wd/wd.sh71
-rw-r--r--plugins/web-search/web-search.plugin.zsh4
-rw-r--r--plugins/yarn/yarn.plugin.zsh88
-rw-r--r--plugins/z/README2
-rw-r--r--plugins/z/z.12
-rw-r--r--plugins/zsh_reload/README.md23
-rw-r--r--plugins/zsh_reload/zsh_reload.plugin.zsh19
-rw-r--r--templates/zshrc.zsh-template11
-rw-r--r--themes/af-magic.zsh-theme2
-rw-r--r--themes/agnoster.zsh-theme4
-rw-r--r--themes/avit.zsh-theme4
-rw-r--r--themes/bira.zsh-theme2
-rw-r--r--themes/cloud.zsh-theme4
-rw-r--r--themes/emotty.zsh-theme4
-rw-r--r--themes/gallifrey.zsh-theme2
-rw-r--r--themes/half-life.zsh-theme4
-rw-r--r--themes/nebirhos.zsh-theme2
-rw-r--r--themes/pure.zsh-theme110
-rw-r--r--themes/refined.zsh-theme106
-rw-r--r--themes/rkj-repos.zsh-theme13
-rw-r--r--themes/steeef.zsh-theme7
-rw-r--r--themes/trapd00r.zsh-theme4
-rw-r--r--tools/check_for_upgrade.sh2
-rwxr-xr-xtools/install.sh8
-rw-r--r--tools/upgrade.sh2
142 files changed, 6252 insertions, 1874 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..ac263fd18
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,123 @@
+# CONTRIBUTING GUIDELINES
+
+Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated.
+It is also essential for the development of the project.
+
+These guidelines are an attempt at better addressing the huge amount of pending
+issues and pull requests. Please read them closely.
+
+Foremost, be so kind as to [search](#use-the-search-luke). This ensures any contribution
+you would make is not already covered.
+
+* [Issues](#reporting-issues)
+ * [You have a problem](#you-have-a-problem)
+ * [You have a suggestion](#you-have-a-suggestion)
+* [Pull Requests](#submitting-pull-requests)
+ * [Getting started](#getting-started)
+ * [You have a solution](#you-have-a-solution)
+ * [You have an addition](#you-have-an-addition)
+* [Information sources (_aka_ search)](#use-the-search-luke)
+
+**BONUS:** [Volunteering](#you-have-spare-time-to-volunteer)
+
+## Reporting Issues
+
+### You have a problem
+
+Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
+your problem.
+
+If you find one, comment on it so we can know there are more people experiencing it.
+
+If not, look at the [Troubleshooting](https://github.com/robbyrussell/oh-my-zsh/wiki/Troubleshooting)
+page for instructions on how to gather data to better debug your problem.
+
+Then, you can go ahead and create an issue with as much detail as you can provide.
+It should include the data gathered as indicated above, along with:
+
+1. How to reproduce the problem
+2. What the correct behavior should be
+3. What the actual behavior is
+
+Please copy to anyone relevant (_eg_ plugin maintainers) by mentioning their GitHub handle
+(starting with `@`) in your message.
+
+We will do our very best to help you.
+
+### You have a suggestion
+
+Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
+your suggestion.
+
+If you find one, comment on it so we can know there are more people supporting it.
+
+If not, you can go ahead and create an issue. Please copy to anyone relevant (_eg_ plugin
+maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
+
+## Submitting Pull Requests
+
+### Getting started
+
+You should be familiar with the basics of
+[contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork
+[properly set up](https://github.com/robbyrussell/oh-my-zsh/wiki/Contribution-Technical-Practices).
+
+You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree.
+
+If you create your own PR, please make sure you do it right. Also be so kind as to reference
+any issue that would be solved in the PR description body,
+[for instance](https://help.github.com/articles/closing-issues-via-commit-messages/)
+_"Fixes #XXXX"_ for issue number XXXX.
+
+### You have a solution
+
+Please be so kind as to [search](#use-the-search-luke) for any open issue already covering
+your [problem](#you-have-a-problem), and any pending/merged/rejected PR covering your solution.
+
+If the solution is already reported, try it out and +1 the pull request if the
+solution works ok. On the other hand, if you think your solution is better, post
+it with a reference to the other one so we can have both solutions to compare.
+
+If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin
+maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
+
+### You have an addition
+
+Please [do not](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#dont-send-us-your-theme-for-now)
+send themes for now.
+
+Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests
+covering or related to what you want to add.
+
+If you find one, try it out and work with the author on a common solution.
+
+If not, then go ahead and submit a PR. Please copy to anyone relevant (_eg_ plugin
+maintainers) by mentioning their GitHub handle (starting with `@`) in your message.
+
+For any extensive change, _eg_ a new plugin, you will have to find testers to +1 your PR.
+
+----
+
+## Use the Search, Luke
+
+_May the Force (of past experiences) be with you_
+
+GitHub offers [many search features](https://help.github.com/articles/searching-github/)
+to help you check whether a similar contribution to yours already exists. Please search
+before making any contribution, it avoids duplicates and eases maintenance. Trust me,
+that works 90% of the time.
+
+You can also take a look at the [FAQ](https://github.com/robbyrussell/oh-my-zsh/wiki/FAQ)
+to be sure your contribution has not already come up.
+
+If all fails, your thing has probably not been reported yet, so you can go ahead
+and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests).
+
+----
+
+### You have spare time to volunteer
+
+Very nice!! :)
+
+Please have a look at the [Volunteer](https://github.com/robbyrussell/oh-my-zsh/wiki/Volunteers)
+page for instructions on where to start and more.
diff --git a/LICENSE.txt b/LICENSE.txt
index 42f607f5d..7af38f217 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2009-2016 Robby Russell and contributors
+Copyright (c) 2009-2018 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 eecde1551..128a07fb5 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,13 @@
Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration.
-That sounds boring. Let's try this again.
+Sounds boring. Let's try again.
-__Oh My Zsh is a way of life!__
+__Oh My Zsh will not make you a 10x developer...but you might feel like one.__
Once installed, your terminal shell will become the talk of the town _or your money back!_ With each keystroke in your command prompt, you'll take advantage of the hundreds of powerful plugins and beautiful themes. Strangers will come up to you in cafés and ask you, _"that is amazing! are you some sort of genius?"_
-Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often.
+Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬
To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
@@ -20,7 +20,7 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
__Disclaimer:__ _Oh My Zsh works best on macOS and Linux._
-* Unix-based operating system (macOS or Linux)
+* Unix-like operating system (macOS or Linux)
* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
* `curl` or `wget` should be installed
* `git` should be installed
@@ -45,16 +45,28 @@ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/to
### Plugins
-Oh My Zsh comes with a shit load of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
+Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the [plugins](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins) directory and/or the [wiki](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) to see what's currently available.
#### Enabling Plugins
Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the `.zshrc` file. You'll find the zshrc file in your `$HOME` directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load.
-For example, this line might begin to look like this:
+```shell
+vi ~/.zshrc
+```
+
+For example, this might begin to look like this:
```shell
-plugins=(git bundler osx rake ruby)
+plugins=(
+ git
+ bundler
+ dotenv
+ osx
+ rake
+ rbenv
+ ruby
+)
```
#### Using Plugins
@@ -69,7 +81,7 @@ We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme
_Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right one (for him)._
-Once you find a theme that you want to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
+Once you find a theme that you'd like to use, you will need to edit the `~/.zshrc` file. You'll see an environment variable (all caps) in there that looks like:
```shell
ZSH_THEME="robbyrussell"
@@ -79,10 +91,11 @@ To use a different theme, simply change the value to match the name of your desi
```shell
ZSH_THEME="agnoster" # (this is one of the fancy ones)
-# you might need to install a special Powerline font on your console's host for this to work
# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster
```
+_Note: many themes require installing the [Powerline Fonts](https://github.com/powerline/fonts) in order to render properly._
+
Open up a new terminal window and your prompt should look something like this:
![Agnoster theme](https://cloud.githubusercontent.com/assets/2618447/6316862/70f58fb6-ba03-11e4-82c9-c083bf9a6574.png)
@@ -96,6 +109,14 @@ If you're feeling feisty, you can let the computer select one randomly for you e
ZSH_THEME="random" # (...please let it be pie... please be some pie..)
```
+And if you want to pick random theme from a list of your favorite themes:
+
+```shell
+ZSH_THEME_RANDOM_CANDIDATES=(
+ "robbyrussell"
+ "agnoster"
+)
+```
## Advanced Topics
@@ -120,7 +141,7 @@ export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubus
##### 1. Clone the repository:
```shell
-git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
+git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
```
##### 2. *Optionally*, backup your existing `~/.zshrc` file:
@@ -184,7 +205,7 @@ If you'd like to upgrade at any point in time (maybe someone just released a new
upgrade_oh_my_zsh
```
-Magic!
+Magic! 🎉
## Uninstalling Oh My Zsh
@@ -217,7 +238,7 @@ We're on the social media.
## Merchandise
-We have [stickers](http://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://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](https://shop.planetargon.com/products/ohmyzsh-stickers-set-of-3-stickers) and [shirts](http://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!
## License
@@ -225,6 +246,6 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt).
## About Planet Argon
-![Planet Argon](http://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg)
+![Planet Argon](https://pa-github-assets.s3.amazonaws.com/PARGON_logo_digital_COL-small.jpg)
-Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/skills/ruby-on-rails-development?utm_source=github).
+Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/skills/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github).
diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme
new file mode 100644
index 000000000..6f9c9db8c
--- /dev/null
+++ b/custom/themes/example.zsh-theme
@@ -0,0 +1 @@
+# Put your custom themes in this folder.
diff --git a/lib/completion.zsh b/lib/completion.zsh
index bbd021656..c7db2eb7b 100644
--- a/lib/completion.zsh
+++ b/lib/completion.zsh
@@ -5,7 +5,7 @@ WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
-setopt auto_menu # show completion menu on succesive tab press
+setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
@@ -25,6 +25,9 @@ else
fi
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
+# Complete . and .. special directories
+zstyle ':completion:*' special-dirs true
+
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 9f11318d2..7410ae645 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -25,7 +25,9 @@ function open_command() {
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
- linux*) open_cmd='xdg-open' ;;
+ linux*) [[ $(uname -a) =~ "Microsoft" ]] && \
+ open_cmd='cmd.exe /c start' || \
+ open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
@@ -86,7 +88,7 @@ function default() {
}
#
-# Set enviroment variable "$1" to default value "$2" if "$1" is not yet defined.
+# Set environment variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The env variable to set
diff --git a/lib/git.zsh b/lib/git.zsh
index f7eccb81d..b55b762d7 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -11,7 +11,7 @@ function git_prompt_info() {
# Checks if working tree is dirty
function parse_git_dirty() {
local STATUS=''
- local FLAGS
+ local -a FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
@@ -77,8 +77,8 @@ function git_current_branch() {
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then
- local commits="$(git rev-list --count @{upstream}..HEAD)"
- if [[ "$commits" != 0 ]]; then
+ local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
+ if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
fi
@@ -87,8 +87,8 @@ function git_commits_ahead() {
# Gets the number of commits behind remote
function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then
- local commits="$(git rev-list --count HEAD..@{upstream})"
- if [[ "$commits" != 0 ]]; then
+ local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
+ if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
fi
@@ -141,11 +141,15 @@ function git_prompt_status() {
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+ elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+ elif $(echo "$INDEX" | grep '^MM ' &> /dev/null); then
+ STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
diff --git a/lib/history.zsh b/lib/history.zsh
index 5de71c2d3..7d4e59d00 100644
--- a/lib/history.zsh
+++ b/lib/history.zsh
@@ -1,24 +1,41 @@
-## Command history configuration
-if [ -z "$HISTFILE" ]; then
- HISTFILE=$HOME/.zsh_history
-fi
+## History wrapper
+function omz_history {
+ # Delete the history file if `-c' argument provided.
+ # This won't affect the `history' command output until the next login.
+ zparseopts -E c=clear l=list
-HISTSIZE=10000
-SAVEHIST=10000
+ if [[ -n "$clear" ]]; then
+ # if -c provided, clobber the history file
+ echo -n >| "$HISTFILE"
+ echo >&2 History file deleted. Reload the session to see its effects.
+ elif [[ -n "$list" ]]; then
+ # if -l provided, run as if calling `fc' directly
+ builtin fc "$@"
+ else
+ # otherwise, call `fc -l 1` to show all available
+ # history (and pass additional parameters)
+ builtin fc "$@" -l 1
+ fi
+}
-# Show history
+# Timestamp format
case $HIST_STAMPS in
- "mm/dd/yyyy") alias history='fc -fl 1' ;;
- "dd.mm.yyyy") alias history='fc -El 1' ;;
- "yyyy-mm-dd") alias history='fc -il 1' ;;
- *) alias history='fc -l 1' ;;
+ "mm/dd/yyyy") alias history='omz_history -f' ;;
+ "dd.mm.yyyy") alias history='omz_history -E' ;;
+ "yyyy-mm-dd") alias history='omz_history -i' ;;
+ *) alias history='omz_history' ;;
esac
-setopt append_history
-setopt extended_history
-setopt hist_expire_dups_first
-setopt hist_ignore_dups # ignore duplication command history list
-setopt hist_ignore_space
-setopt hist_verify
-setopt inc_append_history
-setopt share_history # share command history data
+## History file configuration
+[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
+HISTSIZE=50000
+SAVEHIST=10000
+
+## History command configuration
+setopt extended_history # record timestamp of command in HISTFILE
+setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
+setopt hist_ignore_dups # ignore duplicated commands history list
+setopt hist_ignore_space # ignore commands that start with space
+setopt hist_verify # show command with history expansion to user before running it
+setopt inc_append_history # add commands to HISTFILE in order of execution
+setopt share_history # share command history data
diff --git a/lib/misc.zsh b/lib/misc.zsh
index c81dab413..3052b7710 100644
--- a/lib/misc.zsh
+++ b/lib/misc.zsh
@@ -19,8 +19,8 @@ fi
setopt long_list_jobs
## pager
-export PAGER="less"
-export LESS="-R"
+env_default PAGER 'less'
+env_default LESS '-R'
## super user alias
alias _='sudo'
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index a7de646f2..c0e2ba8f6 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -11,8 +11,6 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
-: ${ZSH_DISABLE_COMPFIX:=true}
-
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
@@ -74,7 +72,7 @@ if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
compinit -d "${ZSH_COMPDUMP}"
fi
else
- compinit -i -d "${ZSH_COMPDUMP}"
+ compinit -u -d "${ZSH_COMPDUMP}"
fi
# Load all of the plugins that were defined in ~/.zshrc
@@ -93,8 +91,12 @@ done
unset config_file
# Load the theme
-if [ "$ZSH_THEME" = "random" ]; then
- themes=($ZSH/themes/*zsh-theme)
+if [[ "$ZSH_THEME" == "random" ]]; then
+ if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
+ themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
+ else
+ themes=($ZSH/themes/*zsh-theme)
+ fi
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
diff --git a/plugins/adb/README.md b/plugins/adb/README.md
index 075beec0e..83dcc7288 100644
--- a/plugins/adb/README.md
+++ b/plugins/adb/README.md
@@ -1,7 +1,7 @@
# adb autocomplete plugin
* Adds autocomplete options for all adb commands.
-
+* Add autocomplete for `adb -s`
## Requirements
diff --git a/plugins/adb/_adb b/plugins/adb/_adb
index f30f3247f..8cbf6593c 100644
--- a/plugins/adb/_adb
+++ b/plugins/adb/_adb
@@ -13,9 +13,13 @@ _1st_arguments=(
'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
'emu:run emulator console command'
'forward:forward socket connections'
+'get-devpath:print the device path'
+'get-serialno:print the serial number of the device'
+'get-state:print the current state of the device: offline | bootloader | device'
'help:show the help message'
'install:push this package file to the device and install it'
'jdwp:list PIDs of processes hosting a JDWP transport'
+'keygen:generate adb public/private key'
'kill-server:kill the server if it is running'
'logcat:view device log'
'pull:copy file/dir from device'
@@ -30,6 +34,7 @@ _1st_arguments=(
'start-server:ensure that there is a server running'
'tcpip:restart host adb in tcpip mode'
'uninstall:remove this app package from the device'
+'usb:restart the adbd daemon listing on USB'
'version:show version num'
'wait-for-device:block until device is online'
)
@@ -38,11 +43,20 @@ local expl
local -a pkgs installed_pkgs
_arguments \
+ '-s[devices]:specify device:->specify_device' \
'*:: :->subcmds' && return 0
+case "$state" in
+ specify_device)
+ _values 'devices' $(adb devices -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \
+ {printf "%s[%s] ",$1,$6 }')
+ return
+ ;;
+esac
+
if (( CURRENT == 1 )); then
_describe -t commands "adb subcommand" _1st_arguments
return
fi
-_files
+_files \ No newline at end of file
diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md
index 16f099415..c3521c523 100644
--- a/plugins/archlinux/README.md
+++ b/plugins/archlinux/README.md
@@ -2,6 +2,31 @@
## Features
+#### TRIZEN
+
+| Alias | Command | Description |
+|---------|------------------------------------|---------------------------------------------------------------------|
+| trconf | trizen -C | Fix all configuration files with vimdiff |
+| trin | trizen -S | Install packages from the repositories |
+| trins | trizen -U | Install a package from a local file |
+| trinsd | trizen -S --asdeps | Install packages as dependencies of another package |
+| trloc | trizen -Qi | Display information about a package in the local database |
+| trlocs | trizen -Qs | Search for packages in the local database |
+| trlst | trizen -Qe | List installed packages including from AUR (tagged as "local") |
+| trmir | trizen -Syy | Force refresh of all package lists after updating mirrorlist |
+| trorph | trizen -Qtd | Remove orphans using yaourt |
+| trre | trizen -R | Remove packages, keeping its settings and dependencies |
+| trrem | trizen -Rns | Remove packages, including its settings and unneeded dependencies |
+| trrep | trizen -Si | Display information about a package in the repositories |
+| trreps | trizen -Ss | Search for packages in the repositories |
+| trupd | trizen -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
+| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
+| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
+| trupd | trizen -Sy | Update and refresh the local package database |
+| trupd | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
+| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
+| upgrade | trizen -Syu | Sync with repositories before upgrading packages |
+
#### YAOURT
| Alias | Command | Description |
@@ -27,7 +52,7 @@
| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
| upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
-### PACAUR
+#### PACAUR
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
@@ -73,6 +98,10 @@
| pacupd | sudo pacman -Sy | Update and refresh the local package database |
| pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
| upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
+| pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
+| pacfiles | pacman -Fs | Search package file names for matching strings |
+| pacls | pacman -Ql | List files in a package |
+| pacown | pacman -Qo | Show which package owns a file |
| Function | Description |
|----------------|------------------------------------------------------|
@@ -80,6 +109,7 @@
| paclist | List all installed packages with a short description |
| pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | Locally trust all keys passed as parameters |
+| pacweb | Open the website of an ArchLinux package |
---
@@ -93,3 +123,4 @@
- ornicar - thibault.duplessis@gmail.com
- Juraj Fiala - doctorjellyface@riseup.net
- Majora320 (Moses Miller) - Majora320@gmail.com
+- Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info
diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
index 3156e949a..ae80eb9f0 100644
--- a/plugins/archlinux/archlinux.plugin.zsh
+++ b/plugins/archlinux/archlinux.plugin.zsh
@@ -1,3 +1,32 @@
+if (( $+commands[trizen] )); then
+ alias trconf='trizen -C'
+ alias trupg='trizen -Syua'
+ alias trsu='trizen -Syua --noconfirm'
+ alias trin='trizen -S'
+ alias trins='trizen -U'
+ alias trre='trizen -R'
+ alias trrem='trizen -Rns'
+ alias trrep='trizen -Si'
+ alias trreps='trizen -Ss'
+ alias trloc='trizen -Qi'
+ alias trlocs='trizen -Qs'
+ alias trlst='trizen -Qe'
+ alias trorph='trizen -Qtd'
+ alias trinsd='trizen -S --asdeps'
+ alias trmir='trizen -Syy'
+
+
+ if (( $+commands[abs] && $+commands[aur] )); then
+ alias trupd='trizen -Sy && sudo abs && sudo aur'
+ elif (( $+commands[abs] )); then
+ alias trupd='trizen -Sy && sudo abs'
+ elif (( $+commands[aur] )); then
+ alias trupd='trizen -Sy && sudo aur'
+ else
+ alias trupd='trizen -Sy'
+ fi
+fi
+
if (( $+commands[yaourt] )); then
alias yaconf='yaourt -C'
alias yaupg='yaourt -Syua'
@@ -28,8 +57,8 @@ if (( $+commands[yaourt] )); then
fi
if (( $+commands[pacaur] )); then
- alias paupg='pacaur -Syua'
- alias pasu='pacaur -Syua --noconfirm'
+ alias paupg='pacaur -Syu'
+ alias pasu='pacaur -Syu --noconfirm'
alias pain='pacaur -S'
alias pains='pacaur -U'
alias pare='pacaur -R'
@@ -54,16 +83,20 @@ if (( $+commands[pacaur] )); then
fi
fi
-if (( $+commands[pacaur] )); then
- upgrade() {
+if (( $+commands[trizen] )); then
+ function upgrade() {
+ trizen -Syu
+ }
+elif (( $+commands[pacaur] )); then
+ function upgrade() {
pacaur -Syu
}
elif (( $+commands[yaourt] )); then
- upgrade() {
+ function upgrade() {
yaourt -Syu
}
else
- upgrade() {
+ function upgrade() {
sudo pacman -Syu
}
fi
@@ -82,6 +115,10 @@ alias pacinsd='sudo pacman -S --asdeps'
alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
+alias pacfileupg='sudo pacman -Fy'
+alias pacfiles='pacman -Fs'
+alias pacls='pacman -Ql'
+alias pacown='pacman -Qo'
if (( $+commands[abs] && $+commands[aur] )); then
@@ -94,13 +131,13 @@ else
alias pacupd='sudo pacman -Sy'
fi
-paclist() {
+function paclist() {
# Source: https://bbs.archlinux.org/viewtopic.php?id=93683
LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
}
-pacdisowned() {
+function pacdisowned() {
emulate -L zsh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
@@ -118,14 +155,14 @@ pacdisowned() {
comm -23 "$fs" "$db"
}
-pacmanallkeys() {
+function pacmanallkeys() {
emulate -L zsh
curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
xargs sudo pacman-key --recv-keys
}
-pacmansignkeys() {
+function pacmansignkeys() {
emulate -L zsh
for key in $*; do
sudo pacman-key --recv-keys $key
@@ -134,3 +171,16 @@ pacmansignkeys() {
--no-permission-warning --command-fd 0 --edit-key $key
done
}
+
+if (( $+commands[xdg-open] )); then
+ function pacweb() {
+ pkg="$1"
+ infos="$(pacman -Si "$pkg")"
+ if [[ -z "$infos" ]]; then
+ return
+ fi
+ repo="$(grep '^Repo' <<< "$infos" | grep -oP '[^ ]+$')"
+ arch="$(grep '^Arch' <<< "$infos" | grep -oP '[^ ]+$')"
+ xdg-open "https://www.archlinux.org/packages/$repo/$arch/$pkg/" &>/dev/null
+ }
+fi
diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh
index 8736d2ff8..d563cf5f8 100644
--- a/plugins/asdf/asdf.plugin.zsh
+++ b/plugins/asdf/asdf.plugin.zsh
@@ -5,3 +5,8 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
if [ -f $ASDF_DIR/asdf.sh ]; then
. $ASDF_DIR/asdf.sh
fi
+
+# Load asdf completions, if found.
+if [ -f $ASDF_DIR/completions/asdf.bash ]; then
+ . $ASDF_DIR/completions/asdf.bash
+fi
diff --git a/plugins/autoenv/autoenv.plugin.zsh b/plugins/autoenv/autoenv.plugin.zsh
index af58ee77b..3c1b0fafc 100644
--- a/plugins/autoenv/autoenv.plugin.zsh
+++ b/plugins/autoenv/autoenv.plugin.zsh
@@ -1,7 +1,7 @@
# Activates autoenv or reports its failure
() {
if ! type autoenv_init >/dev/null; then
- for d (~/.autoenv /usr/local/opt/autoenv /usr/local/bin); do
+ for d (~/.autoenv ~/.local/bin /usr/local/opt/autoenv /usr/local/bin); do
if [[ -e $d/activate.sh ]]; then
autoenv_dir=$d
break
diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
index c05c699e1..7339fad9e 100644
--- a/plugins/autojump/autojump.plugin.zsh
+++ b/plugins/autojump/autojump.plugin.zsh
@@ -5,6 +5,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
. $HOME/.autojump/share/autojump/autojump.zsh
elif [ -f $HOME/.nix-profile/etc/profile.d/autojump.zsh ]; then # nix installation
. $HOME/.nix-profile/etc/profile.d/autojump.zsh
+ elif [ -f /run/current-system/sw/share/autojump/autojump.zsh ]; then # nixos installation
+ . /run/current-system/sw/share/autojump/autojump.zsh
elif [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index d31052f83..183b0f226 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -1,9 +1,24 @@
_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() {
- brew list awscli &> /dev/null
+ [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null
}
export AWS_HOME=~/.aws
@@ -22,16 +37,15 @@ function asp {
}
function aws_profiles {
- reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
+ reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/'))
}
-
compctl -K aws_profiles asp
-if _homebrew-installed && _awscli-homebrew-installed ; then
- _aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh
-else
- _aws_zsh_completer_path=$(which 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
+ _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
fi
-[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
+[ -n "$_aws_zsh_completer_path" ] && [ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path
unset _aws_zsh_completer_path
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index da229cf35..8f398cfb3 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -100,7 +100,7 @@ elif [[ "$OSTYPE" = linux* ]] ; then
else
color='red'
fi
- echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+ echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
else
echo "∞"
fi
diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md
index b154916d6..fad299159 100644
--- a/plugins/bgnotify/README.md
+++ b/plugins/bgnotify/README.md
@@ -10,7 +10,7 @@ Standalone homepage: [t413/zsh-background-notify](https://github.com/t413/zsh-ba
Just add bgnotify to your plugins list in your `.zshrc`
-- On OS X you'll need [terminal-notifer](https://github.com/alloy/terminal-notifier)
+- On OS X you'll need [terminal-notifier](https://github.com/alloy/terminal-notifier)
* `brew install terminal-notifier` (or `gem install terminal-notifier`)
- On ubuntu you're already all set!
- On windows you can use [notifu](http://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package
diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
index d4289c98e..6fb7f3453 100644
--- a/plugins/brew/brew.plugin.zsh
+++ b/plugins/brew/brew.plugin.zsh
@@ -3,7 +3,7 @@ alias bubo='brew update && brew outdated'
alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc'
-if mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
+if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
print -P '%F{yellow}'Oh My Zsh brew plugin:
cat <<-'EOF'
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index c5284dbb1..6b10b78d1 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -14,6 +14,7 @@ bundled_commands=(
cucumber
foodcritic
guard
+ hanami
irb
jekyll
kitchen
diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo
index 175859202..54e709ca0 100644
--- a/plugins/cargo/_cargo
+++ b/plugins/cargo/_cargo
@@ -7,10 +7,13 @@ _cargo() {
_arguments \
'(- 1 *)'{-h,--help}'[show help message]' \
+ '(- 1 *)'{-V,--version}'[show version information]' \
'(- 1 *)'--list'[list installed commands]' \
+ '(- 1 *)'--explain'[Run `rustc --explain CODE`]' \
'(- 1 *)'{-v,--verbose}'[use verbose output]' \
'(- 1 *)'--color'[colorization option]' \
- '(- 1 *)'{-V,--version}'[show version information]' \
+ '(- 1 *)'--frozen'[Require Cargo.lock and cache are up to date]' \
+ '(- 1 *)'--locked'[Require Cargo.lock is up to date]' \
'1: :_cargo_cmds' \
'*:: :->args'
diff --git a/plugins/cask/README.md b/plugins/cask/README.md
index 6457fd858..e1335c1b8 100644
--- a/plugins/cask/README.md
+++ b/plugins/cask/README.md
@@ -1,11 +1,15 @@
-# cask plugin
+# Cask plugin
-Loads `cask` completion from non-standard locations, such as if installed
+[Cask](https://github.com/cask/cask) is a project management tool for Emacs that helps
+automate the package development cycle; development, dependencies, testing, building,
+packaging and more.
+
+This plugin loads `cask` completion from non-standard locations, such as if installed
via Homebrew or others. To enable it, add `cask` to your plugins array:
```zsh
plugins=(... cask)
```
-Make sure you have the `cask` directory in your `$PATH` before loading
-Oh My Zsh, otherwise you'll get the "command not found" error.
+Make sure you have the `cask` directory in your `$PATH` before loading Oh My Zsh,
+otherwise you'll get a "command not found" error.
diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh
index 758b4a56c..998d92098 100644
--- a/plugins/chruby/chruby.plugin.zsh
+++ b/plugins/chruby/chruby.plugin.zsh
@@ -16,12 +16,28 @@
# rvm and rbenv plugins also provide this alias
alias rubies='chruby'
+
_homebrew-installed() {
whence 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/chruby ];then
+ _brew_prefix="/usr/local/opt/chruby"
+ 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 chruby)
+ fi
+ return 0
+ else
+ return $_xit
+ fi
}
_chruby-from-homebrew-installed() {
- [ -r $(brew --prefix chruby) ] &> /dev/null
+ [ -r _brew_prefix ] &> /dev/null
}
_ruby-build_installed() {
@@ -64,8 +80,8 @@ _chruby_dirs() {
}
if _homebrew-installed && _chruby-from-homebrew-installed ; then
- source $(brew --prefix chruby)/share/chruby/chruby.sh
- source $(brew --prefix chruby)/share/chruby/auto.sh
+ source $_brew_prefix/share/chruby/chruby.sh
+ source $_brew_prefix/share/chruby/auto.sh
_chruby_dirs
elif [[ -r "/usr/local/share/chruby/chruby.sh" ]] ; then
source /usr/local/share/chruby/chruby.sh
diff --git a/plugins/chucknorris/LICENSE b/plugins/chucknorris/LICENSE
deleted file mode 100644
index 5f40edd1e..000000000
--- a/plugins/chucknorris/LICENSE
+++ /dev/null
@@ -1,2 +0,0 @@
-License: GPL v2
-Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.
diff --git a/plugins/chucknorris/fortunes/chucknorris b/plugins/chucknorris/fortunes/chucknorris
index e705d1c13..2a13b060f 100644
--- a/plugins/chucknorris/fortunes/chucknorris
+++ b/plugins/chucknorris/fortunes/chucknorris
@@ -1,907 +1,2544 @@
-Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-Chuck Norris does not sleep. He waits.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-The chief export of Chuck Norris is pain.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death.
+Chuck Norris does not sleep. He waits.
%
-Chuck Norris has counted to infinity. Twice.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
+Chuck Norris is the reason why Waldo is hiding.
%
-Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
+Chuck Norris counted to infinity - twice.
%
-Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
+In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
%
There is no chin behind Chuck Norris' beard. There is only another fist.
%
-Chuck Norris does not teabag the ladies. He potato-sacks them.
+Chuck Norris does not teabag the ladies. He potato-sacks them.
%
-Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
+Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
%
-When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-There are no steroids in baseball. Just players Chuck Norris has breathed on.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Chuck Norris once challenged Lance Armstrong in a "Who has more testicles?" contest. Chuck Norris won by 5.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Chuck Norris was the fourth wise man, who gave baby Jesus the gift of beard, which he carried with him until he died. The other three wise men were enraged by the preference that Jesus showed to Chuck's gift, and arranged to have him written out of the bible. All three died soon after of mysterious roundhouse-kick related injuries.
+Chuck Norris can lead a horse to water AND make it drink.
%
-Chuck Norris sheds his skin twice a year.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-When Chuck Norris calls 1-900 numbers, he doesnt get charged. He holds up the phone and money falls out.
+Chuck Norris can slam a revolving door.
%
-Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Some people like to eat frogs' legs. Chuck Norris likes to eat lizard legs. Hence, snakes.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-There are no races, only countries of people Chuck Norris has beaten to different shades of black and blue.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-When Chuck Norris was denied an Egg McMuffin at McDonald's because it was 10:35, he roundhouse kicked the store so hard it became a Wendy's.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-Chuck Norris can't finish a "color by numbers" because his markers are filled with the blood of his victims. Unfortunately, all blood is dark red.
+Guns don't kill people. Chuck Norris kills people.
%
-A Chuck Norris-delivered Roundhouse Kick is the preferred method of execution in 16 states.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-When Chuck Norris falls in water, Chuck Norris doesn't get wet. Water gets Chuck Norris.
+The chief export of Chuck Norris is Pain.
%
-Scientists have estimated that the energy given off during the Big Bang is roughly equal to 1CNRhK (Chuck Norris Roundhouse Kick)
+Chuck Norris has two speeds. Walk, and Kill.
%
-Chuck Norris' house has no doors, only walls that he walks through.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-When Chuck Norris has sex with a man, it won't be because he is gay. It will be because he has run out of women.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-How much wood would a woodchuck chuck if a woodchuck could Chuck Norris? ...All of it.
+Chuck Norris is my Homeboy.
%
-Chuck Norris doesn't actually write books, the words assemble themselves out of fear.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-In honor of Chuck Norris, all McDonald's in Texas have an even larger size than the super-size. When ordering, just ask to be "Norrisized".
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris CAN believe it's not butter.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-If tapped, a Chuck Norris roundhouse kick could power the country of Australia for 44 minutes.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-Chuck Norris can divide by zero.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-The grass is always greener on the other side, unless Chuck Norris has been there. In that case the grass is most likely soaked in blood and tears.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-A picture is worth a thousand words. A Chuck Norris is worth 1 billion words.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Newton's Third Law is wrong: Although it states that for each action, there is an equal and opposite reaction, there is no force equal in reaction to a Chuck Norris roundhouse kick.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-Chuck Norris invented his own type of karate. It's called Chuck-Will-Kill.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-When an episode of Walker Texas Ranger was aired in France, the French surrendered to Chuck Norris just to be on the safe side.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-While urinating, Chuck Norris is easily capable of welding titanium.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris once sued the Houghton-Mifflin textbook company when it became apparent that their account of the war of 1812 was plagiarized from his autobiography.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-When Chuck Norris talks, everybody listens. And dies.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Wilt Chamberlain claims to have slept with more than 20,000 women in his lifetime. Chuck Norris calls this "a slow Tuesday."
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-Contrary to popular belief, there is indeed enough Chuck Norris to go around.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-Chuck Norris doesnt shave; he kicks himself in the face. The only thing that can cut Chuck Norris is Chuck Norris.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-For some, the left testicle is larger than the right one. For Chuck Norris, each testicle is larger than the other one.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Chuck Norris always knows the EXACT location of Carmen SanDiego.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-Chuck Norris invented black. In fact, he invented the entire spectrum of visible light. Except pink. Tom Cruise invented pink.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-When you're Chuck Norris, anything + anything is equal to 1. One roundhouse kick to the face.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-On his birthday, Chuck Norris randomly selects one lucky child to be thrown into the sun.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-Nobody doesn't like Sara Lee. Except Chuck Norris.
+Chuck Norris can win in a top spinning tournament with a cube
%
-Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down!
+Beware of dogs... Dogs, beware of Chuck Norris.
%
-In the beginning there was nothing...then Chuck Norris Roundhouse kicked that nothing in the face and said "Get a job". That is the story of the universe.
+Chuck Norris can dig a hole in air.
%
-Chuck Norris has 12 moons. One of those moons is the Earth.
+The apple falls far from the tree, when a roundhouse kick is taken to the trunk.
%
-Chuck Norris grinds his coffee with his teeth and boils the water with his own rage.
+Chuck Norris - the new standard.
%
-Archeologists unearthed an old english dictionary dating back to the year 1236. It defined "victim" as "one who has encountered Chuck Norris"
+Chuck Norris told me to put this here.
%
-Chuck Norris ordered a Big Mac at Burger King, and got one.
+Chuck Norris doesn't exhale. The air runs desperately scared out of his lungs.
%
-Chuck Norris and Mr. T walked into a bar. The bar was instantly destroyed, as that level of awesome cannot be contained in one building.
+Fear of spiders is aracnaphobia, fear of tight spaces is chlaustraphobia, fear of Chuck Norris is called Logic
%
-If you Google search "Chuck Norris getting his ass kicked" you will generate zero results. It just doesn't happen.
+When Chuck Norris goes to rodeos, bulls ride him.
%
-Chuck Norris can drink an entire gallon of milk in thirty-seven seconds.
+Chuck Norris once walked down a street with his fists in his pockets. He was then arrested for concealing two deadly weapons.
%
-Little known medical fact: Chuck Norris invented the Caesarean section when he roundhouse-kicked his way out of his monther's womb.
+The meaning of life is Chuck Norris
%
-Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint.
+Chuck Norris is the meaning of life. Too bad he's also the meaning of death.
%
-The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.
+If God doesn't know, Chuck does
%
-It takes Chuck Norris 20 minutes to watch 60 Minutes.
+Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint.
%
-You know how they say if you die in your dream then you will die in real life? In actuality, if you dream of death then Chuck Norris will find you and kill you.
+The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.
%
-Chuck Norris has a deep and abiding respect for human life... unless it gets in his way.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-The Bermuda Triangle used to be the Bermuda Square, until Chuck Norris Roundhouse kicked one of the corners off.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-There are no weapons of mass destruction in Iraq, Chuck Norris lives in Oklahoma.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-Chuck Norris doesn't believe in Germany.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-When Chuck Norris is in a crowded area, he doesn't walk around people. He walks through them.
+Chuck Norris does not sleep. He waits.
%
-Chuck Norris once ate an entire bottle of sleeping pills. They made him blink.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-James Cameron wanted Chuck Norris to play the Terminator. However, upon reflection, he realized that would have turned his movie into a documentary, so he went with Arnold Schwarzenegger.
+Chuck Norris is the reason why Waldo is hiding.
%
-Chuck Norris can touch MC Hammer.
+Chuck Norris counted to infinity - twice.
%
-Thousands of years ago Chuck Norris came across a bear. It was so terrified that it fled north into the arctic. It was also so terrified that all of its decendents now have white hair.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-Chuck Norris played Russian Roulette with a fully loaded gun and won.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-It takes 14 puppeteers to make Chuck Norris smile, but only 2 to make him destroy an orphanage.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Chuck Norris is responsible for China's over-population. He hosted a Karate tournament in Beijing and all women within 1,000 miles became pregnant instantly.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Some people wear Superman pajamas. Superman wears Chuck Norris pajamas.
+Chuck Norris can lead a horse to water AND make it drink.
%
-Chuck Norris once worked as a weatherman for the San Diego evening news. Every night he would make the same forecast: Partly cloudy with a 75% chance of Pain.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-Simply by pulling on both ends, Chuck Norris can stretch diamonds back into coal.
+Chuck Norris can slam a revolving door.
%
-When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Chuck Norris invented the bolt-action rifle, liquor, sexual intercourse, and football-- in that order.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-A high tide means Chuck Norris is flying over your coast. The tide is caused by God pissing his pants.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-Chuck Norris keeps his friends close and his enemies closer. Close enough to drop them with one round house kick to the face.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-There is in fact an "I" in Norris, but there is no "team"? not even close.
+Guns don't kill people. Chuck Norris kills people.
%
-Scotty in Star Trek often says "Ye cannae change the laws of physics." This is untrue. Chuck Norris can change the laws of physics. With his fists.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-An anagram for Walker Texas Ranger is KARATE WRANGLER SEX. I don't know what that is, but it sounds AWESOME.
+The chief export of Chuck Norris is Pain.
%
-Chuck Norris doesn't stub his toes. He accidentally destroys chairs, bedframes, and sidewalks.
+Chuck Norris has two speeds. Walk, and Kill.
%
-Using his trademark roundhouse kick, Chuck Norris once made a fieldgoal in RJ Stadium in Tampa Bay from the 50 yard line of Qualcomm stadium in San Diego.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-Chuck Norris roundhouse kicks don't really kill people. They wipe out their entire existence from the space-time continuum.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold.
+Chuck Norris is my Homeboy.
%
-Tom Clancy has to pay royalties to Chuck Norris because "The Sum of All Fears" is the name of Chuck Norris' autobiography.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-Chuck Norris can slam a revolving door.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris is expected to win gold in every swimming competition at the 2008 Beijing Olympics, even though Chuck Norris does not swim. This is because when Chuck Norris enters the water, the water gets out of his way and Chuck Norris simply walks across the pool floor.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-Chuck Norris built a better mousetrap, but the world was too frightened to beat a path to his door.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-The original draft of The Lord of the Rings featured Chuck Norris instead of Frodo Baggins. It was only 5 pages long, as Chuck roundhouse-kicked Sauron's ass halfway through the first chapter.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-Hellen Keller's favorite color is Chuck Norris.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-Chuck Norris eats beef jerky and craps gunpowder. Then, he uses that gunpowder to make a bullet, which he uses to kill a cow and make more beef jerky. Some people refer to this as the "Circle of Life."
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-If, by some incredible space-time paradox, Chuck Norris would ever fight himself, he'd win. Period.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-Chuck Norris is currently suing myspace for taking the name of what he calls everything around you.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-The crossing lights in Chuck Norris's home town say "Die slowly" and "die quickly". They each have a picture of Chuck Norris punching or kicking a pedestrian.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-Science Fact: Roundhouse kicks are comprised primarily of an element called Chucktanium.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-The Sherman tank was originaly called the Norris tank until Chuck Norris decided it wasn't tough enough to be associated with him. The Army, for fear of Chuck Norris, renamed the tank and promised to develop a weapon more fitting of his name. To date, no weapon created has been badass enough to be named after Chuck Norris.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-Chuck Norris proved that we are alone in the universe. We weren't before his first space expedition.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-Superman once watched an episode of Walker, Texas Ranger. He then cried himself to sleep.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Chuck Norris doesn't step on toes. Chuck Norris steps on necks.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-The movie "Delta Force" was extremely hard to make because Chuck had to downplay his abilities. The first few cuts were completely unbelievable.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-Movie trivia: The movie "Invasion U.S.A." is, in fact, a documentary.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-Chuck Norris does not "style" his hair. It lays perfectly in place out of sheer terror.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-A study showed the leading causes of death in the United States are:
-1:Heart disease
-2:Chuck Norris
-3:Cancer
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-It's widely believed that Jesus was Chuck Norris' stunt double for crucifixion due to the fact that it is impossible for nails to pierce Chuck Norris' skin.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-Chuck Norris did in fact, build Rome in a day.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-Along with his black belt, Chuck Norris often chooses to wear brown shoes. No one has DARED call him on it. Ever.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-Anytime someone is elected president in the United States, they must ask permission from Chuck Norris to live in the White House. The reason for this is because Chuck Norris had won every Federal, State, and Local election since 1777. He just allows others to run the country in his place.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-Once you go Norris, you are physically unable to go back.
+When God said "Let there be light!", Chuck Norris said "Only for half the day
%
-Ninjas want to grow up to be just like Chuck Norris. But usually they grow up just to be killed by Chuck Norris.
+Chuck Norris went up the creek without a paddle... or a canoe
%
-Chuck Norris once sued Burger King after they refused to put razor wire in his Whopper Jr, insisting that that actually is "his" way.
+Chuck Norris once asked a man to turn down his music, he refused, that man's baby was born deaf.
%
-The last thing you hear before Chuck Norris gives you a roundhouse kick? No one knows because dead men tell no tales.
+Chuck Norris found the hay in the needle stack.
%
-Chuck Norris doesn't play god. Playing is for children.
+Chuck Norris doesn't need to brush his teeth, his spit acts as a bleach.
%
-As a teen, Chuck Norris had sex with every nun in a convent tucked away in the hills of Tuscany. Nine months later the nuns gave birth to the 1972 Miami Dolphins, the only undefeated and untied team in professional football history.
+Chuck Norris once had a street named after him. But the name removed at once, because nobody crosses Chuck Norris, and lives
%
-Chuck Norris is the only person in the world that can actually email a roundhouse kick.
+The planes in 9/11 were not hijacked. Chuck Norris was just playing with his old radio controller.
%
-Chuck Norris won super bowls VII and VIII singlehandedly before unexpectedly retiring to pursue a career in ass-kicking.
+Machiavelli said it is better to be feared than loved because he was inspired by Chuck Norris.
%
-Wo hu cang long. The translation from Mandarin Chinese reads: "Crouching Chuck, Hidden Norris"
+Chuck Norris Can Play the Theme from the Twilight Zone with His Beard
%
-Chuck Norris can set ants on fire with a magnifying glass. At night.
+Chuck Norris pees Adamantium
%
-Some kids play Kick the can. Chuck Norris played Kick the keg.
+The Beatles are on iTunes because Chuck Norris bought a Mac.
%
-'Icy-Hot' is too weak for Chuck Norris. After a workout, Chuck Norris rubs his muscles down with liquid-hot MAGMA.
+Chuck Norris once rounhouse kicked a football ...... it is now considered as a planet
%
-Chuck Norris cannot love, he can only not kill.
+Chuck Norris yells at Drill Sergeants
%
-When Chuck Norris was a baby, he didn't suck his mother's breast. His mother served him whiskey, straight out of the bottle.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-According to Einstein's theory of relativity, Chuck Norris can actually roundhouse kick you yesterday.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-Chuck Norris once pulled out a single hair from his beard and skewered three men through the heart with it.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-In an act of great philanthropy, Chuck made a generous donation to the American Cancer Society. He donated 6,000 dead bodies for scientific research.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-Chuck Norris' favourite cut of meat is the roundhouse.
+Chuck Norris does not sleep. He waits.
%
-When J. Robert Oppenheimer said "I am become death, the destroyer Of worlds", He was not referring to the atomic bomb. He was referring to the Chuck Norris halloween costume he was wearing.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-Chuck Norris recently had the idea to sell his urine as a canned beverage. We know this beverage as Red Bull.
+Chuck Norris is the reason why Waldo is hiding.
%
-In a recent survey it was discovered the 94% of American women lost their virginity to Chuck Norris. The other 6% were incredibly fat or ugly.
+Chuck Norris counted to infinity - twice.
%
-Chuck Norris invented a language that incorporates karate and roundhouse kicks. So next time Chuck Norris is kicking your ass, don't be offended or hurt, he may be just trying to tell you he likes your hat.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-If at first you don't succeed, you're not Chuck Norris.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Fear is not the only emotion Chuck Norris can smell. He can also detect hope, as in "I hope I don't get a roundhouse kick from Chuck Norris."
-Too late, asshole.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Chuck Norris's show is called Walker: Texas Ranger, because Chuck Norris doesn't run.
+If at first you don't succeed, you're not Chuck Norris.
%
-MacGyver can build an airplane out of gum and paper clips, but Chuck Norris can roundhouse-kick his head through a wall and take it.
+If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass.
%
-Behind every successful man, there is a woman. Behind every dead man, there is Chuck Norris.
+Chuck Norris can lead a horse to water AND make it drink.
%
-What's known as the UFC, or Ultimate Fighting Championship, doesn't use its full name, which happens to be "Ultimate Fighting Championship, Non-Chuck-Norris-Division".
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-Chuck Norris brushes his teeth with a mixture of iron shavings, industrial paint remover, and wood-grain alcohol.
+Chuck Norris can slam a revolving door.
%
-The easiest way to determine Chuck Norris' age is to cut him in half and count the rings.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-There is endless debate about the existence of the human soul. Well it does exist, and Chuck Norris finds it delicious.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-Most boots are made for walkin'. Chuck Norris' boots ain't that merciful.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-The US did not boycott the 1980 Summer Olympics in Moscow due to political reasons: Chuck Norris killed the entire US team with a single round-house kick during TaeKwonDo practice.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-Chuck Norris wears a live rattlesnake as a condom.
+Guns don't kill people. Chuck Norris kills people.
%
-When the movie Pulp Fiction was filmed they had to borrow Chuck Norris's wallet... It's the one that says "Bad Mother Fucker" on it
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-The Bible was originally titled "Chuck Norris and Friends"
+The chief export of Chuck Norris is Pain.
%
-Chuck Norris began selling the Total Gym as an ill-fated attempt to make his day-to-day opponents less laughably pathetic.
+Chuck Norris has two speeds. Walk, and Kill.
%
-Do you know why Baskin Robbins only has 31 flavors? Because Chuck Norris doesn't like Fudge Ripple.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-When Chuck Norris says "More cowbell", he fucking MEANS it.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-On the set of Walker Texas Ranger Chuck Norris brought a dying lamb back to life by nuzzling it with his beard. As the onlookers gathered, the lamb sprang to life. Chuck Norris then roundhouse kicked it, killing it instantly. This was just to prove that the good Chuck giveth, and the good Chuck, he taketh away.
+Chuck Norris is my Homeboy.
%
-Chuck Norris was what Willis was talkin' about.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-Google won't search for Chuck Norris because it knows you don't find Chuck Norris, he finds you.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris can lead a horse to water AND make it drink.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-Nagasaki never had a bomb dropped on it. Chuck Norris jumped out of a plane and punched the ground.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-It is scientifically impossible for Chuck Norris to have had a mortal father. The most popular theory is that he went back in time and fathered himself.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-Chuck Norris destroyed the periodic table, because Chuck Norris only recognizes the element of surprise.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-It is believed dinosaurs are extinct due to a giant meteor. That's true if you want to call Chuck Norris a giant meteor.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Chuck Norris shot the sheriff, but he round house kicked the deputy.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-That's not Chuck Norris doing push-ups -- that's Chuck Norris moving the Earth away from the path of a deadly asteroid.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-Chuck Norris can judge a book by its cover.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-Nothing can escape the gravity of a black hole, except for Chuck Norris. Chuck Norris eats black holes. They taste like chicken.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris does not play the lottery. It doesn't have nearly enough balls.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-Q: How many Chuck Norris' does it take to change a light bulb?
-A: None, Chuck Norris prefers to kill in the dark.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-As President Roosevelt said: "We have nothing to fear but fear itself. And Chuck Norris."
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Chuck Norris just says "no" to drugs. If he said "yes", it would collapse Colombia's infrastructure.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.?
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-Crime does not pay - unless you are an undertaker following Walker, Texas Ranger, on a routine patrol.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-Chuck Norris invented the internet? just so he had a place to store his porn.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Chuck Norris does not own a house. He walks into random houses and people move.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-It is better to give than to receive. This is especially true of a Chuck Norris roundhouse kick.
+Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.?
%
-Chuck Norris is the only person to ever win a staring contest against Ray Charles and Stevie Wonder at the same time.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-Industrial logging isn't the cause of deforestation. Chuck Norris needs toothpicks.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-Chuck Norris smells what the Rock is cooking... because the Rock is Chuck Norris' personal chef.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-When Chuck Norris plays Oregon Trail, his family does not die from cholera or dysentery, but rather, roundhouse kicks to the face. He also requires no wagon, since he carries the oxen, axels, and buffalo meat on his back. He always makes it to Oregon before you.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-Chuck Norris is the reason why Waldo is hiding.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-"Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
+There is no such thing as being hard its called the Chuck Norris factor.
%
-When God said, "let there be light", Chuck Norris said, "say 'please'."
+When Chuck Norris goes to the library, he looks for the guinness book of records in the comedy section.
%
-Chuck Norris does not eat. Food understands that the only safe haven from Chuck Norris' fists is inside his own body.
+Chuck Norris can shoot a person 28 times with an unloaded gun.
%
-One day Chuck Norris walked down the street with a massive erection. There were no survivors.
+Chuck Norris' personal airplane is called Air Force Chuck
%
-Chuck Norris built a time machine and went back in time to stop the JFK assassination. As Oswald shot, Chuck met all three bullets with his beard, deflecting them. JFK's head exploded out of sheer amazement.
+The letters in Chuck Norris cannot be unscrambled.
%
-Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+Cops don't need a badges in their wallets but only a picture of Chuck Norris.
%
-Chuck Norris uses a night light. Not because Chuck Norris is afraid of the dark, but the dark is afraid of Chuck Norris.
+Chuck Norris was the reason why the Great Wall of China was constructed. It failed miserably.
%
-Chuck Norris is not capable of hitting a target on the broad side of a barn. Every time he tries, the whole damn barn falls down.
+If you see a man in the street who looks like Chuck Norris, but isn't, run: you don't want to be caught in the resulting roundhouse kick to his face.
%
-Before each filming of Walker: Texas Ranger, Chuck Norris is injected with fourteen times the lethal dose of elephant tranquilzer. This is, of course, to limit his strength and mobility, in an attempt to lower the fatality rate of the actors he fights.
+The red phone in the oval office...Rings directly to Chuck Norris Cell Phone
%
-When Bruce Banner gets mad, he turns into the Hulk. When the Hulk gets mad, he turns into Chuck Norris.
+The only way sharks will come near CN underwater is when CN is inside of a cage.
%
-Chuck Norris kills anyone that asks, "You want fries with that" because by now everyone should know that Chuck doesn't ever want fries with anything. Ever.
+Chuck Norris uses a real mouse to move the cursor, type on the keyboard, write e-mails, code entire websites, use photoshop, bring coffee.
%
-Chuck Norris once kicked a horse in the chin. Its decendants are known today as Giraffes.
+If Chuck Norris were to get into a fight with another Chuck Norris, Chuck Norris would win.
%
-Sticks and stones may break your bones, but a Chuck Norris glare will liquefy your kidneys.
+"2012" is code for, Chuck Norris when he is pissed.
%
-Human cloning is outlawed because if Chuck Norris were cloned, then it would be possible for a Chuck Norris roundhouse kick to meet another chuck Norris roundhouse kick. Physicists theorize that this contact would end the universe.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-Chuck Norris once went skydiving, but promised never to do it again. One Grand Canyon is enough.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-Chuck Norris's version of a "chocolate milkshake" is a raw porterhouse wrapped around ten Hershey bars, and doused in diesel fuel.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-If Chuck Norris round-house kicks you, you will die. If Chuck Norris' misses you with the round-house kick, the wind behind the kick will tear out your pancreas.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-In a fight between Batman and Darth Vader, the winner would be Chuck Norris.
+Chuck Norris does not sleep. He waits.
%
-Chuck Norris puts his pants on one leg at a time, just like the rest of us. The only difference is, then he fucking kills people.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-Everybody loves Raymond. Except Chuck Norris.
+Chuck Norris is the reason why Waldo is hiding.
%
-Contrary to popular belief, the Titanic didn't hit an iceberg. The ship was off course and accidentally ran into Chuck Norris while he was doing the backstroke across the Atlantic.
+Chuck Norris counted to infinity - twice.
%
-Chuck Norris got his drivers license at the age of 16. Seconds.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-The original title for Alien vs. Predator was Alien and Predator vs Chuck Norris. The film was cancelled shortly after going into preproduction. No one would pay nine dollars to see a movie fourteen seconds long.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-Chuck Norris' sperm is so badass, he had sex with Nicole Kidman, and 7 months later she prematurely gave birth to a Ford Excursion.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Chuck Norris can win at solitaire with only 18 cards.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Chuck Norris once shat blood - the blood of 11,940 natives he had killed and eaten.
+Chuck Norris can lead a horse to water AND make it drink.
%
-Maslow's theory of higher needs does not apply to Chuck Norris. He only has two needs: killing people and finding people to kill.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-The truth will set you free. Unless Chuck Norris has you, in which case, forget it buddy!
+Chuck Norris can slam a revolving door.
%
-For most people, home is where the heart is. For Chuck Norris, home is where he stores his collection of human skulls.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Kryptonite has been found to contain trace elements of Chuck Norris roundhouse kicks to the face. This is why it is so deadly to Superman.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-Saddam Hussein was not found hiding in a "hole." Saddam was roundhouse-kicked in the head by Chuck Norris in Kansas, which sent him through the earth, stopping just short of the surface of Iraq.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-Coroners refer to dead people as "ABC's". Already Been Chucked.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-Chuck Norris doesn't look both ways before he crosses the street... he just roundhouses any cars that get too close.
+Guns don't kill people. Chuck Norris kills people.
%
-Chuck Norris does not have to answer the phone. His beard picks up the incoming electrical impulses and translates them into audible sound.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-How many roundhouse kicks does it take to get to the center of a tootsie pop? Just one. From Chuck Norris.
+The chief export of Chuck Norris is Pain.
%
-Chuck Norris doesnt wear a watch, HE decides what time it is.
+Chuck Norris has two speeds. Walk, and Kill.
%
-The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm, indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-When chuck Norris does division, there are no remainders.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-If you rearrange the letters in "Chuck Norris", they also spell "Crush Rock In". The words "with his fists" are understood.
+Chuck Norris is my Homeboy.
%
-Never look a gift Chuck Norris in the mouth, because he will bite your damn eyes off.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-Give a man a fish, and you will feed him for a day. Give a man anything that is better than a fish, and Chuck Norris will beat his ass and take it.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris used to play baseball. When Babe Ruth was hailed as the better player, Chuck Norris killed him with a baseball bat to the throat. Lou Gehrig got off easy.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-The original title for Star Wars was "Skywalker: Texas Ranger". Starring Chuck Norris.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-Guantuanamo Bay, Cuba, is the military code-word for "Chuck Norris' basement".
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-The phrase 'balls to the wall' was originally conceived to describe Chuck Norris entering any building smaller than an aircraft hangar.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Ozzy Osbourne bites the heads off of bats. Chuck Norris bites the heads off of Siberian Tigers.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-He who lives by the sword, dies by the sword. He who lives by Chuck Norris, dies by the roundhouse kick.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-The best-laid plans of mice and men often go awry. Even the worst-laid plans of Chuck Norris come off without a hitch.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-The phrase 'dead ringer' refers to someone who sits behind Chuck Norris in a movie theater and forgets to turn their cell phone off.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris' Roundhouse kick is so powerful, that on the set of Sidekicks he single-footedly destroyed Jonathan Brandis' Career.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-Chuck Norris can taste lies.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Chuck Norris does not kick ass and take names. In fact, Chuck Norris kicks ass and assigns the corpse a number. It is currently recorded to be in the billions.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-One time, Chuck Norris accidentally stubbed his toe. It destroyed the entire state of Ohio.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-Little Miss Muffet sat on her tuffet, until Chuck Norris roundhouse kicked her into a glacier.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-In 1990, Chuck Norris founded the non-profit organization "Kick Drugs Out of America". If the organization's name were "Roundhouse Kick Drugs out of America", there wouldn't be any drugs in the Western Hemisphere. Anywhere.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Chuck Norris can blow bubbles with beef jerky.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-They had to edit the first ending of 'Lone Wolf McQuade' after Chuck Norris kicked David Carradine's ass, then proceeded to barbecue and eat him.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-Chuck Norris does, in fact, live in a round house.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-Chuck Norris was once on Jeopardy. This show is notable in that it was the first occasion in Jeopardy history that Alex Trebek had appeared without a mustache. And a head.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-When Chuck Norris works out on the Total Gym, the Total Gym feels like it's been raped.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-4 out of 5 doctors fail to recommend Chuck Norris as a solution to most problems. Also, 80% of doctors die unexplained, needlessly brutal deaths.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-Chuck Norris can skeletize a cow in two minutes.
+In the back of the book of world records, it says "All records are held by Chuck Norris. The ones listed are in second place."
+%
+The only place where the Starship Enterprise refuses to boldly go is Chuck Norris' planet...which is all of them.
+%
+Chuck Norris once had a pet monkey........his name was KING KONG
+%
+Chuck Norris can make his own megazord "The Chuck Norris Roundhouse Kickers Ultimate Super Awesome Megazord"
+%
+Simon doesn't say...Chuck Norris says.
+%
+When does Chuck Norris run out of shotgun bullets?.....whenever he wants to.
%
The only sure things are Death and Taxes, and when Chuck Norris goes to work for the IRS, they'll be the same thing.
%
-Chuck Norris' first job was as a paperboy. There were no survivors.
+Chuck Norris' first job was as a paperboy. There were no survivors.
+%
+Chuck Norris can turn toast back into bread
+%
+Chuck Norris started Chuck Norris.
+%
+Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming
+%
+Chuck Norris killed Kemper
+%
+Did you here about the boy who cried Chuck Norris?
+%
+Chuck Norris can't perform Hadoukens, he IS a Hadouken
+%
+Behind every successful man is Chuck Norris
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death
+%
+Chuck Norris doesn't read. He just stares at the book until he gets the information he wants.
+%
+Why didn't the chicken cross the road? Because Chuck Norris got to it first.
+%
+When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000.
+%
+Chuck Norris can milk an alligator
+%
+Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it
+%
+Chuck Norris once proved p^~p by induction on his beard hairs.
+%
+The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon.
+%
+Chuck Norris can bake in a Freezer.
+%
+Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick.
+%
+Chuck Norris once had a weak moment, just to know what it felt like.
+%
+Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima?
+%
+Chuck Norris has made a 148 break a snooker.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+http://chucknorrisfacts.com/ is built in Drupal because Chuck Norris knows a good CMS when he sees one.
+%
+The producers of the movie "The Last Airbender" are now in talks with Chuck Norris in Order to star him in their next sequal "The Last Skull Bender".
+%
+Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you.
+%
+World War II began because Chuck Norris took a nap. When he woke up, Hitler found out and killed himself out of fear Chuck Norris would kill him.
+%
+The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live.
+%
+Only Chuck Norris can win the mind game, 'cause he never minds.
+%
+Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning.
+%
+Bruce Lee didn't defeat Chuck Norris. Chuck hit Bruce with a Delayed roundhouse kick that was so fast that Lee only felt the impact a year later!
+%
+Chuck Norris doesn't need a bulletproof vest to be bulletproof
+%
+When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money.
+%
+Merlin was Chuck Norris' assistant.
+%
+If you put in the correct cheat code in Halo 2, you can have Master Cheif play without his helmet; revealing to be Chuck Norris.
+%
+Those who ignore history, are doomed by Chuck Norris.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Some kids pee their name in snow. Chuck Norris pees his name in concrete.
+%
+The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.”
+%
+Chuck Norris created Heavy Metal when he was upset
+%
+Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag.
+%
+When things go bump in the night.... it's Chuck Norris
+%
+Chuck Norris fed the Hunger Games
+%
+Chuck Norris played "Got your Nose" with Voldemort and won.
+%
+Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife
+%
+Chuck Norris doesn't let it go.
+%
+You know Chuck Norris' pet lizard, right? Last I heard, he was in the movie "Godzilla". Oh, and his pet turtle starred in "Gamera" as well.
+%
+Whatever Chuck Norris wants, it will instantly appear.
+%
+Chuck Norris once cut a knife with a stick of butter.
+%
+Chuck Norris shops at Sam's Club, but leaves without having his receipt checked
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+In 1945 The US army asked if they could clone Chuck Norris. instead he said he could sort out the Japanese.
+%
+One glance from Chuck Norris and snow turns itself yellow.
+%
+Chuck Norris checks under his bed for Fedor Emelianenko because he takes Fedor to the vet regularly.
+%
+Chuck Norris was the image used for Papa Smurf.
+%
+Chuck Norris is so scary he makes Sharks swim backwards away from him
+%
+When Chuck Norris tosses a coin, it lands on both head and tail.
+%
+Chuck Norris found the last digit of pie
+%
+Chuck Norris Watches "the Nat.Geo. Specials" on Discovery Channel
+%
+James Bond has a license to kill. He got it from Chuck Norris.
+%
+Chuck Norris is Chuck Norris
+%
+"The Big Chuck Norris Roundhouse-Kick Theory"
+%
+That's not an eclipse....that's the sun hiding from Chuck Norris.
+%
+Chuck Norris doesn't like Mudkipz
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Chuck Norris doesn’t eat salad, he eats vegetarians
+%
+Every time there's an earthquake, you know Chuck Norris is hungry. The earthquake is caused by his stomach growling.
+%
+Chuck Norris wasn't born on his birthday
+%
+One time a test cheated on Chuck Norris.
+%
+Chuck Norris won a stepdance contest by standing on his hands
+%
+Chuck Norris thretened to kill Michael Jackson, MJ got so scared to turned white.
+%
+When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part.
+%
+Chuck Norris is the life of parties he dosen't attend
+%
+Chuck Norris can rub two fires together and make a stick!
+%
+Contrary to popular beleif, Rome WAS built in a day, by Chuck Norris.
+%
+Chuck Norris rolled a 20 on a 6 sided die.
+%
+When chuck Norris was in school, he made his PE teacher run laps.
+%
+Chuck Norris wins NASCAR races with all right turns.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Chuck Norris is waiting for Mt. St. Helens to erupt again. He's hoping the lava is hot enough to soften his beard so he can shave for the first time.
+%
+Chuck Norris is overra...
+%
+Chuck Norris was originally in Mortal Kombat, but that version was deleted because no one can beat Chuck Norris in a fight.
+%
+Chuck Norris likes everyone on the earth, cause everyone he didn't like... Is dead...
+%
+Chunk Norris can make sour milk turn fresh
+%
+There is no limbo, only a world that doesn't know of Chuck Norris
+%
+Chuck Norris CAN believe it's not butter
+%
+Dog the Bounty Hunter can't track Chuck Norris down.
+%
+Abraham Lincoln didn't die because he was shot, Chuck Norris roundhouse-kicked so fast his foot went back in time and killed Abraham Lincoln.
+%
+When Chuck Norris inhales helium, his voice doesn't change.
+%
+When Chuck Norris drinks water, the water automatically pasteurized.
+%
+Chuck Norris once punched the ground to stop an earthquake. The resulting aftershock caused the BP oil spill
+%
+Chuck Norris can play the death waltz with his chin.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+More of a question than a fact: in a fight between Chuck Norris and Gordan Freeman who would win?
+%
+Chuck Norris once round-house kicked a salesman. Over the phone.
+%
+Chuck Norris can grill a popsicle
+%
+Chuck Norris' films are factual documentaries.
+%
+Casinos pay Chuck Norris not to play at anything or wish anyone good luck.
+%
+Chuck Norris once got a 200 yard punt return
+%
+Every line in a Chuck Norris haiku is "A roundhouse kick to the face." And they all have the correct number of syllables.
+%
+An angry glare from Chuck Norris is known to kill on the spot.
+%
+Evolution's driving mechanism is nature's desperate attempt to escape Chuck Norris.
+%
+When President Roosevelt dropped the atomic bomb on Hiroshima, he did so only because it was more human then sending Chuck Norris.
+%
+Don't get Chuck Norris angry, last time somebody did that Chuck Norris made the Grand Canyon.
+%
+In Texas, there are five sizes for fountain drinks: small, medium, large, Texas sized, and Chuck Norris Sized. It is a cup made of a human skull.
+%
+After Chuck counted to infinity the first time, he vowed to count to infinity a second time....by counting the bodies of those previously roundhoused.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Taking Karate Lessons = $100, Buying MMA DVD's= $150, Subscribing to a UFC event = $50, Getting a Roundhouse Kick from Chuck Norris = PRICELESS
+%
+Chuck Norris played the game of thrones and won
+%
+Chuck Norris doesn't need sunglasses, the sun needs Chuck Norris glasses
+%
+Chuck Norris doesn't call the wrong number, you just answer the wrong phone.
+%
+Chuck Norris once won the tour de france riding a " big wheel"
+%
+May the Force be with Chuck Norris... for it's own good.
+%
+Chuck Norris once played Duck Duck Goose with a group of Kindergarteners. Only one kid made it to first grade
+%
+During the Civil War Chuck Norris was a slave, his master would often beg him for mercy
+%
+Chuck Norris' glass is never half full or half empty. It stays full even after he takes a drink.
+%
+ King Kong climbed the Empire State building in fear of Chuck Norris who was downstairs at the time.
+%
+Chuck Norris can French kiss his elbow.
+%
+Chuck Norris never trains, because he's Chuck Norris.
+%
+Every phobia known to man has a phobia of Chuck Norris
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Once upon a time, Chuck Norris found himself in a town called Shit Creek.....He opened a Paddle Store.
+%
+Chuck Norris Can Power Solar Panels. At Night.
+%
+When Betty White gets angry, she turns into the Hulk. When Valerie Bertinelli gets mad, she turns into Chuck Norris.
+%
+Chuck Norris is so hard, he uses diamonds as stress balls.
+%
+Chuck Norris can roundhouse kick someone through a window without breaking the glass
+%
+Chuck Norris. Enough said.
+%
+The letters in Chuck Norris cannot be unscrambled.
+%
+Chuck Norris once taught a class of martial arts.Unfortunately Chuck had forgiven to take elephant tranquilizers and killed every one just by saluting
+%
+Chuck Norris was heard in a soundproof room!
+%
+Chuck Norris can see in 3D with just one eye.
+%
+Chuck Norris owns all number 1 pencils.
+%
+Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face.
+%
+Chuck Norris doesn’t brew up tea. He sucks the bag.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+They say death by a 1000 lashes was the most painful way to die, that was before they got roundhouse kicked in the face by Chuck Norris
+%
+Chuck Norris made a statue bleed.
+%
+Dead bodies were found of people that are still alive. These people will cross Chuck Norris in the future and will be round-house kicked back in time.
+%
+The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon.
+%
+The kids said when Chuck was eating Trix cereal ´´silly Chuck, Trix are for kids´´...what happened next?..............................Darfur happened.
+%
+Chuck Norris can roundhouse-kick round houses into squares.
+%
+Chuck Norris is allowed two carry-ons.
+%
+Chuck Norris can divide by zero.
+%
+Chuck Norris does not have a cell phone because he hears everything
+%
+Chuck Norris isn't appropriate...appropriate isn't Chuck Norris
+%
+Earth's rotation is purely governed by the direction that Chuck Norris is walking.
+%
+Chuck Norris drowned a man ON LAND.
+%
+The Jone's are trying to keep up with Chuck Norris
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Chuck Norris bowled a 301 after constructing another pin out of his beard hair
+%
+The only reason that USA lost the 2011 world cup to Japan is because Chuck Norris wasn't there.
+%
+Unlike Jack Bauer, Chuck Norris doesn't need bullets. A quick roundhouse to the face kills twice as fast.
+%
+There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up.
+%
+Chuck Norris' dog pick up after him.
+%
+Jedis are now taught to use the "Chuck"
+%
+Chuck Norris dosent carry a list. He always knows what to do.
+%
+When Chuck Norris performs a roundhouse kick, he's actually measuring the circumference of the universe.
+%
+Walker: Texas Ranger went into syndication before the first episode was shot.
+%
+Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down!
+%
+"Walker Texas Ranger: The Movie 3-D" was considered by Warner Brothers; however the technology to create the visual effects will never be possible.
+%
+When Chuck Norris creates a login, it tells him "password not strong enough", he types in his name and it tells him "password too strong."
+%
+Chuck Norris isn't allowed at the zoo because when he's there the animals are terriefied to come out their cages
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Aliens fear that Chuck Norris might abduct them.
+%
+Chuck Norris splattered tiger blood and Adonis' dna on Charlie Sheen with 1 roundhouse kick!
+%
+How much wood could a woodchuck chuck if a woodchuck could chuck wood? No woodchuck could chuck Chuck's wood!
+%
+The sun only rises every morning because Chuck Norris allows it to.
+%
+Chuck Norris can do a regime change with a roundhouse kick.
+%
+Chuck Norris CAN spell with an I before E even after C.
+%
+Ghosts can see Chuck Norris
+%
+The answer to life, the universe and everything isnt 42. It's Chuck Norris.
+%
+When Chuck Norris pokes the Pillsbury Doughboy, it's not a laughing matter.
+%
+Chuck Norris once thought he was wrong. He was, however, mistaken.
+%
+Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming
+%
+"The wind cries Chuck Norris"
+%
+Chuck Norris doesn't need a bulletproof vest. He catches them with his bare hands.
+%
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
+%
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
+%
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
+%
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
+%
+Chuck Norris does not sleep. He waits.
+%
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
+%
+Chuck Norris is the reason why Waldo is hiding.
+%
+Chuck Norris counted to infinity - twice.
+%
+There is no chin behind Chuck Norris’ beard. There is only another fist.
+%
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
+%
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
+%
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
+%
+Chuck Norris can lead a horse to water AND make it drink.
+%
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
+%
+Chuck Norris can slam a revolving door.
+%
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
+%
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
+%
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
+%
+If you spell Chuck Norris in Scrabble, you win. Forever.
+%
+Guns don't kill people. Chuck Norris kills people.
+%
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
+%
+The chief export of Chuck Norris is Pain.
+%
+Chuck Norris has two speeds. Walk, and Kill.
+%
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
+%
+Chuck Norris drives an ice cream truck covered in human skulls.
+%
+Chuck Norris is my Homeboy.
+%
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
+%
+Chuck Norris uses pepper spray to spice up his steaks.
+%
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
+%
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
+%
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
+%
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
+%
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
+%
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
+%
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
+%
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
+%
+The quickest way to a man's heart is with Chuck Norris' fist.
+%
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
+%
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
+%
+Chuck Norris can win a game of Connect Four in only three moves.
+%
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
+%
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
+%
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
+%
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
+%
+Chuck Norris doesn’t wash his clothes, he disembowels them.
+%
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
+%
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
+%
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
+%
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
+%
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
+%
+Chuck Norris: even Naruto can't believe it
+%
+Chuck Norris can fit 10 gallons of water in a 5 gallon water bucket
%
-With the rising cost of gasoline, Chuck Norris is beginning to worry about his drinking habit.
+Chuck Norris roundhouse kicks people in the face first and asks questions later.
%
-The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death.
+Chuck Norris is the only one who can tear a facebook page!
%
-Chuck Norris' testicles do not produce sperm. They produce tiny white ninjas that recognize only one mission: seek and destroy.
+Chuck Norris doesn't need air, he is air
%
-To be or not to be? That is the question. The answer? Chuck Norris.
+Chuck Norris once tried to teach a fat, stupid kid Martial Arts. Unsuccessfully. The kid grew up to be Steven Seagal.
%
-Chuck Norris has never been in a fight, ever. Do you call one roundhouse kick to the face a fight?
+Achievement Unlocked: Chuck Norris of Death
%
-There are two types of people in the world... people that suck, and Chuck Norris.
+Chuck Norris is the ghost in paranormal activity.
%
-Chuck Norris never wet his bed as a child. The bed wet itself out of fear.
+Chuck Norris can't get fired by Donald Trump
%
-If you were somehow able to land a punch on Chuck Norris your entire arm would shatter upon impact. This is only in theory, since, come on, who in their right mind would try this?
+Ozzy Osbourne once accidentally bit the head off a live bat - Chuck Norris once deliberately bit the head off a live pterodactyl.
%
-70% of a human's weight is water. 70% of Chuck Norris' weight is his dick.
+Note to self: Don’t be the cashier to tell Chuck Norris his coupons have expired.
%
-Jean-Claude Van Damme once kicked Chuck Norris' ass. He was then awakened from his dream by a roundhouse kick to the face.
+Chuck Norris was what Willis was talking about.
%
-The pie scene in "American Pie" is based on a dare Chuck Norris took when he was younger. However, in Chuck Norris' case, the "pie" was the molten crater of an active volcano.
+Chuck Norris is entitiled to his own facts.
%
-Chuck Norris uses 8'x10' sheets of plywood as toilet paper.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-Noah was the only man notified before Chuck Norris relieved himself in the Atlantic Ocean.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-Chuck Norris once invited all of the other badasses from TV to duke it out in order to see who was the supreme badass. Only two showed up-- Jack Bauer and MacGyver.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-Jack Bauer tried to use his detailed knowledge of torture techniques, but to no avail: Chuck Norris thrives on pain. Chuck Norris then ripped off Jack Bauer's arm and beat him to death with it. Game, set, match.
+Chuck Norris does not sleep. He waits.
%
-Chuck Norris eats steak for every single meal. Most times he forgets to kill the cow.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-The First Law of Thermodynamics states that energy can neither be created nor destroyed... unless it meets Chuck Norris.
+Chuck Norris is the reason why Waldo is hiding.
%
-Chuck Norris doesn't go on the internet, he has every internet site stored in his memory. He refreshes webpages by blinking.
+Chuck Norris counted to infinity - twice.
%
-Fact: Chuck Norris doesn't consider it sex if the woman survives.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-It is said that looking into Chuck Norris' eyes will reveal your future. Unfortunately, everybody's future is always the same: death by a roundhouse-kick to the face.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-Chuck Norris knows everything there is to know - Except for the definition of mercy.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Scientifically speaking, it is impossible to charge Chuck Norris with "obstruction of justice." This is because even Chuck Norris cannot be in two places at the same time.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Chuck Norris never has to wax his skis because they're always slick with blood.
+Chuck Norris can lead a horse to water AND make it drink.
%
-When you say "no one's perfect", Chuck Norris takes this as a personal insult.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-Chuck Norris can win a game of Trivial Pursuit with one roll of the dice, and without answering a single question... just a nod of the head, and a stroke of the beard.
+Chuck Norris can slam a revolving door.
%
-182,000 Americans die from Chuck Norris-related accidents every year.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Paper beats rock, rock beats scissors, and scissors beats paper, but Chuck Norris beats all 3 at the same time.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-Jesus can walk on water, but Chuck Norris can walk on Jesus.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-All roads lead to Chuck Norris. And by the transitive property, a roundhouse kick to the face.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-If you're driving down the road and you think Chuck Norris just cut you off, you better thank your lucky stars it wasn't the other way around.
+Guns don't kill people. Chuck Norris kills people.
%
-July 4th is Independence day. And the day Chuck Norris was born. Coincidence? i think not.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-Chuck Norris never goes to the dentist because his teeth are unbreakable. His enemies never go to the dentist because they have no teeth.
+The chief export of Chuck Norris is Pain.
%
-In the medical community, death is referred to as "Chuck Norris Disease"
+Chuck Norris has two speeds. Walk, and Kill.
%
-Chuck Norris was once in a knife fight, and the knife lost.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-If you work in an office with Chuck Norris, don't ask him for his three-hole-punch.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-In the Words of Julius Caesar, "Veni, Vidi, Vici, Chuck Norris". Translation: I came, I saw, and I was roundhouse-kicked inthe face by Chuck Norris.
+Chuck Norris is my Homeboy.
%
-The First rule of Chuck Norris is: you do not talk about Chuck Norris.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-Chuck Norris is widely predicted to be first black president. If you're thinking to yourself, "But Chuck Norris isn't black", then you are dead wrong. And stop being a racist.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-When Chuck Norris plays Monopoly, it affects the actual world economy.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-Chuck Norris can be unlocked on the hardest level of Tekken. But only Chuck Norris is skilled enough to unlock himself. Then he roundhouse kicks the Playstation back to Japan.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-Chuck Norris drinks napalm to quell his heartburn.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-Every time someone uses the word "intense", Chuck Norris always replies "you know what else is intense?" followed by a roundhouse kick to the face.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-As an infant, Chuck Norris' parents gave him a toy hammer. He gave the world Stonehenge.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Chuck Norris once ordered a steak in a restaurant. The steak did what it was told.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-Most people fear the Reaper. Chuck Norris considers him "a promising Rookie".
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-There are only two things that can cut diamonds: other diamonds, and Chuck Norris.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-President Roosevelt once rode his horse 100 miles. Chuck Norris carried his the same distance in half the time.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris once ate four 30lb bowling balls without chewing.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-What many people dont know is chuck norris is the founder of planned parenthood. Not even unborn children can escape his wrath.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-Chuck Norris was banned from competitive bullriding after a 1992 exhibition in San Antonio, when he rode the bull 1,346 miles from Texas to Milwaukee Wisconsin to pick up his dry cleaning.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Chuck Norris qualified with a top speed of 324 mph at the Daytona 500, without a car.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-Chuck Norris likes his coffee half and half: half coffee grounds, half wood-grain alcohol.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-Chuck Norris uses tabasco sauce instead of visine.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-The chemical formula for the highly toxic cyanide ion is CN-. These are also Chuck Norris' initials. This is not a coincidence.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Chuck Norris' credit cards have no limit. Last weekend, he maxed them out.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-Think of a hot woman. Chuck Norris did her.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-A man once claimed Chuck Norris kicked his ass twice, but it was promptly dismissed as false - no one could survive it the first time.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-Chuck Norris sleeps with a pillow under his gun.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-Chuck Norris owns a chain of fast-food restaurants throughout the southwest. They serve nothing but barbecue-flavored ice cream and Hot Pockets.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-Chuck Norris doesn't chew gum. Chuck Norris chews tin foil.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-Aliens DO indeed exist. They just know better than to visit a planet that Chuck Norris is on.
+While visiting the hexagon, Chuck Norris was asked to demonstrate his famous roundhouse kick. Henceforth, it has been known as the Pentagon.
%
-When in a bar, you can order a drink called a "Chuck Norris". It is also known as a "Bloody Mary", if your name happens to be Mary.
+When Chuck Norris played the card game War with a friend, France surrendered.
%
-Every time Chuck Norris smiles, someone dies. Unless he smiles while he's roundhouse kicking someone in the face. Then two people die.
+If Goliath listened to Chuck Norris he would have won.
%
-Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag.
+Chuck Norris can defuse bomb even if he cut the wrong wire
%
-There's an order to the universe: space, time, Chuck Norris.... Just kidding, Chuck Norris is first.
+Chuck Norris sleeps in Seattle.
%
-A man once asked Chuck Norris if his real name is "Charles". Chuck Norris did not respond, he simply stared at him until he exploded.
+Chuck Norris shot a man with a knife
%
-Chuck Norris starts everyday with a protein shake made from Carnation Instant Breakfast, one dozen eggs, pure Colombian cocaine, and rattlesnake venom. He injects it directly into his neck with a syringe.
+The dictionary references Chuck Norris several times, he is metioned under Fear, Law, Order and Chucktatorship.
%
-In a tagteam match, Chuck Norris was teamed with Hulk Hogan against King Kong Bundy and Andre The Giant. He pinned all 3 at the same time.
+Chuck Norris CAN balance the light-switch between ON and OFF.
%
-Chuck Norris doesn't see dead people. He makes people dead.
+If Chuck was ever captured, he could win a game of Russian Roulette with six bullets in the revolver, he would shoot everyone else!
%
-Chuck Norris is the only person who can simultaneously hold and fire FIVE Uzis: One in each hand, one in each foot -- and the 5th one he roundhouse-kicks into the air, so that it sprays bullets.
+In a rain storm Chuck Norris stays dry. Rain drops are scared to hit him.
%
-For undercover police work, Chuck Norris pins his badge underneath his shirt, directly into his chest.
+Chuck Norris is the reason tumbleweeds tumble
%
-In the X-Men movies, none of the X-Men super-powers are done with special effects. Chuck Norris is the stuntman for every character.
+The Earth was almost destroyed by a 50 km wide asteroid in 1984, but Chuck Norris roundhouse kicked it into the Sun.
%
-We live in an expanding universe. All of it is trying to get away from Chuck Norris.
+Chuck Norris can terminate a repeating decimal.
%
-Chuck Norris went looking for a bar but couldn't find one. He walked to a vacant lot and sat there. Sure enough within an hour an a half someone constructed a bar around him. He then ordered a shot, drank it, and then burned the place to the ground. Chuck Norris yelled over the roar of the flames, "always leave things the way you found em!"
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-It is said that every time you masturbate, God kills a kitten. Every time God masturbates, Chuck Norris kills a lion.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-The word 'Kill' was invented by Chuck Norris. Other words were 'Die', 'Beer', and 'What'.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-Chuck Norris is a vegetarian. Meaning, he does not eat animals until first he puts them into vegetative state with his fists.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-The 11th commandment is "Thou shalt not piss off Chuck Norris" This commandment is rarely enforced, as it is impossible to accomplish.
+Chuck Norris does not sleep. He waits.
%
-Chuck Norris is his own line at the DMV.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-Two wrongs don't make a right. Unless you're Chuck Norris. Then two wrongs make a roundhouse kick to the face.
+Chuck Norris is the reason why Waldo is hiding.
%
-Who let the dogs out? Chuck Norris let the dogs out... and then roundhouse kicked them through an Oldsmobile.
+Chuck Norris counted to infinity - twice.
%
-Chuck Norris can do a roundhouse kick faster than the speed of light. This means that if you turn on a light switch, you will be dead before the lightbulb turns on.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-When Chuck Norris goes to out to eat, he orders a whole chicken, but he only eats its soul.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-Chuck Norris sold his soul to the devil for his rugged good looks and unparalleled martial arts ability. Shortly after the transaction was finalized, Chuck roundhouse-kicked the devil in the face and took his soul back. The devil, who appreciates irony, couldn't stay mad and admitted he should have seen it coming. They now play poker every second Wednesday of the month.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-Chuck Norris has never won an Academy Award for acting... because he's not acting.
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-If Chuck Norris wants your opinion, he'll beat it into you.
+Chuck Norris can lead a horse to water AND make it drink.
%
-Not everyone that Chuck Norris is mad at gets killed. Some get away. They are called astronauts.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-Chuck Norris has to register every part of his body as a separate lethal weapon. His spleen is considered a concealed weapon in over 50 states.
+Chuck Norris can slam a revolving door.
%
-A movie scene depicting Chuck Norris losing a fight with Bruce Lee was the product of history's most expensive visual effect. When adjusted for inflation, the effect cost more than the Gross National Product of Paraguay.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Godzilla is a Japanese rendition of Chuck Norris' first visit to Tokyo.
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-They once made a Chuck Norris toilet paper, but there was a problem-- It wouldn't take shit from anybody.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-Chuck Norris once rode a nine foot grizzly bear through an automatic car wash, instead of taking a shower.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-"Sweating bullets" is literally what happens when Chuck Norris gets too hot.
+Guns don't kill people. Chuck Norris kills people.
%
-Chuck Norris' sperm can be seen with the naked eye. Each one is the size of a quarter.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-After taking a steroids test doctors informed Chuck Norris that he had tested positive. He laughed upon receiving this information, and said "of course my urine tested positive, what do you think they make steroids from?"
+The chief export of Chuck Norris is Pain.
%
-Chuck Norris doesn't daydream. He's too busy giving other people nightmares.
+Chuck Norris has two speeds. Walk, and Kill.
%
-When Arnold says the line "I'll be back" in the first Terminator movie it is implied that is he going to ask Chuck Norris for help.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-There are no such things as tornados. Chuck Norris just hates trailer parks.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-Chuck Norris' Penis is a third degree blackbelt, and an honorable 32nd-degree mason.
+Chuck Norris is my Homeboy.
%
-Chuck Norris does not follow fashion trends, they follow him. But then he turns around and kicks their ass. Nobody follows Chuck Norris.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-The phrase 'break a leg' was originally coined by Chuck Norris's co-stars in Walker, Texas Ranger as a good luck charm indicating that a broken leg might be the worst extent of their injuries. This never proved to be the case.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-Diamonds are not, despite popular belief, carbon. They are, in fact, Chuck Norris fecal matter. This was proven a recently, when scientific analysis revealed what appeared to be Jean-Claude Van Damme bone fragments inside the Hope Diamond.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-Chuck Norris once participated in the running of the bulls. He walked.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-The Drummer for Def Leppard's only got one arm. Chuck Norris needed a back scratcher.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-Chuck Norris was the orginal sculptor of Mount Rushmore. He completed the entire project using only a bottle opener and a drywall trowel.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Chuck Norris once rode a bull, and nine months later it had a calf.
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-Chuck Norris once lost the remote, but maintained control of the TV by yelling at it in between bites of his "Filet of Child" sandwich.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-For Spring Break '05, Chuck Norris drove to Madagascar, riding a chariot pulled by two electric eels.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-The Manhattan Project was not intended to create nuclear weapons, it was meant to recreate the destructive power in a Chuck Norris Roundhouse Kick. They didn't even come close.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris has banned rainbows from the state of North Dakota.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-Divide Chuck Norris by zero and you will in fact get one........one bad-ass motherfucker that is.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-TNT was originally developed by Chuck Norris to cure indigestion.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-After returning from World War 2 unscathed, Bob Dole was congratulated by Chuck Norris with a handshake. The rest is history.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-Chuck Norris runs on batteries. Specifically, Die Hards.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-"Let the Bodies Hit the Floor" was originally written as Chuck Norris' theme song.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-Chuck Norris will never have a heart attack. His heart isn't nearly foolish enough to attack him.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Only Chuck Norris can prevent forest fires.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-When Chuck Norris makes a burrito, its main ingredient is real toes.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-Chuck Norris is not Irish. His hair is soaked in the blood of his victims.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-Chuck Norris' dick is so big, it has it's own dick, and that dick is still bigger than yours.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-They say curiosity killed the cat. This is false. Chuck Norris killed the cat. Every single one of them.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-There is no such thing as a lesbian, just a woman who has never met Chuck Norris.
+Chuck Norris doesn't look for fun. The fun looks for Chuck Norris.
%
-Chuck Norris crossed the road. No one has ever dared question his motives.
+Chuck Norris starts his day with 6 live chickens two cows, three pigs and a boiling hot cup of pure fury
%
-When Chuck Norris was born, he immediately had sex with the first nurse he saw. He was her first. She was his third. That afternoon.
+The only word that rhymes with orange is Chuck Norris
%
-One time, at band camp, Chuck Norris ate a percussionist.
+Everyone is so scared of Chuck Norris that they kiss his arse by writing these facts, too right they should
%
-Chuck Norris doesn't say "who's your daddy", because he knows the answer.
+gmail@chucknorris.com
%
-Chuck Norris originally wrote the first dictionary. The definition for each word is as follows - A swift roundhouse kick to the face.
+Chuck Norris play's Texas hold em with Zeus, every second Wednesday of the month
%
-Love does not hurt. Chuck Norris does.
+Chuck Norris has killed the Dead Sea
%
-The term "Cleveland Steamer" got its name from Chuck Norris, when he took a dump while visiting the Rock and Roll Hall of fame and buried northern Ohio under a glacier of fecal matter.
+On the keyboard there is no control button because Chuck Norris is always in control.
%
-Chuck Norris once round-house kicked a salesman. Over the phone.
+The truth hurts dosen't it, Chuck Norris' truth kills.
%
-The pen is mighter than the sword, but only if the pen is held by Chuck Norris.
+Chuck Norris sent a BBM to an iphone.
%
-Chuck Norris doesn't kill two birds with one stone. Chuck Norris kills all birds, with two stones. The ones in his pants.
+When Presidents speak, their nation listens. When Chuck Norris blinks, the whole World listens.
%
-Chuck Norris knows the last digit of pi.
+Chuck Norris once cried just to see what it was like. The end result was the creation of life.
%
-Those aren't credits that roll after Walker Texas Ranger. It is actually a list of fatalities that occurred during the making of the episode.
+Chuck Norris is the reason that the world will end in 2012. He was getting bored with the Earth
%
-The air around Chuck Norris is always a balmy 78 degrees.
+When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.
%
-When Chuck Norris wants an egg, he cracks open a chicken.
+Chuck Norris doesn't read books. He stares them down until he gets the information he wants.
%
-Chuck Norris plays racquetball with a waffle iron and a bowling ball.
+There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live.
%
-According to the Bible, God created the universe in six days. Before that, Chuck Norris created God by snapping his fingers.
+Outer space exists because it's afraid to be on the same planet with Chuck Norris.
%
-Chuck Norris doesn't believe in ravioli. He stuffs a live turtle with beef and smothers it in pig's blood.
+Chuck Norris does not sleep. He waits.
%
-Count from one to ten. That's how long it would take Chuck Norris to kill you...Fourty seven times.
+Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
%
-The 1972 Miami Dolphins lost one game, it was an exhibition game vs. Chuck Norris and three seven year old girls. Chuck Norris won with a roundhouse-kick to the face in overtime.
+Chuck Norris is the reason why Waldo is hiding.
%
-Chuck Norris is not Politically Correct. He is just Correct. Always.
+Chuck Norris counted to infinity - twice.
%
-Mr. T pities the fool. Chuck Norris rips the fool's fucking head off.
+There is no chin behind Chuck Norris’ beard. There is only another fist.
%
-Chuck Norris had to stop washing his clothes in the ocean. The tsunamis were killing people.
+When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down.
%
-Chuck Norris has volunteered to remain on earth after the Rapture; he will spend his time fighting the Anti-Christ.
+Chuck Norris is so fast, he can run around the world and punch himself in the back of the head.
%
-They were going to release a Chuck Norris edition of Clue, but the answer always turns out to be "Chuck Norris. In The Library. With a Roundhouse Kick."
+Chuck Norris' hand is the only hand that can beat a Royal Flush.
%
-Chuck Norris is the only known mammal in history to have an opposable thumb. On his penis.
+Chuck Norris can lead a horse to water AND make it drink.
%
-A man once taunted Chuck Norris with a bag of Lay's potato chips, saying "Betcha can't eat just one!" Chuck Norris proceeded to eat the chips, the bag, and the man in one deft move.
+Chuck Norris doesn’t wear a watch. HE decides what time it is.
%
-Chuck Norris' favorite cereal is Kellogg's Nails 'N' Gravel.
+Chuck Norris can slam a revolving door.
%
-In the first Jurassic Park movie, the Tyrannosaurus Rex wasn't chasing the jeep. Chuck Norris was chasing the Tyrannosaurus AND the jeep.
+Chuck Norris does not get frostbite. Chuck Norris bites frost.
%
-Chuck Norris has never been accused of murder for the simple fact that his roundhouse kicks are recognized world-wide as "acts of God."
+Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV.
%
-"Brokeback Mountain" is not just a movie. It's also what Chuck Norris calls the pile of dead ninjas in his front yard.
+Contrary to popular belief, America is not a democracy, it is a Chucktatorship.
%
-Chuck Norris does not wear a condom. Because there is no such thing as protection from Chuck Norris.
+If you spell Chuck Norris in Scrabble, you win. Forever.
%
-Chuck Norris once had sex with a cigarette machine in the Osaka airport.
+Guns don't kill people. Chuck Norris kills people.
%
-Rules of fighting: 1) Don't bring a knife to a gun fight. 2) Don't bring a gun to a Chuck Norris fight.
+There is no theory of evolution. Just a list of animals Chuck Norris allows to live.
%
-Chuck Norris is the only man who has, literally, beaten the odds. With his fists.
+The chief export of Chuck Norris is Pain.
%
-In ancient China there is a legend that one day a child will be born from a dragon, grow to be a man, and vanquish evil from the land. That man is not Chuck Norris, because Chuck Norris killed that man.
+Chuck Norris has two speeds. Walk, and Kill.
%
-Chuck Norris wipes his ass with chain mail and sandpaper.
+The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.
%
-When you play Monopoly with Chuck Norris, you do not pass go, and you do not collect two hundred dollars. You will be lucky if you make it out alive.
+Chuck Norris drives an ice cream truck covered in human skulls.
%
-Chuck Norris describes human beings as "a sociable holder for blood and guts".
+Chuck Norris is my Homeboy.
%
-Chuck Norris once got into a fight with a one-armed Ninja. Seeing that he had an unfair advantage, Chuck Norris ripped both of his arms off and one of his legs. He then roundhouse-kicked the ninja in the head, killing him instantly, and proceeded to sow his limbs back on using only a rusty tent spike and bailing wire.
+Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING.
%
-Chuck Norris likes his ice like he likes his skulls: crushed.
+Chuck Norris uses pepper spray to spice up his steaks.
%
-Chuck Norris can kick through all 6 degrees of separation, hitting anyone, anywhere, in the face, at any time.
+Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean.
%
-Most tough men eat nails for breakfast. chuck Norris does all of his grocery shopping at Home Depot.
+Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down.
%
-Chuck Norris did not "lose" his virginity, he stalked it and then destroyed it with extreme prejudice.
+Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing.
%
-Everything King Midas touches turnes to gold. Everything Chuck Norris touches turns up dead.
+The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably.
%
-Chuck Norris' pulse is measured on the richter scale.
+Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth.
%
-Most people know that Descarte said, "I think, therefore I am." What most people don't know is that that quote continues, "...afraid of Chuck Norris."
+Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.
%
-Chuck Norris once roundhouse-kicked a ten dollar bill into 200 nickels.
+If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face.
%
-For every movie about Vietnam starring Chuck Norris, the historical duration of the war decreases. Just 3 more "Missing in Action" sequels, and that war will have never actually existed.
+When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever.
%
-Chuck Norris' penis has a Hemi.
+The quickest way to a man's heart is with Chuck Norris' fist.
%
-Chuck Norris enjoys a good practical joke. His favorite is where he removes your lower intestine and pretends to make a balloon animal out of it. Then he cracks your skull open with a Volvo for not complimenting him on his balloon animal.
+Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear.
%
-Chuck Norris CAN in fact 'raise the roof'. And he can do it with one hand.
+CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time.
%
-Kenny G is allowed to live because Chuck Norris doesn't kill women.
+Chuck Norris can win a game of Connect Four in only three moves.
%
-Life is not, in fact, like a box of chocolates. It is more like a box of Chuck Norris, roundhouse kicking you in the face. And if you receive a box of Chuck Norris, you ALWAYS know what you are going to get.
+What was going through the minds of all of Chuck Norris' victims before they died? His shoe.
%
-For Chuck Norris, every street is "one way". HIS WAY.
+Chuck Norris is the only man to ever defeat a brick wall in a game of tennis.
%
-There are now five cup sizes at Starbucks: Short, Tall, Grande, Venti, and Chuck Norris.
+Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide.
%
-During the Vietnam War, Chuck Norris allowed himself to be captured. For torture, they made him eat his own entrails. He asked for seconds.
+Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out.
%
-Chuck Norris once created a flamethrower by urinating into a lighter.
+Chuck Norris doesn’t wash his clothes, he disembowels them.
%
-Instead of having a cigarette after sex, Chuck Norris heads outside and brands his cattle.
+A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there.
%
-Chuck Norris actually built the stairway to heaven.
+Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia.
%
-Whoever said "only the good die young" was probably in Chuck Norris's kindergarten class.
+Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre.
%
-Chuck Norris once skewered a man with the Eiffel tower.
+Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch."
%
-The best part of waking up, is not Folgers in your cup, but knowing that Chuck Norris didn't kill you in your sleep.
+Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face.
%
-Chuck Norris doesn't own a can opener, he just chews through the can.
+Only Chuck Norris is stronger than an Altoid.
%
-Occam's Razor says that the simplest answer tends to be the correct one. Norris' Razor involves a flick of the wrist and a Columbian Necktie.
+Chuck Norris has a battlecruiser AND a car.
%
-Chuck Norris needs a monkeywrench and a blowtorch to masturbate.
+Chuck Norris burnt a fire proof vest, UNDERWATER!
%
-Proponents of higher-order theories of consciousness argue that consciousness is explained by the relation between two levels of mental states in which a higher-order mental state takes another mental state. If you mention this to Chuck Norris, expect an explosive roundhouse kick to the face for spouting too much fancy-talk.
+Chuck Norris was once turned down for American Idol. When Simon was questioned about it, he replied "I'm retiring after this season". I wonder why?
%
-Chuck Norris invented all 32 letters of the alphabet.
+Chuck Norris doesn't cheat death, he beats it fair and square.
%
-Remember The Ultimate Warrior? He quit wrestling because Chuck Norris wanted his nickname back.
+When Chuck Norris roundhouse-kicks you HE decides when you will feel the impact .
%
-If a tree falls in the forest, does anybody hear? Yes. Chuck Norris hears it. Chuck Norris can hear everything. Chuck Norris can hear the shrieking terror in your soul.
+Chuck Norris made the big bang just by clicking his fingers
%
-Chuck Norris actually owns IBM. It was an extremely hostile takeover.
+Trick me once, shame on you, trick Chuck Norris.....rest in peace.
%
-He, who laughs last, laughs best. He who laughs at Chuck Norris ? dies.
+Chuck Norris doesn't fight. He gives motivational seminars to die on their own to avoid a roundhouse kick to the face.
%
-Chuck Norris is like a dog, not only because he can smell fear, but because he can piss on whatever the fuck he wants.
+This one time at band camp... BAM! Chuck Norris.
%
-Chuck Norris can jump-start a car using jumper cables attached to his nipples.
+Chuck Norris protects his body guards.
%
-Chuck Norris neither melts in your mouth nor in your hand. He shreds your trachea before ravaging your soul with a combination of chocolate, whickey, roundhouse kicks and death. Oh, and pain. Lots of pain.
+Chuck Norris watched the first steps on the moon... From his summer home on Mars
%
-Chuck Norris doesn't have blood. He is filled with magma.
+The Earth is made up of two-thirds water and one-third Chuck Norris.
%
diff --git a/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
index 54f0bdda9..1bea536e0 100644
--- a/plugins/colored-man-pages/colored-man-pages.plugin.zsh
+++ b/plugins/colored-man-pages/colored-man-pages.plugin.zsh
@@ -16,7 +16,7 @@ EOF
fi
fi
-man() {
+function man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh
index 11b58e69d..b97dffe43 100644
--- a/plugins/colorize/colorize.plugin.zsh
+++ b/plugins/colorize/colorize.plugin.zsh
@@ -3,11 +3,12 @@
# If no highlighting method supported for given extension then it tries
# guess it by looking for file content.
-alias colorize='colorize_via_pygmentize'
+#easier alias to use plugin
+alias ccat='colorize_via_pygmentize'
colorize_via_pygmentize() {
if [ ! -x "$(which pygmentize)" ]; then
- echo "package \'pygmentize\' is not installed!"
+ echo "package \'Pygments\' is not installed!"
return -1
fi
diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh
index 07eb1de88..d00813e39 100644
--- a/plugins/composer/composer.plugin.zsh
+++ b/plugins/composer/composer.plugin.zsh
@@ -39,14 +39,17 @@ alias c='composer'
alias csu='composer self-update'
alias cu='composer update'
alias cr='composer require'
+alias crm='composer remove'
alias ci='composer install'
alias ccp='composer create-project'
alias cdu='composer dump-autoload'
+alias cdo='composer dump-autoload --optimize-autoloader'
alias cgu='composer global update'
alias cgr='composer global require'
+alias cgrm='composer global remove'
# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'
# Add Composer's global binaries to PATH
-export PATH=$PATH:~/.composer/vendor/bin
+export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null)
diff --git a/plugins/copydir/README.md b/plugins/copydir/README.md
new file mode 100644
index 000000000..594bf1065
--- /dev/null
+++ b/plugins/copydir/README.md
@@ -0,0 +1,10 @@
+# copydir plugin
+
+Copies the path of your current folder to the system clipboard.
+
+To use, add `copydir` to your plugins array:
+```
+plugins=(... copydir)
+```
+
+Then use the command `copydir` to copy the $PWD.
diff --git a/plugins/copyfile/README.md b/plugins/copyfile/README.md
new file mode 100644
index 000000000..53138ad06
--- /dev/null
+++ b/plugins/copyfile/README.md
@@ -0,0 +1,10 @@
+# copyfile plugin
+
+Puts the contents of a file in your system clipboard so you can paste it anywhere.
+
+To use, add `copyfile` to your plugins array:
+```
+plugins=(... copyfile)
+```
+
+Then you can run the command `copyfile <filename>` to copy the file named `filename`.
diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
index 31a772d60..19966b6ac 100644
--- a/plugins/debian/debian.plugin.zsh
+++ b/plugins/debian/debian.plugin.zsh
@@ -50,7 +50,7 @@ if [[ $use_sudo -eq 1 ]]; then
alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr'
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
alias afu='sudo apt-file update'
- alias ag='sudo $apt_pref $apt_upgr'
+ alias au='sudo $apt_pref $apt_upgr'
alias ai='sudo $apt_pref install'
# Install all packages given on the command line while using only the first word of each line:
# acs ... | ail
@@ -192,7 +192,7 @@ apt-history () {
awk '{print $4"="$5}'
;;
list)
- zcat $(ls -rt /var/log/dpkg*)
+ zgrep --no-filename '' $(ls -rt /var/log/dpkg*)
;;
*)
echo "Parameters:"
diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh
index 2f32277cf..8c58cab4c 100644
--- a/plugins/dircycle/dircycle.plugin.zsh
+++ b/plugins/dircycle/dircycle.plugin.zsh
@@ -9,6 +9,8 @@
# pushd -N: start counting from right of `dirs' output
switch-to-dir () {
+ [[ ${#dirstack} -eq 0 ]] && return
+
while ! builtin pushd -q $1 &>/dev/null; do
# We found a missing directory: pop it out of the dir stack
builtin popd -q $1
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh
index 0209981e3..239915e48 100644
--- a/plugins/dirhistory/dirhistory.plugin.zsh
+++ b/plugins/dirhistory/dirhistory.plugin.zsh
@@ -2,6 +2,10 @@
# Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories
# that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
#
+# Navigate directory hierarchy using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented)
+# ALT-UP moves to higher hierarchy (cd ..)
+# ALT-DOWN moves into the first directory found in alphabetical order
+#
dirhistory_past=($PWD)
dirhistory_future=()
@@ -119,6 +123,10 @@ zle -N dirhistory_zle_dirhistory_back
# xterm in normal mode
bindkey "\e[3D" dirhistory_zle_dirhistory_back
bindkey "\e[1;3D" dirhistory_zle_dirhistory_back
+# Mac teminal (alt+left/right)
+if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
+ bindkey "^[b" dirhistory_zle_dirhistory_back
+fi
# Putty:
bindkey "\e\e[D" dirhistory_zle_dirhistory_back
# GNU screen:
@@ -127,7 +135,56 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back
zle -N dirhistory_zle_dirhistory_future
bindkey "\e[3C" dirhistory_zle_dirhistory_future
bindkey "\e[1;3C" dirhistory_zle_dirhistory_future
+if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then
+ bindkey "^[f" dirhistory_zle_dirhistory_future
+fi
bindkey "\e\e[C" dirhistory_zle_dirhistory_future
bindkey "\eO3C" dirhistory_zle_dirhistory_future
+#
+# HIERARCHY Implemented in this section, in case someone wants to split it to another plugin if it clashes bindings
+#
+
+# Move up in hierarchy
+function dirhistory_up() {
+ cd .. || return 1
+}
+
+# Move down in hierarchy
+function dirhistory_down() {
+ cd "$(find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1)" || return 1
+}
+
+
+# Bind keys to hierarchy navigation
+function dirhistory_zle_dirhistory_up() {
+ zle kill-buffer # Erase current line in buffer
+ dirhistory_up
+ zle accept-line
+}
+
+function dirhistory_zle_dirhistory_down() {
+ zle kill-buffer # Erase current line in buffer
+ dirhistory_down
+ zle accept-line
+}
+
+zle -N dirhistory_zle_dirhistory_up
+# xterm in normal mode
+bindkey "\e[3A" dirhistory_zle_dirhistory_up
+bindkey "\e[1;3A" dirhistory_zle_dirhistory_up
+# Mac teminal (alt+up)
+ #bindkey "^[?" dirhistory_zle_dirhistory_up #dont know it
+# Putty:
+bindkey "\e\e[A" dirhistory_zle_dirhistory_up
+# GNU screen:
+bindkey "\eO3A" dirhistory_zle_dirhistory_up
+
+zle -N dirhistory_zle_dirhistory_down
+bindkey "\e[3B" dirhistory_zle_dirhistory_down
+bindkey "\e[1;3B" dirhistory_zle_dirhistory_down
+# Mac teminal (alt+down)
+ #bindkey "^[?" dirhistory_zle_dirhistory_down #dont know it
+bindkey "\e\e[B" dirhistory_zle_dirhistory_down
+bindkey "\eO3B" dirhistory_zle_dirhistory_down
diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
index 35865a692..29a51d29d 100644
--- a/plugins/django/django.plugin.zsh
+++ b/plugins/django/django.plugin.zsh
@@ -349,6 +349,7 @@ _managepy-commands() {
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
'runserver:Starts a lightweight Web server for development.'
'shell:Runs a Python interactive interpreter.'
+ 'showmigrations:Shows all available migrations for the current project.'
'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
diff --git a/plugins/docker-compose/_docker-compose b/plugins/docker-compose/_docker-compose
index 2947cef38..c0a54cced 100644
--- a/plugins/docker-compose/_docker-compose
+++ b/plugins/docker-compose/_docker-compose
@@ -3,11 +3,6 @@
# Description
# -----------
# zsh completion for docker-compose
-# https://github.com/sdurrheimer/docker-compose-zsh-completion
-# -------------------------------------------------------------------------
-# Version
-# -------
-# 1.5.0
# -------------------------------------------------------------------------
# Authors
# -------
@@ -199,7 +194,9 @@ __docker-compose_subcommand() {
(build)
_arguments \
$opts_help \
+ "*--build-arg=[Set build-time variables for one service.]:<varname>=<value>: " \
'--force-rm[Always remove intermediate containers.]' \
+ '--memory[Memory limit for the build container.]' \
'--no-cache[Do not use cache when building the image.]' \
'--pull[Always attempt to pull a newer version of the image.]' \
'*:services:__docker-compose_services_from_build' && ret=0
@@ -207,13 +204,16 @@ __docker-compose_subcommand() {
(bundle)
_arguments \
$opts_help \
+ '--push-images[Automatically push images for any services which have a `build` option specified.]' \
'(--output -o)'{--output,-o}'[Path to write the bundle file to. Defaults to "<project name>.dab".]:file:_files' && ret=0
;;
(config)
_arguments \
$opts_help \
'(--quiet -q)'{--quiet,-q}"[Only validate the configuration, don't print anything.]" \
- '--services[Print the service names, one per line.]' && ret=0
+ '--resolve-image-digests[Pin image tags to digests.]' \
+ '--services[Print the service names, one per line.]' \
+ '--volumes[Print the volume names, one per line.]' && ret=0
;;
(create)
_arguments \
@@ -242,7 +242,7 @@ __docker-compose_subcommand() {
$opts_help \
'-d[Detached mode: Run command in the background.]' \
'--privileged[Give extended privileges to the process.]' \
- '--user=[Run the command as this user.]:username:_users' \
+ '(-u --user)'{-u,--user=}'[Run the command as this user.]:username:_users' \
'-T[Disable pseudo-tty allocation. By default `docker-compose exec` allocates a TTY.]' \
'--index=[Index of the container if there are multiple instances of a service \[default: 1\]]:index: ' \
'(-):running services:__docker-compose_runningservices' \
@@ -252,6 +252,12 @@ __docker-compose_subcommand() {
(help)
_arguments ':subcommand:__docker-compose_commands' && ret=0
;;
+ (images)
+ _arguments \
+ $opts_help \
+ '-q[Only display IDs]' \
+ '*:services:__docker-compose_services_all' && ret=0
+ ;;
(kill)
_arguments \
$opts_help \
@@ -308,16 +314,17 @@ __docker-compose_subcommand() {
(run)
_arguments \
$opts_help \
+ $opts_no_deps \
'-d[Detached mode: Run container in the background, print new container name.]' \
'*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \
'--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
'--name=[Assign a name to the container]:name: ' \
- $opts_no_deps \
'(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \
'--rm[Remove container after run. Ignored in detached mode.]' \
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
'-T[Disable pseudo-tty allocation. By default `docker-compose run` allocates a TTY.]' \
'(-u --user)'{-u,--user=}'[Run as specified username or uid]:username or uid:_users' \
+ '(-v --volume)*'{-v,--volume=}'[Bind mount a volume]:volume: ' \
'(-w --workdir)'{-w,--workdir=}'[Working directory inside the container]:workdir: ' \
'(-):services:__docker-compose_services' \
'(-):command: _command_names -e' \
@@ -340,6 +347,11 @@ __docker-compose_subcommand() {
$opts_timeout \
'*:running services:__docker-compose_runningservices' && ret=0
;;
+ (top)
+ _arguments \
+ $opts_help \
+ '*:running services:__docker-compose_runningservices' && ret=0
+ ;;
(unpause)
_arguments \
$opts_help \
@@ -385,9 +397,17 @@ _docker-compose() {
integer ret=1
typeset -A opt_args
+ local file_description
+
+ if [[ -n ${words[(r)-f]} || -n ${words[(r)--file]} ]] ; then
+ file_description="Specify an override docker-compose file (default: docker-compose.override.yml)"
+ else
+ file_description="Specify an alternate docker-compose file (default: docker-compose.yml)"
+ fi
+
_arguments -C \
'(- :)'{-h,--help}'[Get help]' \
- '(-f --file)'{-f,--file}'[Specify an alternate docker-compose file (default: docker-compose.yml)]:file:_files -g "*.yml"' \
+ '*'{-f,--file}"[${file_description}]:file:_files -g '*.yml'" \
'(-p --project-name)'{-p,--project-name}'[Specify an alternate project name (default: directory name)]:project name:' \
'--verbose[Show more output]' \
'(- :)'{-v,--version}'[Print version and exit]' \
diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh
index 4e4ac114a..24bea318b 100644
--- a/plugins/docker-compose/docker-compose.plugin.zsh
+++ b/plugins/docker-compose/docker-compose.plugin.zsh
@@ -21,3 +21,5 @@ alias dcup='docker-compose up'
alias dcdn='docker-compose down'
alias dcl='docker-compose logs'
alias dclf='docker-compose logs -f'
+alias dcpull='docker-compose pull'
+alias dcstart='docker-compose start'
diff --git a/plugins/docker-machine/README.md b/plugins/docker-machine/README.md
new file mode 100644
index 000000000..308a6cfdb
--- /dev/null
+++ b/plugins/docker-machine/README.md
@@ -0,0 +1,19 @@
+# docker-machine plugin for oh my zsh
+
+### Usage
+
+#### docker-vm
+Will create a docker-machine with the name "dev" (required only once)
+To create a second machine call "docker-vm foobar" or pass any other name
+
+#### docker-up
+This will start your "dev" docker-machine (if necessary) and set it as the active one
+To start a named machine use "docker-up foobar"
+
+#### docker-switch dev
+Use this to activate a running docker-machine (or to switch between multiple machines)
+You need to call either this or docker-up when opening a new terminal
+
+#### docker-stop
+This will stop your "dev" docker-machine
+To stop a named machine use "docker-stop foobar" \ No newline at end of file
diff --git a/plugins/docker-machine/docker-machine.plugin.zsh b/plugins/docker-machine/docker-machine.plugin.zsh
new file mode 100644
index 000000000..235d90ee8
--- /dev/null
+++ b/plugins/docker-machine/docker-machine.plugin.zsh
@@ -0,0 +1,33 @@
+DEFAULT_MACHINE="default"
+
+docker-up() {
+ if [ -z "$1" ]
+ then
+ docker-machine start "${DEFAULT_MACHINE}"
+ eval $(docker-machine env "${DEFAULT_MACHINE}")
+ else
+ docker-machine start $1
+ eval $(docker-machine env $1)
+ fi
+ echo $DOCKER_HOST
+}
+docker-stop() {
+ if [ -z "$1" ]
+ then
+ docker-machine stop "${DEFAULT_MACHINE}"
+ else
+ docker-machine stop $1
+ fi
+}
+docker-switch() {
+ eval $(docker-machine env $1)
+ echo $DOCKER_HOST
+}
+docker-vm() {
+ if [ -z "$1" ]
+ then
+ docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 "${DEFAULT_MACHINE}"
+ else
+ docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 $1
+ fi
+} \ No newline at end of file
diff --git a/plugins/docker/README.md b/plugins/docker/README.md
index 1615f75f5..e91798485 100644
--- a/plugins/docker/README.md
+++ b/plugins/docker/README.md
@@ -1,5 +1,5 @@
## Docker autocomplete plugin
A copy of the completion script from the
-[docker](https://github.com/docker/docker/tree/master/contrib/completion/zsh)
+[docker/cli](https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker)
git repo.
diff --git a/plugins/docker/_docker b/plugins/docker/_docker
index 415e731f3..32ad4848a 100644
--- a/plugins/docker/_docker
+++ b/plugins/docker/_docker
@@ -78,7 +78,7 @@ __docker_get_containers() {
s="${${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}[0,12]}"
s="$s:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\:}%% ##}"
- if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
+ if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = (Exit*|Created*) ]]; then
stopped=($stopped $s)
else
running=($running $s)
@@ -100,7 +100,7 @@ __docker_get_containers() {
(( $#s != 0 )) || continue
s="$s:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}"
s="$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\:}%% ##}"
- if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then
+ if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = (Exit*|Created*) ]]; then
stopped=($stopped $s)
else
running=($running $s)
@@ -113,27 +113,27 @@ __docker_get_containers() {
return ret
}
-__docker_stoppedcontainers() {
+__docker_complete_stopped_containers() {
[[ $PREFIX = -* ]] && return 1
__docker_get_containers stopped all "$@"
}
-__docker_runningcontainers() {
+__docker_complete_running_containers() {
[[ $PREFIX = -* ]] && return 1
__docker_get_containers running all "$@"
}
-__docker_containers() {
+__docker_complete_containers() {
[[ $PREFIX = -* ]] && return 1
__docker_get_containers all all "$@"
}
-__docker_containers_ids() {
+__docker_complete_containers_ids() {
[[ $PREFIX = -* ]] && return 1
__docker_get_containers all ids "$@"
}
-__docker_containers_names() {
+__docker_complete_containers_names() {
[[ $PREFIX = -* ]] && return 1
__docker_get_containers all names "$@"
}
@@ -149,25 +149,27 @@ __docker_complete_info_plugins() {
return ret
}
-__docker_images() {
+__docker_complete_images() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
declare -a images
images=(${${${(f)${:-"$(_call_program commands docker $docker_options images)"$'\n'}}[2,-1]}/(#b)([^ ]##) ##([^ ]##) ##([^ ]##)*/${match[3]}:${(r:15:: :::)match[2]} in ${match[1]}})
_describe -t docker-images "images" images && ret=0
- __docker_repositories_with_tags && ret=0
+ __docker_complete_repositories_with_tags && ret=0
return ret
}
-__docker_repositories() {
+__docker_complete_repositories() {
[[ $PREFIX = -* ]] && return 1
+ integer ret=1
declare -a repos
repos=(${${${(f)${:-"$(_call_program commands docker $docker_options images)"$'\n'}}%% *}[2,-1]})
repos=(${repos#<none>})
- _describe -t docker-repos "repositories" repos
+ _describe -t docker-repos "repositories" repos && ret=0
+ return ret
}
-__docker_repositories_with_tags() {
+__docker_complete_repositories_with_tags() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
declare -a repos onlyrepos matched
@@ -219,17 +221,19 @@ __docker_get_log_options() {
integer ret=1
local log_driver=${opt_args[--log-driver]:-"all"}
- local -a awslogs_options fluentd_options gelf_options journald_options json_file_options logentries_options syslog_options splunk_options
-
- awslogs_options=("awslogs-region" "awslogs-group" "awslogs-stream")
- fluentd_options=("env" "fluentd-address" "fluentd-async-connect" "fluentd-buffer-limit" "fluentd-retry-wait" "fluentd-max-retries" "labels" "tag")
- gcplogs_options=("env" "gcp-log-cmd" "gcp-project" "labels")
- gelf_options=("env" "gelf-address" "gelf-compression-level" "gelf-compression-type" "labels" "tag")
- journald_options=("env" "labels" "tag")
- json_file_options=("env" "labels" "max-file" "max-size")
- logentries_options=("logentries-token")
- syslog_options=("env" "labels" "syslog-address" "syslog-facility" "syslog-format" "syslog-tls-ca-cert" "syslog-tls-cert" "syslog-tls-key" "syslog-tls-skip-verify" "tag")
- splunk_options=("env" "labels" "splunk-caname" "splunk-capath" "splunk-format" "splunk-gzip" "splunk-gzip-level" "splunk-index" "splunk-insecureskipverify" "splunk-source" "splunk-sourcetype" "splunk-token" "splunk-url" "splunk-verify-connection" "tag")
+ local -a common_options common_options2 awslogs_options fluentd_options gelf_options journald_options json_file_options logentries_options syslog_options splunk_options
+
+ common_options=("max-buffer-size" "mode")
+ common_options2=("env" "env-regex" "labels")
+ awslogs_options=($common_options "awslogs-create-group" "awslogs-datetime-format" "awslogs-group" "awslogs-multiline-pattern" "awslogs-region" "awslogs-stream" "tag")
+ fluentd_options=($common_options $common_options2 "fluentd-address" "fluentd-async-connect" "fluentd-buffer-limit" "fluentd-retry-wait" "fluentd-max-retries" "fluentd-sub-second-precision" "tag")
+ gcplogs_options=($common_options $common_options2 "gcp-log-cmd" "gcp-meta-id" "gcp-meta-name" "gcp-meta-zone" "gcp-project")
+ gelf_options=($common_options $common_options2 "gelf-address" "gelf-compression-level" "gelf-compression-type" "tag")
+ journald_options=($common_options $common_options2 "tag")
+ json_file_options=($common_options $common_options2 "max-file" "max-size")
+ logentries_options=($common_options $common_options2 "logentries-token" "tag")
+ syslog_options=($common_options $common_options2 "syslog-address" "syslog-facility" "syslog-format" "syslog-tls-ca-cert" "syslog-tls-cert" "syslog-tls-key" "syslog-tls-skip-verify" "tag")
+ splunk_options=($common_options $common_options2 "splunk-caname" "splunk-capath" "splunk-format" "splunk-gzip" "splunk-gzip-level" "splunk-index" "splunk-insecureskipverify" "splunk-source" "splunk-sourcetype" "splunk-token" "splunk-url" "splunk-verify-connection" "tag")
[[ $log_driver = (awslogs|all) ]] && _describe -t awslogs-options "awslogs options" awslogs_options "$@" && ret=0
[[ $log_driver = (fluentd|all) ]] && _describe -t fluentd-options "fluentd options" fluentd_options "$@" && ret=0
@@ -244,7 +248,7 @@ __docker_get_log_options() {
return ret
}
-__docker_log_drivers() {
+__docker_complete_log_drivers() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
drivers=(awslogs etwlogs fluentd gcplogs gelf journald json-file none splunk syslog)
@@ -252,15 +256,19 @@ __docker_log_drivers() {
return ret
}
-__docker_log_options() {
+__docker_complete_log_options() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(syslog-format)
- syslog_format_opts=('rfc3164' 'rfc5424' 'rfc5424micro')
- _describe -t syslog-format-opts "Syslog format Options" syslog_format_opts && ret=0
+ local opts=('rfc3164' 'rfc5424' 'rfc5424micro')
+ _describe -t syslog-format-opts "syslog format options" opts && ret=0
+ ;;
+ (mode)
+ local opts=('blocking' 'non-blocking')
+ _describe -t mode-opts "mode options" opts && ret=0
;;
*)
_message 'value' && ret=0
@@ -295,7 +303,7 @@ __docker_complete_pid() {
if compset -P '*:'; then
case "${${words[-1]%:*}#*=}" in
(container)
- __docker_runningcontainers && ret=0
+ __docker_complete_running_containers && ret=0
;;
*)
_message 'value' && ret=0
@@ -327,36 +335,40 @@ __docker_complete_ps_filters() {
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(ancestor)
- __docker_images && ret=0
+ __docker_complete_images && ret=0
;;
(before|since)
- __docker_containers && ret=0
+ __docker_complete_containers && ret=0
+ ;;
+ (health)
+ health_opts=('healthy' 'none' 'starting' 'unhealthy')
+ _describe -t health-filter-opts "health filter options" health_opts && ret=0
;;
(id)
- __docker_containers_ids && ret=0
+ __docker_complete_containers_ids && ret=0
;;
(is-task)
_describe -t boolean-filter-opts "filter options" boolean_opts && ret=0
;;
(name)
- __docker_containers_names && ret=0
+ __docker_complete_containers_names && ret=0
;;
(network)
- __docker_networks && ret=0
+ __docker_complete_networks && ret=0
;;
(status)
status_opts=('created' 'dead' 'exited' 'paused' 'restarting' 'running' 'removing')
- _describe -t status-filter-opts "Status Filter Options" status_opts && ret=0
+ _describe -t status-filter-opts "status filter options" status_opts && ret=0
;;
(volume)
- __docker_volumes && ret=0
+ __docker_complete_volumes && ret=0
;;
*)
_message 'value' && ret=0
;;
esac
else
- opts=('ancestor' 'before' 'exited' 'id' 'label' 'name' 'network' 'since' 'status' 'volume')
+ opts=('ancestor' 'before' 'exited' 'expose' 'health' 'id' 'label' 'name' 'network' 'publish' 'since' 'status' 'volume')
_describe -t filter-opts "Filter Options" opts -qS "=" && ret=0
fi
@@ -393,12 +405,12 @@ __docker_complete_images_filters() {
declare -a boolean_opts opts
boolean_opts=('true' 'false')
- opts=('before' 'dangling' 'label' 'since')
+ opts=('before' 'dangling' 'label' 'reference' 'since')
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
- (before|since)
- __docker_images && ret=0
+ (before|reference|since)
+ __docker_complete_images && ret=0
;;
(dangling)
_describe -t boolean-filter-opts "filter options" boolean_opts && ret=0
@@ -424,7 +436,7 @@ __docker_complete_events_filter() {
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(container)
- __docker_containers && ret=0
+ __docker_complete_containers && ret=0
;;
(daemon)
emulate -L zsh
@@ -438,16 +450,16 @@ __docker_complete_events_filter() {
;;
(event)
local -a event_opts
- event_opts=('attach' 'commit' 'connect' 'copy' 'create' 'delete' 'destroy' 'detach' 'die' 'disconnect' 'exec_create' 'exec_detach'
- 'exec_start' 'export' 'health_status' 'import' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'rename' 'resize' 'restart' 'save' 'start'
- 'stop' 'tag' 'top' 'unmount' 'unpause' 'untag' 'update')
+ event_opts=('attach' 'commit' 'connect' 'copy' 'create' 'delete' 'destroy' 'detach' 'die' 'disable' 'disconnect' 'enable' 'exec_create' 'exec_detach'
+ 'exec_start' 'export' 'health_status' 'import' 'install' 'kill' 'load' 'mount' 'oom' 'pause' 'pull' 'push' 'reload' 'remove' 'rename' 'resize'
+ 'restart' 'save' 'start' 'stop' 'tag' 'top' 'unmount' 'unpause' 'untag' 'update')
_describe -t event-filter-opts "event filter options" event_opts && ret=0
;;
(image)
- __docker_images && ret=0
+ __docker_complete_images && ret=0
;;
(network)
- __docker_networks && ret=0
+ __docker_complete_networks && ret=0
;;
(type)
local -a type_opts
@@ -455,7 +467,7 @@ __docker_complete_events_filter() {
_describe -t type-filter-opts "type filter options" type_opts && ret=0
;;
(volume)
- __docker_volumes && ret=0
+ __docker_complete_volumes && ret=0
;;
*)
_message 'value' && ret=0
@@ -468,6 +480,628 @@ __docker_complete_events_filter() {
return ret
}
+__docker_complete_prune_filters() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ declare -a opts
+
+ opts=('until')
+
+ if compset -P '*='; then
+ case "${${words[-1]%=*}#*=}" in
+ *)
+ _message 'value' && ret=0
+ ;;
+ esac
+ else
+ _describe -t filter-opts "filter options" opts -qS "=" && ret=0
+ fi
+
+ return ret
+}
+
+# BO checkpoint
+
+__docker_checkpoint_commands() {
+ local -a _docker_checkpoint_subcommands
+ _docker_checkpoint_subcommands=(
+ "create:Create a checkpoint from a running container"
+ "ls:List checkpoints for a container"
+ "rm:Remove a checkpoint"
+ )
+ _describe -t docker-checkpoint-commands "docker checkpoint command" _docker_checkpoint_subcommands
+}
+
+__docker_checkpoint_subcommand() {
+ local -a _command_args opts_help
+ local expl help="--help"
+ integer ret=1
+
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (create)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--checkpoint-dir=[Use a custom checkpoint storage directory]:dir:_directories" \
+ "($help)--leave-running[Leave the container running after checkpoint]" \
+ "($help -)1:container:__docker_complete_running_containers" \
+ "($help -)2:checkpoint: " && ret=0
+ ;;
+ (ls|list)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--checkpoint-dir=[Use a custom checkpoint storage directory]:dir:_directories" \
+ "($help -)1:container:__docker_complete_containers" && ret=0
+ ;;
+ (rm|remove)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--checkpoint-dir=[Use a custom checkpoint storage directory]:dir:_directories" \
+ "($help -)1:container:__docker_complete_containers" \
+ "($help -)2:checkpoint: " && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_checkpoint_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO checkpoint
+
+# BO container
+
+__docker_container_commands() {
+ local -a _docker_container_subcommands
+ _docker_container_subcommands=(
+ "attach:Attach to a running container"
+ "commit:Create a new image from a container's changes"
+ "cp:Copy files/folders between a container and the local filesystem"
+ "create:Create a new container"
+ "diff:Inspect changes on a container's filesystem"
+ "exec:Run a command in a running container"
+ "export:Export a container's filesystem as a tar archive"
+ "inspect:Display detailed information on one or more containers"
+ "kill:Kill one or more running containers"
+ "logs:Fetch the logs of a container"
+ "ls:List containers"
+ "pause:Pause all processes within one or more containers"
+ "port:List port mappings or a specific mapping for the container"
+ "prune:Remove all stopped containers"
+ "rename:Rename a container"
+ "restart:Restart one or more containers"
+ "rm:Remove one or more containers"
+ "run:Run a command in a new container"
+ "start:Start one or more stopped containers"
+ "stats:Display a live stream of container(s) resource usage statistics"
+ "stop:Stop one or more running containers"
+ "top:Display the running processes of a container"
+ "unpause:Unpause all processes within one or more containers"
+ "update:Update configuration of one or more containers"
+ "wait:Block until one or more containers stop, then print their exit codes"
+ )
+ _describe -t docker-container-commands "docker container command" _docker_container_subcommands
+}
+
+__docker_container_subcommand() {
+ local -a _command_args opts_help opts_attach_exec_run_start opts_create_run opts_create_run_update
+ local expl help="--help"
+ integer ret=1
+
+ opts_attach_exec_run_start=(
+ "($help)--detach-keys=[Escape key sequence used to detach a container]:sequence:__docker_complete_detach_keys"
+ )
+ opts_create_run=(
+ "($help -a --attach)"{-a=,--attach=}"[Attach to stdin, stdout or stderr]:device:(STDIN STDOUT STDERR)"
+ "($help)*--add-host=[Add a custom host-to-IP mapping]:host\:ip mapping: "
+ "($help)*--blkio-weight-device=[Block IO (relative device weight)]:device:Block IO weight: "
+ "($help)*--cap-add=[Add Linux capabilities]:capability: "
+ "($help)*--cap-drop=[Drop Linux capabilities]:capability: "
+ "($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: "
+ "($help)--cidfile=[Write the container ID to the file]:CID file:_files"
+ "($help)--cpus=[Number of CPUs (default 0.000)]:cpus: "
+ "($help)*--device=[Add a host device to the container]:device:_files"
+ "($help)*--device-cgroup-rule=[Add a rule to the cgroup allowed devices list]:device:cgroup: "
+ "($help)*--device-read-bps=[Limit the read rate (bytes per second) from a device]:device:IO rate: "
+ "($help)*--device-read-iops=[Limit the read rate (IO per second) from a device]:device:IO rate: "
+ "($help)*--device-write-bps=[Limit the write rate (bytes per second) to a device]:device:IO rate: "
+ "($help)*--device-write-iops=[Limit the write rate (IO per second) to a device]:device:IO rate: "
+ "($help)--disable-content-trust[Skip image verification]"
+ "($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)*"{-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"
+ "($help)*--expose=[Expose a port from the container without publishing it]: "
+ "($help)*--group=[Set one or more supplementary user groups for the container]:group:_groups"
+ "($help -h --hostname)"{-h=,--hostname=}"[Container host name]:hostname:_hosts"
+ "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]"
+ "($help)--init[Run an init inside the container that forwards signals and reaps processes]"
+ "($help)--ip=[IPv4 address]:IPv4: "
+ "($help)--ip6=[IPv6 address]:IPv6: "
+ "($help)--ipc=[IPC namespace to use]:IPC namespace: "
+ "($help)--isolation=[Container isolation technology]:isolation:(default hyperv process)"
+ "($help)*--link=[Add link to another container]:link:->link"
+ "($help)*--link-local-ip=[Container IPv4/IPv6 link-local addresses]:IPv4/IPv6: "
+ "($help)*"{-l=,--label=}"[Container metadata]:label: "
+ "($help)--log-driver=[Default driver for container logs]:logging driver:__docker_complete_log_drivers"
+ "($help)*--log-opt=[Log driver specific options]:log driver options:__docker_complete_log_options"
+ "($help)--mac-address=[Container MAC address]:MAC address: "
+ "($help)*--mount=[Attach a filesystem mount to the container]:mount: "
+ "($help)--name=[Container name]:name: "
+ "($help)--network=[Connect a container to a network]:network mode:(bridge none container host)"
+ "($help)*--network-alias=[Add network-scoped alias for the container]:alias: "
+ "($help)--oom-kill-disable[Disable OOM Killer]"
+ "($help)--oom-score-adj[Tune the host's OOM preferences for containers (accepts -1000 to 1000)]"
+ "($help)--pids-limit[Tune container pids limit (set -1 for unlimited)]"
+ "($help -P --publish-all)"{-P,--publish-all}"[Publish all exposed ports]"
+ "($help)*"{-p=,--publish=}"[Expose a container's port to the host]:port:_ports"
+ "($help)--pid=[PID namespace to use]:PID namespace:__docker_complete_pid"
+ "($help)--privileged[Give extended privileges to this container]"
+ "($help)--read-only[Mount the container's root filesystem as read only]"
+ "($help)*--security-opt=[Security options]:security option: "
+ "($help)*--shm-size=[Size of '/dev/shm' (format is '<number><unit>')]:shm size: "
+ "($help)--stop-signal=[Signal to kill a container]:signal:_signals"
+ "($help)--stop-timeout=[Timeout (in seconds) to stop a container]:time: "
+ "($help)*--sysctl=-[sysctl options]:sysctl: "
+ "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-tty]"
+ "($help -u --user)"{-u=,--user=}"[Username or UID]:user:_users"
+ "($help)*--ulimit=[ulimit options]:ulimit: "
+ "($help)--userns=[Container user namespace]:user namespace:(host)"
+ "($help)--tmpfs[mount tmpfs]"
+ "($help)*-v[Bind mount a volume]:volume: "
+ "($help)--volume-driver=[Optional volume driver for the container]:volume driver:(local)"
+ "($help)*--volumes-from=[Mount volumes from the specified container]:volume: "
+ "($help -w --workdir)"{-w=,--workdir=}"[Working directory inside the container]:directory:_directories"
+ )
+ opts_create_run_update=(
+ "($help)--blkio-weight=[Block IO (relative weight), between 10 and 1000]:Block IO weight:(10 100 500 1000)"
+ "($help -c --cpu-shares)"{-c=,--cpu-shares=}"[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)"
+ "($help)--cpu-period=[Limit the CPU CFS (Completely Fair Scheduler) period]:CPU period: "
+ "($help)--cpu-quota=[Limit the CPU CFS (Completely Fair Scheduler) quota]:CPU quota: "
+ "($help)--cpu-rt-period=[Limit the CPU real-time period]:CPU real-time period in microseconds: "
+ "($help)--cpu-rt-runtime=[Limit the CPU real-time runtime]:CPU real-time runtime in microseconds: "
+ "($help)--cpuset-cpus=[CPUs in which to allow execution]:CPUs: "
+ "($help)--cpuset-mems=[MEMs in which to allow execution]:MEMs: "
+ "($help)--kernel-memory=[Kernel memory limit in bytes]:Memory limit: "
+ "($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: "
+ "($help)--memory-reservation=[Memory soft limit]:Memory limit: "
+ "($help)--memory-swap=[Total memory limit with swap]:Memory limit: "
+ "($help)--restart=[Restart policy]:restart policy:(no on-failure always unless-stopped)"
+ )
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (attach)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ $opts_attach_exec_run_start \
+ "($help)--no-stdin[Do not attach stdin]" \
+ "($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
+ "($help -):containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (commit)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --author)"{-a=,--author=}"[Author]:author: " \
+ "($help)*"{-c=,--change=}"[Apply Dockerfile instruction to the created image]:Dockerfile:_files" \
+ "($help -m --message)"{-m=,--message=}"[Commit message]:message: " \
+ "($help -p --pause)"{-p,--pause}"[Pause container during commit]" \
+ "($help -):container:__docker_complete_containers" \
+ "($help -): :__docker_complete_repositories_with_tags" && ret=0
+ ;;
+ (cp)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -L --follow-link)"{-L,--follow-link}"[Always follow symbol link]" \
+ "($help -)1:container:->container" \
+ "($help -)2:hostpath:_files" && ret=0
+ case $state in
+ (container)
+ if compset -P "*:"; then
+ _files && ret=0
+ else
+ __docker_complete_containers -qS ":" && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (create)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ $opts_create_run \
+ $opts_create_run_update \
+ "($help -): :__docker_complete_images" \
+ "($help -):command: _command_names -e" \
+ "($help -)*::arguments: _normal" && ret=0
+ case $state in
+ (link)
+ if compset -P "*:"; then
+ _wanted alias expl "Alias" compadd -E "" && ret=0
+ else
+ __docker_complete_running_containers -qS ":" && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (diff)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)*:containers:__docker_complete_containers" && ret=0
+ ;;
+ (exec)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ $opts_attach_exec_run_start \
+ "($help -d --detach)"{-d,--detach}"[Detached mode: leave the container running in the background]" \
+ "($help)*"{-e=,--env=}"[Set environment variables]:environment variable: " \
+ "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]" \
+ "($help)--privileged[Give extended Linux capabilities to the command]" \
+ "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-tty]" \
+ "($help -u --user)"{-u=,--user=}"[Username or UID]:user:_users" \
+ "($help -w --workdir)"{-w=,--workdir=}"[Working directory inside the container]:directory:_directories" \
+ "($help -):containers:__docker_complete_running_containers" \
+ "($help -)*::command:->anycommand" && ret=0
+ case $state in
+ (anycommand)
+ shift 1 words
+ (( CURRENT-- ))
+ _normal && ret=0
+ ;;
+ esac
+ ;;
+ (export)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -o --output)"{-o=,--output=}"[Write to a file, instead of stdout]:output file:_files" \
+ "($help -)*:containers:__docker_complete_containers" && ret=0
+ ;;
+ (inspect)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " \
+ "($help -s --size)"{-s,--size}"[Display total file sizes]" \
+ "($help -)*:containers:__docker_complete_containers" && ret=0
+ ;;
+ (kill)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -s --signal)"{-s=,--signal=}"[Signal to send]:signal:_signals" \
+ "($help -)*:containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (logs)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--details[Show extra details provided to logs]" \
+ "($help -f --follow)"{-f,--follow}"[Follow log output]" \
+ "($help -s --since)"{-s=,--since=}"[Show logs since this timestamp]:timestamp: " \
+ "($help -t --timestamps)"{-t,--timestamps}"[Show timestamps]" \
+ "($help)--tail=[Output the last K lines]:lines:(1 10 20 50 all)" \
+ "($help -)*:containers:__docker_complete_containers" && ret=0
+ ;;
+ (ls|list)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Show all containers]" \
+ "($help)--before=[Show only container created before...]:containers:__docker_complete_containers" \
+ "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_ps_filters" \
+ "($help)--format=[Pretty-print containers using a Go template]:template: " \
+ "($help -l --latest)"{-l,--latest}"[Show only the latest created container]" \
+ "($help -n --last)"{-n=,--last=}"[Show n last created containers (includes all states)]:n:(1 5 10 25 50)" \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
+ "($help -s --size)"{-s,--size}"[Display total file sizes]" \
+ "($help)--since=[Show only containers created since...]:containers:__docker_complete_containers" && ret=0
+ ;;
+ (pause|unpause)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)*:containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (port)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)1:containers:__docker_complete_running_containers" \
+ "($help -)2:port:_ports" && ret=0
+ ;;
+ (prune)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*--filter=[Filter values]:filter:__docker_complete_prune_filters" \
+ "($help -f --force)"{-f,--force}"[Do not prompt for confirmation]" && ret=0
+ ;;
+ (rename)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -):old name:__docker_complete_containers" \
+ "($help -):new name: " && ret=0
+ ;;
+ (restart)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \
+ "($help -)*:containers:__docker_complete_containers_ids" && ret=0
+ ;;
+ (rm)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Force removal]" \
+ "($help -l --link)"{-l,--link}"[Remove the specified link and not the underlying container]" \
+ "($help -v --volumes)"{-v,--volumes}"[Remove the volumes associated to the container]" \
+ "($help -)*:containers:->values" && ret=0
+ case $state in
+ (values)
+ if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then
+ __docker_complete_containers && ret=0
+ else
+ __docker_complete_stopped_containers && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (run)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ $opts_create_run \
+ $opts_create_run_update \
+ $opts_attach_exec_run_start \
+ "($help -d --detach)"{-d,--detach}"[Detached mode: leave the container running in the background]" \
+ "($help)--health-cmd=[Command to run to check health]:command: " \
+ "($help)--health-interval=[Time between running the check]:time: " \
+ "($help)--health-retries=[Consecutive failures needed to report unhealthy]:retries:(1 2 3 4 5)" \
+ "($help)--health-timeout=[Maximum time to allow one check to run]:time: " \
+ "($help)--no-healthcheck[Disable any container-specified HEALTHCHECK]" \
+ "($help)--rm[Remove intermediate containers when it exits]" \
+ "($help)--runtime=[Name of the runtime to be used for that container]:runtime:__docker_complete_runtimes" \
+ "($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
+ "($help)--storage-opt=[Storage driver options for the container]:storage options:->storage-opt" \
+ "($help -): :__docker_complete_images" \
+ "($help -):command: _command_names -e" \
+ "($help -)*::arguments: _normal" && ret=0
+ case $state in
+ (link)
+ if compset -P "*:"; then
+ _wanted alias expl "Alias" compadd -E "" && ret=0
+ else
+ __docker_complete_running_containers -qS ":" && ret=0
+ fi
+ ;;
+ (storage-opt)
+ if compset -P "*="; then
+ _message "value" && ret=0
+ else
+ opts=('size')
+ _describe -t filter-opts "storage options" opts -qS "=" && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (start)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ $opts_attach_exec_run_start \
+ "($help -a --attach)"{-a,--attach}"[Attach container's stdout/stderr and forward all signals]" \
+ "($help -i --interactive)"{-i,--interactive}"[Attach container's stdin]" \
+ "($help -)*:containers:__docker_complete_stopped_containers" && ret=0
+ ;;
+ (stats)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Show all containers (default shows just running)]" \
+ "($help)--format=[Pretty-print images using a Go template]:template: " \
+ "($help)--no-stream[Disable streaming stats and only pull the first result]" \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help -)*:containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (stop)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \
+ "($help -)*:containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (top)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)1:containers:__docker_complete_running_containers" \
+ "($help -)*:: :->ps-arguments" && ret=0
+ case $state in
+ (ps-arguments)
+ _ps && ret=0
+ ;;
+ esac
+ ;;
+ (update)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ opts_create_run_update \
+ "($help -)*: :->values" && ret=0
+ case $state in
+ (values)
+ if [[ ${words[(r)--kernel-memory*]} = (--kernel-memory*) ]]; then
+ __docker_complete_stopped_containers && ret=0
+ else
+ __docker_complete_containers && ret=0
+ fi
+ ;;
+ esac
+ ;;
+ (wait)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)*:containers:__docker_complete_running_containers" && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_container_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO container
+
+# BO image
+
+__docker_image_commands() {
+ local -a _docker_image_subcommands
+ _docker_image_subcommands=(
+ "build:Build an image from a Dockerfile"
+ "history:Show the history of an image"
+ "import:Import the contents from a tarball to create a filesystem image"
+ "inspect:Display detailed information on one or more images"
+ "load:Load an image from a tar archive or STDIN"
+ "ls:List images"
+ "prune:Remove unused images"
+ "pull:Pull an image or a repository from a registry"
+ "push:Push an image or a repository to a registry"
+ "rm:Remove one or more images"
+ "save:Save one or more images to a tar archive (streamed to STDOUT by default)"
+ "tag:Tag an image into a repository"
+ )
+ _describe -t docker-image-commands "docker image command" _docker_image_subcommands
+}
+
+__docker_image_subcommand() {
+ local -a _command_args opts_help
+ local expl help="--help"
+ integer ret=1
+
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (build)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*--add-host=[Add a custom host-to-IP mapping]:host\:ip mapping: " \
+ "($help)*--build-arg=[Build-time variables]:<varname>=<value>: " \
+ "($help)*--cache-from=[Images to consider as cache sources]: :__docker_complete_repositories_with_tags" \
+ "($help -c --cpu-shares)"{-c=,--cpu-shares=}"[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)" \
+ "($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: " \
+ "($help)--compress[Compress the build context using gzip]" \
+ "($help)--cpu-period=[Limit the CPU CFS (Completely Fair Scheduler) period]:CPU period: " \
+ "($help)--cpu-quota=[Limit the CPU CFS (Completely Fair Scheduler) quota]:CPU quota: " \
+ "($help)--cpu-rt-period=[Limit the CPU real-time period]:CPU real-time period in microseconds: " \
+ "($help)--cpu-rt-runtime=[Limit the CPU real-time runtime]:CPU real-time runtime in microseconds: " \
+ "($help)--cpuset-cpus=[CPUs in which to allow execution]:CPUs: " \
+ "($help)--cpuset-mems=[MEMs in which to allow execution]:MEMs: " \
+ "($help)--disable-content-trust[Skip image verification]" \
+ "($help -f --file)"{-f=,--file=}"[Name of the Dockerfile]:Dockerfile:_files" \
+ "($help)--force-rm[Always remove intermediate containers]" \
+ "($help)--isolation=[Container isolation technology]:isolation:(default hyperv process)" \
+ "($help)*--label=[Set metadata for an image]:label=value: " \
+ "($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: " \
+ "($help)--memory-swap=[Total memory limit with swap]:Memory limit: " \
+ "($help)--network=[Connect a container to a network]:network mode:(bridge none container host)" \
+ "($help)--no-cache[Do not use cache when building the image]" \
+ "($help)--pull[Attempt to pull a newer version of the image]" \
+ "($help -q --quiet)"{-q,--quiet}"[Suppress verbose build output]" \
+ "($help)--rm[Remove intermediate containers after a successful build]" \
+ "($help)*--shm-size=[Size of '/dev/shm' (format is '<number><unit>')]:shm size: " \
+ "($help)--squash[Squash newly built layers into a single new layer]" \
+ "($help -t --tag)*"{-t=,--tag=}"[Repository, name and tag for the image]: :__docker_complete_repositories_with_tags" \
+ "($help)*--ulimit=[ulimit options]:ulimit: " \
+ "($help)--userns=[Container user namespace]:user namespace:(host)" \
+ "($help -):path or URL:_directories" && ret=0
+ ;;
+ (history)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -H --human)"{-H,--human}"[Print sizes and dates in human readable format]" \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
+ "($help -)*: :__docker_complete_images" && ret=0
+ ;;
+ (import)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*"{-c=,--change=}"[Apply Dockerfile instruction to the created image]:Dockerfile:_files" \
+ "($help -m --message)"{-m=,--message=}"[Commit message for imported image]:message: " \
+ "($help -):URL:(- http:// file://)" \
+ "($help -): :__docker_complete_repositories_with_tags" && ret=0
+ ;;
+ (inspect)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " \
+ "($help -)*:images:__docker_complete_images" && ret=0
+ ;;
+ (load)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -i --input)"{-i=,--input=}"[Read from tar archive file]:archive file:_files -g \"*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz))(-.)\"" \
+ "($help -q --quiet)"{-q,--quiet}"[Suppress the load output]" && ret=0
+ ;;
+ (ls|list)
+ local state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Show all images]" \
+ "($help)--digests[Show digests]" \
+ "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_images_filters" \
+ "($help)--format=[Pretty-print images using a Go template]:template: " \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
+ "($help -): :__docker_complete_repositories" && ret=0
+ ;;
+ (prune)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Remove all unused images, not just dangling ones]" \
+ "($help)*--filter=[Filter values]:filter:__docker_complete_prune_filters" \
+ "($help -f --force)"{-f,--force}"[Do not prompt for confirmation]" && ret=0
+ ;;
+ (pull)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all-tags)"{-a,--all-tags}"[Download all tagged images]" \
+ "($help)--disable-content-trust[Skip image verification]" \
+ "($help -):name:__docker_search" && ret=0
+ ;;
+ (push)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--disable-content-trust[Skip image signing]" \
+ "($help -): :__docker_complete_images" && ret=0
+ ;;
+ (rm)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Force removal]" \
+ "($help)--no-prune[Do not delete untagged parents]" \
+ "($help -)*: :__docker_complete_images" && ret=0
+ ;;
+ (save)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -o --output)"{-o=,--output=}"[Write to file]:file:_files" \
+ "($help -)*: :__docker_complete_images" && ret=0
+ ;;
+ (tag)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -):source:__docker_complete_images"\
+ "($help -):destination:__docker_complete_repositories_with_tags" && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_container_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO image
+
# BO network
__docker_network_complete_ls_filters() {
@@ -480,21 +1114,25 @@ __docker_network_complete_ls_filters() {
__docker_complete_info_plugins Network && ret=0
;;
(id)
- __docker_networks_ids && ret=0
+ __docker_complete_networks_ids && ret=0
;;
(name)
- __docker_networks_names && ret=0
+ __docker_complete_networks_names && ret=0
+ ;;
+ (scope)
+ opts=('global' 'local' 'swarm')
+ _describe -t scope-filter-opts "Scope filter options" opts && ret=0
;;
(type)
- type_opts=('builtin' 'custom')
- _describe -t type-filter-opts "Type Filter Options" type_opts && ret=0
+ opts=('builtin' 'custom')
+ _describe -t type-filter-opts "Type filter options" opts && ret=0
;;
*)
_message 'value' && ret=0
;;
esac
else
- opts=('driver' 'id' 'label' 'name' 'type')
+ opts=('driver' 'id' 'label' 'name' 'scope' 'type')
_describe -t filter-opts "Filter Options" opts -qS "=" && ret=0
fi
@@ -529,6 +1167,7 @@ __docker_get_networks() {
for line in $lines; do
s="${line[${begin[NETWORK ID]},${end[NETWORK ID]}]%% ##}"
s="$s:${(l:7:: :::)${${line[${begin[DRIVER]},${end[DRIVER]}]}%% ##}}"
+ s="$s, ${${line[${begin[SCOPE]},${end[SCOPE]}]}%% ##}"
networks=($networks $s)
done
fi
@@ -538,6 +1177,7 @@ __docker_get_networks() {
for line in $lines; do
s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
s="$s:${(l:7:: :::)${${line[${begin[DRIVER]},${end[DRIVER]}]}%% ##}}"
+ s="$s, ${${line[${begin[SCOPE]},${end[SCOPE]}]}%% ##}"
networks=($networks $s)
done
fi
@@ -546,17 +1186,17 @@ __docker_get_networks() {
return ret
}
-__docker_networks() {
+__docker_complete_networks() {
[[ $PREFIX = -* ]] && return 1
__docker_get_networks all "$@"
}
-__docker_networks_ids() {
+__docker_complete_networks_ids() {
[[ $PREFIX = -* ]] && return 1
__docker_get_networks ids "$@"
}
-__docker_networks_names() {
+__docker_complete_networks_names() {
[[ $PREFIX = -* ]] && return 1
__docker_get_networks names "$@"
}
@@ -569,6 +1209,7 @@ __docker_network_commands() {
"disconnect:Disconnects a container from a network"
"inspect:Displays detailed information on a network"
"ls:Lists all the networks created by the user"
+ "prune:Remove all unused networks"
"rm:Deletes one or more networks"
)
_describe -t docker-network-commands "docker network command" _docker_network_subcommands
@@ -586,19 +1227,19 @@ __docker_network_subcommand() {
_arguments $(__docker_arguments) \
$opts_help \
"($help)*--alias=[Add network-scoped alias for the container]:alias: " \
- "($help)--ip=[Container IPv4 address]:IPv4: " \
- "($help)--ip6=[Container IPv6 address]:IPv6: " \
+ "($help)--ip=[IPv4 address]:IPv4: " \
+ "($help)--ip6=[IPv6 address]:IPv6: " \
"($help)*--link=[Add a link to another container]:link:->link" \
"($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: " \
- "($help -)1:network:__docker_networks" \
- "($help -)2:containers:__docker_containers" && ret=0
+ "($help -)1:network:__docker_complete_networks" \
+ "($help -)2:containers:__docker_complete_containers" && ret=0
case $state in
(link)
if compset -P "*:"; then
_wanted alias expl "Alias" compadd -E "" && ret=0
else
- __docker_runningcontainers -qS ":" && ret=0
+ __docker_complete_running_containers -qS ":" && ret=0
fi
;;
esac
@@ -606,6 +1247,7 @@ __docker_network_subcommand() {
(create)
_arguments $(__docker_arguments) -A '-*' \
$opts_help \
+ "($help)--attachable[Enable manual container attachment]" \
"($help)*--aux-address[Auxiliary IPv4 or IPv6 addresses used by network driver]:key=IP: " \
"($help -d --driver)"{-d=,--driver=}"[Driver to manage the Network]:driver:(null host bridge overlay)" \
"($help)*--gateway=[IPv4 or IPv6 Gateway for the master subnet]:IP: " \
@@ -622,32 +1264,34 @@ __docker_network_subcommand() {
(disconnect)
_arguments $(__docker_arguments) \
$opts_help \
- "($help -)1:network:__docker_networks" \
- "($help -)2:containers:__docker_containers" && ret=0
+ "($help -)1:network:__docker_complete_networks" \
+ "($help -)2:containers:__docker_complete_containers" && ret=0
;;
(inspect)
_arguments $(__docker_arguments) \
$opts_help \
"($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " \
- "($help -)*:network:__docker_networks" && ret=0
+ "($help)--verbose[Show detailed information]" \
+ "($help -)*:network:__docker_complete_networks" && ret=0
;;
(ls)
_arguments $(__docker_arguments) \
$opts_help \
"($help)--no-trunc[Do not truncate the output]" \
- "($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_network_complete_ls_filters" \
"($help)--format=[Pretty-print networks using a Go template]:template: " \
"($help -q --quiet)"{-q,--quiet}"[Only display numeric IDs]" && ret=0
- case $state in
- (filter-options)
- __docker_network_complete_ls_filters && ret=0
- ;;
- esac
+ ;;
+ (prune)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*--filter=[Filter values]:filter:__docker_complete_prune_filters" \
+ "($help -f --force)"{-f,--force}"[Do not prompt for confirmation]" && ret=0
;;
(rm)
_arguments $(__docker_arguments) \
$opts_help \
- "($help -)*:network:__docker_networks" && ret=0
+ "($help -)*:network:__docker_complete_networks" && ret=0
;;
(help)
_arguments $(__docker_arguments) ":subcommand:__docker_network_commands" && ret=0
@@ -700,7 +1344,7 @@ __docker_node_complete_ps_filters() {
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(desired-state)
- state_opts=('accepted' 'running')
+ state_opts=('accepted' 'running' 'shutdown')
_describe -t state-opts "desired state options" state_opts && ret=0
;;
*)
@@ -750,7 +1394,7 @@ __docker_nodes() {
# Names
if [[ $type = (names|all) ]]; then
for line in $lines; do
- s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
+ s="${line[${begin[HOSTNAME]},${end[HOSTNAME]}]%% ##}"
nodes=($nodes $s)
done
fi
@@ -814,7 +1458,7 @@ __docker_node_subcommand() {
(rm|remove)
_arguments $(__docker_arguments) \
$opts_help \
- "($help)--force[Force remove an active node]" \
+ "($help -f --force)"{-f,--force}"[Force remove a node from the swarm]" \
"($help -)*:node:__docker_complete_pending_nodes" && ret=0
;;
(demote)
@@ -832,13 +1476,8 @@ __docker_node_subcommand() {
(ls|list)
_arguments $(__docker_arguments) \
$opts_help \
- "($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_node_complete_ls_filters" \
"($help -q --quiet)"{-q,--quiet}"[Only display IDs]" && ret=0
- case $state in
- (filter-options)
- __docker_node_complete_ls_filters && ret=0
- ;;
- esac
;;
(promote)
_arguments $(__docker_arguments) \
@@ -849,15 +1488,12 @@ __docker_node_subcommand() {
_arguments $(__docker_arguments) \
$opts_help \
"($help -a --all)"{-a,--all}"[Display all instances]" \
- "($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_node_complete_ps_filters" \
+ "($help)--format=[Format the output using the given go template]:template: " \
"($help)--no-resolve[Do not map IDs to Names]" \
"($help)--no-trunc[Do not truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only display IDs]" \
"($help -)*:node:__docker_complete_nodes" && ret=0
- case $state in
- (filter-options)
- __docker_node_complete_ps_filters && ret=0
- ;;
- esac
;;
(update)
_arguments $(__docker_arguments) \
@@ -880,13 +1516,42 @@ __docker_node_subcommand() {
# BO plugin
-__docker_complete_plugins() {
+__docker_plugin_complete_ls_filters() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+
+ if compset -P '*='; then
+ case "${${words[-1]%=*}#*=}" in
+ (capability)
+ opts=('authz' 'ipamdriver' 'logdriver' 'metricscollector' 'networkdriver' 'volumedriver')
+ _describe -t capability-opts "capability options" opts && ret=0
+ ;;
+ (enabled)
+ opts=('false' 'true')
+ _describe -t enabled-opts "enabled options" opts && ret=0
+ ;;
+ *)
+ _message 'value' && ret=0
+ ;;
+ esac
+ else
+ opts=('capability' 'enabled')
+ _describe -t filter-opts "filter options" opts -qS "=" && ret=0
+ fi
+
+ return ret
+}
+
+__docker_plugins() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
local line s
- declare -a lines plugins
+ declare -a lines plugins args
+
+ filter=$1; shift
+ [[ $filter != "none" ]] && args=("-f $filter")
- lines=(${(f)${:-"$(_call_program commands docker $docker_options plugin ls)"$'\n'}})
+ lines=(${(f)${:-"$(_call_program commands docker $docker_options plugin ls $args)"$'\n'}})
# Parse header line to find columns
local i=1 j=1 k header=${lines[1]}
@@ -912,6 +1577,21 @@ __docker_complete_plugins() {
return ret
}
+__docker_complete_plugins() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker_plugins none "$@"
+}
+
+__docker_complete_enabled_plugins() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker_plugins enabled=true "$@"
+}
+
+__docker_complete_disabled_plugins() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker_plugins enabled=false "$@"
+}
+
__docker_plugin_commands() {
local -a _docker_plugin_subcommands
_docker_plugin_subcommands=(
@@ -923,6 +1603,7 @@ __docker_plugin_commands() {
"push:Push a plugin"
"rm:Remove a plugin"
"set:Change settings for a plugin"
+ "upgrade:Upgrade an existing plugin"
)
_describe -t docker-plugin-commands "docker plugin command" _docker_plugin_subcommands
}
@@ -935,16 +1616,68 @@ __docker_plugin_subcommand() {
opts_help=("(: -)--help[Print usage]")
case "$words[1]" in
- (disable|enable|inspect|install|ls|push|rm)
+ (disable)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Force the disable of an active plugin]" \
+ "($help -)1:plugin:__docker_complete_enabled_plugins" && ret=0
+ ;;
+ (enable)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--timeout=[HTTP client timeout (in seconds)]:timeout: " \
+ "($help -)1:plugin:__docker_complete_disabled_plugins" && ret=0
+ ;;
+ (inspect)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given Go template]:template: " \
+ "($help -)*:plugin:__docker_complete_plugins" && ret=0
+ ;;
+ (install)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--alias=[Local name for plugin]:alias: " \
+ "($help)--disable[Do not enable the plugin on install]" \
+ "($help)--disable-content-trust[Skip image verification (default true)]" \
+ "($help)--grant-all-permissions[Grant all permissions necessary to run the plugin]" \
+ "($help -)1:plugin:__docker_complete_plugins" \
+ "($help -)*:key=value: " && ret=0
+ ;;
+ (ls|list)
_arguments $(__docker_arguments) \
$opts_help \
+ "($help)*"{-f=,--filter=}"[Filter output based on conditions provided]:filter:__docker_plugin_complete_ls_filters" \
+ "($help --format)--format=[Format the output using the given Go template]:template: " \
+ "($help)--no-trunc[Don't truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only display IDs]" && ret=0
+ ;;
+ (push)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--disable-content-trust[Skip image verification (default true)]" \
"($help -)1:plugin:__docker_complete_plugins" && ret=0
;;
+ (rm|remove)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Force the removal of an active plugin]" \
+ "($help -)*:plugin:__docker_complete_plugins" && ret=0
+ ;;
(set)
_arguments $(__docker_arguments) \
$opts_help \
"($help -)1:plugin:__docker_complete_plugins" \
- "($help-)*:key=value: " && ret=0
+ "($help -)*:key=value: " && ret=0
+ ;;
+ (upgrade)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--disable-content-trust[Skip image verification (default true)]" \
+ "($help)--grant-all-permissions[Grant all permissions necessary to run the plugin]" \
+ "($help)--skip-remote-check[Do not check if specified remote plugin matches existing plugin image]" \
+ "($help -)1:plugin:__docker_complete_plugins" \
+ "($help -):remote: " && ret=0
;;
(help)
_arguments $(__docker_arguments) ":subcommand:__docker_plugin_commands" && ret=0
@@ -956,6 +1689,108 @@ __docker_plugin_subcommand() {
# EO plugin
+# BO secret
+
+__docker_secrets() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ local line s
+ declare -a lines secrets
+
+ type=$1; shift
+
+ lines=(${(f)${:-"$(_call_program commands docker $docker_options secret ls)"$'\n'}})
+
+ # Parse header line to find columns
+ local i=1 j=1 k header=${lines[1]}
+ declare -A begin end
+ while (( j < ${#header} - 1 )); do
+ i=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 1 ))
+ j=$(( i + ${${header[$i,-1]}[(i) ]} - 1 ))
+ k=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 2 ))
+ begin[${header[$i,$((j-1))]}]=$i
+ end[${header[$i,$((j-1))]}]=$k
+ done
+ end[${header[$i,$((j-1))]}]=-1
+ lines=(${lines[2,-1]})
+
+ # ID
+ if [[ $type = (ids|all) ]]; then
+ for line in $lines; do
+ s="${line[${begin[ID]},${end[ID]}]%% ##}"
+ secrets=($secrets $s)
+ done
+ fi
+
+ # Names
+ if [[ $type = (names|all) ]]; then
+ for line in $lines; do
+ s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
+ secrets=($secrets $s)
+ done
+ fi
+
+ _describe -t secrets-list "secrets" secrets "$@" && ret=0
+ return ret
+}
+
+__docker_complete_secrets() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker_secrets all "$@"
+}
+
+__docker_secret_commands() {
+ local -a _docker_secret_subcommands
+ _docker_secret_subcommands=(
+ "create:Create a secret using stdin as content"
+ "inspect:Display detailed information on one or more secrets"
+ "ls:List secrets"
+ "rm:Remove one or more secrets"
+ )
+ _describe -t docker-secret-commands "docker secret command" _docker_secret_subcommands
+}
+
+__docker_secret_subcommand() {
+ local -a _command_args opts_help
+ local expl help="--help"
+ integer ret=1
+
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (create)
+ _arguments $(__docker_arguments) -A '-*' \
+ $opts_help \
+ "($help)*"{-l=,--label=}"[Secret labels]:label: " \
+ "($help -):secret: " && ret=0
+ ;;
+ (inspect)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given Go template]:template: " \
+ "($help -)*:secret:__docker_complete_secrets" && ret=0
+ ;;
+ (ls|list)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)--format=[Format the output using the given go template]:template: " \
+ "($help -q --quiet)"{-q,--quiet}"[Only display IDs]" && ret=0
+ ;;
+ (rm|remove)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -)*:secret:__docker_complete_secrets" && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_secret_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO secret
+
# BO service
__docker_service_complete_ls_filters() {
@@ -967,6 +1802,10 @@ __docker_service_complete_ls_filters() {
(id)
__docker_complete_services_ids && ret=0
;;
+ (mode)
+ opts=('global' 'replicated')
+ _describe -t mode-opts "mode options" opts && ret=0
+ ;;
(name)
__docker_complete_services_names && ret=0
;;
@@ -975,7 +1814,7 @@ __docker_service_complete_ls_filters() {
;;
esac
else
- opts=('id' 'label' 'name')
+ opts=('id' 'label' 'mode' 'name')
_describe -t filter-opts "filter options" opts -qS "=" && ret=0
fi
@@ -989,7 +1828,7 @@ __docker_service_complete_ps_filters() {
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(desired-state)
- state_opts=('accepted' 'running')
+ state_opts=('accepted' 'running' 'shutdown')
_describe -t state-opts "desired state options" state_opts && ret=0
;;
*)
@@ -1004,6 +1843,28 @@ __docker_service_complete_ps_filters() {
return ret
}
+__docker_service_complete_placement_pref() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+
+ if compset -P '*='; then
+ case "${${words[-1]%=*}#*=}" in
+ (spread)
+ opts=('engine.labels' 'node.labels')
+ _describe -t spread-opts "spread options" opts -qS "." && ret=0
+ ;;
+ *)
+ _message 'value' && ret=0
+ ;;
+ esac
+ else
+ opts=('spread')
+ _describe -t pref-opts "placement pref options" opts -qS "=" && ret=0
+ fi
+
+ return ret
+}
+
__docker_services() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
@@ -1069,9 +1930,11 @@ __docker_service_commands() {
_docker_service_subcommands=(
"create:Create a new service"
"inspect:Display detailed information on one or more services"
+ "logs:Fetch the logs of a service or task"
"ls:List services"
"rm:Remove one or more services"
- "scale:Scale one or multiple services"
+ "rollback:Revert changes to a service's configuration"
+ "scale:Scale one or multiple replicated services"
"ps:List the tasks of a service"
"update:Update a service"
)
@@ -1088,26 +1951,39 @@ __docker_service_subcommand() {
"($help)*--constraint=[Placement constraints]:constraint: "
"($help)--endpoint-mode=[Placement constraints]:mode:(dnsrr vip)"
"($help)*"{-e=,--env=}"[Set environment variables]:env: "
- "($help)*--group-add=[Add additional user groups to the container]:group:_groups"
+ "($help)--health-cmd=[Command to run to check health]:command: "
+ "($help)--health-interval=[Time between running the check]:time: "
+ "($help)--health-retries=[Consecutive failures needed to report unhealthy]:retries:(1 2 3 4 5)"
+ "($help)--health-timeout=[Maximum time to allow one check to run]:time: "
+ "($help)--hostname=[Service container hostname]:hostname: " \
+ "($help)--isolation=[Service container isolation mode]:isolation:(default process hyperv)" \
"($help)*--label=[Service labels]:label: "
"($help)--limit-cpu=[Limit CPUs]:value: "
"($help)--limit-memory=[Limit Memory]:value: "
- "($help)--log-driver=[Logging driver for service]:logging driver:__docker_log_drivers"
- "($help)*--log-opt=[Logging driver options]:log driver options:__docker_log_options"
- "($help)*--mount=[Attach a mount to the service]:mount: "
- "($help)--name=[Service name]:name: "
+ "($help)--log-driver=[Logging driver for service]:logging driver:__docker_complete_log_drivers"
+ "($help)*--log-opt=[Logging driver options]:log driver options:__docker_complete_log_options"
+ "($help)*--mount=[Attach a filesystem mount to the service]:mount: "
"($help)*--network=[Network attachments]:network: "
- "($help)*"{-p=,--publish=}"[Publish a port as a node port]:port: "
+ "($help)--no-healthcheck[Disable any container-specified HEALTHCHECK]"
+ "($help)--read-only[Mount the container's root filesystem as read only]"
"($help)--replicas=[Number of tasks]:replicas: "
"($help)--reserve-cpu=[Reserve CPUs]:value: "
"($help)--reserve-memory=[Reserve Memory]:value: "
"($help)--restart-condition=[Restart when condition is met]:mode:(any none on-failure)"
"($help)--restart-delay=[Delay between restart attempts]:delay: "
"($help)--restart-max-attempts=[Maximum number of restarts before giving up]:max-attempts: "
- "($help)--restart-window=[Window used to evaluate the restart policy]:window: "
+ "($help)--restart-window=[Window used to evaluate the restart policy]:duration: "
+ "($help)--rollback-delay=[Delay between task rollbacks]:duration: "
+ "($help)--rollback-failure-action=[Action on rollback failure]:action:(continue pause)"
+ "($help)--rollback-max-failure-ratio=[Failure rate to tolerate during a rollback]:failure rate: "
+ "($help)--rollback-monitor=[Duration after each task rollback to monitor for failure]:duration: "
+ "($help)--rollback-parallelism=[Maximum number of tasks rolled back simultaneously]:number: "
+ "($help)*--secret=[Specify secrets to expose to the service]:secret:__docker_complete_secrets"
"($help)--stop-grace-period=[Time to wait before force killing a container]:grace period: "
+ "($help)--stop-signal=[Signal to stop the container]:signal:_signals"
+ "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-TTY]"
"($help)--update-delay=[Delay between updates]:delay: "
- "($help)--update-failure-action=[Action on update failure]:mode:(pause continue)"
+ "($help)--update-failure-action=[Action on update failure]:mode:(continue pause rollback)"
"($help)--update-max-failure-ratio=[Failure rate to tolerate during an update]:fraction: "
"($help)--update-monitor=[Duration after each task update to monitor for failure]:window: "
"($help)--update-parallelism=[Maximum number of tasks updated simultaneously]:number: "
@@ -1122,8 +1998,15 @@ __docker_service_subcommand() {
$opts_help \
$opts_create_update \
"($help)*--container-label=[Container labels]:label: " \
+ "($help)*--dns=[Set custom DNS servers]:DNS: " \
+ "($help)*--dns-option=[Set DNS options]:DNS option: " \
+ "($help)*--dns-search=[Set custom DNS search domains]:DNS search: " \
+ "($help)*--env-file=[Read environment variables from a file]:environment file:_files" \
"($help)--mode=[Service Mode]:mode:(global replicated)" \
- "($help -): :__docker_images" \
+ "($help)--name=[Service name]:name: " \
+ "($help)*--placement-pref=[Add a placement preference]:pref:__docker_service_complete_placement_pref" \
+ "($help)*"{-p=,--publish=}"[Publish a port as a node port]:port: " \
+ "($help -): :__docker_complete_images" \
"($help -):command: _command_names -e" \
"($help -)*::arguments: _normal" && ret=0
;;
@@ -1134,25 +2017,41 @@ __docker_service_subcommand() {
"($help)--pretty[Print the information in a human friendly format]" \
"($help -)*:service:__docker_complete_services" && ret=0
;;
+ (logs)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --follow)"{-f,--follow}"[Follow log output]" \
+ "($help)--no-resolve[Do not map IDs to Names]" \
+ "($help)--no-task-ids[Do not include task IDs]" \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help)--since=[Show logs since timestamp]:timestamp: " \
+ "($help)--tail=[Number of lines to show from the end of the logs]:lines:(1 10 20 50 all)" \
+ "($help -t --timestamps)"{-t,--timestamps}"[Show timestamps]" \
+ "($help -)1:service:__docker_complete_services" && ret=0
+ ;;
(ls|list)
_arguments $(__docker_arguments) \
$opts_help \
- "($help)*"{-f=,--filter=}"[Filter output based on conditions provided]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Filter output based on conditions provided]:filter:__docker_service_complete_ls_filters" \
+ "($help)--format=[Pretty-print services using a Go template]:template: " \
"($help -q --quiet)"{-q,--quiet}"[Only display IDs]" && ret=0
- case $state in
- (filter-options)
- __docker_service_complete_ls_filters && ret=0
- ;;
- esac
;;
(rm|remove)
_arguments $(__docker_arguments) \
$opts_help \
"($help -)*:service:__docker_complete_services" && ret=0
;;
+ (rollback)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -d --detach)"{-d=false,--detach=false}"[Disable detached mode]" \
+ "($help -q --quiet)"{-q,--quiet}"[Suppress progress output]" \
+ "($help -)*:service:__docker_complete_services" && ret=0
+ ;;
(scale)
_arguments $(__docker_arguments) \
$opts_help \
+ "($help -d --detach)"{-d=false,--detach=false}"[Disable detached mode]" \
"($help -)*:service:->values" && ret=0
case $state in
(values)
@@ -1167,16 +2066,12 @@ __docker_service_subcommand() {
(ps)
_arguments $(__docker_arguments) \
$opts_help \
- "($help -a --all)"{-a,--all}"[Display all tasks]" \
- "($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_service_complete_ps_filters" \
+ "($help)--format=[Format the output using the given go template]:template: " \
"($help)--no-resolve[Do not map IDs to Names]" \
"($help)--no-trunc[Do not truncate output]" \
- "($help -)1:service:__docker_complete_services" && ret=0
- case $state in
- (filter-options)
- __docker_service_complete_ps_filters && ret=0
- ;;
- esac
+ "($help -q --quiet)"{-q,--quiet}"[Only display task IDs]" \
+ "($help -)*:service:__docker_complete_services" && ret=0
;;
(update)
_arguments $(__docker_arguments) \
@@ -1185,9 +2080,20 @@ __docker_service_subcommand() {
"($help)--arg=[Service command args]:arguments: _normal" \
"($help)*--container-label-add=[Add or update container labels]:label: " \
"($help)*--container-label-rm=[Remove a container label by its key]:label: " \
+ "($help)*--dns-add=[Add or update custom DNS servers]:DNS: " \
+ "($help)*--dns-rm=[Remove custom DNS servers]:DNS: " \
+ "($help)*--dns-option-add=[Add or update DNS options]:DNS option: " \
+ "($help)*--dns-option-rm=[Remove DNS options]:DNS option: " \
+ "($help)*--dns-search-add=[Add or update custom DNS search domains]:DNS search: " \
+ "($help)*--dns-search-rm=[Remove DNS search domains]:DNS search: " \
"($help)--force[Force update]" \
- "($help)*--group-rm=[Remove previously added user groups from the container]:group:_groups" \
- "($help)--image=[Service image tag]:image:__docker_repositories" \
+ "($help)*--group-add=[Add additional supplementary user groups to the container]:group:_groups" \
+ "($help)*--group-rm=[Remove previously added supplementary user groups from the container]:group:_groups" \
+ "($help)--image=[Service image tag]:image:__docker_complete_repositories" \
+ "($help)*--placement-pref-add=[Add a placement preference]:pref:__docker_service_complete_placement_pref" \
+ "($help)*--placement-pref-rm=[Remove a placement preference]:pref:__docker_service_complete_placement_pref" \
+ "($help)*--publish-add=[Add or update a port]:port: " \
+ "($help)*--publish-rm=[Remove a port(target-port mandatory)]:port: " \
"($help)--rollback[Rollback to previous specification]" \
"($help -)1:service:__docker_complete_services" && ret=0
;;
@@ -1201,6 +2107,150 @@ __docker_service_subcommand() {
# EO service
+# BO stack
+
+__docker_stack_complete_ps_filters() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+
+ if compset -P '*='; then
+ case "${${words[-1]%=*}#*=}" in
+ (desired-state)
+ state_opts=('accepted' 'running' 'shutdown')
+ _describe -t state-opts "desired state options" state_opts && ret=0
+ ;;
+ *)
+ _message 'value' && ret=0
+ ;;
+ esac
+ else
+ opts=('desired-state' 'id' 'name')
+ _describe -t filter-opts "filter options" opts -qS "=" && ret=0
+ fi
+
+ return ret
+}
+
+__docker_stack_complete_services_filters() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+
+ if compset -P '*='; then
+ case "${${words[-1]%=*}#*=}" in
+ *)
+ _message 'value' && ret=0
+ ;;
+ esac
+ else
+ opts=('id' 'label' 'name')
+ _describe -t filter-opts "filter options" opts -qS "=" && ret=0
+ fi
+
+ return ret
+}
+
+__docker_stacks() {
+ [[ $PREFIX = -* ]] && return 1
+ integer ret=1
+ local line s
+ declare -a lines stacks
+
+ lines=(${(f)${:-"$(_call_program commands docker $docker_options stack ls)"$'\n'}})
+
+ # Parse header line to find columns
+ local i=1 j=1 k header=${lines[1]}
+ declare -A begin end
+ while (( j < ${#header} - 1 )); do
+ i=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 1 ))
+ j=$(( i + ${${header[$i,-1]}[(i) ]} - 1 ))
+ k=$(( j + ${${header[$j,-1]}[(i)[^ ]]} - 2 ))
+ begin[${header[$i,$((j-1))]}]=$i
+ end[${header[$i,$((j-1))]}]=$k
+ done
+ end[${header[$i,$((j-1))]}]=-1
+ lines=(${lines[2,-1]})
+
+ # Service NAME
+ for line in $lines; do
+ s="${line[${begin[NAME]},${end[NAME]}]%% ##}"
+ stacks=($stacks $s)
+ done
+
+ _describe -t stacks-list "stacks" stacks "$@" && ret=0
+ return ret
+}
+
+__docker_complete_stacks() {
+ [[ $PREFIX = -* ]] && return 1
+ __docker_stacks "$@"
+}
+
+__docker_stack_commands() {
+ local -a _docker_stack_subcommands
+ _docker_stack_subcommands=(
+ "deploy:Deploy a new stack or update an existing stack"
+ "ls:List stacks"
+ "ps:List the tasks in the stack"
+ "rm:Remove the stack"
+ "services:List the services in the stack"
+ )
+ _describe -t docker-stack-commands "docker stack command" _docker_stack_subcommands
+}
+
+__docker_stack_subcommand() {
+ local -a _command_args opts_help
+ local expl help="--help"
+ integer ret=1
+
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (deploy|up)
+ _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)--with-registry-auth[Send registry authentication details to Swarm agents]" \
+ "($help -):stack:__docker_complete_stacks" && ret=0
+ ;;
+ (ls|list)
+ _arguments $(__docker_arguments) \
+ $opts_help && ret=0
+ ;;
+ (ps)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Display all tasks]" \
+ "($help)*"{-f=,--filter=}"[Filter output based on conditions provided]:filter:__docker_stack_complete_ps_filters" \
+ "($help)--format=[Format the output using the given go template]:template: " \
+ "($help)--no-resolve[Do not map IDs to Names]" \
+ "($help)--no-trunc[Do not truncate output]" \
+ "($help -q --quiet)"{-q,--quiet}"[Only display task IDs]" \
+ "($help -):stack:__docker_complete_stacks" && ret=0
+ ;;
+ (rm|remove|down)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -):stack:__docker_complete_stacks" && ret=0
+ ;;
+ (services)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*"{-f=,--filter=}"[Filter output based on conditions provided]:filter:__docker_stack_complete_services_filters" \
+ "($help)--format=[Pretty-print services using a Go template]:template: " \
+ "($help -q --quiet)"{-q,--quiet}"[Only display IDs]" \
+ "($help -):stack:__docker_complete_stacks" && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_stack_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO stack
+
# BO swarm
__docker_swarm_commands() {
@@ -1210,6 +2260,8 @@ __docker_swarm_commands() {
"join:Join a swarm as a node and/or manager"
"join-token:Manage join tokens"
"leave:Leave a swarm"
+ "unlock:Unlock swarm"
+ "unlock-key:Manage the unlock key"
"update:Update the swarm"
)
_describe -t docker-swarm-commands "docker swarm command" _docker_swarm_subcommands
@@ -1226,15 +2278,25 @@ __docker_swarm_subcommand() {
(init)
_arguments $(__docker_arguments) \
$opts_help \
- "($help)--advertise-addr[Advertised address]:ip\:port: " \
+ "($help)--advertise-addr=[Advertised address]:ip\:port: " \
+ "($help)--data-path-addr=[Data path IP or interface]:ip " \
+ "($help)--autolock[Enable manager autolocking]" \
+ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \
+ "($help)--cert-expiry=[Validity period for node certificates]:duration: " \
+ "($help)--dispatcher-heartbeat=[Dispatcher heartbeat period]:duration: " \
"($help)*--external-ca=[Specifications of one or more certificate signing endpoints]:endpoint: " \
"($help)--force-new-cluster[Force create a new cluster from current state]" \
- "($help)--listen-addr=[Listen address]:ip\:port: " && ret=0
+ "($help)--listen-addr=[Listen address]:ip\:port: " \
+ "($help)--max-snapshots[Number of additional Raft snapshots to retain]" \
+ "($help)--snapshot-interval[Number of log entries between Raft snapshots]" \
+ "($help)--task-history-limit=[Task history retention limit]:limit: " && ret=0
;;
(join)
- _arguments $(__docker_arguments) \
+ _arguments $(__docker_arguments) -A '-*' \
$opts_help \
- "($help)--advertise-addr[Advertised address]:ip\:port: " \
+ "($help)--advertise-addr=[Advertised address]:ip\:port: " \
+ "($help)--data-path-addr=[Data path IP or interface]:ip " \
+ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \
"($help)--listen-addr=[Listen address]:ip\:port: " \
"($help)--token=[Token for entry into the swarm]:secret: " \
"($help -):host\:port: " && ret=0
@@ -1248,13 +2310,28 @@ __docker_swarm_subcommand() {
;;
(leave)
_arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Force this node to leave the swarm, ignoring warnings]" && ret=0
+ ;;
+ (unlock)
+ _arguments $(__docker_arguments) \
$opts_help && ret=0
;;
+ (unlock-key)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -q --quiet)"{-q,--quiet}"[Only display token]" \
+ "($help)--rotate[Rotate unlock token]" && ret=0
+ ;;
(update)
_arguments $(__docker_arguments) \
$opts_help \
+ "($help)--autolock[Enable manager autolocking]" \
"($help)--cert-expiry=[Validity period for node certificates]:duration: " \
"($help)--dispatcher-heartbeat=[Dispatcher heartbeat period]:duration: " \
+ "($help)*--external-ca=[Specifications of one or more certificate signing endpoints]:endpoint: " \
+ "($help)--max-snapshots[Number of additional Raft snapshots to retain]" \
+ "($help)--snapshot-interval[Number of log entries between Raft snapshots]" \
"($help)--task-history-limit=[Task history retention limit]:limit: " && ret=0
;;
(help)
@@ -1267,6 +2344,63 @@ __docker_swarm_subcommand() {
# EO swarm
+# BO system
+
+__docker_system_commands() {
+ local -a _docker_system_subcommands
+ _docker_system_subcommands=(
+ "df:Show docker filesystem usage"
+ "events:Get real time events from the server"
+ "info:Display system-wide information"
+ "prune:Remove unused data"
+ )
+ _describe -t docker-system-commands "docker system command" _docker_system_subcommands
+}
+
+__docker_system_subcommand() {
+ local -a _command_args opts_help
+ local expl help="--help"
+ integer ret=1
+
+ opts_help=("(: -)--help[Print usage]")
+
+ case "$words[1]" in
+ (df)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -v --verbose)"{-v,--verbose}"[Show detailed information on space usage]" && ret=0
+ ;;
+ (events)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_events_filter" \
+ "($help)--since=[Events created since this timestamp]:timestamp: " \
+ "($help)--until=[Events created until this timestamp]:timestamp: " \
+ "($help)--format=[Format the output using the given go template]:template: " && ret=0
+ ;;
+ (info)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " && ret=0
+ ;;
+ (prune)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -a --all)"{-a,--all}"[Remove all unused data, not just dangling ones]" \
+ "($help)*--filter=[Filter values]:filter:__docker_complete_prune_filters" \
+ "($help -f --force)"{-f,--force}"[Do not prompt for confirmation]" \
+ "($help)--volumes=[Remove all unused volumes]" && ret=0
+ ;;
+ (help)
+ _arguments $(__docker_arguments) ":subcommand:__docker_volume_commands" && ret=0
+ ;;
+ esac
+
+ return ret
+}
+
+# EO system
+
# BO volume
__docker_volume_complete_ls_filters() {
@@ -1283,7 +2417,7 @@ __docker_volume_complete_ls_filters() {
__docker_complete_info_plugins Volume && ret=0
;;
(name)
- __docker_volumes && ret=0
+ __docker_complete_volumes && ret=0
;;
*)
_message 'value' && ret=0
@@ -1297,7 +2431,7 @@ __docker_volume_complete_ls_filters() {
return ret
}
-__docker_volumes() {
+__docker_complete_volumes() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
declare -a lines volumes
@@ -1335,6 +2469,7 @@ __docker_volume_commands() {
"create:Create a volume"
"inspect:Display detailed information on one or more volumes"
"ls:List volumes"
+ "prune:Remove all unused volumes"
"rm:Remove one or more volumes"
)
_describe -t docker-volume-commands "docker volume command" _docker_volume_subcommands
@@ -1360,25 +2495,25 @@ __docker_volume_subcommand() {
_arguments $(__docker_arguments) \
$opts_help \
"($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " \
- "($help -)1:volume:__docker_volumes" && ret=0
+ "($help -)1:volume:__docker_complete_volumes" && ret=0
;;
(ls)
_arguments $(__docker_arguments) \
$opts_help \
- "($help)*"{-f=,--filter=}"[Provide filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_volume_complete_ls_filters" \
"($help)--format=[Pretty-print volumes using a Go template]:template: " \
"($help -q --quiet)"{-q,--quiet}"[Only display volume names]" && ret=0
- case $state in
- (filter-options)
- __docker_volume_complete_ls_filters && ret=0
- ;;
- esac
+ ;;
+ (prune)
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -f --force)"{-f,--force}"[Do not prompt for confirmation]" && ret=0
;;
(rm)
_arguments $(__docker_arguments) \
$opts_help \
"($help -f --force)"{-f,--force}"[Force the removal of one or more volumes]" \
- "($help -):volume:__docker_volumes" && ret=0
+ "($help -):volume:__docker_complete_volumes" && ret=0
;;
(help)
_arguments $(__docker_arguments) ":subcommand:__docker_volume_commands" && ret=0
@@ -1397,18 +2532,32 @@ __docker_caching_policy() {
__docker_commands() {
local cache_policy
+ integer force_invalidation=0
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy
fi
- if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \
- && ! _retrieve_cache docker_subcommands;
+ if ( (( ! ${+_docker_hide_legacy_commands} )) || _cache_invalid docker_hide_legacy_commands ) \
+ && ! _retrieve_cache docker_hide_legacy_commands;
+ then
+ _docker_hide_legacy_commands="${DOCKER_HIDE_LEGACY_COMMANDS}"
+ _store_cache docker_hide_legacy_commands _docker_hide_legacy_commands
+ fi
+
+ if [[ "${_docker_hide_legacy_commands}" != "${DOCKER_HIDE_LEGACY_COMMANDS}" ]]; then
+ force_invalidation=1
+ _docker_hide_legacy_commands="${DOCKER_HIDE_LEGACY_COMMANDS}"
+ _store_cache docker_hide_legacy_commands _docker_hide_legacy_commands
+ fi
+
+ if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands ) \
+ && ! _retrieve_cache docker_subcommands || [[ ${force_invalidation} -eq 1 ]];
then
local -a lines
lines=(${(f)"$(_call_program commands docker 2>&1)"})
- _docker_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/ ##/:})
+ _docker_subcommands=(${${${(M)${lines[$((${lines[(i)*Commands:]} + 1)),-1]}:# *}## #}/ ##/:})
_docker_subcommands=($_docker_subcommands 'daemon:Enable daemon mode' 'help:Show help for a command')
(( $#_docker_subcommands > 2 )) && _store_cache docker_subcommands _docker_subcommands
fi
@@ -1416,194 +2565,86 @@ __docker_commands() {
}
__docker_subcommand() {
- local -a _command_args opts_help opts_build_create_run opts_build_create_run_update opts_create_run opts_create_run_update
+ local -a _command_args opts_help
local expl help="--help"
integer ret=1
opts_help=("(: -)--help[Print usage]")
- opts_build_create_run=(
- "($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: "
- "($help)--isolation=[Container isolation technology]:isolation:(default hyperv process)"
- "($help)--disable-content-trust[Skip image verification]"
- "($help)*--shm-size=[Size of '/dev/shm' (format is '<number><unit>')]:shm size: "
- "($help)*--ulimit=[ulimit options]:ulimit: "
- "($help)--userns=[Container user namespace]:user namespace:(host)"
- )
- opts_build_create_run_update=(
- "($help -c --cpu-shares)"{-c=,--cpu-shares=}"[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)"
- "($help)--cpu-period=[Limit the CPU CFS (Completely Fair Scheduler) period]:CPU period: "
- "($help)--cpu-quota=[Limit the CPU CFS (Completely Fair Scheduler) quota]:CPU quota: "
- "($help)--cpuset-cpus=[CPUs in which to allow execution]:CPUs: "
- "($help)--cpuset-mems=[MEMs in which to allow execution]:MEMs: "
- "($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: "
- "($help)--memory-swap=[Total memory limit with swap]:Memory limit: "
- )
- opts_create_run=(
- "($help -a --attach)"{-a=,--attach=}"[Attach to stdin, stdout or stderr]:device:(STDIN STDOUT STDERR)"
- "($help)*--add-host=[Add a custom host-to-IP mapping]:host\:ip mapping: "
- "($help)*--blkio-weight-device=[Block IO (relative device weight)]:device:Block IO weight: "
- "($help)*--cap-add=[Add Linux capabilities]:capability: "
- "($help)*--cap-drop=[Drop Linux capabilities]:capability: "
- "($help)--cidfile=[Write the container ID to the file]:CID file:_files"
- "($help)*--device=[Add a host device to the container]:device:_files"
- "($help)*--device-read-bps=[Limit the read rate (bytes per second) from a device]:device:IO rate: "
- "($help)*--device-read-iops=[Limit the read rate (IO per second) from a device]:device:IO rate: "
- "($help)*--device-write-bps=[Limit the write rate (bytes per second) to a device]:device:IO rate: "
- "($help)*--device-write-iops=[Limit the write rate (IO per second) to a device]:device:IO rate: "
- "($help)*--dns=[Custom DNS servers]:DNS server: "
- "($help)*--dns-opt=[Custom DNS options]:DNS option: "
- "($help)*--dns-search=[Custom DNS search domains]:DNS domains: "
- "($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"
- "($help)*--expose=[Expose a port from the container without publishing it]: "
- "($help)*--group-add=[Add additional groups to run as]:group:_groups"
- "($help -h --hostname)"{-h=,--hostname=}"[Container host name]:hostname:_hosts"
- "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]"
- "($help)--ip=[Container IPv4 address]:IPv4: "
- "($help)--ip6=[Container IPv6 address]:IPv6: "
- "($help)--ipc=[IPC namespace to use]:IPC namespace: "
- "($help)*--link=[Add link to another container]:link:->link"
- "($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: "
- "($help)*"{-l=,--label=}"[Container metadata]:label: "
- "($help)--log-driver=[Default driver for container logs]:logging driver:__docker_log_drivers"
- "($help)*--log-opt=[Log driver specific options]:log driver options:__docker_log_options"
- "($help)--mac-address=[Container MAC address]:MAC address: "
- "($help)--name=[Container name]:name: "
- "($help)--network=[Connect a container to a network]:network mode:(bridge none container host)"
- "($help)*--network-alias=[Add network-scoped alias for the container]:alias: "
- "($help)--oom-kill-disable[Disable OOM Killer]"
- "($help)--oom-score-adj[Tune the host's OOM preferences for containers (accepts -1000 to 1000)]"
- "($help)--pids-limit[Tune container pids limit (set -1 for unlimited)]"
- "($help -P --publish-all)"{-P,--publish-all}"[Publish all exposed ports]"
- "($help)*"{-p=,--publish=}"[Expose a container's port to the host]:port:_ports"
- "($help)--pid=[PID namespace to use]:PID namespace:__docker_complete_pid"
- "($help)--privileged[Give extended privileges to this container]"
- "($help)--read-only[Mount the container's root filesystem as read only]"
- "($help)*--security-opt=[Security options]:security option: "
- "($help)*--sysctl=-[sysctl options]:sysctl: "
- "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-tty]"
- "($help -u --user)"{-u=,--user=}"[Username or UID]:user:_users"
- "($help)--tmpfs[mount tmpfs]"
- "($help)*-v[Bind mount a volume]:volume: "
- "($help)--volume-driver=[Optional volume driver for the container]:volume driver:(local)"
- "($help)*--volumes-from=[Mount volumes from the specified container]:volume: "
- "($help -w --workdir)"{-w=,--workdir=}"[Working directory inside the container]:directory:_directories"
- )
- opts_create_run_update=(
- "($help)--blkio-weight=[Block IO (relative weight), between 10 and 1000]:Block IO weight:(10 100 500 1000)"
- "($help)--kernel-memory=[Kernel memory limit in bytes]:Memory limit: "
- "($help)--memory-reservation=[Memory soft limit]:Memory limit: "
- "($help)--restart=[Restart policy]:restart policy:(no on-failure always unless-stopped)"
- )
- opts_attach_exec_run_start=(
- "($help)--detach-keys=[Escape key sequence used to detach a container]:sequence:__docker_complete_detach_keys"
- )
case "$words[1]" in
- (attach)
- _arguments $(__docker_arguments) \
- $opts_help \
- $opts_attach_exec_run_start \
- "($help)--no-stdin[Do not attach stdin]" \
- "($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
- "($help -):containers:__docker_runningcontainers" && ret=0
- ;;
- (build)
- _arguments $(__docker_arguments) \
- $opts_help \
- $opts_build_create_run \
- $opts_build_create_run_update \
- "($help)*--build-arg[Build-time variables]:<varname>=<value>: " \
- "($help)--compress[Compress the build context using gzip]" \
- "($help -f --file)"{-f=,--file=}"[Name of the Dockerfile]:Dockerfile:_files" \
- "($help)--force-rm[Always remove intermediate containers]" \
- "($help)*--label=[Set metadata for an image]:label=value: " \
- "($help)--no-cache[Do not use cache when building the image]" \
- "($help)--pull[Attempt to pull a newer version of the image]" \
- "($help -q --quiet)"{-q,--quiet}"[Suppress verbose build output]" \
- "($help)--rm[Remove intermediate containers after a successful build]" \
- "($help -t --tag)*"{-t=,--tag=}"[Repository, name and tag for the image]: :__docker_repositories_with_tags" \
- "($help -):path or URL:_directories" && ret=0
+ (attach|commit|cp|create|diff|exec|export|kill|logs|pause|unpause|port|rename|restart|rm|run|start|stats|stop|top|update|wait)
+ __docker_container_subcommand && ret=0
;;
- (commit)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -a --author)"{-a=,--author=}"[Author]:author: " \
- "($help)*"{-c=,--change=}"[Apply Dockerfile instruction to the created image]:Dockerfile:_files" \
- "($help -m --message)"{-m=,--message=}"[Commit message]:message: " \
- "($help -p --pause)"{-p,--pause}"[Pause container during commit]" \
- "($help -):container:__docker_containers" \
- "($help -): :__docker_repositories_with_tags" && ret=0
+ (build|history|import|load|pull|push|save|tag)
+ __docker_image_subcommand && ret=0
;;
- (cp)
+ (checkpoint)
+ local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
$opts_help \
- "($help -L --follow-link)"{-L,--follow-link}"[Always follow symbol link]" \
- "($help -)1:container:->container" \
- "($help -)2:hostpath:_files" && ret=0
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
+
case $state in
- (container)
- if compset -P "*:"; then
- _files && ret=0
- else
- __docker_containers -qS ":" && ret=0
- fi
+ (command)
+ __docker_checkpoint_commands && ret=0
+ ;;
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_checkpoint_subcommand && ret=0
;;
esac
;;
- (create)
+ (container)
+ local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
$opts_help \
- $opts_build_create_run \
- $opts_build_create_run_update \
- $opts_create_run \
- $opts_create_run_update \
- "($help -): :__docker_images" \
- "($help -):command: _command_names -e" \
- "($help -)*::arguments: _normal" && ret=0
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
case $state in
- (link)
- if compset -P "*:"; then
- _wanted alias expl "Alias" compadd -E "" && ret=0
- else
- __docker_runningcontainers -qS ":" && ret=0
- fi
+ (command)
+ __docker_container_commands && ret=0
+ ;;
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_container_subcommand && ret=0
;;
esac
-
;;
(daemon)
_arguments $(__docker_arguments) \
$opts_help \
"($help)*--add-runtime=[Register an additional OCI compatible runtime]:runtime:__docker_complete_runtimes" \
- "($help)--api-cors-header=[CORS headers in the remote API]:CORS headers: " \
+ "($help)*--allow-nondistributable-artifacts=[Push nondistributable artifacts to specified registries]:registry: " \
+ "($help)--api-cors-header=[CORS headers in the Engine API]:CORS headers: " \
"($help)*--authorization-plugin=[Authorization plugins to load]" \
"($help -b --bridge)"{-b=,--bridge=}"[Attach containers to a network bridge]:bridge:_net_interfaces" \
"($help)--bip=[Network bridge IP]:IP address: " \
"($help)--cgroup-parent=[Parent cgroup for all containers]:cgroup: " \
+ "($help)--cluster-advertise=[Address or interface name to advertise]:Instance to advertise (host\:port): " \
+ "($help)--cluster-store=[URL of the distributed storage backend]:Cluster Store:->cluster-store" \
+ "($help)*--cluster-store-opt=[Cluster store options]:Cluster options:->cluster-store-options" \
"($help)--config-file=[Path to daemon configuration file]:Config File:_files" \
"($help)--containerd=[Path to containerd socket]:socket:_files -g \"*.sock\"" \
+ "($help)--data-root=[Root directory of persisted Docker data]:path:_directories" \
"($help -D --debug)"{-D,--debug}"[Enable debug mode]" \
"($help)--default-gateway[Container default gateway IPv4 address]:IPv4 address: " \
"($help)--default-gateway-v6[Container default gateway IPv6 address]:IPv6 address: " \
- "($help)--cluster-store=[URL of the distributed storage backend]:Cluster Store:->cluster-store" \
- "($help)--cluster-advertise=[Address or interface name to advertise]:Instance to advertise (host\:port): " \
- "($help)*--cluster-store-opt=[Cluster store options]:Cluster options:->cluster-store-options" \
+ "($help)--default-shm-size=[Default shm size for containers]:size:" \
+ "($help)*--default-ulimit=[Default ulimits for containers]:ulimit: " \
"($help)*--dns=[DNS server to use]:DNS: " \
- "($help)*--dns-search=[DNS search domains to use]:DNS search: " \
"($help)*--dns-opt=[DNS options to use]:DNS option: " \
- "($help)*--default-ulimit=[Default ulimits for containers]:ulimit: " \
- "($help)--disable-legacy-registry[Disable contacting legacy registries]" \
+ "($help)*--dns-search=[DNS search domains to use]:DNS search: " \
"($help)*--exec-opt=[Runtime execution options]:runtime execution options: " \
"($help)--exec-root=[Root directory for execution state files]:path:_directories" \
+ "($help)--experimental[Enable experimental features]" \
"($help)--fixed-cidr=[IPv4 subnet for fixed IPs]:IPv4 subnet: " \
"($help)--fixed-cidr-v6=[IPv6 subnet for fixed IPs]:IPv6 subnet: " \
"($help -G --group)"{-G=,--group=}"[Group for the unix socket]:group:_groups" \
- "($help -g --graph)"{-g=,--graph=}"[Root of the Docker runtime]:path:_directories" \
"($help -H --host)"{-H=,--host=}"[tcp://host:port to bind/connect to]:host: " \
"($help)--icc[Enable inter-container communication]" \
+ "($help)--init[Run an init inside containers to forward signals and reap processes]" \
"($help)--init-path=[Path to the docker-init binary]:docker-init binary:_files" \
"($help)*--insecure-registry=[Enable insecure registry communication]:registry: " \
"($help)--ip=[Default IP when binding container ports]" \
@@ -1614,8 +2655,8 @@ __docker_subcommand() {
"($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \
"($help)*--label=[Key=value labels]:label: " \
"($help)--live-restore[Enable live restore of docker when containers are still running]" \
- "($help)--log-driver=[Default driver for container logs]:logging driver:__docker_log_drivers" \
- "($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_log_options" \
+ "($help)--log-driver=[Default driver for container logs]:logging driver:__docker_complete_log_drivers" \
+ "($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_complete_log_options" \
"($help)--max-concurrent-downloads[Set the max concurrent downloads for each pull]" \
"($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \
"($help)--mtu=[Network MTU]:mtu:(0 576 1420 1500 9000)" \
@@ -1623,8 +2664,10 @@ __docker_subcommand() {
"($help -p --pidfile)"{-p=,--pidfile=}"[Path to use for daemon PID file]:PID file:_files" \
"($help)--raw-logs[Full timestamps without ANSI coloring]" \
"($help)*--registry-mirror=[Preferred Docker registry mirror]:registry mirror: " \
+ "($help)--seccomp-profile=[Path to seccomp profile]:path:_files -g \"*.json\"" \
"($help -s --storage-driver)"{-s=,--storage-driver=}"[Storage driver to use]:driver:(aufs btrfs devicemapper overlay overlay2 vfs zfs)" \
"($help)--selinux-enabled[Enable selinux support]" \
+ "($help)--shutdown-timeout=[Set the shutdown timeout value in seconds]:time: " \
"($help)*--storage-opt=[Storage driver options]:storage driver options: " \
"($help)--tls[Use TLS]" \
"($help)--tlscacert=[Trust certs signed only by this CA]:PEM file:_files -g \"*.(pem|crt)\"" \
@@ -1632,7 +2675,8 @@ __docker_subcommand() {
"($help)--tlskey=[Path to TLS key file]:Key file:_files -g \"*.(pem|key)\"" \
"($help)--tlsverify[Use TLS and verify the remote]" \
"($help)--userns-remap=[User/Group setting for user namespaces]:user\:group:->users-groups" \
- "($help)--userland-proxy[Use userland proxy for loopback traffic]" && ret=0
+ "($help)--userland-proxy[Use userland proxy for loopback traffic]" \
+ "($help)--userland-proxy-path=[Path to the userland proxy binary]:binary:_files" && ret=0
case $state in
(cluster-store)
@@ -1661,84 +2705,29 @@ __docker_subcommand() {
;;
esac
;;
- (diff)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -)*:containers:__docker_containers" && ret=0
+ (events|info)
+ __docker_system_subcommand && ret=0
;;
- (events)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_events_filter" \
- "($help)--since=[Events created since this timestamp]:timestamp: " \
- "($help)--until=[Events created until this timestamp]:timestamp: " \
- "($help)--format=[Format the output using the given go template]:template: " && ret=0
- ;;
- (exec)
- local state
+ (image)
+ local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
$opts_help \
- $opts_attach_exec_run_start \
- "($help -d --detach)"{-d,--detach}"[Detached mode: leave the container running in the background]" \
- "($help -e --env)"{-e,--env}"[Set environment variables]" \
- "($help -i --interactive)"{-i,--interactive}"[Keep stdin open even if not attached]" \
- "($help)--privileged[Give extended Linux capabilities to the command]" \
- "($help -t --tty)"{-t,--tty}"[Allocate a pseudo-tty]" \
- "($help -u --user)"{-u=,--user=}"[Username or UID]:user:_users" \
- "($help -):containers:__docker_runningcontainers" \
- "($help -)*::command:->anycommand" && ret=0
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
case $state in
- (anycommand)
- shift 1 words
- (( CURRENT-- ))
- _normal && ret=0
+ (command)
+ __docker_image_commands && ret=0
;;
- esac
- ;;
- (export)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -o --output)"{-o=,--output=}"[Write to a file, instead of stdout]:output file:_files" \
- "($help -)*:containers:__docker_containers" && ret=0
- ;;
- (history)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -H --human)"{-H,--human}"[Print sizes and dates in human readable format]" \
- "($help)--no-trunc[Do not truncate output]" \
- "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
- "($help -)*: :__docker_images" && ret=0
- ;;
- (images)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -a --all)"{-a,--all}"[Show all images]" \
- "($help)--digests[Show digests]" \
- "($help)*"{-f=,--filter=}"[Filter values]:filter:->filter-options" \
- "($help)--format=[Pretty-print images using a Go template]:template: " \
- "($help)--no-trunc[Do not truncate output]" \
- "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
- "($help -): :__docker_repositories" && ret=0
-
- case $state in
- (filter-options)
- __docker_complete_images_filters && ret=0
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_image_subcommand && ret=0
;;
esac
;;
- (import)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help)*"{-c=,--change=}"[Apply Dockerfile instruction to the created image]:Dockerfile:_files" \
- "($help -m --message)"{-m=,--message=}"[Commit message for imported image]:message: " \
- "($help -):URL:(- http:// file://)" \
- "($help -): :__docker_repositories_with_tags" && ret=0
- ;;
- (info|version)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " && ret=0
+ (images)
+ words[1]='ls'
+ __docker_image_subcommand && ret=0
;;
(inspect)
local state
@@ -1746,55 +2735,53 @@ __docker_subcommand() {
$opts_help \
"($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " \
"($help -s --size)"{-s,--size}"[Display total file sizes if the type is container]" \
- "($help)--type=[Return JSON for specified type]:type:(image container)" \
+ "($help)--type=[Return JSON for specified type]:type:(container image network node plugin service volume)" \
"($help -)*: :->values" && ret=0
case $state in
(values)
if [[ ${words[(r)--type=container]} == --type=container ]]; then
- __docker_containers && ret=0
+ __docker_complete_containers && ret=0
elif [[ ${words[(r)--type=image]} == --type=image ]]; then
- __docker_images && ret=0
+ __docker_complete_images && ret=0
+ elif [[ ${words[(r)--type=network]} == --type=network ]]; then
+ __docker_complete_networks && ret=0
+ elif [[ ${words[(r)--type=node]} == --type=node ]]; then
+ __docker_complete_nodes && ret=0
+ elif [[ ${words[(r)--type=plugin]} == --type=plugin ]]; then
+ __docker_complete_plugins && ret=0
+ elif [[ ${words[(r)--type=service]} == --type=secrets ]]; then
+ __docker_complete_secrets && ret=0
+ elif [[ ${words[(r)--type=service]} == --type=service ]]; then
+ __docker_complete_services && ret=0
+ elif [[ ${words[(r)--type=volume]} == --type=volume ]]; then
+ __docker_complete_volumes && ret=0
else
- __docker_images && __docker_containers && ret=0
+ __docker_complete_containers
+ __docker_complete_images
+ __docker_complete_networks
+ __docker_complete_nodes
+ __docker_complete_plugins
+ __docker_complete_secrets
+ __docker_complete_services
+ __docker_complete_volumes && ret=0
fi
;;
esac
;;
- (kill)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -s --signal)"{-s=,--signal=}"[Signal to send]:signal:_signals" \
- "($help -)*:containers:__docker_runningcontainers" && ret=0
- ;;
- (load)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -i --input)"{-i=,--input=}"[Read from tar archive file]:archive file:_files -g \"*.((tar|TAR)(.gz|.GZ|.Z|.bz2|.lzma|.xz|)|(tbz|tgz|txz))(-.)\"" \
- "($help -q --quiet)"{-q,--quiet}"[Suppress the load output]" && ret=0
- ;;
(login)
- _arguments $(__docker_arguments) \
+ _arguments $(__docker_arguments) -A '-*' \
$opts_help \
"($help -p --password)"{-p=,--password=}"[Password]:password: " \
+ "($help)--password-stdin[Read password from stdin]" \
"($help -u --user)"{-u=,--user=}"[Username]:username: " \
"($help -)1:server: " && ret=0
;;
(logout)
- _arguments $(__docker_arguments) \
+ _arguments $(__docker_arguments) -A '-*' \
$opts_help \
"($help -)1:server: " && ret=0
;;
- (logs)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help)--details[Show extra details provided to logs]" \
- "($help -f --follow)"{-f,--follow}"[Follow log output]" \
- "($help -s --since)"{-s=,--since=}"[Show logs since this timestamp]:timestamp: " \
- "($help -t --timestamps)"{-t,--timestamps}"[Show timestamps]" \
- "($help)--tail=[Output the last K lines]:lines:(1 10 20 50 all)" \
- "($help -)*:containers:__docker_containers" && ret=0
- ;;
(network)
local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
@@ -1829,11 +2816,6 @@ __docker_subcommand() {
;;
esac
;;
- (pause|unpause)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -)*:containers:__docker_runningcontainers" && ret=0
- ;;
(plugin)
local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
@@ -1851,140 +2833,36 @@ __docker_subcommand() {
;;
esac
;;
- (port)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -)1:containers:__docker_runningcontainers" \
- "($help -)2:port:_ports" && ret=0
- ;;
(ps)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -a --all)"{-a,--all}"[Show all containers]" \
- "($help)--before=[Show only container created before...]:containers:__docker_containers" \
- "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_ps_filters" \
- "($help)--format=[Pretty-print containers using a Go template]:template: " \
- "($help -l --latest)"{-l,--latest}"[Show only the latest created container]" \
- "($help -n --last)"{-n=,--last=}"[Show n last created containers (includes all states)]:n:(1 5 10 25 50)" \
- "($help)--no-trunc[Do not truncate output]" \
- "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
- "($help -s --size)"{-s,--size}"[Display total file sizes]" \
- "($help)--since=[Show only containers created since...]:containers:__docker_containers" && ret=0
- ;;
- (pull)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -a --all-tags)"{-a,--all-tags}"[Download all tagged images]" \
- "($help)--disable-content-trust[Skip image verification]" \
- "($help -):name:__docker_search" && ret=0
- ;;
- (push)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help)--disable-content-trust[Skip image signing]" \
- "($help -): :__docker_images" && ret=0
- ;;
- (rename)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -):old name:__docker_containers" \
- "($help -):new name: " && ret=0
- ;;
- (stop)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \
- "($help -)*:containers:__docker_runningcontainers" && ret=0
- ;;
- (restart)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \
- "($help -)*:containers:__docker_containers_ids" && ret=0
- ;;
- (rm)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -f --force)"{-f,--force}"[Force removal]" \
- "($help -l --link)"{-l,--link}"[Remove the specified link and not the underlying container]" \
- "($help -v --volumes)"{-v,--volumes}"[Remove the volumes associated to the container]" \
- "($help -)*:containers:->values" && ret=0
- case $state in
- (values)
- if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then
- __docker_containers && ret=0
- else
- __docker_stoppedcontainers && ret=0
- fi
- ;;
- esac
+ words[1]='ls'
+ __docker_container_subcommand && ret=0
;;
(rmi)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -f --force)"{-f,--force}"[Force removal]" \
- "($help)--no-prune[Do not delete untagged parents]" \
- "($help -)*: :__docker_images" && ret=0
- ;;
- (run)
- _arguments $(__docker_arguments) \
- $opts_help \
- $opts_build_create_run \
- $opts_build_create_run_update \
- $opts_create_run \
- $opts_create_run_update \
- $opts_attach_exec_run_start \
- "($help -d --detach)"{-d,--detach}"[Detached mode: leave the container running in the background]" \
- "($help)--health-cmd=[Command to run to check health]:command: " \
- "($help)--health-interval=[Time between running the check]:time: " \
- "($help)--health-retries=[Consecutive failures needed to report unhealthy]:retries:(1 2 3 4 5)" \
- "($help)--health-timeout=[Maximum time to allow one check to run]:time: " \
- "($help)--no-healthcheck[Disable any container-specified HEALTHCHECK]" \
- "($help)--rm[Remove intermediate containers when it exits]" \
- "($help)--runtime=[Name of the runtime to be used for that container]:runtime:__docker_complete_runtimes" \
- "($help)--sig-proxy[Proxy all received signals to the process (non-TTY mode only)]" \
- "($help)--stop-signal=[Signal to kill a container]:signal:_signals" \
- "($help)--storage-opt=[Storage driver options for the container]:storage options:->storage-opt" \
- "($help -): :__docker_images" \
- "($help -):command: _command_names -e" \
- "($help -)*::arguments: _normal" && ret=0
-
- case $state in
- (link)
- if compset -P "*:"; then
- _wanted alias expl "Alias" compadd -E "" && ret=0
- else
- __docker_runningcontainers -qS ":" && ret=0
- fi
- ;;
- (storage-opt)
- if compset -P "*="; then
- _message "value" && ret=0
- else
- opts=('size')
- _describe -t filter-opts "storage options" opts -qS "=" && ret=0
- fi
- ;;
- esac
-
- ;;
- (save)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -o --output)"{-o=,--output=}"[Write to file]:file:_files" \
- "($help -)*: :__docker_images" && ret=0
+ words[1]='rm'
+ __docker_image_subcommand && ret=0
;;
(search)
- _arguments $(__docker_arguments) \
+ _arguments $(__docker_arguments) -A '-*' \
$opts_help \
- "($help)*"{-f=,--filter=}"[Filter values]:filter:->filter-options" \
+ "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_search_filters" \
"($help)--limit=[Maximum returned search results]:limit:(1 5 10 25 50)" \
"($help)--no-trunc[Do not truncate output]" \
"($help -):term: " && ret=0
+ ;;
+ (secret)
+ local curcontext="$curcontext" state
+ _arguments $(__docker_arguments) \
+ $opts_help \
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
case $state in
- (filter-options)
- __docker_complete_search_filters && ret=0
+ (command)
+ __docker_secret_commands && ret=0
+ ;;
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_secret_subcommand && ret=0
;;
esac
;;
@@ -2005,21 +2883,22 @@ __docker_subcommand() {
;;
esac
;;
- (start)
- _arguments $(__docker_arguments) \
- $opts_help \
- $opts_attach_exec_run_start \
- "($help -a --attach)"{-a,--attach}"[Attach container's stdout/stderr and forward all signals]" \
- "($help -i --interactive)"{-i,--interactive}"[Attach container's stding]" \
- "($help -)*:containers:__docker_stoppedcontainers" && ret=0
- ;;
- (stats)
+ (stack)
+ local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
$opts_help \
- "($help -a --all)"{-a,--all}"[Show all containers (default shows just running)]" \
- "($help)--format=[Pretty-print images using a Go template]:template: " \
- "($help)--no-stream[Disable streaming stats and only pull the first result]" \
- "($help -)*:containers:__docker_runningcontainers" && ret=0
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
+
+ case $state in
+ (command)
+ __docker_stack_commands && ret=0
+ ;;
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_stack_subcommand && ret=0
+ ;;
+ esac
;;
(swarm)
local curcontext="$curcontext" state
@@ -2038,40 +2917,27 @@ __docker_subcommand() {
;;
esac
;;
- (tag)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -):source:__docker_images"\
- "($help -):destination:__docker_repositories_with_tags" && ret=0
- ;;
- (top)
+ (system)
+ local curcontext="$curcontext" state
_arguments $(__docker_arguments) \
$opts_help \
- "($help -)1:containers:__docker_runningcontainers" \
- "($help -)*:: :->ps-arguments" && ret=0
+ "($help -): :->command" \
+ "($help -)*:: :->option-or-argument" && ret=0
+
case $state in
- (ps-arguments)
- _ps && ret=0
+ (command)
+ __docker_system_commands && ret=0
+ ;;
+ (option-or-argument)
+ curcontext=${curcontext%:*:*}:docker-${words[-1]}:
+ __docker_system_subcommand && ret=0
;;
esac
-
;;
- (update)
+ (version)
_arguments $(__docker_arguments) \
$opts_help \
- $opts_create_run_update \
- $opts_build_create_run_update \
- "($help -)*: :->values" && ret=0
-
- case $state in
- (values)
- if [[ ${words[(r)--kernel-memory*]} = (--kernel-memory*) ]]; then
- __docker_stoppedcontainers && ret=0
- else
- __docker_containers && ret=0
- fi
- ;;
- esac
+ "($help -f --format)"{-f=,--format=}"[Format the output using the given go template]:template: " && ret=0
;;
(volume)
local curcontext="$curcontext" state
@@ -2090,11 +2956,6 @@ __docker_subcommand() {
;;
esac
;;
- (wait)
- _arguments $(__docker_arguments) \
- $opts_help \
- "($help -)*:containers:__docker_runningcontainers" && ret=0
- ;;
(help)
_arguments $(__docker_arguments) ":subcommand:__docker_commands" && ret=0
;;
diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md
new file mode 100644
index 000000000..ade09fbb2
--- /dev/null
+++ b/plugins/dotenv/README.md
@@ -0,0 +1,34 @@
+# dotenv
+
+Automatically load your project ENV variables from `.env` file when you `cd` into project root directory.
+
+Storing configuration in the environment is one of the tenets of a [twelve-factor app](http://www.12factor.net). Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.
+
+## Installation
+
+Just add the plugin to your `.zshrc`:
+
+```sh
+plugins=(git man dotenv)
+```
+
+## Usage
+
+Create `.env` file inside your project directory and put your local ENV variables there.
+
+For example:
+```sh
+export AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
+export SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
+export MONGO_URI=mongodb://127.0.0.1:27017
+export PORT=3001
+```
+`export` is optional. This format works as well:
+```sh
+AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
+SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
+MONGO_URI=mongodb://127.0.0.1:27017
+PORT=3001
+```
+
+**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it supposed to be local only.
diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh
new file mode 100644
index 000000000..9dd784229
--- /dev/null
+++ b/plugins/dotenv/dotenv.plugin.zsh
@@ -0,0 +1,10 @@
+#!/bin/zsh
+
+source_env() {
+ if [[ -f .env ]]; then
+ source .env
+ fi
+}
+
+autoload -U add-zsh-hook
+add-zsh-hook chpwd source_env
diff --git a/plugins/droplr/README.md b/plugins/droplr/README.md
index cfbec25ed..25cf61db7 100644
--- a/plugins/droplr/README.md
+++ b/plugins/droplr/README.md
@@ -1,6 +1,6 @@
# droplr
-Use [Droplr](https://droplr.com/) from the comand line to upload files and shorten
+Use [Droplr](https://droplr.com/) from the command line to upload files and shorten
links. It needs to have [Droplr.app](https://droplr.com/apps) installed and logged
in. MacOS only.
diff --git a/plugins/eecms/eecms.plugin.zsh b/plugins/eecms/eecms.plugin.zsh
new file mode 100644
index 000000000..ee10fbb7e
--- /dev/null
+++ b/plugins/eecms/eecms.plugin.zsh
@@ -0,0 +1,20 @@
+# ExpressionEngine CMS basic command completion
+
+_eecms_console () {
+ echo "php $(find . -maxdepth 3 -mindepth 1 -name 'eecms' -type f | head -n 1)"
+}
+
+_eecms_get_command_list () {
+ `_eecms_console` | sed "/Available commands/,/^/d" | sed "s/[[:space:]].*//g"
+}
+
+_eecms () {
+ compadd `_eecms_get_command_list`
+}
+
+compdef _eecms '`_eecms_console`'
+compdef _eecms 'system/ee/eecms'
+compdef _eecms eecms
+
+#Alias
+alias eecms='`_eecms_console`'
diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
index c102a5a1e..db0ab13af 100644
--- a/plugins/emacs/emacs.plugin.zsh
+++ b/plugins/emacs/emacs.plugin.zsh
@@ -10,7 +10,7 @@
# - Configuration changes made at runtime are applied to all frames.
-if "$ZSH/tools/require_tool.sh" emacs 24 2>/dev/null ; then
+if "$ZSH/tools/require_tool.sh" emacsclient 24 2>/dev/null ; then
export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
# set EDITOR if not already defined.
diff --git a/plugins/emotty/emotty.plugin.zsh b/plugins/emotty/emotty.plugin.zsh
index b32dd1a4c..b0d24c322 100644
--- a/plugins/emotty/emotty.plugin.zsh
+++ b/plugins/emotty/emotty.plugin.zsh
@@ -26,13 +26,14 @@ function emotty() {
# Use emotty set defined by user, fallback to default
local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]}
# Parse $TTY number, normalizing it to an emotty set index
- (( tty = (${TTY##/dev/ttys} % ${#${=emotty}}) + 1 ))
+ (( tty = (${TTY##/dev/tty} % ${#${=emotty}}) + 1 ))
local character_name=${${=emotty}[tty]}
echo "${emoji[${character_name}]}${emoji2[emoji_style]}"
}
function display_emotty() {
- local name=$1
+ local name=${1:-$emotty_set}
+ echo $name
for i in ${=_emotty_sets[$name]}; do
printf "${emoji[$i]}${emoji2[emoji_style]} "
done
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index c524bf8f5..34f8d8710 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -10,7 +10,7 @@ extract() {
Usage: extract [-option] [file ...]
Options:
- -r, --remove Remove archive.
+ -r, --remove Remove archive after unpacking.
EOF
fi
diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh
index 2c302f74d..45d10858f 100644
--- a/plugins/fasd/fasd.plugin.zsh
+++ b/plugins/fasd/fasd.plugin.zsh
@@ -6,6 +6,6 @@ if [ $commands[fasd] ]; then # check if fasd is installed
source "$fasd_cache"
unset fasd_cache
- alias v="f -e $EDITOR"
+ alias v="f -e \"$EDITOR\""
alias o='a -e open_command'
fi
diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md
deleted file mode 100644
index f384b0ffd..000000000
--- a/plugins/fedora/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a plugin based on yum plugin, but using dnf as main frontend
-(from Fedora 22 onwards, yum is deprecated in favor of dnf).
-
diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh
index eddc3627b..16a214313 100644..120000
--- a/plugins/fedora/fedora.plugin.zsh
+++ b/plugins/fedora/fedora.plugin.zsh
@@ -1,16 +1 @@
-## Aliases
-
-alias dnfs="dnf search" # search package
-alias dnfp="dnf info" # show package info
-alias dnfl="dnf list" # list packages
-alias dnfgl="dnf grouplist" # list package groups
-alias dnfli="dnf list installed" # print all installed packages
-alias dnfmc="dnf makecache" # rebuilds the dnf package list
-
-alias dnfu="sudo dnf upgrade" # upgrade packages
-alias dnfi="sudo dnf install" # install package
-alias dnfgi="sudo dnf groupinstall" # install package group
-alias dnfr="sudo dnf remove" # remove package
-alias dnfgr="sudo dnf groupremove" # remove pagage group
-alias dnfrl="sudo dnf remove --remove-leaves" # remove package and leaves
-alias dnfc="sudo dnf clean all" # clean cache
+../dnf/dnf.plugin.zsh \ No newline at end of file
diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
index bda050725..5f5e4aa73 100644
--- a/plugins/git-flow/git-flow.plugin.zsh
+++ b/plugins/git-flow/git-flow.plugin.zsh
@@ -35,6 +35,10 @@ alias gflrs='git flow release start'
alias gflff='git flow feature finish'
alias gflhf='git flow hotfix finish'
alias gflrf='git flow release finish'
+alias gflfp='git flow feature publish'
+alias gflhp='git flow hotfix publish'
+alias gflrp='git flow release publish'
+alias gflfpll='git flow feature pull'
_git-flow ()
{
diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py
index a8eb8284b..14d875973 100644
--- a/plugins/git-prompt/gitstatus.py
+++ b/plugins/git-prompt/gitstatus.py
@@ -41,7 +41,7 @@ ahead, behind = 0, 0
status = [(line[0], line[1], line[2:]) for line in stdout.decode('utf-8').splitlines()]
for st in status:
if st[0] == '#' and st[1] == '#':
- if re.search('Initial commit on', st[2]):
+ if re.search('Initial commit on', st[2]) or re.search('No commits yet on', st[2]):
branch = st[2].split(' ')[-1]
elif re.search('no branch', st[2]): # detached status
branch = get_tagname_or_hash()
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 178f1deb2..34598fb35 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -43,6 +43,8 @@ alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
+alias gau='git add --update'
+alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
@@ -84,6 +86,7 @@ alias gcs='git commit -S'
alias gd='git diff'
alias gdca='git diff --cached'
+alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
@@ -105,6 +108,10 @@ ggf() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force origin "${b:=$1}"
}
+ggfl() {
+[[ "$#" != 1 ]] && local b="$(git_current_branch)"
+git push --force-with-lease origin "${b:=$1}"
+}
compdef _git ggf=git-checkout
ggl() {
@@ -173,8 +180,10 @@ alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate'
-alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
-alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
+alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
+alias glod="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
+alias glods="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
+alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
@@ -185,6 +194,7 @@ alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
+alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
@@ -237,4 +247,4 @@ alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
-alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip--"'
+alias 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/github/_hub b/plugins/github/_hub
index 3a6493878..1833a9c09 100644
--- a/plugins/github/_hub
+++ b/plugins/github/_hub
@@ -89,6 +89,7 @@ __hub_setup_zsh_fns () {
browse:'browse the project on GitHub'
compare:'open GitHub compare view'
ci-status:'lookup commit in GitHub Status API'
+ sync:'update local branches from upstream'
)
_describe -t hub-commands 'hub command' hub_commands && ret=0
@@ -115,6 +116,7 @@ create
browse
compare
ci-status
+sync
EOF
__git_list_all_commands_without_hub
}
diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
index 0ab399c97..077f07bd4 100644
--- a/plugins/github/github.plugin.zsh
+++ b/plugins/github/github.plugin.zsh
@@ -1,8 +1,6 @@
# Set up hub wrapper for git, if it is available; http://github.com/github/hub
-if [ "$commands[(I)hub]" ]; then
- if hub --version &>/dev/null; then
- eval $(hub alias -s zsh)
- fi
+if (( $+commands[hub] )); then
+ alias git=hub
fi
# Functions #################################################################
diff --git a/plugins/gitignore/gitignore.plugin.zsh b/plugins/gitignore/gitignore.plugin.zsh
index ba1b38711..f242169e4 100644
--- a/plugins/gitignore/gitignore.plugin.zsh
+++ b/plugins/gitignore/gitignore.plugin.zsh
@@ -1,7 +1,7 @@
-function gi() { curl -sL https://www.gitignore.io/api/${(j:,:)@} }
+function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} }
_gitignoreio_get_command_list() {
- curl -sL https://www.gitignore.io/api/list | tr "," "\n"
+ curl -fL https://www.gitignore.io/api/list | tr "," "\n"
}
_gitignoreio () {
diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
index de95f7e6c..b66e25d7f 100644
--- a/plugins/gnu-utils/gnu-utils.plugin.zsh
+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
@@ -52,7 +52,7 @@ if [[ -x "${commands[gwhoami]}" ]]; then
#
# This method is inflexible since the aliases are at risk of being
- # overriden resulting in the BSD coreutils being called.
+ # overridden resulting in the BSD coreutils being called.
#
# (( ${+commands[$gcmd]} )) && \
# alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh
index 3e6a34f42..3e24c2527 100644
--- a/plugins/gpg-agent/gpg-agent.plugin.zsh
+++ b/plugins/gpg-agent/gpg-agent.plugin.zsh
@@ -1,41 +1,16 @@
-local GPG_ENV=$HOME/.gnupg/gpg-agent.env
+# Enable gpg-agent if it is not running-
+# --use-standard-socket will work from version 2 upwards
-function start_agent_nossh {
- eval $(/usr/bin/env gpg-agent --quiet --daemon --write-env-file ${GPG_ENV} 2> /dev/null)
- chmod 600 ${GPG_ENV}
- export GPG_AGENT_INFO
-}
+AGENT_SOCK=$(gpgconf --list-dirs | grep agent-socket | cut -d : -f 2)
-function start_agent_withssh {
- eval $(/usr/bin/env gpg-agent --quiet --daemon --enable-ssh-support --write-env-file ${GPG_ENV} 2> /dev/null)
- chmod 600 ${GPG_ENV}
- export GPG_AGENT_INFO
- export SSH_AUTH_SOCK
- export SSH_AGENT_PID
-}
-
-# check if another agent is running
-if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
- # source settings of old agent, if applicable
- if [ -f "${GPG_ENV}" ]; then
- . ${GPG_ENV} > /dev/null
- export GPG_AGENT_INFO
- export SSH_AUTH_SOCK
- export SSH_AGENT_PID
- fi
-
- # check again if another agent is running using the newly sourced settings
- if ! gpg-connect-agent --quiet /bye > /dev/null 2> /dev/null; then
- # check for existing ssh-agent
- if ssh-add -l > /dev/null 2> /dev/null; then
- # ssh-agent running, start gpg-agent without ssh support
- start_agent_nossh;
- else
- # otherwise start gpg-agent with ssh support
- start_agent_withssh;
- fi
- fi
+if [[ ! -S $AGENT_SOCK ]]; then
+ gpg-agent --daemon --use-standard-socket &>/dev/null
fi
+export GPG_TTY=$TTY
-GPG_TTY=$(tty)
-export GPG_TTY
+# Set SSH to use gpg-agent if it's enabled
+GNUPGCONFIG="${GNUPGHOME:-"$HOME/.gnupg"}/gpg-agent.conf"
+if [[ -r $GNUPGCONFIG ]] && command grep -q enable-ssh-support "$GNUPGCONFIG"; then
+ export SSH_AUTH_SOCK="$AGENT_SOCK.ssh"
+ unset SSH_AGENT_PID
+fi
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index b2015a351..c7047552d 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -24,29 +24,60 @@ function _gradle_core_commands() {
function _gradle_arguments() {
_arguments -C \
'-a[Do not rebuild project dependencies]' \
- '-h[Help]' \
- '-D[System property]' \
+ '-b[Specifies the build file]' \
+ '-c[Specifies the settings file]' \
'-d[Log at the debug level]' \
- '--gui[Launches the Gradle GUI app]' \
- '--stop[Stop the Gradle daemon]' \
- '--daemon[Use the Gradle daemon]' \
- '--no-daemon[Do not use the Gradle daemon]' \
- '--rerun-task [Specifies that any task optimization is ignored.]' \
- '-i[Log at the info level]' \
- '-m[Dry run]' \
- '-P[Set a project property]' \
- '-p[Specifies the start directory]' \
- '--profile[Profile the build time]' \
- '-q[Log at the quiet level (only show errors)]' \
- '-v[Print the Gradle version info]' \
+ '-g[Specifies the Gradle user home directory]' \
+ '-h[Shows a help message]' \
+ '-i[Set log level to INFO]' \
+ '-m[Runs the build with all task actions disabled]' \
+ '-p[Specifies the start directory for Gradle]' \
+ '-q[Log errors only]' \
+ '-s[Print out the stacktrace also for user exceptions]' \
+ '-t[Continuous mode. Automatically re-run build after changes]' \
+ '-u[Don''t search in parent directories for a settings.gradle file]' \
+ '-v[Prints Gradle version info]' \
'-x[Specify a task to be excluded]' \
- '-b[Specifies the build file.]' \
- '-c[Specifies the settings file.]' \
- '--continue[Continues task execution after a task failure.]' \
- '-g[Specifies the Gradle user home directory.]' \
- '-I[Specifies an initialization script.]' \
- '--refresh-dependencies[Refresh the state of dependencies.]' \
- '-u[Don''t search in parent directories for a settings.gradle file.]' \
+ '-D[Set a system property]' \
+ '-I[Specifies an initialization script]' \
+ '-P[Sets a project property of the root project]' \
+ '-S[Print out the full (very verbose) stacktrace]' \
+ '--build-file[Specifies the build file]' \
+ '--configure-on-demand[Only relevant projects are configured]' \
+ '--console[Type of console output to generate (plain, auto, or rich)]' \
+ '--continue[Continues task execution after a task failure]' \
+ '--continuous[Continuous mode. Automatically re-run build after changes]' \
+ '--daemon[Use the Gradle Daemon]' \
+ '--debug[Log at the debug level]' \
+ '--dry-run[Runs the build with all task actions disabled]' \
+ '--exclude-task[Specify a task to be excluded]' \
+ '--full-stacktrace[Print out the full (very verbose) stacktrace]' \
+ '--gradle-user-home[Specifies the Gradle user home directory]' \
+ '--gui[Launches the Gradle GUI app (Deprecated)]' \
+ '--help[Shows a help message]' \
+ '--include-build[Run the build as a composite, including the specified build]' \
+ '--info[Set log level to INFO]' \
+ '--init-script[Specifies an initialization script]' \
+ '--max-workers[Set the maximum number of workers that Gradle may use]' \
+ '--no-daemon[Do not use the Gradle Daemon]' \
+ '--no-rebuild[Do not rebuild project dependencies]' \
+ '--no-search-upwards[Don''t search in parent directories for a settings.gradle file]' \
+ '--offline[Build without accessing network resources]' \
+ '--parallel[Build projects in parallel]' \
+ '--profile[Profile build time and create report]' \
+ '--project-cache-dir[Specifies the project-specific cache directory]' \
+ '--project-dir[Specifies the start directory for Gradle]' \
+ '--project-prop[Sets a project property of the root project]' \
+ '--quiet[Log errors only]' \
+ '--recompile-scripts[Forces scripts to be recompiled, bypassing caching]' \
+ '--refresh-dependencies[Refresh the state of dependencies]' \
+ '--rerun-task[Specifies that any task optimization is ignored]' \
+ '--settings-file[Specifies the settings file]' \
+ '--stacktrace[Print out the stacktrace also for user exceptions]' \
+ '--status[Print Gradle Daemon status]' \
+ '--stop[Stop all Gradle Daemons]' \
+ '--system-prop[Set a system property]' \
+ '--version[Prints Gradle version info]' \
'*::command:->command' \
&& return 0
}
@@ -57,11 +88,11 @@ function _gradle_arguments() {
# and if so, regenerate the .gradle_tasks cache file
############################################################################
_gradle_does_task_list_need_generating () {
- [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache ]]
+ [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache || build.gradle.kts -nt .gradletasknamecache ]]
}
##############
-# Parse the tasks from `gradle(w) tasks --all` into .gradletasknamecache
+# Parse the tasks from `gradle(w) tasks --all` and return them to the calling function.
# All lines in the output from gradle(w) that are between /^-+$/ and /^\s*$/
# are considered to be tasks. If and when gradle adds support for listing tasks
# for programmatic parsing, this method can be deprecated.
@@ -76,7 +107,7 @@ _gradle_parse_tasks () {
task_name_buffer=""
elif [[ $line =~ ^\s*$ ]]; then
if [[ "$lines_might_be_tasks" = true ]]; then
- # If a newline is found, send the buffer to .gradletasknamecache
+ # If a newline is found, echo the buffer to the calling function
while read -r task; do
echo $task | awk '/[a-zA-Z0-9:-]+/ {print $1}'
done <<< "$task_name_buffer"
@@ -90,24 +121,43 @@ _gradle_parse_tasks () {
done <<< "$1"
}
+
+##############
+# Gradle tasks from subprojects are allowed to be executed without specifying
+# the subproject; that task will then be called on all subprojects.
+# gradle(w) tasks --all only lists tasks per subproject, but when autocompleting
+# we often want to be able to run a specific task on all subprojects, e.g.
+# "gradle clean".
+# This function uses the list of tasks from "gradle tasks --all", and for each
+# line grabs everything after the last ":" and combines that output with the original
+# output. The combined list is returned as the result of this function.
+##############
+_gradle_parse_and_extract_tasks () {
+ # All tasks
+ tasks=$(_gradle_parse_tasks "$1")
+ # Task name without sub project(s) prefix
+ simple_tasks=$(echo $tasks | awk 'BEGIN { FS = ":" } { print $NF }')
+ echo "$tasks\n$simple_tasks"
+}
+
##############################################################################
# Discover the gradle tasks by running "gradle tasks --all"
############################################################################
_gradle_tasks () {
- if [[ -f build.gradle ]]; then
+ if [[ -f build.gradle || -f build.gradle.kts ]]; then
_gradle_arguments
if _gradle_does_task_list_need_generating; then
- _gradle_parse_tasks "$(gradle tasks --all)" > .gradletasknamecache
+ _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache
fi
compadd -X "==== Gradle Tasks ====" $(cat .gradletasknamecache)
fi
}
_gradlew_tasks () {
- if [[ -f build.gradle ]]; then
+ if [[ -f build.gradle || -f build.gradle.kts ]]; then
_gradle_arguments
if _gradle_does_task_list_need_generating; then
- _gradle_parse_tasks "$(./gradlew tasks --all)" > .gradletasknamecache
+ _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache
fi
compadd -X "==== Gradlew Tasks ====" $(cat .gradletasknamecache)
fi
diff --git a/plugins/hanami/README.md b/plugins/hanami/README.md
new file mode 100644
index 000000000..ef3451faf
--- /dev/null
+++ b/plugins/hanami/README.md
@@ -0,0 +1,32 @@
+# Hanami Plugin #
+This plugin adds convenient ways to work with [Hanami](http://hanamirb.org/) via console.
+It's inspired by Rails plugin, so if you've used it, you'll feel like home.
+
+## Usage ##
+
+For example, type `hc` into your console when you're within Hanami project directory to run
+the application console. Have a look at available shortcuts below. You can read more about
+these commands [on the official website](http://hanamirb.org/guides/command-line/applications/).
+
+## Aliases ##
+
+| Alias | Command | Description |
+|-------|---------------------------|---------------------------------------------------------|
+| HED | HANAMI_ENV=development | Set environment variable HANAMI_ENV to development |
+| HEP | HANAMI_ENV=production | Set environment variable HANAMI_ENV to production |
+| HET | HANAMI_ENV=test | Set environment variable HANAMI_ENV to test |
+| hc | hanami console | Run application console |
+| hd | hanami destroy | Remove specified hanami resource |
+| hg | hanami generate | Create specified hanami resource |
+| hgm | hanami generate migration | Create migration file |
+| hs | hanami server | Launch server with hanami application |
+| hsp | hanami server -p | Launch server with specified port |
+| hr | hanami routes | List application routes |
+| hdc | hanami db create | Create application database |
+| hdd | hanami db drop | Delete application database |
+| hdp | hanami db prepare | Prepare database for the current environment |
+| hda | hanami db apply | Recreates a fresh schema after migrations (destructive) |
+| hdv | hanami db version | Print current database version |
+| hdrs | hdd && hdp | Drop and recreate application database |
+| hdtp | HET hdp | Actualize test environment database |
+| hrg | hr &#124; grep | Grep hanami routes with specified pattern |
diff --git a/plugins/hanami/hanami.plugin.zsh b/plugins/hanami/hanami.plugin.zsh
new file mode 100644
index 000000000..349c42cae
--- /dev/null
+++ b/plugins/hanami/hanami.plugin.zsh
@@ -0,0 +1,19 @@
+alias -g HED='HANAMI_ENV=development'
+alias -g HEP='HANAMI_ENV=production'
+alias -g HET='HANAMI_ENV=test'
+
+alias hc='hanami console'
+alias hd='hanami destroy'
+alias hg='hanami generate'
+alias hgm='hanami generate migration'
+alias hs='hanami server'
+alias hsp='hanami server -p'
+alias hr='hanami routes'
+alias hdc='hanami db create'
+alias hdd='hanami db drop'
+alias hdp='hanami db prepare'
+alias hda='hanami db apply'
+alias hdv='hanami db version'
+alias hdrs='hdd && hdp'
+alias hdtp='HET hdp'
+alias hrg='hr | grep'
diff --git a/plugins/helm/helm.plugin.zsh b/plugins/helm/helm.plugin.zsh
new file mode 100644
index 000000000..78499c15d
--- /dev/null
+++ b/plugins/helm/helm.plugin.zsh
@@ -0,0 +1,7 @@
+# Autocompletion for helm.
+#
+# Copy from kubectl : https://github.com/pstadler
+
+if [ $commands[helm] ]; then
+ source <(helm completion zsh)
+fi
diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
index fd72e530e..4122de237 100644
--- a/plugins/heroku/_heroku
+++ b/plugins/heroku/_heroku
@@ -31,6 +31,10 @@ _1st_arguments=(
"domains\:add":"add a custom domain to an app"
"domains\:remove":"remove a custom domain from an app"
"domains\:clear":"remove all custom domains from an app"
+ "features":"list available app features"
+ "features\:disable":"disables a feature"
+ "features\:enable":"enables an feature"
+ "features\:info":"displays additional information about feature"
"help":"list available commands or display help for a specific command"
"keys":"display keys for the current user"
"keys\:add":"add a key for the current user"
@@ -41,6 +45,18 @@ _1st_arguments=(
"logs\:drains":"manage syslog drains"
"maintenance\:on":"put the app into maintenance mode"
"maintenance\:off":"take the app out of maintenance mode"
+ "pipelines":"list pipelines you have access to"
+ "pipelines\:add":"add this app to a pipeline"
+ "pipelines\:create":"create a new pipeline"
+ "pipelines\:destroy":"destroy a pipeline"
+ "pipelines\:diff":"compares the latest release of this app to its downstream app(s)"
+ "pipelines\:info":"show list of apps in a pipeline"
+ "pipelines\:list":"list pipelines you have access to"
+ "pipelines\:open":"open a pipeline in dashboard"
+ "pipelines\:promote":"promote the latest release of this app to its downstream app(s)"
+ "pipelines\:remove":"remove this app from its pipeline"
+ "pipelines\:rename":"rename a pipeline"
+ "pipelines\:update":"update this app's stage in a pipeline"
"pg\:credentials":"display the DATABASE credentials"
"pg\:diagnose":"run diagnostics report on DATABASE"
"pg\:info":"display database information"
@@ -56,6 +72,7 @@ _1st_arguments=(
"pg\:unfollow":"stop a replica from following and make it a read/write database"
"pg\:upgrade":"unfollow a database and upgrade it to the latest PostgreSQL version"
"pg\:wait":"monitor database creation, exit when complete"
+ "pg\:backups":"Interact with built-in backups"
"pgbackups":"list captured backups"
"pgbackups\:url":"get a temporary URL for a backup"
"pgbackups\:capture":"capture a backup from a database id"
@@ -127,6 +144,41 @@ case "$words[1]" in
'(-t|--tail)'{-t,--tail}'[continually stream logs]' \
)
;;
+ pipelines)
+ _command_args=(
+ '(--json)'--json'[output in json format]' \
+ )
+ ;;
+ pipelines:add)
+ _command_args=(
+ '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
+ )
+ ;;
+ pipelines:create)
+ _command_args=(
+ '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
+ )
+ ;;
+ pipelines:info)
+ _command_args=(
+ '(--json)'--json'[output in json format]' \
+ )
+ ;;
+ pipelines:list)
+ _command_args=(
+ '(--json)'--json'[output in json format]' \
+ )
+ ;;
+ pipelines:promote)
+ _command_args=(
+ '(-t|--to)'{-t,--to}'[comma separated list of apps to promote to]' \
+ )
+ ;;
+ pipelines:update)
+ _command_args=(
+ '(-s|--stage)'{-s,--stage}'[stage of first app in pipeline]' \
+ )
+ ;;
pgbackups:capture)
_command_args=(
'(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
@@ -144,5 +196,4 @@ _arguments \
'(--app)--app[the app name]' \
'(--remote)--remote[the remote name]' \
'(--help)--help[help about the current command]' \
- && return 0
-
+ && return 0
diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh
index ad316acc8..3b8afd317 100644
--- a/plugins/history-substring-search/history-substring-search.zsh
+++ b/plugins/history-substring-search/history-substring-search.zsh
@@ -244,7 +244,7 @@ _history-substring-search-end() {
_history_substring_search_result=$BUFFER
- # the search was succesful so display the result properly by clearing away
+ # the search was successful so display the result properly by clearing away
# existing highlights and moving the cursor to the end of the result buffer
if [[ $_history_substring_search_refresh_display -eq 1 ]]; then
region_highlight=()
diff --git a/plugins/iterm2/iterm2.plugin.zsh b/plugins/iterm2/iterm2.plugin.zsh
new file mode 100644
index 000000000..e4ac72ee3
--- /dev/null
+++ b/plugins/iterm2/iterm2.plugin.zsh
@@ -0,0 +1,68 @@
+#####################################################
+# iTerm2 plugin for oh-my-zsh #
+# Author: Aviv Rosenberg (github.com/avivrosenberg) #
+#####################################################
+
+###
+# This plugin is only relevant if the terminal is iTerm2 on OSX.
+if [[ "$OSTYPE" == darwin* ]] && [[ -n "$ITERM_SESSION_ID" ]] ; then
+
+ ###
+ # Executes an arbitrary iTerm2 command via an escape code sequce.
+ # See https://iterm2.com/documentation-escape-codes.html for all supported commands.
+ # Example: $ _iterm2_command "1337;StealFocus"
+ function _iterm2_command() {
+ local cmd="$1"
+
+ # Escape codes for wrapping commands for iTerm2.
+ local iterm2_prefix="\x1B]"
+ local iterm2_suffix="\x07"
+
+ # If we're in tmux, a special escape code must be prepended/appended so that
+ # the iTerm2 escape code is passed on into iTerm2.
+ if [[ -n $TMUX ]]; then
+ local tmux_prefix="\x1BPtmux;\x1B"
+ local tmux_suffix="\x1B\\"
+ fi
+
+ echo -n "${tmux_prefix}${iterm2_prefix}${cmd}${iterm2_suffix}${tmux_suffix}"
+ }
+
+ ###
+ # iterm2_profile(): Function for changing the current terminal window's
+ # profile (colors, fonts, settings, etc).
+ # To change the current iTerm2 profile, call this function and pass in a name
+ # of another existing iTerm2 profile (name can contain spaces).
+ function iterm2_profile() {
+ # Desired name of profile
+ local profile="$1"
+
+ # iTerm2 command for changing profile
+ local cmd="1337;SetProfile=$profile"
+
+ # send the sequence
+ _iterm2_command "${cmd}"
+
+ # update shell variable
+ ITERM_PROFILE="$profile"
+ }
+
+ ###
+ # iterm2_tab_color(): Changes the color of iTerm2's currently active tab.
+ # Usage: iterm2_tab_color <red> <green> <blue>
+ # where red/green/blue are on the range 0-255.
+ function iterm2_tab_color() {
+ _iterm2_command "6;1;bg;red;brightness;$1"
+ _iterm2_command "6;1;bg;green;brightness;$2"
+ _iterm2_command "6;1;bg;blue;brightness;$3"
+ }
+
+
+ ###
+ # iterm2_tab_color_reset(): Resets the color of iTerm2's current tab back to
+ # default.
+ function iterm2_tab_color_reset() {
+ _iterm2_command "6;1;bg;*;default"
+ }
+
+fi
diff --git a/plugins/jira/README.md b/plugins/jira/README.md
index efb8a743a..a934ae68c 100644
--- a/plugins/jira/README.md
+++ b/plugins/jira/README.md
@@ -21,6 +21,7 @@ jira new # opens a new issue
jira dashboard # opens your JIRA dashboard
jira reported [username] # queries for issues reported by a user
jira assigned [username] # queries for issues assigned to a user
+jira branch # opens an existing issue matching the current branch name
jira ABC-123 # opens an existing issue
jira ABC-123 m # opens an existing issue for adding a comment
```
diff --git a/plugins/jira/_jira b/plugins/jira/_jira
index 03fe6a499..d64614233 100644
--- a/plugins/jira/_jira
+++ b/plugins/jira/_jira
@@ -7,6 +7,7 @@ _1st_arguments=(
'dashboard:open the dashboard'
'reported:search for issues reported by a user'
'assigned:search for issues assigned to a user'
+ 'branch:open the issue named after the git branch of the current directory'
'dumpconfig:display effective jira configuration'
)
diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh
index 67c989457..052481a60 100644
--- a/plugins/jira/jira.plugin.zsh
+++ b/plugins/jira/jira.plugin.zsh
@@ -2,13 +2,21 @@
#
# See README.md for details
-: ${JIRA_DEFAULT_ACTION:=new}
-
function jira() {
emulate -L zsh
- local action=${1:=$JIRA_DEFAULT_ACTION}
+ local action jira_url jira_prefix
+ if [[ -n "$1" ]]; then
+ action=$1
+ elif [[ -f .jira-default-action ]]; then
+ action=$(cat .jira-default-action)
+ elif [[ -f ~/.jira-default-action ]]; then
+ action=$(cat ~/.jira-default-action)
+ elif [[ -n "${JIRA_DEFAULT_ACTION}" ]]; then
+ action=${JIRA_DEFAULT_ACTION}
+ else
+ action="new"
+ fi
- local jira_url jira_prefix
if [[ -f .jira-url ]]; then
jira_url=$(cat .jira-url)
elif [[ -f ~/.jira-url ]]; then
@@ -51,8 +59,14 @@ function jira() {
echo "JIRA_DEFAULT_ACTION=$JIRA_DEFAULT_ACTION"
else
# Anything that doesn't match a special action is considered an issue name
- local issue_arg=$action
- local issue="${jira_prefix}${issue_arg}"
+ # but `branch` is a special case that will parse the current git branch
+ if [[ "$action" == "branch" ]]; then
+ local issue_arg=$(git rev-parse --abbrev-ref HEAD)
+ local issue="${jira_prefix}${issue_arg}"
+ else
+ local issue_arg=$action
+ local issue="${jira_prefix}${issue_arg}"
+ fi
local url_fragment=''
if [[ "$2" == "m" ]]; then
url_fragment="#add-comment"
diff --git a/plugins/kops/kops.plugin.zsh b/plugins/kops/kops.plugin.zsh
new file mode 100644
index 000000000..f707f3aff
--- /dev/null
+++ b/plugins/kops/kops.plugin.zsh
@@ -0,0 +1,9 @@
+# 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/kube-ps1/README.md b/plugins/kube-ps1/README.md
new file mode 100644
index 000000000..a572773a3
--- /dev/null
+++ b/plugins/kube-ps1/README.md
@@ -0,0 +1,76 @@
+Kubernetes prompt for zsh
+=========================
+
+A Kubernetes (k8s) zsh prompt that displays the current cluster cluster
+and the namespace.
+
+Inspired by several tools used to simplify usage of kubectl
+
+NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) designed for bash
+as well as zsh.
+
+## Requirements
+
+The default prompt assumes you have the kubectl command line utility installed. It
+can be obtained here:
+
+[Install and Set up kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
+
+If using this with OpenShift, the oc tool needs installed. It can be obtained from here:
+
+[OC Client Tools](https://www.openshift.org/download.html)
+
+## Helper utilities
+
+There are several great tools that make using kubectl very enjoyable.
+
+[kubectx and kubenx](https://github.com/ahmetb/kubectx) are great for
+fast switching between clusters and namespaces.
+
+## Prompt Structure
+
+The prompt layout is:
+
+```
+(<logo>|<cluster>:<namespace>)
+```
+
+Supported platforms:
+* k8s - Kubernetes
+* ocp - OpenShift
+
+## Install
+
+1. Clone this repository
+2. Source the kube-ps1.zsh in your ~./.zshrc
+
+ZSH:
+```
+source path/kube-ps1.sh
+PROMPT='$(kube_ps1) '
+```
+
+## Colors
+
+The colors are of my opinion. Blue was used as the prefix to match the Kubernetes
+color as closely as possible. Red was chosen as the cluster name to stand out, and cyan
+for the namespace. These can of course be changed.
+
+## Customization
+
+The default settings can be overridden in ~/.zshrc
+
+| Variable | Default | Meaning |
+| :------- | :-----: | ------- |
+| `KUBE_PS1_DEFAULT` | `true` | Default settings for the prompt |
+| `KUBE_PS1_PREFIX` | `(` | Prompt opening character |
+| `KUBE_PS1_DEFAULT_LABEL` | `⎈ ` | Default prompt symbol |
+| `KUBE_PS1_SEPERATOR` | `\|` | Separator between symbol and cluster name |
+| `KUBE_PS1_PLATFORM` | `kubectl` | Cluster type and binary to use |
+| `KUBE_PS1_DIVIDER` | `:` | Separator between cluster and namespace |
+| `KUBE_PS1_SUFFIX` | `)` | Prompt closing character |
+| `KUBE_PS1_DEFAULT_LABEL_IMG` | `false` | Use Kubernetes img as the label: ☸️ |
+
+## Contributors
+
+Jared Yanovich
diff --git a/plugins/kube-ps1/kube-ps1.zsh b/plugins/kube-ps1/kube-ps1.zsh
new file mode 100644
index 000000000..e1cb4339d
--- /dev/null
+++ b/plugins/kube-ps1/kube-ps1.zsh
@@ -0,0 +1,123 @@
+#!/bin/zsh
+
+# Kubernetes prompt helper for bash/zsh
+# Displays current context and namespace
+
+# Copyright 2017 Jon Mosco
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Debug
+[[ -n $DEBUG ]] && set -x
+
+setopt PROMPT_SUBST
+add-zsh-hook precmd _kube_ps1_load
+zmodload zsh/stat
+
+# Default values for the prompt
+# Override these values in ~/.zshrc or ~/.bashrc
+KUBE_PS1_DEFAULT="${KUBE_PS1_DEFAULT:=true}"
+KUBE_PS1_PREFIX="("
+KUBE_PS1_DEFAULT_LABEL="${KUBE_PS1_DEFAULT_LABEL:="⎈ "}"
+KUBE_PS1_DEFAULT_LABEL_IMG="${KUBE_PS1_DEFAULT_LABEL_IMG:=false}"
+KUBE_PS1_SEPERATOR="|"
+KUBE_PS1_PLATFORM="${KUBE_PS1_PLATFORM:="kubectl"}"
+KUBE_PS1_DIVIDER=":"
+KUBE_PS1_SUFFIX=")"
+KUBE_PS1_UNAME=$(uname)
+KUBE_PS1_LAST_TIME=0
+
+kube_ps1_label () {
+
+ [[ "${KUBE_PS1_DEFAULT_LABEL_IMG}" == false ]] && return
+
+ if [[ "${KUBE_PS1_DEFAULT_LABEL_IMG}" == true ]]; then
+ local KUBE_LABEL="☸️ "
+ fi
+
+ KUBE_PS1_DEFAULT_LABEL="${KUBE_LABEL}"
+
+}
+
+_kube_ps1_split() {
+ type setopt >/dev/null 2>&1 && setopt SH_WORD_SPLIT
+ local IFS=$1
+ echo $2
+}
+
+_kube_ps1_file_newer_than() {
+
+ local mtime
+ local file=$1
+ local check_time=$2
+ mtime=$(stat +mtime "${file}")
+
+ [ "${mtime}" -gt "${check_time}" ]
+
+}
+
+_kube_ps1_load() {
+ # kubectl will read the environment variable $KUBECONFIG
+ # otherwise set it to ~/.kube/config
+ KUBECONFIG="${KUBECONFIG:=$HOME/.kube/config}"
+
+ for conf in $(_kube_ps1_split : "${KUBECONFIG}"); do
+ # TODO: check existence of $conf
+ if _kube_ps1_file_newer_than "${conf}" "${KUBE_PS1_LAST_TIME}"; then
+ _kube_ps1_get_context_ns
+ return
+ fi
+ done
+}
+
+_kube_ps1_get_context_ns() {
+
+ # Set the command time
+ KUBE_PS1_LAST_TIME=$(date +%s)
+
+ if [[ "${KUBE_PS1_DEFAULT}" == true ]]; then
+ local KUBE_BINARY="${KUBE_PS1_PLATFORM}"
+ elif [[ "${KUBE_PS1_DEFAULT}" == false ]] && [[ "${KUBE_PS1_PLATFORM}" == "kubectl" ]];then
+ local KUBE_BINARY="kubectl"
+ elif [[ "${KUBE_PS1_PLATFORM}" == "oc" ]]; then
+ local KUBE_BINARY="oc"
+ fi
+
+ KUBE_PS1_CONTEXT="$(${KUBE_BINARY} config current-context)"
+ KUBE_PS1_NAMESPACE="$(${KUBE_BINARY} config view --minify --output 'jsonpath={..namespace}')"
+ # Set namespace to default if it is not defined
+ KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-default}"
+
+}
+
+# source our symbol
+kube_ps1_label
+
+# Build our prompt
+kube_ps1 () {
+ local reset_color="%f"
+ local blue="%F{blue}"
+ local red="%F{red}"
+ local cyan="%F{cyan}"
+
+ KUBE_PS1="${reset_color}$KUBE_PS1_PREFIX"
+ KUBE_PS1+="${blue}$KUBE_PS1_DEFAULT_LABEL"
+ KUBE_PS1+="${reset_color}$KUBE_PS1_SEPERATOR"
+ KUBE_PS1+="${red}$KUBE_PS1_CONTEXT${reset_color}"
+ KUBE_PS1+="$KUBE_PS1_DIVIDER"
+ KUBE_PS1+="${cyan}$KUBE_PS1_NAMESPACE${reset_color}"
+ KUBE_PS1+="$KUBE_PS1_SUFFIX"
+
+ echo "${KUBE_PS1}"
+
+}
diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh
index 51ae142a2..ec1321d8b 100644
--- a/plugins/kubectl/kubectl.plugin.zsh
+++ b/plugins/kubectl/kubectl.plugin.zsh
@@ -5,3 +5,58 @@
if [ $commands[kubectl] ]; then
source <(kubectl completion zsh)
fi
+
+# This command is used ALOT both below and in daily life
+alias k=kubectl
+
+# Apply a YML file
+alias kaf='k apply -f'
+
+# Drop into an interactive terminal on a container
+alias keti='k exec -ti'
+
+# Manage configuration quickly to switch contexts between local, dev ad staging.
+alias kcuc='k config use-context'
+alias kcsc='k config set-context'
+alias kcdc='k config delete-context'
+alias kccc='k config current-context'
+
+# Pod management.
+alias kgp='k get pods'
+alias kep='k edit pods'
+alias kdp='k describe pods'
+alias kdelp='k delete pods'
+
+# Service management.
+alias kgs='k get svc'
+alias kes='k edit svc'
+alias kds='k describe svc'
+alias kdels='k delete svc'
+
+# Ingress management
+alias kgi='k get ingress'
+alias kei='k edit ingress'
+alias kdi='k describe ingress'
+alias kdeli='k delete ingress'
+
+# Secret management
+alias kgsec='k get secret'
+alias kdsec='k describe secret'
+alias kdelsec='k delete secret'
+
+# Deployment management.
+alias kgd='k get deployment'
+alias ked='k edit deployment'
+alias kdd='k describe deployment'
+alias kdeld='k delete deployment'
+alias ksd='k scale deployment'
+alias krsd='k rollout status deployment'
+
+# Rollout management.
+alias kgrs='k get rs'
+alias krh='k rollout history'
+alias kru='k rollout undo'
+
+# Logs
+alias kl='k logs'
+alias klf='k logs -f'
diff --git a/plugins/laravel5/laravel5.plugin.zsh b/plugins/laravel5/laravel5.plugin.zsh
index 38454f40d..487a0742b 100644
--- a/plugins/laravel5/laravel5.plugin.zsh
+++ b/plugins/laravel5/laravel5.plugin.zsh
@@ -1,6 +1,6 @@
# Laravel5 basic command completion
_laravel5_get_command_list () {
- php artisan --no-ansi | sed "1,/Available commands/d" | awk '/^ +[a-z]+/ { print $1 }'
+ php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"
}
_laravel5 () {
diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh
index e882b288f..53bb19e46 100644
--- a/plugins/last-working-dir/last-working-dir.plugin.zsh
+++ b/plugins/last-working-dir/last-working-dir.plugin.zsh
@@ -4,8 +4,10 @@ typeset -g ZSH_LAST_WORKING_DIRECTORY
# Updates the last directory once directory is changed
chpwd_functions+=(chpwd_last_working_dir)
chpwd_last_working_dir() {
- local cache_file="$ZSH_CACHE_DIR/last-working-dir"
- pwd >| "$cache_file"
+ if [ "$ZSH_SUBSHELL" = 0 ]; then
+ local cache_file="$ZSH_CACHE_DIR/last-working-dir"
+ pwd >| "$cache_file"
+ fi
}
# Changes directory to the last working directory
diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
index 1b32ec2e4..e9a62a863 100644
--- a/plugins/lol/lol.plugin.zsh
+++ b/plugins/lol/lol.plugin.zsh
@@ -45,6 +45,7 @@ alias bringz='git pull'
alias chicken='git add'
alias oanward='git commit -m'
alias ooanward='git commit -am'
+alias yolo='git commit -m "$(curl -s whatthecommit.com/index.txt)"'
alias letcat='git checkout'
alias violenz='git rebase'
diff --git a/plugins/minikube/minikube.plugin.zsh b/plugins/minikube/minikube.plugin.zsh
new file mode 100644
index 000000000..d8ebe79af
--- /dev/null
+++ b/plugins/minikube/minikube.plugin.zsh
@@ -0,0 +1,6 @@
+# Autocompletion for Minikube.
+#
+
+if [ $commands[minikube] ]; then
+ source <(minikube completion zsh)
+fi
diff --git a/plugins/mix-fast/mix-fast.plugin.zsh b/plugins/mix-fast/mix-fast.plugin.zsh
index 3719c3525..e27e30d64 100644
--- a/plugins/mix-fast/mix-fast.plugin.zsh
+++ b/plugins/mix-fast/mix-fast.plugin.zsh
@@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () {
}
_mix_generate () {
- mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
+ mix help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
}
_mix () {
diff --git a/plugins/mix/_mix b/plugins/mix/_mix
index 57fdf808a..ecbe7e2d3 100644
--- a/plugins/mix/_mix
+++ b/plugins/mix/_mix
@@ -21,6 +21,15 @@ _1st_arguments=(
'deps.unlock:Unlock the given dependencies'
'deps.update:Update the given dependencies'
'do:Executes the tasks separated by comma'
+ 'ecto.create:Create Ecto database'
+ 'ecto.drop:Drop the storage for the given repository'
+ 'ecto.dump:Dumps the current environment’s database structure'
+ 'ecto.gen.migration:Generates a migration'
+ 'ecto.gen.repo:Generates a new repository'
+ 'ecto.load:Loads the current environment’s database structure'
+ 'ecto.migrate:Runs Ecto migration'
+ 'ecto.migrations:Displays the up / down migration status'
+ 'ecto.rollback:Reverts applied migrations'
'escript.build:Builds an escript for the project'
'help:Print help information for tasks'
'hex:Print hex help information'
@@ -36,6 +45,8 @@ _1st_arguments=(
'loadconfig:Loads and persists the given configuration'
'local:List local tasks'
'local.hex:Install hex locally'
+ 'local.phoenix:Updates Phoenix locally'
+ 'local.phx:Updates the Phoenix project generator locally'
'local.rebar:Install rebar locally'
'new:Create a new Elixir project'
'phoenix.digest:Digests and compress static files'
@@ -44,9 +55,24 @@ _1st_arguments=(
'phoenix.gen.json:Generates a controller and model for a JSON based resource'
'phoenix.gen.model:Generates an Ecto model'
'phoenix.gen.secret:Generates a secret'
- 'phoenix.new:Create a new Phoenix application'
+ 'phoenix.new:Creates a new Phoenix v1.2.1 application'
'phoenix.routes:Prints all routes'
'phoenix.server:Starts applications and their servers'
+ 'phx.digest:Digests and compresses static files'
+ 'phx.digest.clean:Removes old versions of static assets.'
+ 'phx.gen.channel:Generates a Phoenix channel'
+ 'phx.gen.context:Generates a context with functions around an Ecto schema'
+ 'phx.gen.embedded:Generates an embedded Ecto schema file'
+ 'phx.gen.html:Generates controller, views, and context for an HTML resource'
+ 'phx.gen.json:Generates controller, views, and context for a JSON resource'
+ 'phx.gen.presence:Generates a Presence tracker'
+ 'phx.gen.schema:Generates an Ecto schema and migration file'
+ 'phx.gen.secret:Generates a secret'
+ 'phx.new:Creates a new Phoenix v1.3.0 application'
+ 'phx.new.ecto:Creates a new Ecto project within an umbrella project'
+ 'phx.new.web:Creates a new Phoenix web project within an umbrella project'
+ 'phx.routes:Prints all routes'
+ 'phx.server:Starts applications and their servers'
'run:Run the given file or expression'
"test:Run a project's tests"
'--help:Describe available tasks'
@@ -58,7 +84,7 @@ __task_list ()
local expl
declare -a tasks
- tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server run test)
+ tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test)
_wanted tasks expl 'help' compadd $tasks
}
@@ -86,6 +112,9 @@ case $state in
(test)
_files
;;
+ (run)
+ _files
+ ;;
esac
;;
esac
diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md
index ffc5f6832..986ac84a4 100644
--- a/plugins/mvn/README.md
+++ b/plugins/mvn/README.md
@@ -17,6 +17,7 @@ plugins=(... mvn)
| `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` |
diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
index 04bd186af..ee6fe2770 100644
--- a/plugins/mvn/mvn.plugin.zsh
+++ b/plugins/mvn/mvn.plugin.zsh
@@ -1,43 +1,42 @@
# 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`
+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)
+
-
# Wrapper function for Maven's mvn command.
-mvn-color()
-{
+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" \
+ 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}
- )
+ echo -ne "${RESET_FORMATTING}"
+ )
}
-
+
# Override the mvn command with the colorized one.
#alias mvn="mvn-color"
@@ -48,6 +47,7 @@ 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'
@@ -65,30 +65,30 @@ alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
function listMavenCompletions {
- reply=(
+ reply=(
# common lifecycle
clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
-
+
# 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
-
+
# deploy
deploy:deploy-file
# failsafe
failsafe:integration-test failsafe:verify
# install
- install:install-file
+ install:install-file install:help
# site
- site:site site:deploy site:run site:stage site:stage-deploy
+ site:site site:deploy site:run site:stage site:stage-deploy site:attach-descriptor site:jar site:effective-site
# surefire
surefire:test
-
+
# checkstyle
- checkstyle:checkstyle checkstyle:check
+ checkstyle:checkstyle checkstyle:check checkstyle:checkstyle-aggregate
# javadoc
- javadoc:javadoc javadoc:jar javadoc:aggregate
+ 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:jxr jxr:aggregate jxr:test-jxr jxr:test-aggregate
# pmd
pmd:pmd pmd:cpd pmd:check pmd:cpd-check
@@ -101,27 +101,27 @@ function listMavenCompletions {
# assembly
assembly:single assembly:assembly
# dependency
- dependency:analyze dependency:analyze-dep-mgt dependency:analyze-only dependency:analyze-report dependency:build-classpath dependency:copy dependency:copy-dependencies dependency:get dependency:go-offline dependency:list dependency:purge-local-repository dependency:resolve dependency:resolve-plugins dependency:sources dependency:tree dependency:unpack dependency:unpack-dependencies
+ 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: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: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
+ 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:aggregate source:jar source:jar-no-fork source:test-jar source:test-jar-no-fork
+
# eclipse
eclipse:clean eclipse:eclipse
# idea
idea:clean idea:idea
-
+
# jetty
jetty:run jetty:run-exploded
# cargo
@@ -134,7 +134,7 @@ function listMavenCompletions {
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
tomee:run tomee:run-war tomee:run-war-only tomee:stop tomee:deploy tomee:undeploy
# spring-boot
spring-boot:run spring-boot:repackage
@@ -143,7 +143,7 @@ function listMavenCompletions {
# 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:checkin scm:checkout scm:update scm:status
+ 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
@@ -172,18 +172,104 @@ function listMavenCompletions {
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=
+ "-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 -amd -B -C -c -cpu -D -e -emp -ep -f -fae -ff -fn -gs -h -l -N -npr -npu -nsu -o -P -pl -q -rf -s -T -t -U -up -V -v -X
+ -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`
+ -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)
);
}
diff --git a/plugins/node/node.plugin.zsh b/plugins/node/node.plugin.zsh
index e2f18a032..e196662c7 100644
--- a/plugins/node/node.plugin.zsh
+++ b/plugins/node/node.plugin.zsh
@@ -2,5 +2,5 @@
# TODO: Make the section part easier to use.
function node-docs {
local section=${1:-all}
- open_command "http://nodejs.org/docs/$(node --version)/api/$section.html"
+ open_command "https://nodejs.org/docs/$(node --version)/api/$section.html"
}
diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
index 43aedc36d..43af35ddb 100644
--- a/plugins/npm/npm.plugin.zsh
+++ b/plugins/npm/npm.plugin.zsh
@@ -38,9 +38,20 @@ alias npmV="npm -v"
# List packages
alias npmL="npm list"
+# List top-level installed packages
+alias npmL0="npm ls --depth=0"
+
# Run npm start
alias npmst="npm start"
# Run npm test
alias npmt="npm test"
+# Run npm scripts
+alias npmR="npm run"
+
+# Run npm publish
+alias npmP="npm publish"
+
+# Run npm init
+alias npmI="npm init"
diff --git a/plugins/npx/README.md b/plugins/npx/README.md
new file mode 100644
index 000000000..2c94e4515
--- /dev/null
+++ b/plugins/npx/README.md
@@ -0,0 +1,17 @@
+# NPX Plugin
+> npx(1) -- execute npm package binaries. ([more info](https://github.com/zkat/npx))
+
+This plugin automatically registers npx command-not-found handler if `npx` exists in your `$PATH`.
+
+## Setup
+
+- Add plugin to `~/.zshrc`
+
+```bash
+plugins=(.... npx)
+```
+
+- Globally install npx binary (you need node.js installed too!)
+```bash
+sudo npm install -g npx
+``` \ No newline at end of file
diff --git a/plugins/npx/npx.plugin.zsh b/plugins/npx/npx.plugin.zsh
new file mode 100644
index 000000000..32bb67377
--- /dev/null
+++ b/plugins/npx/npx.plugin.zsh
@@ -0,0 +1,7 @@
+# NPX Plugin
+# https://www.npmjs.com/package/npx
+# Maintainer: Pooya Parsa <pooya@pi0.ir>
+
+(( $+commands[npx] )) && {
+ source <(npx --shell-auto-fallback zsh)
+}
diff --git a/plugins/oc/oc.plugin.zsh b/plugins/oc/oc.plugin.zsh
new file mode 100644
index 000000000..b968c4bd4
--- /dev/null
+++ b/plugins/oc/oc.plugin.zsh
@@ -0,0 +1,7 @@
+# Autocompletion for oc, the command line interface for OpenShift
+#
+# Author: https://github.com/kevinkirkup
+
+if [ $commands[oc] ]; then
+ source <(oc completion zsh)
+fi
diff --git a/plugins/osx/README.md b/plugins/osx/README.md
index b77daecc5..d3a8f94df 100644
--- a/plugins/osx/README.md
+++ b/plugins/osx/README.md
@@ -12,6 +12,33 @@ plugins=(... osx)
Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
+## Acknowledgements
+
+This application makes use of the following third party scripts:
+
+[shpotify](https://github.com/hnarayanan/shpotify)
+
+Copyright (c) 2012–2017 [Harish Narayanan](https://harishnarayanan.org/).
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
## Commands
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index d7baa1191..b7d6aca72 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -184,6 +184,7 @@ function vncviewer() {
# iTunes control function
function itunes() {
local opt=$1
+ local playlist=$2
shift
case "$opt" in
launch|play|pause|stop|rewind|resume|quit)
@@ -200,6 +201,19 @@ function itunes() {
vol)
opt="set sound volume to $1" #$1 Due to the shift
;;
+ playlist)
+ # Inspired by: https://gist.github.com/nakajijapan/ac8b45371064ae98ea7f
+if [[ ! -z "$playlist" ]]; then
+ osascript -e 'tell application "iTunes"' -e "set new_playlist to \"$playlist\" as string" -e "play playlist new_playlist" -e "end tell" 2>/dev/null;
+ if [[ $? -eq 0 ]]; then
+ opt="play"
+ else
+ opt="stop"
+ fi
+ else
+ opt="set allPlaylists to (get name of every playlist)"
+ fi
+ ;;
playing|status)
local state=`osascript -e 'tell application "iTunes" to player state as string'`
if [[ "$state" = "playing" ]]; then
@@ -250,6 +264,7 @@ EOF
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
echo "\tvol\tSet the volume, takes an argument from 0 to 100"
echo "\tplaying|status\tShow what song is currently playing in iTunes."
+ echo "\tplaylist [playlist name]\t Play specific playlist"
echo "\thelp\tshow this message and exit"
return 0
;;
@@ -262,268 +277,7 @@ EOF
}
# Spotify control function
-function spotify() {
-
- showHelp () {
- echo "Usage:";
- echo;
- echo " $(basename "$0") <command>";
- echo;
- echo "Commands:";
- echo;
- echo " play # Resumes playback where Spotify last left off.";
- echo " play [song name] # Finds a song by name and plays it.";
- echo " play album [album name] # Finds an album by name and plays it.";
- echo " play artist [artist name] # Finds an artist by name and plays it.";
- echo " play list [playlist name] # Finds a playlist by name and plays it.";
- echo " pause # Pauses Spotify playback.";
- echo " next # Skips to the next song in a playlist.";
- echo " prev # Returns to the previous song in a playlist.";
- echo " pos [time] # Jumps to a time (in secs) in the current song.";
- echo " quit # Stops playback and quits Spotify.";
- echo;
- echo " vol up # Increases the volume by 10%.";
- echo " vol down # Decreases the volume by 10%.";
- echo " vol [amount] # Sets the volume to an amount between 0 and 100.";
- echo " vol show # Shows the current Spotify volume.";
- echo;
- echo " status # Shows the current player status.";
- echo " share # Copies the current song URL to the clipboard."
- echo " info # Shows Full Information about song that is playing.";
- echo;
- echo " toggle shuffle # Toggles shuffle playback mode.";
- echo " toggle repeat # Toggles repeat playback mode.";
- }
-
- cecho(){
- bold=$(tput bold);
- green=$(tput setaf 2);
- reset=$(tput sgr0);
- echo "$bold$green$1$reset";
- }
-
- showStatus () {
- state=$(osascript -e 'tell application "Spotify" to player state as string');
- cecho "Spotify is currently $state.";
- if [ "$state" = "playing" ]; then
- artist=$(osascript -e 'tell application "Spotify" to artist of current track as string');
- album=$(osascript -e 'tell application "Spotify" to album of current track as string');
- track=$(osascript -e 'tell application "Spotify" to name of current track as string');
- duration=$(osascript -e 'tell application "Spotify" to duration of current track as string');
- duration=$(echo "scale=2; $duration / 60 / 1000" | bc);
- position=$(osascript -e 'tell application "Spotify" to player position as string' | tr ',' '.');
- position=$(echo "scale=2; $position / 60" | bc | awk '{printf "%0.2f", $0}');
-
- printf "$reset""Artist: %s\nAlbum: %s\nTrack: %s \nPosition: %s / %s\n" "$artist" "$album" "$track" "$position" "$duration";
- fi
- }
-
-
-
- if [ $# = 0 ]; then
- showHelp;
- else
- if [ "$(osascript -e 'application "Spotify" is running')" = "false" ]; then
- osascript -e 'tell application "Spotify" to activate'
- sleep 2
- fi
- fi
-
- while [ $# -gt 0 ]; do
- arg=$1;
-
- case $arg in
- "play" )
- if [ $# != 1 ]; then
- # There are additional arguments, so find out how many
- array=( $@ );
- len=${#array[@]};
- SPOTIFY_SEARCH_API="https://api.spotify.com/v1/search"
- SPOTIFY_PLAY_URI="";
-
- searchAndPlay() {
- type="$1"
- Q="$2"
-
- cecho "Searching ${type}s for: $Q";
-
- SPOTIFY_PLAY_URI=$( \
- curl -s -G $SPOTIFY_SEARCH_API --data-urlencode "q=$Q" -d "type=$type&limit=1&offset=0" -H "Accept: application/json" \
- | grep -E -o "spotify:$type:[a-zA-Z0-9]+" -m 1
- )
- }
-
- case $2 in
- "list" )
- _args=${array[*]:2:$len};
- Q=$_args;
-
- cecho "Searching playlists for: $Q";
-
- results=$( \
- curl -s -G $SPOTIFY_SEARCH_API --data-urlencode "q=$Q" -d "type=playlist&limit=10&offset=0" -H "Accept: application/json" \
- | grep -E -o "spotify:user:[a-zA-Z0-9_]+:playlist:[a-zA-Z0-9]+" -m 10 \
- )
-
- count=$( \
- echo "$results" | grep -c "spotify:user" \
- )
-
- if [ "$count" -gt 0 ]; then
- random=$(( RANDOM % count));
-
- SPOTIFY_PLAY_URI=$( \
- echo "$results" | awk -v random="$random" '/spotify:user:[a-zA-Z0-9]+:playlist:[a-zA-Z0-9]+/{i++}i==random{print; exit}' \
- )
- fi;;
-
- "album" | "artist" | "track" )
- _args=${array[*]:2:$len};
- searchAndPlay "$2" "$_args";;
-
- * )
- _args=${array[*]:1:$len};
- searchAndPlay track "$_args";;
- esac
-
- if [ "$SPOTIFY_PLAY_URI" != "" ]; then
- cecho "Playing ($Q Search) -> Spotify URL: $SPOTIFY_PLAY_URI";
-
- osascript -e "tell application \"Spotify\" to play track \"$SPOTIFY_PLAY_URI\"";
-
- else
- cecho "No results when searching for $Q";
- fi
- else
- # play is the only param
- cecho "Playing Spotify.";
- osascript -e 'tell application "Spotify" to play';
- fi
- break ;;
-
- "pause" )
- state=$(osascript -e 'tell application "Spotify" to player state as string');
- if [ "$state" = "playing" ]; then
- cecho "Pausing Spotify.";
- else
- cecho "Playing Spotify.";
- fi
-
- osascript -e 'tell application "Spotify" to playpause';
- break ;;
-
- "quit" )
- cecho "Quitting Spotify.";
- osascript -e 'tell application "Spotify" to quit';
- exit 1 ;;
-
- "next" )
- cecho "Going to next track." ;
- osascript -e 'tell application "Spotify" to next track';
- break ;;
-
- "prev" )
- cecho "Going to previous track.";
- osascript -e 'tell application "Spotify" to previous track';
- break ;;
-
- "vol" )
- vol=$(osascript -e 'tell application "Spotify" to sound volume as integer');
- if [[ "$2" = "show" || "$2" = "" ]]; then
- cecho "Current Spotify volume level is $vol.";
- break ;
- elif [ "$2" = "up" ]; then
- if [ "$vol" -le 90 ]; then
- newvol=$(( vol+10 ));
- cecho "Increasing Spotify volume to $newvol.";
- else
- newvol=100;
- cecho "Spotify volume level is at max.";
- fi
- elif [ "$2" = "down" ]; then
- if [ "$vol" -ge 10 ]; then
- newvol=$(( vol-10 ));
- cecho "Reducing Spotify volume to $newvol.";
- else
- newvol=0;
- cecho "Spotify volume level is at min.";
- fi
- elif [ "$2" -ge 0 ]; then
- newvol=$2;
- fi
-
- osascript -e "tell application \"Spotify\" to set sound volume to $newvol";
- break ;;
-
- "toggle" )
- if [ "$2" = "shuffle" ]; then
- osascript -e 'tell application "Spotify" to set shuffling to not shuffling';
- curr=$(osascript -e 'tell application "Spotify" to shuffling');
- cecho "Spotify shuffling set to $curr";
- elif [ "$2" = "repeat" ]; then
- osascript -e 'tell application "Spotify" to set repeating to not repeating';
- curr=$(osascript -e 'tell application "Spotify" to repeating');
- cecho "Spotify repeating set to $curr";
- fi
- break ;;
-
- "pos" )
- cecho "Adjusting Spotify play position."
- osascript -e "tell application \"Spotify\" to set player position to $2";
- break;;
-
- "status" )
- showStatus;
- break ;;
-
- "info" )
- info=$(osascript -e 'tell application "Spotify"
- set tM to round (duration of current track / 60) rounding down
- set tS to duration of current track mod 60
- set pos to player position as text
- set myTime to tM as text & "min " & tS as text & "s"
- set nM to round (player position / 60) rounding down
- set nS to round (player position mod 60) rounding down
- set nowAt to nM as text & "min " & nS as text & "s"
- set info to "" & "\nArtist: " & artist of current track
- set info to info & "\nTrack: " & name of current track
- set info to info & "\nAlbum Artist: " & album artist of current track
- set info to info & "\nAlbum: " & album of current track
- set info to info & "\nSeconds: " & duration of current track
- set info to info & "\nSeconds played: " & pos
- set info to info & "\nDuration: " & mytime
- set info to info & "\nNow at: " & nowAt
- set info to info & "\nPlayed Count: " & played count of current track
- set info to info & "\nTrack Number: " & track number of current track
- set info to info & "\nPopularity: " & popularity of current track
- set info to info & "\nId: " & id of current track
- set info to info & "\nSpotify URL: " & spotify url of current track
- set info to info & "\nArtwork: " & artwork of current track
- set info to info & "\nPlayer: " & player state
- set info to info & "\nVolume: " & sound volume
- set info to info & "\nShuffle: " & shuffling
- set info to info & "\nRepeating: " & repeating
- end tell
- return info')
- echo "$info";
- break ;;
-
- "share" )
- url=$(osascript -e 'tell application "Spotify" to spotify url of current track');
- remove='spotify:track:'
- url=${url#$remove}
- url="http://open.spotify.com/track/$url"
- cecho "Share URL: $url";
- cecho -n "$url" | pbcopy
- break;;
-
- -h|--help| *)
- showHelp;
- break ;;
- esac
- done
-}
-
+source ${ZSH}/plugins/osx/spotify
# Show/hide hidden files in the Finder
alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
diff --git a/plugins/osx/spotify b/plugins/osx/spotify
new file mode 100644
index 000000000..69f6c5419
--- /dev/null
+++ b/plugins/osx/spotify
@@ -0,0 +1,438 @@
+#!/usr/bin/env bash
+
+function spotify() {
+# Copyright (c) 2012--2017 Harish Narayanan <mail@harishnarayanan.org>
+#
+# Contains numerous helpful contributions from Jorge Colindres, Thomas
+# Pritchard, iLan Epstein, Gabriele Bonetti, Sean Heller, Eric Martin
+# and Peter Fonseca.
+
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+USER_CONFIG_DEFAULTS="CLIENT_ID=\"\"\nCLIENT_SECRET=\"\"";
+USER_CONFIG_FILE="${HOME}/.shpotify.cfg";
+if ! [[ -f "${USER_CONFIG_FILE}" ]]; then
+ touch "${USER_CONFIG_FILE}";
+ echo -e "${USER_CONFIG_DEFAULTS}" > "${USER_CONFIG_FILE}";
+fi
+source "${USER_CONFIG_FILE}";
+
+showAPIHelp() {
+ echo;
+ echo "Connecting to Spotify's API:";
+ echo;
+ echo " This command line application needs to connect to Spotify's API in order to";
+ echo " find music by name. It is very likely you want this feature!";
+ echo;
+ echo " To get this to work, you need to sign up (or in) and create an 'Application' at:";
+ echo " https://developer.spotify.com/my-applications/#!/applications/create";
+ echo;
+ echo " Once you've created an application, find the 'Client ID' and 'Client Secret'";
+ echo " values, and enter them into your shpotify config file at '${USER_CONFIG_FILE}'";
+ echo;
+ echo " Be sure to quote your values and don't add any extra spaces!";
+ echo " When done, it should look like this (but with your own values):";
+ echo ' CLIENT_ID="abc01de2fghijk345lmnop"';
+ echo ' CLIENT_SECRET="qr6stu789vwxyz"';
+}
+
+showHelp () {
+ echo "Usage:";
+ echo;
+ echo " `basename $0` <command>";
+ echo;
+ echo "Commands:";
+ echo;
+ echo " play # Resumes playback where Spotify last left off.";
+ echo " play <song name> # Finds a song by name and plays it.";
+ echo " play album <album name> # Finds an album by name and plays it.";
+ echo " play artist <artist name> # Finds an artist by name and plays it.";
+ echo " play list <playlist name> # Finds a playlist by name and plays it.";
+ echo " play uri <uri> # Play songs from specific uri.";
+ echo;
+ echo " next # Skips to the next song in a playlist.";
+ echo " prev # Returns to the previous song in a playlist.";
+ echo " replay # Replays the current track from the begining.";
+ echo " pos <time> # Jumps to a time (in secs) in the current song.";
+ echo " pause # Pauses (or resumes) Spotify playback.";
+ echo " stop # Stops playback.";
+ echo " quit # Stops playback and quits Spotify.";
+ echo;
+ echo " vol up # Increases the volume by 10%.";
+ echo " vol down # Decreases the volume by 10%.";
+ echo " vol <amount> # Sets the volume to an amount between 0 and 100.";
+ echo " vol [show] # Shows the current Spotify volume.";
+ echo;
+ echo " status # Shows the current player status.";
+ echo;
+ echo " share # Displays the current song's Spotify URL and URI."
+ echo " share url # Displays the current song's Spotify URL and copies it to the clipboard."
+ echo " share uri # Displays the current song's Spotify URI and copies it to the clipboard."
+ echo;
+ echo " toggle shuffle # Toggles shuffle playback mode.";
+ echo " toggle repeat # Toggles repeat playback mode.";
+ showAPIHelp
+}
+
+cecho(){
+ bold=$(tput bold);
+ green=$(tput setaf 2);
+ reset=$(tput sgr0);
+ echo $bold$green"$1"$reset;
+}
+
+showStatus () {
+ state=`osascript -e 'tell application "Spotify" to player state as string'`;
+ cecho "Spotify is currently $state.";
+ artist=`osascript -e 'tell application "Spotify" to artist of current track as string'`;
+ album=`osascript -e 'tell application "Spotify" to album of current track as string'`;
+ track=`osascript -e 'tell application "Spotify" to name of current track as string'`;
+ duration=`osascript -e 'tell application "Spotify"
+ set durSec to (duration of current track / 1000) as text
+ set tM to (round (durSec / 60) rounding down) as text
+ if length of ((durSec mod 60 div 1) as text) is greater than 1 then
+ set tS to (durSec mod 60 div 1) as text
+ else
+ set tS to ("0" & (durSec mod 60 div 1)) as text
+ end if
+ set myTime to tM as text & ":" & tS as text
+ end tell
+ return myTime'`;
+ position=`osascript -e 'tell application "Spotify"
+ set pos to player position
+ set nM to (round (pos / 60) rounding down) as text
+ if length of ((round (pos mod 60) rounding down) as text) is greater than 1 then
+ set nS to (round (pos mod 60) rounding down) as text
+ else
+ set nS to ("0" & (round (pos mod 60) rounding down)) as text
+ end if
+ set nowAt to nM as text & ":" & nS as text
+ end tell
+ return nowAt'`;
+
+ echo -e $reset"Artist: $artist\nAlbum: $album\nTrack: $track \nPosition: $position / $duration";
+}
+
+if [ $# = 0 ]; then
+ showHelp;
+else
+ if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then
+ osascript -e 'tell application "Spotify" to activate'
+ sleep 2
+ fi
+fi
+while [ $# -gt 0 ]; do
+ arg=$1;
+
+ case $arg in
+ "play" )
+ if [ $# != 1 ]; then
+ # There are additional arguments, so find out how many
+ array=( $@ );
+ len=${#array[@]};
+ SPOTIFY_SEARCH_API="https://api.spotify.com/v1/search";
+ SPOTIFY_TOKEN_URI="https://accounts.spotify.com/api/token";
+ if [ -z "${CLIENT_ID}" ]; then
+ cecho "Invalid Client ID, please update ${USER_CONFIG_FILE}";
+ showAPIHelp;
+ exit 1;
+ fi
+ if [ -z "${CLIENT_SECRET}" ]; then
+ cecho "Invalid Client Secret, please update ${USER_CONFIG_FILE}";
+ showAPIHelp;
+ exit 1;
+ fi
+ SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n");
+ SPOTIFY_PLAY_URI="";
+
+ getAccessToken() {
+ cecho "Connecting to Spotify's API";
+
+ SPOTIFY_TOKEN_RESPONSE_DATA=$( \
+ curl "${SPOTIFY_TOKEN_URI}" \
+ --silent \
+ -X "POST" \
+ -H "Authorization: Basic ${SHPOTIFY_CREDENTIALS}" \
+ -d "grant_type=client_credentials" \
+ )
+ if ! [[ "${SPOTIFY_TOKEN_RESPONSE_DATA}" =~ "access_token" ]]; then
+ cecho "Autorization failed, please check ${USER_CONFG_FILE}"
+ cecho "${SPOTIFY_TOKEN_RESPONSE_DATA}"
+ showAPIHelp
+ exit 1
+ fi
+ SPOTIFY_ACCESS_TOKEN=$( \
+ printf "${SPOTIFY_TOKEN_RESPONSE_DATA}" \
+ | grep -E -o '"access_token":".*",' \
+ | sed 's/"access_token"://g' \
+ | sed 's/"//g' \
+ | sed 's/,.*//g' \
+ )
+ }
+
+ searchAndPlay() {
+ type="$1"
+ Q="$2"
+
+ getAccessToken;
+
+ cecho "Searching ${type}s for: $Q";
+
+ SPOTIFY_PLAY_URI=$( \
+ curl -s -G $SPOTIFY_SEARCH_API \
+ -H "Authorization: Bearer ${SPOTIFY_ACCESS_TOKEN}" \
+ -H "Accept: application/json" \
+ --data-urlencode "q=$Q" \
+ -d "type=$type&limit=1&offset=0" \
+ | grep -E -o "spotify:$type:[a-zA-Z0-9]+" -m 1
+ )
+ echo "play uri: ${SPOTIFY_PLAY_URI}"
+ }
+
+ case $2 in
+ "list" )
+ _args=${array[@]:2:$len};
+ Q=$_args;
+
+ getAccessToken;
+
+ cecho "Searching playlists for: $Q";
+
+ results=$( \
+ curl -s -G $SPOTIFY_SEARCH_API --data-urlencode "q=$Q" -d "type=playlist&limit=10&offset=0" -H "Accept: application/json" -H "Authorization: Bearer ${SPOTIFY_ACCESS_TOKEN}" \
+ | grep -E -o "spotify:user:[a-zA-Z0-9_]+:playlist:[a-zA-Z0-9]+" -m 10 \
+ )
+
+ count=$( \
+ echo "$results" | grep -c "spotify:user" \
+ )
+
+ if [ "$count" -gt 0 ]; then
+ random=$(( $RANDOM % $count));
+
+ SPOTIFY_PLAY_URI=$( \
+ echo "$results" | awk -v random="$random" '/spotify:user:[a-zA-Z0-9]+:playlist:[a-zA-Z0-9]+/{i++}i==random{print; exit}' \
+ )
+ fi;;
+
+ "album" | "artist" | "track" )
+ _args=${array[@]:2:$len};
+ searchAndPlay $2 "$_args";;
+
+ "uri" )
+ SPOTIFY_PLAY_URI=${array[@]:2:$len};;
+
+ * )
+ _args=${array[@]:1:$len};
+ searchAndPlay track "$_args";;
+ esac
+
+ if [ "$SPOTIFY_PLAY_URI" != "" ]; then
+ if [ "$2" = "uri" ]; then
+ cecho "Playing Spotify URI: $SPOTIFY_PLAY_URI";
+ else
+ cecho "Playing ($Q Search) -> Spotify URI: $SPOTIFY_PLAY_URI";
+ fi
+
+ osascript -e "tell application \"Spotify\" to play track \"$SPOTIFY_PLAY_URI\"";
+
+ else
+ cecho "No results when searching for $Q";
+ fi
+
+ else
+
+ # play is the only param
+ cecho "Playing Spotify.";
+ osascript -e 'tell application "Spotify" to play';
+ fi
+ break ;;
+
+ "pause" )
+ state=`osascript -e 'tell application "Spotify" to player state as string'`;
+ if [ $state = "playing" ]; then
+ cecho "Pausing Spotify.";
+ else
+ cecho "Playing Spotify.";
+ fi
+
+ osascript -e 'tell application "Spotify" to playpause';
+ break ;;
+
+ "stop" )
+ state=`osascript -e 'tell application "Spotify" to player state as string'`;
+ if [ $state = "playing" ]; then
+ cecho "Pausing Spotify.";
+ osascript -e 'tell application "Spotify" to playpause';
+ else
+ cecho "Spotify is already stopped."
+ fi
+
+ break ;;
+
+ "quit" ) cecho "Quitting Spotify.";
+ osascript -e 'tell application "Spotify" to quit';
+ exit 1 ;;
+
+ "next" ) cecho "Going to next track." ;
+ osascript -e 'tell application "Spotify" to next track';
+ showStatus;
+ break ;;
+
+ "prev" ) cecho "Going to previous track.";
+ osascript -e '
+ tell application "Spotify"
+ set player position to 0
+ previous track
+ end tell';
+ showStatus;
+ break ;;
+
+ "replay" ) cecho "Replaying current track.";
+ osascript -e 'tell application "Spotify" to set player position to 0'
+ break ;;
+
+ "vol" )
+ vol=`osascript -e 'tell application "Spotify" to sound volume as integer'`;
+ if [[ $2 = "" || $2 = "show" ]]; then
+ cecho "Current Spotify volume level is $vol.";
+ break ;
+ elif [ "$2" = "up" ]; then
+ if [ $vol -le 90 ]; then
+ newvol=$(( vol+10 ));
+ cecho "Increasing Spotify volume to $newvol.";
+ else
+ newvol=100;
+ cecho "Spotify volume level is at max.";
+ fi
+ elif [ "$2" = "down" ]; then
+ if [ $vol -ge 10 ]; then
+ newvol=$(( vol-10 ));
+ cecho "Reducing Spotify volume to $newvol.";
+ else
+ newvol=0;
+ cecho "Spotify volume level is at min.";
+ fi
+ elif [[ $2 =~ ^[0-9]+$ ]] && [[ $2 -ge 0 && $2 -le 100 ]]; then
+ newvol=$2;
+ cecho "Setting Spotify volume level to $newvol";
+ else
+ echo "Improper use of 'vol' command"
+ echo "The 'vol' command should be used as follows:"
+ echo " vol up # Increases the volume by 10%.";
+ echo " vol down # Decreases the volume by 10%.";
+ echo " vol [amount] # Sets the volume to an amount between 0 and 100.";
+ echo " vol # Shows the current Spotify volume.";
+ break
+ fi
+
+ osascript -e "tell application \"Spotify\" to set sound volume to $newvol";
+ break ;;
+
+ "toggle" )
+ if [ "$2" = "shuffle" ]; then
+ osascript -e 'tell application "Spotify" to set shuffling to not shuffling';
+ curr=`osascript -e 'tell application "Spotify" to shuffling'`;
+ cecho "Spotify shuffling set to $curr";
+ elif [ "$2" = "repeat" ]; then
+ osascript -e 'tell application "Spotify" to set repeating to not repeating';
+ curr=`osascript -e 'tell application "Spotify" to repeating'`;
+ cecho "Spotify repeating set to $curr";
+ fi
+ break ;;
+
+ "status" )
+ showStatus;
+ break ;;
+
+ "info" )
+ info=`osascript -e 'tell application "Spotify"
+ set durSec to (duration of current track / 1000)
+ set tM to (round (durSec / 60) rounding down) as text
+ if length of ((durSec mod 60 div 1) as text) is greater than 1 then
+ set tS to (durSec mod 60 div 1) as text
+ else
+ set tS to ("0" & (durSec mod 60 div 1)) as text
+ end if
+ set myTime to tM as text & "min " & tS as text & "s"
+ set pos to player position
+ set nM to (round (pos / 60) rounding down) as text
+ if length of ((round (pos mod 60) rounding down) as text) is greater than 1 then
+ set nS to (round (pos mod 60) rounding down) as text
+ else
+ set nS to ("0" & (round (pos mod 60) rounding down)) as text
+ end if
+ set nowAt to nM as text & "min " & nS as text & "s"
+ set info to "" & "\nArtist: " & artist of current track
+ set info to info & "\nTrack: " & name of current track
+ set info to info & "\nAlbum Artist: " & album artist of current track
+ set info to info & "\nAlbum: " & album of current track
+ set info to info & "\nSeconds: " & durSec
+ set info to info & "\nSeconds played: " & pos
+ set info to info & "\nDuration: " & mytime
+ set info to info & "\nNow at: " & nowAt
+ set info to info & "\nPlayed Count: " & played count of current track
+ set info to info & "\nTrack Number: " & track number of current track
+ set info to info & "\nPopularity: " & popularity of current track
+ set info to info & "\nId: " & id of current track
+ set info to info & "\nSpotify URL: " & spotify url of current track
+ set info to info & "\nArtwork: " & artwork url of current track
+ set info to info & "\nPlayer: " & player state
+ set info to info & "\nVolume: " & sound volume
+ set info to info & "\nShuffle: " & shuffling
+ set info to info & "\nRepeating: " & repeating
+ end tell
+ return info'`
+ cecho "$info";
+ break ;;
+
+ "share" )
+ uri=`osascript -e 'tell application "Spotify" to spotify url of current track'`;
+ remove='spotify:track:'
+ url=${uri#$remove}
+ url="http://open.spotify.com/track/$url"
+
+ if [ "$2" = "" ]; then
+ cecho "Spotify URL: $url"
+ cecho "Spotify URI: $uri"
+ echo "To copy the URL or URI to your clipboard, use:"
+ echo "\`spotify share url\` or"
+ echo "\`spotify share uri\` respectively."
+ elif [ "$2" = "url" ]; then
+ cecho "Spotify URL: $url";
+ echo -n $url | pbcopy
+ elif [ "$2" = "uri" ]; then
+ cecho "Spotify URI: $uri";
+ echo -n $uri | pbcopy
+ fi
+ break;;
+
+ "pos" )
+ cecho "Adjusting Spotify play position."
+ osascript -e "tell application \"Spotify\" to set player position to $2";
+ break;;
+
+ "help" | * )
+ showHelp;
+ break ;;
+ esac
+done
+}
diff --git a/plugins/pip/_pip b/plugins/pip/_pip
index 732ffabea..607f68e58 100644
--- a/plugins/pip/_pip
+++ b/plugins/pip/_pip
@@ -72,6 +72,7 @@ case "$words[1]" in
install)
_arguments \
'(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
+ '(--user)--user[install packages to user home]' \
'(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
'(-r --requirement)'{-r,--requirement}'[Requirements file for packages to install]:File:_files' \
'(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index aa1f9488a..dbc7da472 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -1,35 +1,41 @@
-_homebrew-installed() {
- type brew &> /dev/null
-}
+# This plugin loads pyenv into the current shell and provides prompt info via
+# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
-_pyenv-from-homebrew-installed() {
- brew --prefix pyenv &> /dev/null
-}
+FOUND_PYENV=$+commands[pyenv]
-FOUND_PYENV=0
-pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv")
-if _homebrew-installed && _pyenv-from-homebrew-installed ; then
- pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}")
+if [[ $FOUND_PYENV -ne 1 ]]; then
+ pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv")
+ for dir in $pyenvdirs; do
+ if [[ -d $dir/bin ]]; then
+ export PATH="$PATH:$dir/bin"
+ FOUND_PYENV=1
+ break
+ fi
+ done
fi
-for pyenvdir in "${pyenvdirs[@]}" ; do
- if [ -d $pyenvdir/bin -a $FOUND_PYENV -eq 0 ] ; then
- FOUND_PYENV=1
- export PYENV_ROOT=$pyenvdir
- export PATH=${pyenvdir}/bin:$PATH
- eval "$(pyenv init - zsh)"
-
- if pyenv commands | command grep -q virtualenv-init; then
- eval "$(pyenv virtualenv-init - zsh)"
+if [[ $FOUND_PYENV -ne 1 ]]; then
+ if (( $+commands[brew] )) && dir=$(brew --prefix pyenv 2>/dev/null); then
+ if [[ -d $dir/bin ]]; then
+ export PATH="$PATH:$dir/bin"
+ FOUND_PYENV=1
fi
-
- function pyenv_prompt_info() {
- echo "$(pyenv version-name)"
- }
fi
-done
-unset pyenvdir
+fi
-if [ $FOUND_PYENV -eq 0 ] ; then
- function pyenv_prompt_info() { echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" }
+if [[ $FOUND_PYENV -eq 1 ]]; then
+ eval "$(pyenv init - zsh)"
+ if (( $+commands[pyenv-virtualenv-init] )); then
+ eval "$(pyenv virtualenv-init - zsh)"
+ fi
+ function pyenv_prompt_info() {
+ echo "$(pyenv version-name)"
+ }
+else
+ # fallback to system python
+ function pyenv_prompt_info() {
+ echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
+ }
fi
+
+unset FOUND_PYENV dir
diff --git a/plugins/rails/_rails b/plugins/rails/_rails
index 96f57ce64..ad7505506 100644
--- a/plugins/rails/_rails
+++ b/plugins/rails/_rails
@@ -51,6 +51,9 @@ _arguments \
if (( CURRENT == 1 )); then
_describe -t commands "rails subcommand" _1st_arguments
return
+else
+ _files
+ return
fi
case "$words[1]" in
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
index c8974b5f4..eb3f30360 100644
--- a/plugins/rails/rails.plugin.zsh
+++ b/plugins/rails/rails.plugin.zsh
@@ -1,5 +1,7 @@
function _rails_command () {
- if [ -e "bin/rails" ]; then
+ if [ -e "bin/stubs/rails" ]; then
+ bin/stubs/rails $@
+ elif [ -e "bin/rails" ]; then
bin/rails $@
elif [ -e "script/rails" ]; then
ruby script/rails $@
@@ -11,7 +13,9 @@ function _rails_command () {
}
function _rake_command () {
- if [ -e "bin/rake" ]; then
+ if [ -e "bin/stubs/rake" ]; then
+ bin/stubs/rake $@
+ elif [ -e "bin/rake" ]; then
bin/rake $@
elif type bundle &> /dev/null && [ -e "Gemfile" ]; then
bundle exec rake $@
diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
index ef5106f2d..7430e9625 100644
--- a/plugins/rbenv/rbenv.plugin.zsh
+++ b/plugins/rbenv/rbenv.plugin.zsh
@@ -7,6 +7,9 @@ rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv"
if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then
rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}")
unset rbenv_homebrew_path
+ if [[ $RBENV_ROOT = '' ]]; then
+ RBENV_ROOT="$HOME/.rbenv"
+ fi
fi
for rbenvdir in "${rbenvdirs[@]}" ; do
diff --git a/plugins/react-native/README.md b/plugins/react-native/README.md
index 78bfb6844..980246cf1 100644
--- a/plugins/react-native/README.md
+++ b/plugins/react-native/README.md
@@ -1,14 +1,29 @@
-# React Native
+# React Native plugin
-**Maintainer:** [BilalBudhani](https://github.com/BilalBudhani)
+This plugin adds completion for [`react-native`](https://facebook.github.io/react-native/).
+It also defines a few [aliases](#aliases) for the commands more frequently used.
-### List of Aliases
+To enable, add `react-native` to your `plugins` array in your zshrc file:
-Alias | React Native command
-------|---------------------
-**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"*
+```zsh
+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"` |
+| _Logging_ |
+| **rnland** | `react-native log-android` |
+| **rnlios** | `react-native log-ios` |
diff --git a/plugins/react-native/_react-native b/plugins/react-native/_react-native
index 47ee8c370..893ac040a 100644
--- a/plugins/react-native/_react-native
+++ b/plugins/react-native/_react-native
@@ -3,12 +3,21 @@
local -a _1st_arguments
_1st_arguments=(
+ 'init:<ProjectName> generates a new project and installs its dependencies'
+ 'android:creates an empty android project'
'start:starts the webserver'
- 'bundle:builds the javascript bundle for offline use'
- 'new-library:generates a native library bridge'
- 'android:generates an Android project for your app'
+ 'run-ios:builds your app and starts it on iOS simulator'
'run-android:builds your app and starts it on a connected Android emulator or device'
- 'upgrade:upgrade your apps template files to the latest version; run this after updating the react-native version in your package.json and running npm install'
+ 'new-library:generates a native library bridge'
+ 'bundle:builds the javascript bundle for offline use'
+ 'unbundle:builds javascript as "unbundle" for offline use'
+ 'link:[options] <packageName> links all native dependencies'
+ 'unlink:[options] <packageName> unlink native dependency'
+ 'install:[options] <packageName> install and link native dependencies'
+ 'uninstall:[options] <packageName> uninstall and unlink native dependencies'
+ "upgrade:upgrade your app's template files to the latest version; run this after updating the react-native version in your package.json and running npm install"
+ 'log-android:starts adb logcat'
+ 'log-ios:starts iOS device syslog tail'
)
diff --git a/plugins/react-native/react-native.plugin.zsh b/plugins/react-native/react-native.plugin.zsh
index f19cba820..0566941a1 100644
--- a/plugins/react-native/react-native.plugin.zsh
+++ b/plugins/react-native/react-native.plugin.zsh
@@ -1,9 +1,14 @@
+alias rn='react-native'
+alias rns='react-native start'
+alias rnlink='react-native link'
+
alias rnand='react-native run-android'
+alias rnios='react-native run-ios'
alias rnios4s='react-native run-ios --simulator "iPhone 4s"'
alias rnios5='react-native run-ios --simulator "iPhone 5"'
alias rnios5s='react-native run-ios --simulator "iPhone 5s"'
alias rnios6='react-native run-ios --simulator "iPhone 6"'
alias rnios6s='react-native run-ios --simulator "iPhone 6s"'
-alias rnios='react-native run-ios'
-alias rnlink='react-native link'
+alias rnland='react-native log-android'
+alias rnlios='react-native log-ios'
diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
index 38e4d7cd0..177b35b31 100644
--- a/plugins/ruby/ruby.plugin.zsh
+++ b/plugins/ruby/ruby.plugin.zsh
@@ -4,3 +4,11 @@ alias sgem='sudo gem'
# Find ruby file
alias rfind='find . -name "*.rb" | xargs grep -n'
+
+# Shorthand Ruby
+alias rb="ruby"
+
+# Gem Command Shorthands
+alias gin="gem install"
+alias gun="gem uninstall"
+alias gli="gem list"
diff --git a/plugins/rust/_rust b/plugins/rust/_rust
index f4e8f6f78..6e3f344cd 100644
--- a/plugins/rust/_rust
+++ b/plugins/rust/_rust
@@ -15,59 +15,93 @@ _rustc_crate_types=(
'lib'
'rlib'
'dylib'
+ 'cdylib'
'staticlib'
+ 'proc-macro'
)
_rustc_emit_types=(
'asm'
- 'bc'
- 'ir'
+ 'llvm-bc'
+ 'llvm-ir'
'obj'
+ 'metadata'
'link'
+ 'dep-info'
+ 'mir'
+)
+_rustc_print_types=(
+ 'crate-name'
+ 'file-names'
+ 'sysroot'
+ 'cfg'
+ 'target-list'
+ 'target-cpus'
+ 'target-features'
+ 'relocation-models'
+ 'code-models'
+ 'target-spec-json'
+ 'native-static-libs'
)
_rustc_pretty_types=(
'normal[un-annotated source]'
'expanded[crates expanded]'
- 'typed[crates expanded, with type annotations]'
- 'identified[fully parenthesized, AST nodes and blocks with IDs]'
+ 'expanded,identified[fully parenthesized, AST nodes with IDs]'
+)
+_rustc_unpretty_types=(
+ 'normal[un-annotated source]'
+ 'expanded[crates expanded]'
+ 'expanded,identified[fully parenthesized, AST nodes with IDs]'
'flowgraph=[graphviz formatted flowgraph for node]:NODEID:'
+ 'everybody_loops[all function bodies replaced with `loop {}`]'
+ 'hir[the HIR]'
+ 'hir,identified'
+ 'hir,typed[HIR with types for each node]'
)
_rustc_color_types=(
'auto[colorize, if output goes to a tty (default)]'
'always[always colorize output]'
'never[never colorize output]'
)
+_rustc_error_format=(
+ 'human'
+ 'json'
+)
_rustc_opts_vals=(
+ --cfg='[Configure the compilation environment]:SPEC:'
+ -L'[Add a directory to the library search path]:DIR:_files -/'
--crate-name='[Specify the name of the crate being built]'
--crate-type='[Comma separated list of types of crates for the compiler to emit]:TYPES:_values -s "," "Crate types" "$_rustc_crate_types[@]"'
--emit='[Comma separated list of types of output for the compiler to emit]:TYPES:_values -s "," "Emit Targets" "$_rustc_emit_types[@]"'
+ --print='[Comma separated list of compiler information to print on stdout]:TYPES:_values -s "," "Printable info" "$_rustc_print_types[@]"'
+ -o'[Write output to <filename>. Ignored if more than one --emit is specified.]:FILENAME:_files'
+ --out-dir='[Write output to compiler-chosen filename in <dir>. Ignored if -o is specified. (default the current directory)]:DIR:_files -/'
+ --explain='[Provide a detailed explanation of an error message]:OPT:'
+ --target='[Target triple cpu-manufacturer-kernel\[-os\] to compile]:TRIPLE:'
+ --extern'[Specify where an external rust library is located]:ARG:'
+ --sysroot='[Override the system root]:PATH:_files -/'
+ --error-format='[How errors and other messages are produced]:TYPES:_values "$_rustc_error_format"'
--debuginfo='[Emit DWARF debug info to the objects created]:LEVEL:_values "Debug Levels" "$_rustc_debuginfo_levels[@]"'
--dep-info='[Output dependency info to <filename> after compiling]::FILE:_files -/'
- --sysroot='[Override the system root]:PATH:_files -/'
- --cfg='[Configure the compilation environment]:SPEC:'
- --out-dir='[Write output to compiler-chosen filename in <dir>. Ignored if -o is specified. (default the current directory)]:DIR:_files -/'
- -o'[Write output to <filename>. Ignored if more than one --emit is specified.]:FILENAME:_files'
--opt-level='[Optimize with possible levels 0-3]:LEVEL:(0 1 2 3)'
--pretty='[Pretty-print the input instead of compiling]::TYPE:_values "TYPES" "$_rustc_pretty_types[@]"'
- -L'[Add a directory to the library search path]:DIR:_files -/'
- --target='[Target triple cpu-manufacturer-kernel\[-os\] to compile]:TRIPLE:'
+ --unpretty='[Present the input source, unstable (and less-pretty)]::TYPE:_values "TYPES" "$_rustc_unpretty_types[@]"'
--color='[Configure coloring of output]:CONF:_values "COLORS" "$_rustc_color_types[@]"'
- {-v,--version}'[Print version info and exit]::VERBOSE:(verbose)'
- --explain='[Provide a detailed explanation of an error message]:OPT:'
- --extern'[Specify where an external rust library is located]:ARG:'
)
_rustc_opts_switches=(
-g'[Equivalent to --debuginfo=2]'
+ -O'[Equivalent to --opt-level=2]'
+ --test'[Build a test harness]'
+ {-v,--verbose}'[Use verbose output]'
+ {-V,--version}'[Print version info and exit]'
{-h,--help}'[Display this message]'
--no-analysis'[Parse and expand the output, but run no analysis or produce output]'
--no-trans'[Run all passes except translation; no output]'
- -O'[Equivalent to --opt-level=2]'
--parse-only'[Parse only; do not compile, assemble, or link]'
--print-crate-name'[Output the crate name and exit]'
--print-file-name'[Output the file(s) that would be written if compilation continued and exit]'
- --test'[Build a test harness]'
)
_rustc_opts_codegen=(
'ar=[Path to the archive utility to use when assembling archives.]:BIN:_path_files'
@@ -139,6 +173,9 @@ _rustc_opts_lint=(
_rustc_opts_debug=(
'verbose[in general, enable more debug printouts]'
+ 'span-free-formats[when debug-printing compiler state, do not include spans]'
+ "identify-regions[make unnamed regions display as '# (where # is some non-ident unique id)]"
+ 'emit-end-regions[emit EndRegion as part of MIR; enable transforms that solely process EndRegion]'
'time-passes[measure time of each rustc pass]'
'count-llvm-insns[count where LLVM instrs originate]'
'time-llvm-passes[measure time of each LLVM pass]'
diff --git a/plugins/scala/_scala b/plugins/scala/_scala
index c4ccb37d3..80434680c 100644
--- a/plugins/scala/_scala
+++ b/plugins/scala/_scala
@@ -152,10 +152,10 @@ Y_opts=(
"-Ydump-classes+[Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)]:output directory:_files -/"
"-Yeta-expand-keeps-star[Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.]"
"-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/"
- "-Yinfer-argument-types[Infer types for arguments of overriden methods]"
+ "-Yinfer-argument-types[Infer types for arguments of overridden methods]"
"-Yinline[Perform inlining when possible]"
"-Yinline-handlers[Perform exception handler inlining when possible]"
- "-Yinline-warnings[Emit inlining warnings (normally surpressed due to high volume)]"
+ "-Yinline-warnings[Emit inlining warnings (normally suppressed due to high volume)]"
"-Yinvalidate+[Invalidate classpath entry before run]:classpath entry"
"-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)"
"-Ylog-classpath[Output information about what classpath is being applied]"
diff --git a/plugins/shrink-path/shrink-path.plugin.zsh b/plugins/shrink-path/shrink-path.plugin.zsh
index f111962a5..6dd6a930f 100644
--- a/plugins/shrink-path/shrink-path.plugin.zsh
+++ b/plugins/shrink-path/shrink-path.plugin.zsh
@@ -94,6 +94,11 @@ shrink_path () {
(( tilde )) && dir=${dir/$HOME/\~}
tree=(${(s:/:)dir})
(
+ # unset chpwd_functions since we'll be calling `cd` and don't
+ # want any side-effects (eg., if the user was using auto-ls)
+ chpwd_functions=()
+ # unset chpwd since even if chpwd_functions is (), zsh will
+ # attempt to execute chpwd
unfunction chpwd 2> /dev/null
if [[ $tree[1] == \~* ]] {
cd ${~tree[1]}
diff --git a/plugins/sublime/README.md b/plugins/sublime/README.md
index 7b02d8428..5379891ad 100644
--- a/plugins/sublime/README.md
+++ b/plugins/sublime/README.md
@@ -19,3 +19,7 @@ Plugin for Sublime Text, a cross platform text and code editor, available for Li
* If `sst` command is called, it is like `sudo st`, opening the file or folder in Sublime Text. Useful for editing system protected files.
* If `stp` command is called, it find a `.sublime-project` file by traversing up the directory structure. If there is no `.sublime-project` file, but if the current folder is a Git repo, opens up the root directory of the repo. If the current folder is not a Git repo, then opens up the current directory.
+
+ * If `stn` command is called without an argument, create a stub `.sublime-project` file in the current working directory if one does not already exist
+
+ * If `stn` is passed a directory, create a stub `.sublime-project` file in it
diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
index f84b7032a..f5bb070ab 100644
--- a/plugins/sublime/sublime.plugin.zsh
+++ b/plugins/sublime/sublime.plugin.zsh
@@ -1,5 +1,9 @@
+# Sublime Text Aliases
+
+() {
+
if [[ "$OSTYPE" == linux* ]]; then
- local _sublime_linux_paths > /dev/null 2>&1
+ local _sublime_linux_paths
_sublime_linux_paths=(
"$HOME/bin/sublime_text"
"/opt/sublime_text/sublime_text"
@@ -19,9 +23,8 @@ if [[ "$OSTYPE" == linux* ]]; then
break
fi
done
-
elif [[ "$OSTYPE" = darwin* ]]; then
- local _sublime_darwin_paths > /dev/null 2>&1
+ local _sublime_darwin_paths
_sublime_darwin_paths=(
"/usr/local/bin/subl"
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
@@ -38,10 +41,9 @@ elif [[ "$OSTYPE" = darwin* ]]; then
break
fi
done
-
elif [[ "$OSTYPE" = 'cygwin' ]]; then
- local _sublime_cygwin_paths > /dev/null 2>&1
- _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"
)
@@ -52,9 +54,10 @@ elif [[ "$OSTYPE" = 'cygwin' ]]; then
break
fi
done
-
fi
+}
+
alias stt='st .'
find_project()
@@ -84,4 +87,35 @@ find_project()
st $FINAL_DEST
}
+function create_project() {
+
+ local _target=$1
+
+ if [[ "${_target}" == "" ]]; then
+ _target=$(pwd);
+ elif [[ ! -d ${_target} ]]; then
+ echo "${_target} is not a valid directory"
+ return 1
+ fi
+
+ local _sublime_project_file=$_target/$(basename $_target).sublime-project
+
+ if [[ ! -f $_sublime_project_file ]]; then
+
+ touch $_sublime_project_file
+
+ echo -e "{" >> $_sublime_project_file
+ echo -e "\t\"folders\":" >> $_sublime_project_file
+ echo -e "\t\t[{" >> $_sublime_project_file
+ echo -e "\t\t\t\"path\": \".\"," >> $_sublime_project_file
+ echo -e "\t\t\t\"file_exclude_patterns\": []" >> $_sublime_project_file
+ echo -e "\t\t}]" >> $_sublime_project_file
+ echo -e "}" >> $_sublime_project_file
+
+ echo -e "New Sublime Text project created:\n\t${_sublime_project_file}"
+
+ fi
+}
+
alias stp=find_project
+alias stn=create_project
diff --git a/plugins/suse/suse.plugin.zsh b/plugins/suse/suse.plugin.zsh
index afd8ecabd..f7215528b 100644
--- a/plugins/suse/suse.plugin.zsh
+++ b/plugins/suse/suse.plugin.zsh
@@ -1,4 +1,4 @@
-#Alias for Zypper according to the offical Zypper's alias
+#Alias for Zypper according to the official Zypper's alias
#Main commands
alias z='sudo zypper' #call zypper
@@ -51,7 +51,7 @@ alias zrr='sudo zypper rr' #remove repositories
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 sytem
+alias zrs='sudo zypper rs' #remove specified repository index service from the system
alias zls='sudo zypper ls' #list services defined on the system
#Package Locks Management commands
diff --git a/plugins/swiftpm/README.md b/plugins/swiftpm/README.md
new file mode 100644
index 000000000..07ca25651
--- /dev/null
+++ b/plugins/swiftpm/README.md
@@ -0,0 +1,22 @@
+# Swift Package Manager
+
+## Description
+
+This plugin provides a few utilities that make you faster on your daily work with the [Swift Package Manager](https://github.com/apple/swift-package-manager).
+
+To start using it, add the `swiftpm` plugin to your `plugins` array in `~/.zshrc`:
+
+```zsh
+plugins=(... swiftpm)
+```
+
+## Aliases
+
+| Alias | Description | Command |
+|-------|-------------------------------------|------------------------------------|
+| `spi` | Initialize a new package | `swift package init` |
+| `spf` | Fetch package dependencies | `swift package fetch` |
+| `spu` | Update package dependencies | `swift package update` |
+| `spx` | Generates an Xcode project | `swift package generate-xcodeproj` |
+| `sps` | Print the resolved dependency graph | `swift package show-dependencies` |
+| `spd` | Print parsed Package.swift as JSON | `swift package dump-package` |
diff --git a/plugins/swiftpm/swiftpm.plugin.zsh b/plugins/swiftpm/swiftpm.plugin.zsh
new file mode 100644
index 000000000..ef872ea34
--- /dev/null
+++ b/plugins/swiftpm/swiftpm.plugin.zsh
@@ -0,0 +1,8 @@
+# Some aliases to make your life with the Swift Package Manager faster ✌️
+
+alias spi='swift package init'
+alias spf='swift package fetch'
+alias spu='swift package update'
+alias spx='swift package generate-xcodeproj'
+alias sps='swift package show-dependencies'
+alias spd='swift package dump-package'
diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
index c2a1affad..0b608fe2a 100644
--- a/plugins/symfony2/symfony2.plugin.zsh
+++ b/plugins/symfony2/symfony2.plugin.zsh
@@ -25,5 +25,7 @@ alias sfcw='sf cache:warmup'
alias sfroute='sf debug:router'
alias sfcontainer='sf debug:container'
alias sfgb='sf generate:bundle'
+alias sfge='sf doctrine:generate:entity'
+alias sfsu='sf doctrine:schema:update'
alias sfdev='sf --env=dev'
alias sfprod='sf --env=prod'
diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md
index 44e38a1c0..e5d9e47b6 100644
--- a/plugins/terraform/README.md
+++ b/plugins/terraform/README.md
@@ -1,7 +1,9 @@
-## atom
+## Terraform oh-my-zsh plugin
Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently.
+Current as of Terraform v0.11.7
+
### Requirements
* [Terraform](https://terraform.io/)
@@ -9,3 +11,13 @@ Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely a
### Usage
* Type `terraform` into your prompt and hit `TAB` to see available completion options
+
+### Expanding ZSH prompt with current Terraform workspace name
+
+If you want to get current Terraform workspace name in your ZSH prompt open
+your .zsh-theme file and in a chosen place insert:
+
+```
+$FG[045]\
+$(tf_prompt_info)\
+```
diff --git a/plugins/terraform/_terraform b/plugins/terraform/_terraform
index 11740dc48..1d1315a8a 100644
--- a/plugins/terraform/_terraform
+++ b/plugins/terraform/_terraform
@@ -3,89 +3,151 @@
local -a _terraform_cmds
_terraform_cmds=(
'apply:Builds or changes infrastructure'
+ 'console:Interactive console for Terraform interpolations'
'destroy:Destroy Terraform-managed infrastructure'
+ 'fmt:Rewrites config files to canonical format'
'get:Download and install modules for the configuration'
'graph:Create a visual graph of Terraform resources'
- 'init:Initializes Terraform configuration from a module'
+ 'import:Import existing infrastructure into Terraform'
+ 'init:Initialize a Terraform working directory'
'output:Read an output from a state file'
'plan:Generate and show an execution plan'
- 'pull:Refreshes the local state copy from the remote server'
- 'push:Uploads the local state to the remote server'
+ 'providers:Prints a tree of the providers used in the configuration'
+ 'push:Upload this Terraform module to Atlas to run'
'refresh:Update local state file against real resources'
- 'remote:Configures remote state management'
'show:Inspect Terraform state or plan'
- 'taint:Manually forcing a destroy and recreate on the next plan/apply'
+ 'taint:Manually mark a resource for recreation'
+ 'untaint:Manually unmark a resource as tainted'
+ 'validate:Validates the Terraform files'
'version:Prints the Terraform version'
+ 'workspace:Workspace management'
)
__apply() {
_arguments \
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
+ '-auto-approve[Skip interactive approval of plan before applying.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
'-input=[(true) Ask for input for variables if not directly set.]' \
- '-no-color[If specified, output will not contain any color.]' \
+ '-no-color[If specified, output wil be colorless.]' \
+ '-parallelism=[(10) Limit the number of parallel resource operations.]' \
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
- '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
+ '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
- '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
- '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
+ '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
+}
+
+__console() {
+ _arguments \
+ '-state=[(terraform.tfstate) Path to read state.]' \
+ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
+ '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
}
__destroy() {
_arguments \
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
- '-force[If set, then the destroy confirmation will not be shown.]' \
- '-input=[(true) Ask for input for variables if not directly set.]' \
- '-no-color[If specified, output will not contain any color.]' \
+ '-auto-approve[Skip interactive approval before destroying.]' \
+ '-force[Deprecated: same as auto-approve.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
+ '-no-color[If specified, output will contain no color.]' \
+ '-parallelism=[(10) Limit the number of concurrent operations.]' \
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
- '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
+ '-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
- '-target=[(resource) Instead of affecting "dependencies" will instead also destroy any resources that depend on the target(s) specified.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
- '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
+ '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
+}
+
+__fmt() {
+ _arguments \
+ '-list=[(true) List files whose formatting differs (always false if using STDIN)]' \
+ '-write=[(true) Write result to source file instead of STDOUT (always false if using STDIN or -check)]' \
+ '-diff=[(false) Display diffs of formatting changes]' \
+ '-check=[(false) Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]'
}
__get() {
_arguments \
- '-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]'
+ '-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]' \
+ '-no-color[If specified, output will contain no color.]'
}
__graph() {
_arguments \
'-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors.]' \
- '-module-depth=[(n) The maximum depth to expand modules. By default this is zero, which will not expand modules at all.]' \
- '-verbose[Generate a verbose, "worst-case" graph, with all nodes for potential operations in place.]'
+ '-no-color[If specified, output will contain no color.]' \
+ '-type=[(plan) Type of graph to output. Can be: plan, plan-destroy, apply, validate, input, refresh.]'
+}
+
+__import() {
+ _arguments \
+ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
+ '-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]' \
+ '-allow-missing-config[Allow import when no resource configuration block exists.]' \
+ '-input=[(true) Ask for input for variables if not directly set.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
+ '-no-color[If specified, output will contain no color.]' \
+ '-provider=[(provider) Specific provider to use for import. This is used for specifying aliases, such as "aws.eu". Defaults to the normal provider prefix of the resource being imported.]' \
+ '-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]' \
+ '-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]' \
+ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \
+ '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]'
}
__init() {
_arguments \
- '-address=[(url) URL of the remote storage server. Required for HTTP backend, optional for Atlas and Consul.]' \
- '-access-token=[(token) Authentication token for state storage server. Required for Atlas backend, optional for Consul.]' \
- '-backend=[(atlas) Specifies the type of remote backend. Must be one of Atlas, Consul, or HTTP. Defaults to atlas.]' \
- '-name=[(name) Name of the state file in the state storage server. Required for Atlas backend.]' \
- '-path=[(path) Path of the remote state in Consul. Required for the Consul backend.]'
+ '-backend=[(true) Configure the backend for this configuration.]' \
+ '-backend-config=[This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a 'key=value' format. This is merged with what is in the configuration file. This can be specified multiple times. The backend type must be in the configuration itself.]' \
+ '-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \
+ '-from-module=[Copy the contents of the given module into the target directory before initialization.]' \
+ '-get=[(true) Download any modules for this configuration.]' \
+ '-get-plugins=[(true) Download any missing plugins for this configuration.]' \
+ '-input=[(true) Ask for input if necessary. If false, will error if input was required.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
+ '-no-color[If specified, output will contain no color.]' \
+ '-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]' \
+ '-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \
+ '-upgrade=[(false) If installing modules (-get) or plugins (-get-plugins), ignore previously-downloaded objects and install the latest version allowed within configured constraints.]' \
+ '-verify-plugins=[(true) Verify the authenticity and integrity of automatically downloaded plugins.]'
}
__output() {
_arguments \
'-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate".]' \
- '-module=[(module_name) The module path which has needed output. By default this is the root path. Other modules can be specified by a period-separated list.]'
+ '-no-color[ If specified, output will contain no color.]' \
+ '-module=[(name) If specified, returns the outputs for a specific module]' \
+ '-json[If specified, machine readable output will be printed in JSON format]'
}
__plan() {
_arguments \
- '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with" .backup" extension. Set to "-" to disable backup.]' \
- '-destroy[If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \
- '-detailed-exitcode[Return a detailed exit code when the command exits. When provided, this argument changes the exit codes and their meanings to provide more granular information about what the resulting plan contains]' \
+ '-destroy[() If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \
+ '-detailed-exitcode[() Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \
'-input=[(true) Ask for input for variables if not directly set.]' \
- '-module-depth=[(n) Specifies the depth of modules to show in the output. This does not affect the plan itself, only the output shown. By default, this is zero. -1 will expand all.]' \
- '-no-color[If specified, output will not contain any color.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
+ '-module-depth=[(n) Specifies the depth of modules to show in the output. This does not affect the plan itself, only the output shown. By default, this is -1, which will expand all.]' \
+ '-no-color[() If specified, output will contain no color.]' \
'-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \
+ '-parallelism=[(10) Limit the number of concurrent operations.]' \
'-refresh=[(true) Update state prior to checking for differences.]' \
'-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]' \
- '-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
+ '-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]' \
'-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
- '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
+ '-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]' \
+}
+
+__providers() {
+ _arguments \
+
}
__push() {
@@ -98,12 +160,15 @@ __push() {
'-token=[(token) Atlas API token to use to authorize the upload. If blank or unspecified, the ATLAS_TOKEN environmental variable will be used.]' \
'-var=[("foo=bar") Set the value of a variable for the Terraform configuration.]' \
'-var-file=[(foo) Set the value of variables using a variable file.]' \
- '-vcs=[(true) If true (default), then Terraform will detect if a VCS is in use, such as Git, and will only upload files that are comitted to version control. If no version control system is detected, Terraform will upload all files in path (parameter to the command).]'
+ '-vcs=[(true) If true (default), then Terraform will detect if a VCS is in use, such as Git, and will only upload files that are committed to version control. If no version control system is detected, Terraform will upload all files in path (parameter to the command).]'
}
__refresh() {
_arguments \
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
+ '-input=[(true) Ask for input for variables if not directly set.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
'-no-color[If specified, output will not contain any color.]' \
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]' \
@@ -112,19 +177,6 @@ __refresh() {
'-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
}
-__remote() {
- _arguments \
- '-address=[(url) URL of the remote storage server. Required for HTTP backend, optional for Atlas and Consul.]' \
- '-access-token=[(token) Authentication token for state storage server. Required for Atlas backend, optional for Consul.]' \
- '-backend=[(atlas) Specifies the type of remote backend. Must be one of Atlas, Consul, or HTTP. Defaults to atlas.]' \
- '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
- '-disable[Disables remote state management and migrates the state to the -state path.]' \
- '-name=[(name) Name of the state file in the state storage server. Required for Atlas backend.]' \
- '-path=[(path) Path of the remote state in Consul. Required for the Consul backend.]' \
- '-pull=[(true) Controls if the remote state is pulled before disabling. This defaults to true to ensure the latest state is cached before disabling.]' \
- '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]'
-}
-
__show() {
_arguments \
'-module-depth=[(n) The maximum depth to expand modules. By default this is zero, which will not expand modules at all.]' \
@@ -135,12 +187,46 @@ __taint() {
_arguments \
'-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
'-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \
'-no-color[If specified, output will not contain any color.]' \
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
'-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]'
}
+__untaint() {
+ _arguments \
+ '-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \
+ '-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]' \
+ '-lock=[(true) Lock the state file when locking is supported.]' \
+ '-lock-timeout=[(0s) Duration to retry a state lock.]' \
+ '-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \
+ '-no-color[If specified, output will not contain any color.]' \
+ '-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]' \
+ '-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]'
+}
+
+__validate() {
+ _arguments \
+ '-check-variables=[(true) If set to true (default), the command will check whether all required variables have been specified.]' \
+ '-no-color[If specified, output will not contain any color.]' \
+ '-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
+ '-var-file=[(path) Set variables in the Terraform configuration from a file. If "terraform.tfvars" is present, it will be automatically loaded if this flag is not specified.]'
+}
+
+__workspace() {
+ local -a __workspace_cmds
+ __workspace_cmds=(
+ 'delete:Delete a workspace'
+ 'list:List Workspaces'
+ 'new:Create a new workspace'
+ 'select:Select a workspace'
+ 'show:Show the name of the current workspace'
+ )
+ _describe -t workspace "workspace commands" __workspace_cmds
+}
+
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
@@ -152,26 +238,38 @@ local -a _command_args
case "$words[1]" in
apply)
__apply ;;
+ console)
+ __console;;
destroy)
__destroy ;;
+ fmt)
+ __fmt;;
get)
__get ;;
graph)
__graph ;;
+ import)
+ __import;;
init)
__init ;;
output)
__output ;;
plan)
__plan ;;
+ providers)
+ __providers ;;
push)
__push ;;
refresh)
__refresh ;;
- remote)
- __remote ;;
show)
__show ;;
taint)
__taint ;;
+ untaint)
+ __untaint ;;
+ validate)
+ __validate ;;
+ workspace)
+ test $CURRENT -lt 3 && __workspace ;;
esac
diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh
new file mode 100644
index 000000000..b170f73a6
--- /dev/null
+++ b/plugins/terraform/terraform.plugin.zsh
@@ -0,0 +1,7 @@
+function tf_prompt_info() {
+ # check if in terraform dir
+ if [ -d .terraform ]; then
+ workspace=$(terraform workspace show 2> /dev/null) || return
+ echo "[${workspace}]"
+ fi
+}
diff --git a/plugins/ubuntu/readme.md b/plugins/ubuntu/readme.md
index c9ef61f4e..99d62a6f7 100644
--- a/plugins/ubuntu/readme.md
+++ b/plugins/ubuntu/readme.md
@@ -10,12 +10,12 @@ 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 exeptional 4 letter alias for a single command.
+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 Dist-upgrade
+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/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh
index ffde284fe..f7363feb8 100644
--- a/plugins/ubuntu/ubuntu.plugin.zsh
+++ b/plugins/ubuntu/ubuntu.plugin.zsh
@@ -2,58 +2,71 @@
# https://github.com/AlexBio
# https://github.com/dbb
# https://github.com/Mappleconfusers
+# https://github.com/trinaldi
# Nicolas Jonas nextgenthemes.com
# https://github.com/loctauxphilippe
+# https://github.com/HaraldNordgren
#
# Debian, Ubuntu and friends related zsh aliases and functions for zsh
+(( $+commands[apt] )) && APT=apt || APT=apt-get
+
alias acs='apt-cache search'
compdef _acs acs='apt-cache search'
alias afs='apt-file search --regexp'
compdef _afs afs='apt-file search --regexp'
-# These are apt-get only
-alias ags='apt-get source' # asrc
-compdef _ags ags='apt-get source'
+# These are apt/apt-get only
+alias ags="$APT source" # asrc
+compdef _ags ags="$APT source"
alias acp='apt-cache policy' # app
compdef _acp acp='apt-cache policy'
+#List all installed packages
+alias agli='apt list --installed'
+compdef _agli agli='apt list --installed'
+
# superuser operations ######################################################
+
+# List available updates only
+alias aglu='sudo apt-get -u upgrade --assume-no'
+compdef _aglu aglu='sudo apt-get -u upgrade --assume-no'
+
alias afu='sudo apt-file update'
compdef _afu afu='sudo apt-file update'
alias ppap='sudo ppa-purge'
compdef _ppap ppap='sudo ppa-purge'
-alias ag='sudo apt-get' # age - but without sudo
-alias aga='sudo apt-get autoclean' # aac
-alias agb='sudo apt-get build-dep' # abd
-alias agc='sudo apt-get clean' # adc
-alias agd='sudo apt-get dselect-upgrade' # ads
-alias agi='sudo apt-get install' # ai
-alias agp='sudo apt-get purge' # ap
-alias agr='sudo apt-get remove' # ar
-alias agu='sudo apt-get update' # ad
-alias agud='sudo apt-get update && sudo apt-get dist-upgrade' #adu
-alias agug='sudo apt-get upgrade' # ag
-alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg
-alias agar='sudo apt-get autoremove'
-
-compdef _ag ag='sudo apt-get'
-compdef _aga aga='sudo apt-get autoclean'
-compdef _agb agb='sudo apt-get build-dep'
-compdef _agc agc='sudo apt-get clean'
-compdef _agd agd='sudo apt-get dselect-upgrade'
-compdef _agi agi='sudo apt-get install'
-compdef _agp agp='sudo apt-get purge'
-compdef _agr agr='sudo apt-get remove'
-compdef _agu agu='sudo apt-get update'
-compdef _agud agud='sudo apt-get update && sudo apt-get dist-upgrade'
-compdef _agug agug='sudo apt-get upgrade'
-compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade'
-compdef _agar agar='sudo apt-get autoremove'
+alias ag="sudo $APT" # age - but without sudo
+alias aga="sudo $APT autoclean" # aac
+alias agb="sudo $APT build-dep" # abd
+alias agc="sudo $APT clean" # adc
+alias agd="sudo $APT dselect-upgrade" # ads
+alias agi="sudo $APT install" # ai
+alias agp="sudo $APT purge" # ap
+alias agr="sudo $APT remove" # ar
+alias agu="sudo $APT update" # ad
+alias agud="sudo $APT update && sudo $APT dist-upgrade" #adu
+alias agug="sudo $APT upgrade" # ag
+alias aguu="sudo $APT update && sudo $APT upgrade" #adg
+alias agar="sudo $APT autoremove"
+
+compdef _ag ag="sudo $APT"
+compdef _aga aga="sudo $APT autoclean"
+compdef _agb agb="sudo $APT build-dep"
+compdef _agc agc="sudo $APT clean"
+compdef _agd agd="sudo $APT dselect-upgrade"
+compdef _agi agi="sudo $APT install"
+compdef _agp agp="sudo $APT purge"
+compdef _agr agr="sudo $APT remove"
+compdef _agu agu="sudo $APT update"
+compdef _agud agud="sudo $APT update && sudo $APT dist-upgrade"
+compdef _agug agug="sudo $APT upgrade"
+compdef _aguu aguu="sudo $APT update && sudo $APT upgrade"
+compdef _agar agar="sudo $APT autoremove"
# Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
@@ -69,7 +82,7 @@ alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
# apt-add-repository with automatic install/upgrade of the desired package
# Usage: aar ppa:xxxxxx/xxxxxx [packagename]
# If packagename is not given as 2nd argument the function will ask for it and guess the default by taking
-# the part after the / from the ppa name wich is sometimes the right name for the package you want to install
+# the part after the / from the ppa name which is sometimes the right name for the package you want to install
aar() {
if [ -n "$2" ]; then
PACKAGE=$2
@@ -81,8 +94,8 @@ aar() {
PACKAGE=${1##*/}
fi
- sudo apt-add-repository $1 && sudo apt-get update
- sudo apt-get install $PACKAGE
+ sudo apt-add-repository $1 && sudo $APT update
+ sudo $APT install $PACKAGE
}
# Prints apt history
@@ -108,7 +121,7 @@ apt-history () {
awk '{print $4"="$5}'
;;
list)
- zcat $(ls -rt /var/log/dpkg*)
+ zgrep --no-filename '' $(ls -rt /var/log/dpkg*)
;;
*)
echo "Parameters:"
diff --git a/plugins/vagrant/_vagrant b/plugins/vagrant/_vagrant
index c5335e72e..a32347daa 100644
--- a/plugins/vagrant/_vagrant
+++ b/plugins/vagrant/_vagrant
@@ -81,7 +81,7 @@ __vagrant-box ()
case $state in
(command)
- _describe -t commands "gem subcommand" _box_arguments
+ _describe -t commands "vagrant subcommand" _box_arguments
return
;;
@@ -110,7 +110,7 @@ _arguments -C \
case $state in
(command)
- _describe -t commands "gem subcommand" _1st_arguments
+ _describe -t commands "vagrant subcommand" _1st_arguments
return
;;
diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
index 6cd30732e..484f18c91 100644
--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
@@ -6,6 +6,13 @@ if (( $+commands[$virtualenvwrapper] )); then
unsetopt equals
source ${${virtualenvwrapper}:c}
}
+elif [[ -f "/usr/local/bin/virtualenvwrapper.sh" ]]; then
+ function {
+ setopt local_options
+ unsetopt equals
+ virtualenvwrapper="/usr/local/bin/virtualenvwrapper.sh"
+ source "/usr/local/bin/virtualenvwrapper.sh"
+ }
elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
function {
setopt local_options
diff --git a/plugins/wd/README.md b/plugins/wd/README.md
index ed149eb3e..b1deeffd5 100644
--- a/plugins/wd/README.md
+++ b/plugins/wd/README.md
@@ -3,16 +3,17 @@ wd
[![Build Status](https://travis-ci.org/mfaerevaag/wd.png?branch=master)](https://travis-ci.org/mfaerevaag/wd)
-`wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems ineffecient when the folder is frequently visited or has a long path.
+`wd` (*warp directory*) lets you jump to custom directories in zsh, without using `cd`. Why? Because `cd` seems inefficient when the folder is frequently visited or has a long path.
-*NOTE*: If you are not using zsh, check out the `ruby` branch which has `wd` implemented as a gem.
+![tty.gif](https://raw.githubusercontent.com/mfaerevaag/wd/master/tty.gif)
+*NEWS*: If you are not using zsh, check out the c-port, [wd-c](https://github.com/mfaerevaag/wd-c), which works with all shells using wrapper functions.
### Setup
### oh-my-zsh
-`wd` comes bundles with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
+`wd` comes bundled with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
Just add the plugin in your `~/.zshrc` file:
@@ -27,6 +28,10 @@ Run either in terminal:
* `wget --no-check-certificate https://github.com/mfaerevaag/wd/raw/master/install.sh -O - | sh`
+##### Arch ([AUR](https://aur.archlinux.org/))
+
+ # yaourt -S zsh-plugin-wd-git
+
#### Manual
@@ -48,7 +53,7 @@ Run either in terminal:
#### Completion
-If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utelize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
+If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utilize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
fpath=(~/path/to/wd $fpath)
@@ -66,7 +71,9 @@ Also, you may have to force a rebuild of `zcompdump` by running:
If a warp point with the same name exists, use `add!` to overwrite it.
- Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict other features, as below.
+ Note, a warp point cannot contain colons, or only consist of only spaces and dots. The first will conflict in how `wd` stores the warp points, and the second will conflict with other features, as below.
+
+ You can omit point name to use the current directory's name instead.
* From an other directory (not necessarily), warp to `foo` with:
@@ -84,6 +91,8 @@ Also, you may have to force a rebuild of `zcompdump` by running:
$ wd rm foo
+ You can omit point name to use the current directory's name instead.
+
* List all warp points (stored in `~/.warprc`):
$ wd list
@@ -143,8 +152,8 @@ The project is licensed under the [MIT-license](https://github.com/mfaerevaag/wd
### Finally
-If you have issues, feedback or improvements, don't hesitate to report it or submit a pull-request. In the case of an issue, we would much appreciate if you would include a failing test in `test/tests.sh`. Explanation on how to run the tests, read the section "Testing" in this README.
+If you have issues, feedback or improvements, don't hesitate to report it or submit a pull-request. In the case of an issue, we would much appreciate if you would include a failing test in `test/tests.sh`. For an explanation on how to run the tests, read the section "Testing" in this README.
-Credit to [altschuler](https://github.com/altschuler) for awesome idea.
+Credit to [altschuler](https://github.com/altschuler) for an awesome idea.
Hope you enjoy!
diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh
index b67f4a1e2..4354a71f4 100644
--- a/plugins/wd/_wd.sh
+++ b/plugins/wd/_wd.sh
@@ -16,6 +16,19 @@ function _wd() {
warp_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" )
+ typeset -A points
+ while read -r line
+ do
+ arr=(${(s,:,)line})
+ name=${arr[1]}
+ target_path=${arr[2]}
+
+ # replace ~ from path to fix completion (#17)
+ target_path=${target_path/#\~/$HOME}
+
+ points[$name]=$target_path
+ done < $CONFIG
+
commands=(
'add:Adds the current working directory to your warp points'
'add!:Overwrites existing warp point'
@@ -34,13 +47,15 @@ function _wd() {
'1: :->first_arg' \
'2: :->second_arg' && ret=0
+ local target=$words[2]
+
case $state in
first_arg)
_describe -t warp_points "Warp points" warp_points && ret=0
_describe -t commands "Commands" commands && ret=0
;;
second_arg)
- case $words[2] in
+ case $target in
add\!|rm)
_describe -t points "Warp points" warp_points && ret=0
;;
@@ -56,6 +71,10 @@ function _wd() {
path)
_describe -t points "Warp points" warp_points && ret=0
;;
+ *)
+ # complete sub directories from the warp point
+ _path_files -W "(${points[$target]})" -/ && ret=0
+ ;;
esac
;;
esac
diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh
index cf54713bd..3d68583f1 100755
--- a/plugins/wd/wd.sh
+++ b/plugins/wd/wd.sh
@@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd
# version
-readonly WD_VERSION=0.4.2
+readonly WD_VERSION=0.4.6
# colors
readonly WD_BLUE="\033[96m"
@@ -72,25 +72,28 @@ wd_print_msg()
wd_print_usage()
{
cat <<- EOF
-Usage: wd [command] <point>
+Usage: wd [command] [point]
Commands:
- add <point> Adds the current working directory to your warp points
- add! <point> Overwrites existing warp point
- rm <point> Removes the given warp point
- show Print warp points to current directory
- show <point> Print path to given warp point
- list Print all stored warp points
-ls <point> Show files from given warp point
-path <point> Show the path to given warp point
- clean! Remove points warping to nonexistent directories
-
- -v | --version Print version
- -d | --debug Exit after execution with exit codes (for testing)
- -c | --config Specify config file (default ~/.warprc)
- -q | --quiet Suppress all output
-
- help Show this extremely helpful text
+ add <point> Adds the current working directory to your warp points
+ add Adds the current working directory to your warp points with current directory's name
+ add! <point> Overwrites existing warp point
+ add! Overwrites existing warp point with current directory's name
+ rm <point> Removes the given warp point
+ rm Removes the given warp point with current directory's name
+ show <point> Print path to given warp point
+ show Print warp points to current directory
+ list Print all stored warp points
+ ls <point> Show files from given warp point (ls)
+ path <point> Show the path to given warp point (pwd)
+ clean! Remove points warping to nonexistent directories
+
+ -v | --version Print version
+ -d | --debug Exit after execution with exit codes (for testing)
+ -c | --config Specify config file (default ~/.warprc)
+ -q | --quiet Suppress all output
+
+ help Show this extremely helpful text
EOF
}
@@ -131,10 +134,11 @@ wd_getdir()
wd_warp()
{
local point=$1
+ local sub=$2
if [[ $point =~ "^\.+$" ]]
then
- if [ $#1 < 2 ]
+ if [[ $#1 < 2 ]]
then
wd_exit_warn "Warping to current directory?"
else
@@ -143,7 +147,12 @@ wd_warp()
fi
elif [[ ${points[$point]} != "" ]]
then
- cd ${points[$point]/#\~/$HOME}
+ if [[ $sub != "" ]]
+ then
+ cd ${points[$point]/#\~/$HOME}/$sub
+ else
+ cd ${points[$point]/#\~/$HOME}
+ fi
else
wd_exit_fail "Unknown warp point '${point}'"
fi
@@ -154,6 +163,11 @@ wd_add()
local force=$1
local point=$2
+ if [[ $point == "" ]]
+ then
+ point=$(basename $PWD)
+ fi
+
if [[ $point =~ "^[\.]+$" ]]
then
wd_exit_fail "Warp point cannot be just dots"
@@ -163,10 +177,7 @@ wd_add()
elif [[ $point == *:* ]]
then
wd_exit_fail "Warp point cannot contain colons"
- elif [[ $point == "" ]]
- then
- wd_exit_fail "Warp point cannot be empty"
- elif [[ ${points[$2]} == "" ]] || $force
+ elif [[ ${points[$point]} == "" ]] || $force
then
wd_remove $point > /dev/null
printf "%q:%s\n" "${point}" "${PWD/#$HOME/~}" >> $WD_CONFIG
@@ -185,6 +196,11 @@ wd_remove()
{
local point=$1
+ if [[ $point == "" ]]
+ then
+ point=$(basename $PWD)
+ fi
+
if [[ ${points[$point]} != "" ]]
then
local config_tmp=$WD_CONFIG.tmp
@@ -294,7 +310,7 @@ wd_clean() {
key=${arr[1]}
val=${arr[2]}
- if [ -d "$val" ]
+ if [ -d "${val/#\~/$HOME}" ]
then
wd_tmp=$wd_tmp"\n"`echo $line`
else
@@ -356,7 +372,8 @@ while read -r line
do
arr=(${(s,:,)line})
key=${arr[1]}
- val=${arr[2]}
+ # join the rest, in case the path contains colons
+ val=${(j,:,)arr[2,-1]}
points[$key]=$val
done < $WD_CONFIG
@@ -424,7 +441,7 @@ else
break
;;
*)
- wd_warp $o
+ wd_warp $o $2
break
;;
--)
diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh
index 3b5478ca2..863384223 100644
--- a/plugins/web-search/web-search.plugin.zsh
+++ b/plugins/web-search/web-search.plugin.zsh
@@ -15,6 +15,8 @@ function web_search() {
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="
)
# check whether the search engine is supported
@@ -47,6 +49,8 @@ alias yandex='web_search yandex'
alias github='web_search github'
alias baidu='web_search baidu'
alias ecosia='web_search ecosia'
+alias goodreads='web_search goodreads'
+alias qwant='web_search qwant'
#add your own !bang searches here
alias wiki='web_search duckduckgo \!w'
diff --git a/plugins/yarn/yarn.plugin.zsh b/plugins/yarn/yarn.plugin.zsh
new file mode 100644
index 000000000..5fa512377
--- /dev/null
+++ b/plugins/yarn/yarn.plugin.zsh
@@ -0,0 +1,88 @@
+# Alias sorted alphabetically
+
+alias y="yarn "
+alias ya="yarn add"
+alias ycc="yarn cache clean"
+alias yh="yarn help"
+alias yo="yarn outdated"
+alias yui="yarn upgrade-interactive"
+
+_yarn ()
+{
+ local -a _1st_arguments _dopts _dev _production
+ local expl
+ typeset -A opt_args
+
+ _dopts=(
+ '(--force)--force[This refetches all packages, even ones that were previously installed.]'
+ )
+
+ _installopts=(
+ '(--flat)--flat[Only allow one version of a package. On the first run this will prompt you to choose a single version for each package that is depended on at multiple version ranges.]'
+ '(--har)--har[Outputs an HTTP archive from all the network requests performed during the installation.]'
+ '(--no-lockfile)--no-lockfile[Don’t read or generate a yarn.lock lockfile.]'
+ '(--pure-lockfile)--pure-lockfile[Don’t generate a yarn.lock lockfile.]'
+ )
+
+ _dev=('(--dev)--dev[Save installed packages into the project"s package.json devDependencies]')
+
+ _production=('(--production)--production[Do not install project devDependencies]')
+
+ _1st_arguments=(
+ 'help:Display help information about yarn' \
+ 'init:Initialize for the development of a package.' \
+ 'add:Add a package to use in your current package.' \
+ 'install:Install all the dependencies listed within package.json in the local node_modules folder.' \
+ 'publish:Publish a package to a package manager.' \
+ 'remove:Remove a package that will no longer be used in your current package.' \
+ 'cache:Clear the local cache. It will be populated again the next time yarn or yarn install is run.' \
+ 'clean:Frees up space by removing unnecessary files and folders from dependencies.' \
+ 'check:Verifies that versions of the package dependencies in the current project’s package.json matches that of yarn’s lock file.' \
+ 'ls:List all installed packages.' \
+ 'global:Makes binaries available to use on your operating system.' \
+ 'info:<package> [<field>] - fetch information about a package and return it in a tree format.' \
+ 'outdated:Checks for outdated package dependencies.' \
+ 'run:Runs a defined package script.' \
+ 'self-update:Updates Yarn to the latest version.' \
+ 'upgrade:Upgrades packages to their latest version based on the specified range.' \
+ 'why:<query> - Show information about why a package is installed.'
+ )
+ _arguments \
+ '*:: :->subcmds' && return 0
+
+ if (( CURRENT == 1 )); then
+ _describe -t commands "yarn subcommand" _1st_arguments
+ return
+ fi
+
+ case "$words[1]" in
+ add)
+ _arguments \
+ $_dopts \
+ $_dev \
+ $_production
+ ;;
+ install)
+ _arguments \
+ $_installopts \
+ $_dopts \
+ $_dev \
+ $_no_color \
+ $_production
+ ;;
+ update)
+ _arguments \
+ $_dopts
+ ;;
+ remove)
+ _arguments \
+ $_dopts
+ ;;
+ *)
+ _arguments \
+ ;;
+ esac
+
+}
+
+compdef _yarn yarn
diff --git a/plugins/z/README b/plugins/z/README
index 7de82a4c7..56261cff4 100644
--- a/plugins/z/README
+++ b/plugins/z/README
@@ -125,7 +125,7 @@ ENVIRONMENT
Directories must be full paths without trailing slashes.
The environment variable $_Z_OWNER can be set to your username, to
- allow usage of z when your sudo enviroment keeps $HOME set.
+ allow usage of z when your sudo environment keeps $HOME set.
FILES
Data is stored in $HOME/.z. This can be overridden by setting the
diff --git a/plugins/z/z.1 b/plugins/z/z.1
index cc99910bf..bbc1bf5df 100644
--- a/plugins/z/z.1
+++ b/plugins/z/z.1
@@ -151,7 +151,7 @@ directory trees to exclude from tracking. \fB$HOME\fR is always excluded.
Directories must be full paths without trailing slashes.
.P
The environment variable \fB$_Z_OWNER\fR can be set to your username, to
-allow usage of \fBz\fR when your sudo enviroment keeps \fB$HOME\fR set.
+allow usage of \fBz\fR when your sudo environment keeps \fB$HOME\fR set.
.SH
FILES
Data is stored in \fB$HOME/.z\fR. This can be overridden by setting the
diff --git a/plugins/zsh_reload/README.md b/plugins/zsh_reload/README.md
new file mode 100644
index 000000000..d31a827fe
--- /dev/null
+++ b/plugins/zsh_reload/README.md
@@ -0,0 +1,23 @@
+# zsh_reload plugin
+
+The zsh_reload plugin defines a function to reload the zsh session with
+just a few keystrokes.
+
+To use it, add `zsh_reload` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... zsh_reload)
+```
+
+## Usage
+
+To reload the zsh session, just run `src`:
+
+```zsh
+$ vim ~/.zshrc # enabled a plugin
+$ src
+re-compiling /home/user/.zshrc.zwc: succeeded
+re-compiling /home/user/.oh-my-zsh/cache/zcomp-host.zwc: succeeded
+
+# you now have a fresh zsh session. happy hacking!
+```
diff --git a/plugins/zsh_reload/zsh_reload.plugin.zsh b/plugins/zsh_reload/zsh_reload.plugin.zsh
index cde9ebeca..51048ba9d 100644
--- a/plugins/zsh_reload/zsh_reload.plugin.zsh
+++ b/plugins/zsh_reload/zsh_reload.plugin.zsh
@@ -1,13 +1,12 @@
-# reload zshrc
-function src()
-{
- local cache=$ZSH_CACHE_DIR
- autoload -U compinit zrecompile
- compinit -d "$cache/zcomp-$HOST"
+src() {
+ local cache="$ZSH_CACHE_DIR"
+ autoload -U compinit zrecompile
+ compinit -i -d "$cache/zcomp-$HOST"
- for f in ~/.zshrc "$cache/zcomp-$HOST"; do
- zrecompile -p $f && command rm -f $f.zwc.old
- done
+ for f in ~/.zshrc "$cache/zcomp-$HOST"; do
+ zrecompile -p $f && command rm -f $f.zwc.old
+ done
- source ~/.zshrc
+ # Use $SHELL if available; remove leading dash if login shell
+ [[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
}
diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
index af42e5b9f..bba2d370d 100644
--- a/templates/zshrc.zsh-template
+++ b/templates/zshrc.zsh-template
@@ -9,6 +9,13 @@ export ZSH=$HOME/.oh-my-zsh
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
+# Set list of themes to load
+# Setting this variable when ZSH_THEME=random
+# cause zsh load theme from this variable instead of
+# looking in ~/.oh-my-zsh/themes/
+# An empty array have no effect
+# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
+
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
@@ -51,7 +58,9 @@ 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/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 97d142a0f..1c6d1732c 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -27,7 +27,7 @@ else
fi
# git settings
-ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:"
+ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075]($FG[078]"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 07546fd34..b0a794f4d 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -93,9 +93,9 @@ prompt_git() {
PL_BRANCH_CHAR=$'\ue0a0' # 
}
local ref dirty mode repo_path
- repo_path=$(git rev-parse --git-dir 2>/dev/null)
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
+ repo_path=$(git rev-parse --git-dir 2>/dev/null)
dirty=$(parse_git_dirty)
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
if [[ -n $dirty ]]; then
@@ -151,7 +151,7 @@ prompt_bzr() {
prompt_hg() {
(( $+commands[hg] )) || return
- local rev status
+ local rev st branch
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
index 4f0dcbcc6..c43fcc9fe 100644
--- a/themes/avit.zsh-theme
+++ b/themes/avit.zsh-theme
@@ -50,9 +50,7 @@ function _ruby_version() {
# use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() {
# Only proceed if there is actually a commit.
- if git log -1 > /dev/null 2>&1; then
- # Get the last commit.
- last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null)
+ if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
now=$(date +%s)
seconds_since_last_commit=$((now-last_commit))
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index 4b2853c32..29bda0be8 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -10,7 +10,7 @@ else
local user_symbol='$'
fi
-local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
+local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
local rvm_ruby=''
if which rvm-prompt &> /dev/null; then
rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme
index 4efbf9776..59a3472b6 100644
--- a/themes/cloud.zsh-theme
+++ b/themes/cloud.zsh-theme
@@ -6,5 +6,5 @@ PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[gr
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" \ No newline at end of file
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡ %{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
diff --git a/themes/emotty.zsh-theme b/themes/emotty.zsh-theme
index 34d491ff0..13adad78d 100644
--- a/themes/emotty.zsh-theme
+++ b/themes/emotty.zsh-theme
@@ -68,6 +68,10 @@ prompt_glyph="%{%(#.${root_prompt}.${user_prompt}) %2G%}"
setopt promptsubst
+# Workaround for zsh 5.2 release (kudos to @timothybasanov)
+autoload +X VCS_INFO_nvcsformats
+functions[VCS_INFO_nvcsformats]=${functions[VCS_INFO_nvcsformats]/local -a msgs/}
+
autoload -U add-zsh-hook
autoload -Uz vcs_info
diff --git a/themes/gallifrey.zsh-theme b/themes/gallifrey.zsh-theme
index fce7cb923..252566f06 100644
--- a/themes/gallifrey.zsh-theme
+++ b/themes/gallifrey.zsh-theme
@@ -1,4 +1,4 @@
-# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg
+# ZSH Theme - Preview: https://flic.kr/p/ZFvivf
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg[green]%}%m%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b '
diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme
index a3c505706..8b458cde9 100644
--- a/themes/half-life.zsh-theme
+++ b/themes/half-life.zsh-theme
@@ -17,7 +17,7 @@ setopt prompt_subst
autoload -U add-zsh-hook
autoload -Uz vcs_info
-#use extended color pallete if available
+#use extended color palette if available
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
turquoise="%F{81}"
orange="%F{166}"
@@ -60,7 +60,7 @@ zstyle ':vcs_info:*:prompt:*' nvcsformats ""
function steeef_preexec {
- case "$(history $HISTCMD)" in
+ case "$2" in
*git*)
PR_GIT_UPDATE=1
;;
diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme
index a5a226b69..e2424465a 100644
--- a/themes/nebirhos.zsh-theme
+++ b/themes/nebirhos.zsh-theme
@@ -11,7 +11,7 @@ else
fi
# Get the host name (first 4 chars)
-HOST_PROMPT_="%{$fg_bold[red]%}@$HOST[0,4] ➜ %{$fg_bold[cyan]%}%c "
+HOST_PROMPT_="%{$fg_bold[red]%}@$HOST ➜ %{$fg_bold[cyan]%}%c "
GIT_PROMPT="%{$fg_bold[blue]%}\$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}"
PROMPT="$HOST_PROMPT_$RUBY_PROMPT_$GIT_PROMPT"
diff --git a/themes/pure.zsh-theme b/themes/pure.zsh-theme
index 1473194a5..98c1312af 100644
--- a/themes/pure.zsh-theme
+++ b/themes/pure.zsh-theme
@@ -1,106 +1,10 @@
-#!/usr/bin/env zsh
+print -P '%F{yellow}'Oh My Zsh pure theme:
+cat <<-EOF
-# ------------------------------------------------------------------------------
-#
-# Pure - A minimal and beautiful theme for oh-my-zsh
-#
-# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
-# thanks goes out to him for designing the fantastic Pure prompt in the first
-# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from
-# which I've borrowed both some ideas and some actual code. You can find out
-# more about both of these fantastic two people here:
-#
-# Sindre Sorhus
-# Github: https://github.com/sindresorhus
-# Twitter: https://twitter.com/sindresorhus
-#
-# Julien Nicoulaud
-# Github: https://github.com/nicoulaj
-# Twitter: https://twitter.com/nicoulaj
-#
-# ------------------------------------------------------------------------------
+ The pure theme has been renamed as 'refined' as per the original author's
+ request. Change your ZSH_THEME to 'refined' to avoid seeing this warning.
-# Set required options
-#
-setopt prompt_subst
+EOF
+print -P '%f'
-# Load required modules
-#
-autoload -Uz vcs_info
-
-# Set vcs_info parameters
-#
-zstyle ':vcs_info:*' enable hg bzr git
-zstyle ':vcs_info:*:*' unstagedstr '!'
-zstyle ':vcs_info:*:*' stagedstr '+'
-zstyle ':vcs_info:*:*' formats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%%u%c"
-zstyle ':vcs_info:*:*' actionformats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%u%c (%a)"
-zstyle ':vcs_info:*:*' nvcsformats "%~" "" ""
-
-# Fastest possible way to check if repo is dirty
-#
-git_dirty() {
- # Check if we're in a git repo
- command git rev-parse --is-inside-work-tree &>/dev/null || return
- # Check if it's dirty
- command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo "*"
-}
-
-# Display information about the current repository
-#
-repo_information() {
- echo "%F{blue}${vcs_info_msg_0_%%/.} %F{8}$vcs_info_msg_1_`git_dirty` $vcs_info_msg_2_%f"
-}
-
-# Displays the exec time of the last command if set threshold was exceeded
-#
-cmd_exec_time() {
- local stop=`date +%s`
- local start=${cmd_timestamp:-$stop}
- let local elapsed=$stop-$start
- [ $elapsed -gt 5 ] && echo ${elapsed}s
-}
-
-# Get the intial timestamp for cmd_exec_time
-#
-preexec() {
- cmd_timestamp=`date +%s`
-}
-
-# Output additional information about paths, repos and exec time
-#
-precmd() {
- vcs_info # Get version control info before we start outputting stuff
- print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f"
-}
-
-# Define prompts
-#
-PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure
-RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH
-
-# ------------------------------------------------------------------------------
-#
-# List of vcs_info format strings:
-#
-# %b => current branch
-# %a => current action (rebase/merge)
-# %s => current version control system
-# %r => name of the root directory of the repository
-# %S => current path relative to the repository root directory
-# %m => in case of Git, show information about stashes
-# %u => show unstaged changes in the repository
-# %c => show staged changes in the repository
-#
-# List of prompt format strings:
-#
-# prompt:
-# %F => color dict
-# %f => reset color
-# %~ => current path
-# %* => time
-# %n => username
-# %m => shortname host
-# %(?..) => prompt conditional - %(condition.true.false)
-#
-# ------------------------------------------------------------------------------
+source ${0:h:A}/refined.zsh-theme
diff --git a/themes/refined.zsh-theme b/themes/refined.zsh-theme
new file mode 100644
index 000000000..0e5681cc7
--- /dev/null
+++ b/themes/refined.zsh-theme
@@ -0,0 +1,106 @@
+#!/usr/bin/env zsh
+
+# ------------------------------------------------------------------------------
+#
+# Pure - A minimal and beautiful theme for oh-my-zsh
+#
+# Based on the custom Zsh-prompt of the same name by Sindre Sorhus. A huge
+# thanks goes out to him for designing the fantastic Pure prompt in the first
+# place! I'd also like to thank Julien Nicoulaud for his "nicoulaj" theme from
+# which I've borrowed both some ideas and some actual code. You can find out
+# more about both of these fantastic two people here:
+#
+# Sindre Sorhus
+# Github: https://github.com/sindresorhus
+# Twitter: https://twitter.com/sindresorhus
+#
+# Julien Nicoulaud
+# Github: https://github.com/nicoulaj
+# Twitter: https://twitter.com/nicoulaj
+#
+# ------------------------------------------------------------------------------
+
+# Set required options
+#
+setopt prompt_subst
+
+# Load required modules
+#
+autoload -Uz vcs_info
+
+# Set vcs_info parameters
+#
+zstyle ':vcs_info:*' enable hg bzr git
+zstyle ':vcs_info:*:*' unstagedstr '!'
+zstyle ':vcs_info:*:*' stagedstr '+'
+zstyle ':vcs_info:*:*' formats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%%u%c"
+zstyle ':vcs_info:*:*' actionformats "$FX[bold]%r$FX[no-bold]/%S" "%s/%b" "%u%c (%a)"
+zstyle ':vcs_info:*:*' nvcsformats "%~" "" ""
+
+# Fastest possible way to check if repo is dirty
+#
+git_dirty() {
+ # Check if we're in a git repo
+ command git rev-parse --is-inside-work-tree &>/dev/null || return
+ # Check if it's dirty
+ command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo "*"
+}
+
+# Display information about the current repository
+#
+repo_information() {
+ echo "%F{blue}${vcs_info_msg_0_%%/.} %F{8}$vcs_info_msg_1_`git_dirty` $vcs_info_msg_2_%f"
+}
+
+# Displays the exec time of the last command if set threshold was exceeded
+#
+cmd_exec_time() {
+ local stop=`date +%s`
+ local start=${cmd_timestamp:-$stop}
+ let local elapsed=$stop-$start
+ [ $elapsed -gt 5 ] && echo ${elapsed}s
+}
+
+# Get the initial timestamp for cmd_exec_time
+#
+preexec() {
+ cmd_timestamp=`date +%s`
+}
+
+# Output additional information about paths, repos and exec time
+#
+precmd() {
+ vcs_info # Get version control info before we start outputting stuff
+ print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f"
+}
+
+# Define prompts
+#
+PROMPT="%(?.%F{magenta}.%F{red})❯%f " # Display a red prompt char on failure
+RPROMPT="%F{8}${SSH_TTY:+%n@%m}%f" # Display username if connected via SSH
+
+# ------------------------------------------------------------------------------
+#
+# List of vcs_info format strings:
+#
+# %b => current branch
+# %a => current action (rebase/merge)
+# %s => current version control system
+# %r => name of the root directory of the repository
+# %S => current path relative to the repository root directory
+# %m => in case of Git, show information about stashes
+# %u => show unstaged changes in the repository
+# %c => show staged changes in the repository
+#
+# List of prompt format strings:
+#
+# prompt:
+# %F => color dict
+# %f => reset color
+# %~ => current path
+# %* => time
+# %n => username
+# %m => shortname host
+# %(?..) => prompt conditional - %(condition.true.false)
+#
+# ------------------------------------------------------------------------------
diff --git a/themes/rkj-repos.zsh-theme b/themes/rkj-repos.zsh-theme
index a3f1f3dfa..65a075456 100644
--- a/themes/rkj-repos.zsh-theme
+++ b/themes/rkj-repos.zsh-theme
@@ -1,13 +1,13 @@
-# user, host, full path, and time/date
-# on two lines for easier vgrepping
-# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
+# user, host, full path, and time/date on two lines for easier vgrepping
function hg_prompt_info {
+ if (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then
hg prompt --angle-brackets "\
<hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\
</%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
%{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}<
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
+ fi
}
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+"
@@ -23,14 +23,13 @@ function mygit() {
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
- echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$(git_prompt_status)%{$fg_bold[blue]%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
fi
}
function retcode() {}
# alternate prompt with git & hg
-PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}
-%{\e[0;34m%}%B└─%B[%{\e[1;35m%}%?$(retcode)%{\e[0;34m%}%B] <$(mygit)$(hg_prompt_info)>%{\e[0m%}%b '
+PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg[black]%}@%{$fg[cyan]%}%m%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}]
+%{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)$(hg_prompt_info)>%{$reset_color%} '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '
-
diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
index 13dc3ad2f..622c90465 100644
--- a/themes/steeef.zsh-theme
+++ b/themes/steeef.zsh-theme
@@ -19,7 +19,7 @@ setopt prompt_subst
autoload -U add-zsh-hook
autoload -Uz vcs_info
-#use extended color pallete if available
+#use extended color palette if available
if [[ $terminfo[colors] -ge 256 ]]; then
turquoise="%F{81}"
orange="%F{166}"
@@ -62,10 +62,13 @@ zstyle ':vcs_info:*:prompt:*' nvcsformats ""
function steeef_preexec {
- case "$(history $HISTCMD)" in
+ case "$2" in
*git*)
PR_GIT_UPDATE=1
;;
+ *hub*)
+ PR_GIT_UPDATE=1
+ ;;
*svn*)
PR_GIT_UPDATE=1
;;
diff --git a/themes/trapd00r.zsh-theme b/themes/trapd00r.zsh-theme
index ca1676fb5..3fa5d57ab 100644
--- a/themes/trapd00r.zsh-theme
+++ b/themes/trapd00r.zsh-theme
@@ -36,7 +36,7 @@ local c12=$(printf "\e[38;5;142m\e[1m")
local c13=$(printf "\e[38;5;196m\e[1m")
-# We dont want to use the extended colorset in the TTY / VC.
+# We don't want to use the extended colorset in the TTY / VC.
if [ "$TERM" = "linux" ]; then
c1=$( printf "\e[34;1m")
c2=$( printf "\e[35m")
@@ -71,7 +71,7 @@ prompt_jnrowe_precmd () {
PROMPT='%{$fg_bold[green]%}%p%{$reset_color%}${vcs_info_msg_0_}${dir_status} ${ret_status}%{$reset_color%}
> '
-# modified, to be commited
+# modified, to be committed
elif [[ $(git diff --cached --name-status 2>/dev/null ) != "" ]]; then
dir_status="%{$c1%}%n%{$c4%}@%{$c2%}%m%{$c0%}:%{$c3%}%l%{$c6%}->%{$(zsh_path)%} %{$c0%}(%{$c5%}%?%{$c0%})"
PROMPT='${vcs_info_msg_0_}%{$30%} %{$bg_bold[red]%}%{$fg_bold[cyan]%}C%{$fg_bold[black]%}OMMIT%{$reset_color%}
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index a57f6da0f..b42b87750 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -42,7 +42,7 @@ if mkdir "$ZSH/log/update.lock" 2>/dev/null; then
if [ "$DISABLE_UPDATE_PROMPT" = "true" ]; then
_upgrade_zsh
else
- echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"
+ echo "[Oh My Zsh] Would you like to update? [Y/n]: \c"
read line
if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
_upgrade_zsh
diff --git a/tools/install.sh b/tools/install.sh
index 3f4de8681..ad47df785 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -24,12 +24,10 @@ main() {
# which may fail on systems lacking tput or terminfo
set -e
- CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
- if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
+ if ! command -v zsh >/dev/null 2>&1; then
printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
exit
fi
- unset CHECK_ZSH_INSTALLED
if [ ! -n "$ZSH" ]; then
ZSH=~/.oh-my-zsh
@@ -49,7 +47,7 @@ main() {
umask g-w,o-w
printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
- hash git >/dev/null 2>&1 || {
+ command -v git >/dev/null 2>&1 || {
echo "Error: git is not installed"
exit 1
}
@@ -107,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 http://shop.planetargon.com.'
+ echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.'
echo ''
printf "${NORMAL}"
env zsh
diff --git a/tools/upgrade.sh b/tools/upgrade.sh
index d5e7e8ba8..25b2de27a 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: http://shop.planetargon.com/"
+ printf "${BLUE}${BOLD}%s${NORMAL}\n" "Get your Oh My Zsh swag at: https://shop.planetargon.com/"
else
printf "${RED}%s${NORMAL}\n" 'There was an error updating. Try again later?'
fi