diff --git a/.github/main.workflow b/.github/main.workflow new file mode 100644 index 000000000..0dbb0247a --- /dev/null +++ b/.github/main.workflow @@ -0,0 +1,17 @@ +workflow "Triage Pull Request" { + on = "pull_request" + resolves = ["Triage"] +} + +# Only act if there are code changes: if the pull_request +# event's action is either 'opened' (new PR) or 'synchronize' (new commits) +action "Filter actions" { + uses = "actions/bin/filter@0ac6d44" + args = "action 'opened|synchronize'" +} + +action "Triage" { + needs = ["Filter actions"] + uses = "ohmyzsh/github-actions/pull-request-triage@master" + secrets = ["GITHUB_TOKEN"] +} diff --git a/.gitignore b/.gitignore index b2022081a..87a79cdae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ # custom files custom/ -!custom/plugins/example -!custom/example.zsh # temp files directories cache/ diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..20ad1ccee --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ohmyzsh@planetargon.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac263fd18..f575157c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,10 @@ # CONTRIBUTING GUIDELINES -Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged and appreciated. +Oh-My-Zsh is a community-driven project. Contribution is welcome, encouraged, and appreciated. It is also essential for the development of the project. +First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md). + These guidelines are an attempt at better addressing the huge amount of pending issues and pull requests. Please read them closely. diff --git a/LICENSE.txt b/LICENSE.txt index 7af38f217..4d465b1c3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2009-2018 Robby Russell and contributors +Copyright (c) 2009-2019 Robby Russell and contributors See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index a6d74cbd2..38f6ae9f3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Oh My Zsh

-Oh My Zsh is an open source, community-driven framework for managing your [zsh](http://www.zsh.org/) configuration. +Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration. Sounds boring. Let's try again. @@ -12,7 +12,7 @@ Once installed, your terminal shell will become the talk of the town _or your mo Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬 -To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. +To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter. ## Getting Started @@ -21,7 +21,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-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) +* [Zsh](https://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 @@ -75,7 +75,7 @@ Most plugins (should! we're working on this) include a __README__, which documen ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://wiki.github.com/robbyrussell/oh-my-zsh/themes) on the wiki. Check them out! +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have [screenshots](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes) on the wiki. Check them out! #### Selecting a Theme @@ -141,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: @@ -163,6 +163,7 @@ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc ```shell chsh -s /bin/zsh ``` +You must log out and log back in to see this change. ##### 5. Initialize your new zsh configuration @@ -213,12 +214,16 @@ Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy b If you want to uninstall `oh-my-zsh`, just run `uninstall_oh_my_zsh` from the command-line. It will remove itself and revert your previous `bash` or `zsh` configuration. -## Contributing +## How do I contribute to Oh My Zsh? -I'm far from being a [Zsh](http://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! +Before you participate in our delightful community, please read the [code of conduct](CODE_OF_CONDUCT.md). + +I'm far from being a [Zsh](https://www.zsh.org/) expert and suspect there are many ways to improve – if you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! We also need people to test out pull-requests. So take a look through [the open issues](https://github.com/robbyrussell/oh-my-zsh/issues) and help where you can. +See [Contributing](CONTRIBUTING.md) for more details. + ### Do NOT send us themes We have (more than) enough themes for the time being. Please add your theme to the [external themes](https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes) wiki page. @@ -238,7 +243,7 @@ We're on the social media. ## Merchandise -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! +We have [stickers, shirts, and coffee mugs available](https://shop.planetargon.com/collections/oh-my-zsh?utm_source=github) for you to show off your love of Oh My Zsh. Again, you will become the talk of the town! ## License diff --git a/custom/themes/example.zsh-theme b/custom/themes/example.zsh-theme new file mode 100644 index 000000000..ef8f1c630 --- /dev/null +++ b/custom/themes/example.zsh-theme @@ -0,0 +1,4 @@ +# Put your custom themes in this folder. +# Example: + +PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " diff --git a/lib/compfix.zsh b/lib/compfix.zsh index 208aaadb1..b09b283f2 100644 --- a/lib/compfix.zsh +++ b/lib/compfix.zsh @@ -2,10 +2,6 @@ # insecure ownership or permissions) by: # # * Human-readably notifying the user of these insecurities. -# * Moving away all existing completion caches to a temporary directory. Since -# any of these caches may have been generated from insecure directories, they -# are all suspect now. Failing to do so typically causes subsequent compinit() -# calls to fail with "command not found: compdef" errors. (That's bad.) function handle_completion_insecurities() { # List of the absolute paths of all unique insecure directories, split on # newline from compaudit()'s output resembling: @@ -22,39 +18,27 @@ function handle_completion_insecurities() { insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} ) # If no such directories exist, get us out of here. - if (( ! ${#insecure_dirs} )); then - print "[oh-my-zsh] No insecure completion-dependent directories detected." - return - fi + [[ -z "${insecure_dirs}" ]] && return # List ownership and permissions of all insecure directories. print "[oh-my-zsh] Insecure completion-dependent directories detected:" ls -ld "${(@)insecure_dirs}" - print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all" - print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh." - print "[oh-my-zsh] See the above list for directories with group or other writability.\n" - # Locally enable the "NULL_GLOB" option, thus removing unmatched filename - # globs from argument lists *AND* printing no warning when doing so. Failing - # to do so prints an unreadable warning if no completion caches exist below. - setopt local_options null_glob + cat </dev/null + ${=open_cmd} "$@" &>/dev/null else - nohup $open_cmd "$@" &>/dev/null + nohup ${=open_cmd} "$@" &>/dev/null fi } @@ -52,8 +51,7 @@ function open_command() { # 1 if it does not exist # function alias_value() { - alias "$1" | sed "s/^$1='\(.*\)'$/\1/" - test $(alias "$1") + (( $+aliases[$1] )) && echo $aliases[$1] } # @@ -81,7 +79,7 @@ function try_alias_value() { # 0 if the variable exists, 3 if it was set # function default() { - test `typeset +m "$1"` && return 0 + (( $+parameters[$1] )) && return 0 typeset -g "$1"="$2" && return 3 } @@ -95,8 +93,8 @@ function default() { # 0 if the env variable exists, 3 if it was set # function env_default() { - env | grep -q "^$1=" && return 0 - export "$1=$2" && return 3 + (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0 + export "$1=$2" && return 3 } diff --git a/lib/git.zsh b/lib/git.zsh index 9b0f6e36f..640561e97 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -10,13 +10,10 @@ function git_prompt_info() { # Checks if working tree is dirty function parse_git_dirty() { - local STATUS='' + local STATUS local -a FLAGS - FLAGS=('--porcelain') + FLAGS=('--porcelain' '--ignore-submodules=dirty') if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then - if [[ $POST_1_7_2_GIT -gt 0 ]]; then - FLAGS+='--ignore-submodules=dirty' - fi if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then FLAGS+='--untracked-files=no' fi @@ -77,8 +74,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 +84,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 @@ -181,28 +178,6 @@ function git_prompt_status() { echo $STATUS } -# Compares the provided version of git to the version installed and on path -# Outputs -1, 0, or 1 if the installed version is less than, equal to, or -# greater than the input version, respectively. -function git_compare_version() { - local INPUT_GIT_VERSION INSTALLED_GIT_VERSION - INPUT_GIT_VERSION=(${(s/./)1}) - INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null)) - INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}) - - for i in {1..3}; do - if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then - echo 1 - return 0 - fi - if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then - echo -1 - return 0 - fi - done - echo 0 -} - # Outputs the name of the current user # Usage example: $(git_current_user_name) function git_current_user_name() { @@ -214,8 +189,3 @@ function git_current_user_name() { function git_current_user_email() { command git config user.email 2>/dev/null } - -# This is unlikely to change so make it all statically assigned -POST_1_7_2_GIT=$(git_compare_version "1.7.2") -# Clean up the namespace slightly by removing the checker function -unfunction git_compare_version diff --git a/lib/history.zsh b/lib/history.zsh index 5de71c2d3..52e45bf4c 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,24 +1,40 @@ -## Command history configuration -if [ -z "$HISTFILE" ]; then - HISTFILE=$HOME/.zsh_history -fi +## History wrapper +function omz_history { + local clear list + 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 + # unless a number is provided, show all history events (starting from 1) + [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1 + fi +} -# Show history -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' ;; +# Timestamp format +case ${HIST_STAMPS-} in + "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' ;; + *) alias history="omz_history -t '$HIST_STAMPS'" ;; 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 3052b7710..b30822b50 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -18,13 +18,11 @@ fi ## jobs setopt long_list_jobs -## pager -env_default PAGER 'less' -env_default LESS '-R' +env_default 'PAGER' 'less' +env_default 'LESS' '-R' ## super user alias alias _='sudo' -alias please='sudo' ## more intelligent acking for ubuntu users if which ack-grep &> /dev/null; then diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 335c02a3d..5069c4b21 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -10,9 +10,15 @@ # Dummy implementations that return false to prevent command_not_found # errors with themes, that implement these functions # Real implementations will be used when the respective plugins are loaded -function chruby_prompt_info hg_prompt_info pyenv_prompt_info \ - rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \ - virtualenv_prompt_info { +function chruby_prompt_info \ + rbenv_prompt_info \ + hg_prompt_info \ + pyenv_prompt_info \ + svn_prompt_info \ + vi_mode_prompt_info \ + virtualenv_prompt_info \ + jenv_prompt_info \ +{ return 1 } @@ -22,10 +28,13 @@ function rvm_prompt_info() { [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1 local rvm_prompt rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) - [[ "${rvm_prompt}x" == "x" ]] && return 1 - echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" + [[ -z "${rvm_prompt}" ]] && return 1 + echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt}${ZSH_THEME_RUBY_PROMPT_SUFFIX}" } +ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" + + # use this to enable users to see their ruby version, no matter which # version management system they use function ruby_prompt_info() { diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh index 87092d8ae..312ab2248 100644 --- a/lib/spectrum.zsh +++ b/lib/spectrum.zsh @@ -1,7 +1,7 @@ #! /bin/zsh # A script to make using 256 colors in zsh less painful. # P.C. Shyamshankar -# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ +# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ typeset -AHg FX FG BG diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 871ab28df..aa14f3f07 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -21,7 +21,7 @@ function title { print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name ;; - screen*) + screen*|tmux*) print -Pn "\ek$1:q\e\\" # set screen hardstatus ;; *) @@ -80,7 +80,7 @@ preexec_functions+=(omz_termsupport_preexec) # Keep Apple Terminal.app's current working directory updated -# Based on this answer: http://superuser.com/a/315029 +# Based on this answer: https://superuser.com/a/315029 # With extra fixes to handle multibyte chars and non-UTF-8 locales if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 96f34aa81..5016d86ca 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -19,7 +19,7 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then # coreutils, so prefer it to "gls". gls --color -d . &>/dev/null && alias ls='gls --color=tty' colorls -G -d . &>/dev/null && alias ls='colorls -G' - elif [[ "$OSTYPE" == darwin* ]]; then + elif [[ "$OSTYPE" == (darwin|freebsd)* ]]; then # this is a good alias, it works by default just using $LSCOLORS ls -G . &>/dev/null && alias ls='ls -G' @@ -45,11 +45,10 @@ setopt prompt_subst [[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO="" -# Apply theming defaults -PS1="%n@%m:%~%# " - # git theming default: Variables for theming the git info prompt ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean +ZSH_THEME_RUBY_PROMPT_PREFIX="(" +ZSH_THEME_RUBY_PROMPT_SUFFIX=")" diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 7f78e4140..6b2662d5e 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -1,6 +1,17 @@ +# Set ZSH_CACHE_DIR to the path where cache files should be created +# or else we will use the default cache/ +if [[ -z "$ZSH_CACHE_DIR" ]]; then + ZSH_CACHE_DIR="$ZSH/cache" +fi + +# Migrate .zsh-update file to $ZSH_CACHE_DIR +if [ -f ~/.zsh-update ] && [ ! -f ${ZSH_CACHE_DIR}/.zsh-update ]; then + mv ~/.zsh-update ${ZSH_CACHE_DIR}/.zsh-update +fi + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then - env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh + env ZSH=$ZSH ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh fi # Initializes Oh My Zsh @@ -11,29 +22,12 @@ 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 ZSH_CUSTOM="$ZSH/custom" fi -# Set ZSH_CACHE_DIR to the path where cache files should be created -# or else we will use the default cache/ -if [[ -z "$ZSH_CACHE_DIR" ]]; then - ZSH_CACHE_DIR="$ZSH/cache" -fi - - -# Load all of the config files in ~/oh-my-zsh that end in .zsh -# TIP: Add files you don't want in git to .gitignore -for config_file ($ZSH/lib/*.zsh); do - custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}" - [ -f "${custom_config_file}" ] && config_file=${custom_config_file} - source $config_file -done - is_plugin() { local base_dir=$1 @@ -41,6 +35,7 @@ is_plugin() { test -f $base_dir/plugins/$name/$name.plugin.zsh \ || test -f $base_dir/plugins/$name/_$name } + # Add all defined plugins to fpath. This must be done # before running compinit. for plugin ($plugins); do @@ -48,6 +43,8 @@ for plugin ($plugins); do fpath=($ZSH_CUSTOM/plugins/$plugin $fpath) elif is_plugin $ZSH $plugin; then fpath=($ZSH/plugins/$plugin $fpath) + else + echo "[oh-my-zsh] plugin '$plugin' not found" fi done @@ -65,18 +62,25 @@ if [ -z "$ZSH_COMPDUMP" ]; then fi if [[ $ZSH_DISABLE_COMPFIX != true ]]; then - # If completion insecurities exist, warn the user without enabling completions. - if ! compaudit &>/dev/null; then - # This function resides in the "lib/compfix.zsh" script sourced above. - handle_completion_insecurities - # Else, enable and cache completions to the desired file. - else - compinit -d "${ZSH_COMPDUMP}" - fi + source $ZSH/lib/compfix.zsh + # If completion insecurities exist, warn the user + handle_completion_insecurities + # Load only from secure directories + compinit -i -C -d "${ZSH_COMPDUMP}" else - compinit -i -d "${ZSH_COMPDUMP}" + # If the user wants it, load from all found directories + compinit -u -C -d "${ZSH_COMPDUMP}" fi + +# Load all of the config files in ~/oh-my-zsh that end in .zsh +# TIP: Add files you don't want in git to .gitignore +for config_file ($ZSH/lib/*.zsh); do + custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}" + [ -f "${custom_config_file}" ] && config_file=${custom_config_file} + source $config_file +done + # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then diff --git a/plugins/adb/_adb b/plugins/adb/_adb index 8cbf6593c..78c457746 100644 --- a/plugins/adb/_adb +++ b/plugins/adb/_adb @@ -48,8 +48,13 @@ _arguments \ case "$state" in specify_device) - _values 'devices' $(adb devices -l|awk 'NR>1&& $1 ~ /^[a-zA-Z0-9].*$/ \ - {printf "%s[%s] ",$1,$6 }') + _values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \ + {sub(/ +/," ",$0); \ + gsub(":","\\:",$1); \ + for(i=1;i<=NF;i++) { + if($i ~ /model:/) { split($i,m,":") } \ + else if($i ~ /product:/) { split($i,p,":") } } \ + printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""} return ;; esac @@ -59,4 +64,4 @@ if (( CURRENT == 1 )); then return fi -_files \ No newline at end of file +_files diff --git a/plugins/ansible/README.md b/plugins/ansible/README.md new file mode 100644 index 000000000..e0e6a19bb --- /dev/null +++ b/plugins/ansible/README.md @@ -0,0 +1,34 @@ +# ansible plugin + +## Introduction + +The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases). + +To use it, add `ansible` to the plugins array of your zshrc file: + +``` +plugins=(... ansible) +``` + +## Aliases + +| Command | Description | +|:-------------------------------------------|:--------------------------------------------------------------------| +| `ansible-version` / `aver` | Show the version on ansible installed in this host | +| `ansible-role-init ` / `arinit` | Creates the Ansible Role as per Ansible Galaxy standard | +| `a` | command `ansible` | +| `aconf` | command `ansible-config` | +| `acon` | command `ansible-console` | +| `ainv` | command `ansible-inventory` | +| `aplaybook` | command `ansible-playbook` | +| `ainv` | command `ansible-inventory` | +| `adoc` | command `ansible-doc` | +| `agal` | command `ansible-galaxy` | +| `apull` | command `ansible-pull` | +| `aval` | command `ansible-vault` | + +## Maintainer + +### [Deepankumar](https://github.com/deepan10) + +[https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin](https://github.com/deepan10/oh-my-zsh/tree/features/ansible-plugin) diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh new file mode 100644 index 000000000..f68ff23a5 --- /dev/null +++ b/plugins/ansible/ansible.plugin.zsh @@ -0,0 +1,28 @@ +# Functions +function ansible-version(){ + ansible --version +} + +function ansible-role-init(){ + if ! [ -z $1] ; then + echo "Ansible Role : $1 Creating...." + ansible-galaxy init $1 + tree $1 + else + echo "Usage : ansible-role-init " + echo "Example : ansible-role-init role1" + fi +} + +# Alias +alias a='ansible ' +alias aconf='ansible-config ' +alias acon='ansible-console ' +alias aver='ansible-version' +alias arinit='ansible-role-init' +alias aplaybook='ansible-playbook ' +alias ainv='ansible-inventory ' +alias adoc='ansible-doc ' +alias agal='ansible-galaxy ' +alias apull='ansible-pull ' +alias aval='ansible-vault' \ No newline at end of file diff --git a/plugins/ant/README.md b/plugins/ant/README.md new file mode 100644 index 000000000..5f88984ac --- /dev/null +++ b/plugins/ant/README.md @@ -0,0 +1,12 @@ +# Ant + +This plugin provides completion for [Ant](https://ant.apache.org/). + +To use it add ant to the plugins array in your zshrc file. + +```bash +plugins=(... ant) +``` + +It caches ant targets in a file named `.ant_targets`, you might want to add that to +your `.gitignore` file. diff --git a/plugins/archlinux/README.md b/plugins/archlinux/README.md index e408db13d..ff2b6a4c4 100644 --- a/plugins/archlinux/README.md +++ b/plugins/archlinux/README.md @@ -2,6 +2,51 @@ ## Features +#### YAY + +| Alias | Command | Description | +|---------|------------------------------------|---------------------------------------------------------------------| +| yaconf | yay -Pg | Print current configuration | +| yain | yay -S | Install packages from the repositories | +| yains | yay -U | Install a package from a local file | +| yainsd | yay -S --asdeps | Install packages as dependencies of another package | +| yaloc | yay -Qi | Display information about a package in the local database | +| yalocs | yay -Qs | Search for packages in the local database | +| yalst | yay -Qe | List installed packages including from AUR (tagged as "local") | +| yamir | yay -Syy | Force refresh of all package lists after updating mirrorlist | +| yaorph | yay -Qtd | Remove orphans using yay | +| yare | yay -R | Remove packages, keeping its settings and dependencies | +| yarem | yay -Rns | Remove packages, including its settings and unneeded dependencies | +| yarep | yay -Si | Display information about a package in the repositories | +| yareps | yay -Ss | Search for packages in the repositories | +| yaupg | yay -Syu | Sync with repositories before upgrading packages | +| yasu | yay -Syu --no-confirm | Same as `yaupg`, but without confirmation | + +#### TRIZEN + +| Alias | Command | Description | +|---------|------------------------------------|---------------------------------------------------------------------| +| 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 | +| trupg | 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 +72,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 | |---------|------------------------------------|---------------------------------------------------------------------| @@ -74,7 +119,9 @@ | 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. | +| 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 | |----------------|------------------------------------------------------| @@ -82,6 +129,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 | --- @@ -95,3 +143,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 0fab1252b..e0101c7eb 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' @@ -27,6 +56,35 @@ if (( $+commands[yaourt] )); then fi fi +if (( $+commands[yay] )); then + alias yaconf='yay -Pg' + alias yaupg='yay -Syu' + alias yasu='yay -Syu --noconfirm' + alias yain='yay -S' + alias yains='yay -U' + alias yare='yay -R' + alias yarem='yay -Rns' + alias yarep='yay -Si' + alias yareps='yay -Ss' + alias yaloc='yay -Qi' + alias yalocs='yay -Qs' + alias yalst='yay -Qe' + alias yaorph='yay -Qtd' + alias yainsd='yay -S --asdeps' + alias yamir='yay -Syy' + + + if (( $+commands[abs] && $+commands[aur] )); then + alias yaupd='yay -Sy && sudo abs && sudo aur' + elif (( $+commands[abs] )); then + alias yaupd='yay -Sy && sudo abs' + elif (( $+commands[aur] )); then + alias yaupd='yay -Sy && sudo aur' + else + alias yaupd='yay -Sy' + fi +fi + if (( $+commands[pacaur] )); then alias paupg='pacaur -Syu' alias pasu='pacaur -Syu --noconfirm' @@ -54,16 +112,24 @@ 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 } +elif (( $+commands[yay] )); then + function upgrade() { + yay -Syu + } else - upgrade() { + function upgrade() { sudo pacman -Syu } fi @@ -83,7 +149,9 @@ 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 tFs' +alias pacfiles='pacman -Fs' +alias pacls='pacman -Ql' +alias pacown='pacman -Qo' if (( $+commands[abs] && $+commands[aur] )); then @@ -96,13 +164,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-$$ @@ -120,14 +188,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 @@ -136,3 +204,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..38b225538 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,7 +1,19 @@ -# Find where asdf should be installed. +# Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" +ASDF_COMPLETIONS="$ASDF_DIR/completions" -# Load asdf, if found. -if [ -f $ASDF_DIR/asdf.sh ]; then - . $ASDF_DIR/asdf.sh +# If not found, check for Homebrew package +if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then + ASDF_DIR="$(brew --prefix asdf)" + ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" +fi + +# Load command +if [[ -f "$ASDF_DIR/asdf.sh" ]]; then + . "$ASDF_DIR/asdf.sh" + + # Load completions + if [[ -f "$ASDF_COMPLETIONS/asdf.bash" ]]; then + . "$ASDF_COMPLETIONS/asdf.bash" + fi fi diff --git a/plugins/autojump/README.md b/plugins/autojump/README.md new file mode 100644 index 000000000..18ff793cd --- /dev/null +++ b/plugins/autojump/README.md @@ -0,0 +1,11 @@ +# Autojump plugin + +This plugin loads the [autojump navigation tool](https://github.com/wting/autojump). + +To use it, add `autojump` to the plugins array in your zshrc file: + +```zsh +plugins=(... autojump) +``` + +More info on the usage: https://github.com/wting/autojump diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh index 7339fad9e..13c1d00ed 100644 --- a/plugins/autojump/autojump.plugin.zsh +++ b/plugins/autojump/autojump.plugin.zsh @@ -1,23 +1,39 @@ -if [ $commands[autojump] ]; then # check if autojump is installed - if [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation - . $HOME/.autojump/etc/profile.d/autojump.zsh - elif [ -f $HOME/.autojump/share/autojump/autojump.zsh ]; then # another manual user-local installation - . $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 - . /etc/profile.d/autojump.zsh - elif [ -f /etc/profile.d/autojump.sh ]; then # gentoo installation - . /etc/profile.d/autojump.sh - elif [ -f /usr/local/share/autojump/autojump.zsh ]; then # freebsd installation - . /usr/local/share/autojump/autojump.zsh - elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports - . /opt/local/etc/profile.d/autojump.zsh - elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.sh ]; then # mac os x with brew - . `brew --prefix`/etc/autojump.sh +(( $+commands[autojump] )) || { + echo '[oh-my-zsh] Please install autojump first (https://github.com/wting/autojump)' + return +} + +declare -a autojump_paths +autojump_paths=( + $HOME/.autojump/etc/profile.d/autojump.zsh # manual installation + $HOME/.autojump/share/autojump/autojump.zsh # manual installation + $HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation + /run/current-system/sw/share/autojump/autojump.zsh # NixOS installation + /usr/share/autojump/autojump.zsh # Debian and Ubuntu package + /etc/profile.d/autojump.zsh # manual installation + /etc/profile.d/autojump.sh # Gentoo installation + /usr/local/share/autojump/autojump.zsh # FreeBSD installation + /opt/local/etc/profile.d/autojump.sh # macOS with MacPorts + /usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default) +) + +for file in $autojump_paths; do + if [[ -f "$file" ]]; then + source "$file" + found=1 + break + fi +done + +# if no path found, try Homebrew +if (( ! found && $+commands[brew] )); then + file=$(brew --prefix)/etc/profile.d/autojump.sh + if [[ -f "$file" ]]; then + source "$file" + found=1 fi fi + +(( ! found )) && echo '[oh-my-zsh] autojump script not found' + +unset autojump_paths file found diff --git a/plugins/autopep8/README.md b/plugins/autopep8/README.md new file mode 100644 index 000000000..02bbb9af4 --- /dev/null +++ b/plugins/autopep8/README.md @@ -0,0 +1,8 @@ +# autopep8 plugin + +This plugin adds completion for [autopep8](https://pypi.org/project/autopep8/), a tool that automatically formats Python code to conform to the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide. + +To use it, add autopep8 to the plugins array of your zshrc file: +``` +plugins=(... autopep8) +``` diff --git a/plugins/autopep8/autopep8.plugin.zsh b/plugins/autopep8/autopep8.plugin.zsh deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/aws/README.md b/plugins/aws/README.md new file mode 100644 index 000000000..57c3b54ac --- /dev/null +++ b/plugins/aws/README.md @@ -0,0 +1,38 @@ +# aws + +This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html) +and a few utilities to manage AWS profiles and display them in the prompt. + +To use it, add `aws` to the plugins array in your zshrc file. + +```zsh +plugins=(... aws) +``` + +## Plugin commands + +* `asp []`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to ``. + It also sets `$AWS_EB_PROFILE` to `` for the Elastic Beanstalk CLI. + Run `asp` without arguments to clear the profile. + +* `agp`: gets the current value of `$AWS_PROFILE`. + +* `aws_change_access_key`: changes the AWS access key of a profile. + +* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`). + Used to provide completion for the `asp` function. + +## Plugin options + +* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT. + Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to + see the AWS profile prompt. + +## Theme + +The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays +the current `$AWS_PROFILE`. It uses two variables to control how that is shown: + +- ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to ``. diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh index 6a0e04add..4bec30490 100644 --- a/plugins/aws/aws.plugin.zsh +++ b/plugins/aws/aws.plugin.zsh @@ -1,52 +1,85 @@ -_homebrew-installed() { - type brew &> /dev/null - _xit=$? - if [ $_xit -eq 0 ];then - # ok , we have brew installed - # speculatively we check default brew prefix - if [ -h /usr/local/opt/awscli ];then - _brew_prefix="/usr/local/opt/awscli" - else - # ok , it is not default prefix - # this call to brew is expensive ( about 400 ms ), so at least let's make it only once - _brew_prefix=$(brew --prefix awscli) - fi - return 0 - else - return $_xit - fi -} - -_awscli-homebrew-installed() { - [ -r $_brew_prefix/libexec/bin/aws_zsh_completer.sh ] &> /dev/null -} - -export AWS_HOME=~/.aws +# AWS profile selection function agp { - echo $AWS_DEFAULT_PROFILE + echo $AWS_PROFILE } function asp { - local rprompt=${RPROMPT//} - export AWS_DEFAULT_PROFILE=$1 export AWS_PROFILE=$1 + export AWS_EB_PROFILE=$1 - export RPROMPT="$rprompt" + if [[ -z "$1" ]]; then + echo AWS profile cleared. + fi +} + +function aws_change_access_key { + if [[ -z "$1" ]] then + echo "usage: $0 " + return 1 + fi + + echo Insert the credentials when asked. + asp "$1" + aws iam create-access-key + aws configure --profile "$1" + + echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\` + echo Your current keys are: + aws iam list-access-keys } function aws_profiles { - reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) + reply=($(grep '\[profile' "${AWS_CONFIG_FILE:-$HOME/.aws/config}"|sed -e 's/.*profile \([a-zA-Z0-9_\.-]*\).*/\1/')) +} +compctl -K aws_profiles asp aws_change_access_key + + +# AWS prompt + +function aws_prompt_info() { + [[ -z $AWS_PROFILE ]] && return + echo "${ZSH_THEME_AWS_PREFIX:=}" } -compctl -K aws_profiles asp - -if _homebrew-installed && _awscli-homebrew-installed ; then - _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh -else - _aws_zsh_completer_path=$(which aws_zsh_completer.sh) +if [ "$SHOW_AWS_PROMPT" != false ]; then + RPROMPT='$(aws_prompt_info)'"$RPROMPT" fi -[ -x $_aws_zsh_completer_path ] && source $_aws_zsh_completer_path -unset _aws_zsh_completer_path + +# Load awscli completions + +_awscli-homebrew-installed() { + # check if Homebrew is installed + (( $+commands[brew] )) || return 1 + + # speculatively check default brew prefix + if [ -h /usr/local/opt/awscli ]; then + _brew_prefix=/usr/local/opt/awscli + else + # ok, it is not in the default prefix + # this call to brew is expensive (about 400 ms), so at least let's make it only once + _brew_prefix=$(brew --prefix awscli) + fi +} + +# get aws_zsh_completer.sh location from $PATH +_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]" + +# otherwise check common locations +if [[ -z $_aws_zsh_completer_path ]]; then + # Homebrew + if _awscli-homebrew-installed; then + _aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh + # Ubuntu + elif [[ -e /usr/share/zsh/vendor-completions/_awscli ]]; then + _aws_zsh_completer_path=/usr/share/zsh/vendor-completions/_awscli + # RPM + else + _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh + fi +fi + +[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path +unset _aws_zsh_completer_path _brew_prefix diff --git a/plugins/battery/README.md b/plugins/battery/README.md new file mode 100644 index 000000000..b7a13a7ec --- /dev/null +++ b/plugins/battery/README.md @@ -0,0 +1,13 @@ +# Battery Plugin + +This plugin adds some functions you can use to display battery information in your custom theme. + +To use, add `battery` to the list of plugins in your `.zshrc` file: + +`plugins=(... battery)` + +Then, add the `battery_pct_prompt` function to your custom theme. For example: + +``` +RPROMPT='$(battery_pct_prompt)' +``` diff --git a/plugins/bbedit/README.md b/plugins/bbedit/README.md index ec2b743d6..263c54c47 100644 --- a/plugins/bbedit/README.md +++ b/plugins/bbedit/README.md @@ -1,11 +1,11 @@ ## bbedit -Plugin for BBEdit, an HTML and text editor for Mac OS X +Plugin for BBEdit, an HTML and text editor for Mac OS X ### Requirements - * [BBEdit](http://www.barebones.com/products/bbedit/) - * [BBEdit Command-Line Tools](http://www.barebones.com/support/bbedit/cmd-line-tools.html) + * [BBEdit](https://www.barebones.com/products/bbedit/) + * [BBEdit Command-Line Tools](https://www.barebones.com/support/bbedit/cmd-line-tools.html) ### Usage diff --git a/plugins/bgnotify/README.md b/plugins/bgnotify/README.md index fad299159..1d8fac54d 100644 --- a/plugins/bgnotify/README.md +++ b/plugins/bgnotify/README.md @@ -13,7 +13,7 @@ Just add bgnotify to your plugins list in your `.zshrc` - 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 +- On windows you can use [notifu](https://www.paralint.com/projects/notifu/) or the Cygwin Ports libnotify package ## Screenshots diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh old mode 100755 new mode 100644 index 459f5214e..b3a6890b8 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -42,7 +42,7 @@ bgnotify () { ## args: (title, subtitle) elif hash notify-send 2>/dev/null; then #ubuntu gnome! notify-send "$1" "$2" elif hash kdialog 2>/dev/null; then #ubuntu kde! - kdialog -title "$1" --passivepopup "$2" 5 + kdialog --title "$1" --passivepopup "$2" 5 elif hash notifu 2>/dev/null; then #cygwyn support! notifu /m "$2" /p "$1" fi diff --git a/plugins/bower/README.md b/plugins/bower/README.md new file mode 100644 index 000000000..743b6a0ea --- /dev/null +++ b/plugins/bower/README.md @@ -0,0 +1,18 @@ +# Bower plugin + +This plugin adds completion for [Bower](https://bower.io/) and a few useful aliases for common Bower commands. + +To use it, add `bower` to the plugins array in your zshrc file: + +``` +plugins=(... bower) +``` + +## Aliases + +| Alias | Command | Description | +|-------|-----------------|--------------------------------------------------------| +| bi | `bower install` | Installs the project dependencies listed in bower.json | +| bl | `bower list` | List local packages and possible updates | +| bs | `bower search` | Finds all packages or a specific package. | + diff --git a/plugins/brew/README.md b/plugins/brew/README.md new file mode 100644 index 000000000..c129a7652 --- /dev/null +++ b/plugins/brew/README.md @@ -0,0 +1,21 @@ +# brew plugin + +The plugin adds several aliases for common [brew](https://brew.sh) commands. + +To use it, add `brew` to the plugins array of your zshrc file: +``` +plugins=(... brew) +``` + +## Aliases + +| Alias | Command | Description | +|--------|----------------------|---------------| +| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade command. | +| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. | +| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. | +| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. | +| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. | +| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. | +| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. | +| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. | \ No newline at end of file diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 6fb7f3453..cfbaa3480 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,7 +1,11 @@ +alias brewp='brew pin' alias brews='brew list -1' +alias brewsp='brew list --pinned' alias bubo='brew update && brew outdated' alias bubc='brew upgrade && brew cleanup' alias bubu='bubo && bubc' +alias bcubo='brew update && brew cask outdated' +alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then print -P '%F{yellow}'Oh My Zsh brew plugin: diff --git a/plugins/bundler/README.md b/plugins/bundler/README.md index 04d551447..dc2f17008 100644 --- a/plugins/bundler/README.md +++ b/plugins/bundler/README.md @@ -2,7 +2,8 @@ - adds completion for basic bundler commands - adds short aliases for common bundler commands - - `be` aliased to `bundle exec` + - `be` aliased to `bundle exec`. + It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`). - `bl` aliased to `bundle list` - `bp` aliased to `bundle package` - `bo` aliased to `bundle open` @@ -13,7 +14,8 @@ - looks for a binstub under `./bin/` and executes it (if present) - calls `bundle exec ` otherwise -For a full list of *common gems* being wrapped by default please look at the `bundler.plugin.zsh` file. +Common gems wrapped by default (by name of the executable): +`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`. ## Configuration diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 6b10b78d1..668e15d2f 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -54,10 +54,14 @@ done ## Functions bundle_install() { - if _bundler-installed && _within-bundled-project; then + if ! _bundler-installed; then + echo "Bundler is not installed" + elif ! _within-bundled-project; then + echo "Can't 'bundle install' outside a bundled project" + else local bundler_version=`bundle version | cut -d' ' -f3` if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then - if [[ "$OSTYPE" = darwin* ]] + if [[ "$OSTYPE" = (darwin|freebsd)* ]] then local cores_num="$(sysctl -n hw.ncpu)" else @@ -67,8 +71,6 @@ bundle_install() { else bundle install $@ fi - else - echo "Can't 'bundle install' outside a bundled project" fi } diff --git a/plugins/bwana/README.md b/plugins/bwana/README.md new file mode 100644 index 000000000..dd4fe9f9c --- /dev/null +++ b/plugins/bwana/README.md @@ -0,0 +1,12 @@ +# Bwana + +This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). + +To use it add bwana to the plugins array in your zshrc file. + +```bash +plugins=(... bwana) +``` + +The `bwana` function opens the man page of the passed argument in the Bwana app. +For example: `bwana ln` opens the man page for `ln` in Bwana. diff --git a/plugins/bwana/bwana.plugin.zsh b/plugins/bwana/bwana.plugin.zsh index 455da8621..71c9eb18d 100644 --- a/plugins/bwana/bwana.plugin.zsh +++ b/plugins/bwana/bwana.plugin.zsh @@ -1,13 +1,13 @@ # -# Requires http://www.bruji.com/bwana/ +# Requires https://www.bruji.com/bwana/ # if [[ -e /Applications/Bwana.app ]] || ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana ) then - function man() { + function bwana() { open "man:$1" } else - echo "Bwana lets you read man files in Safari through a man: URI scheme" - echo "To use it within Zsh, install it from http://www.bruji.com/bwana/" + echo "Bwana lets you read man files in Safari through a man: URI scheme" + echo "To use it within Zsh, install it from https://www.bruji.com/bwana/" fi diff --git a/plugins/cabal/README.md b/plugins/cabal/README.md new file mode 100644 index 000000000..b1106c40f --- /dev/null +++ b/plugins/cabal/README.md @@ -0,0 +1,9 @@ +# Cabal + +This plugin provides completion for [Cabal](https://www.haskell.org/cabal/), a build tool for Haskell. It +also provides a function `cabal_sandbox_info` that prints whether the current working directory is in a sandbox. + +To use it, add cabal to the plugins array of your zshrc file: +``` +plugins=(... cabal) +``` diff --git a/plugins/cake/README.md b/plugins/cake/README.md new file mode 100644 index 000000000..aad92a3ec --- /dev/null +++ b/plugins/cake/README.md @@ -0,0 +1,15 @@ +# Cake + +This plugin provides completion for [CakePHP](https://cakephp.org/). + +To use it add cake to the plugins array in your zshrc file. + +```bash +plugins=(... cake) +``` + +## Note + +This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your +`.gitignore` files. diff --git a/plugins/capistrano/README.md b/plugins/capistrano/README.md new file mode 100644 index 000000000..335b794fa --- /dev/null +++ b/plugins/capistrano/README.md @@ -0,0 +1,14 @@ +# Capistrano + +This plugin provides completion for [Capistrano](https://capistranorb.com/). + +To use it add capistrano to the plugins array in your zshrc file. + +```bash +plugins=(... capistrano) +``` + +For a working completion use the `capit` command instead of `cap`, because cap is a +[reserved word in zsh](http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module). + +`capit` automatically runs cap with bundler if a Gemfile is found. diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh index 0b5559791..819572825 100644 --- a/plugins/capistrano/capistrano.plugin.zsh +++ b/plugins/capistrano/capistrano.plugin.zsh @@ -1,7 +1,7 @@ -# Added `shipit` because `cap` is a reserved word. `cap` completion doesn't work. +# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work. # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module -func capit() { +function capit() { if [ -f Gemfile ] then bundle exec cap $* diff --git a/plugins/cargo/README.md b/plugins/cargo/README.md index 5fa688d21..31bae4efe 100644 --- a/plugins/cargo/README.md +++ b/plugins/cargo/README.md @@ -1,6 +1,6 @@ # cargo -This plugin adds completion for the Rust build tool [`cargo`](https://github.com/rust-lang/cargo). +This plugin adds completion for the Rust build tool [`Cargo`](https://github.com/rust-lang/cargo). To use it, add `cargo` to the plugins array in your zshrc file: @@ -8,4 +8,4 @@ To use it, add `cargo` to the plugins array in your zshrc file: plugins=(... cargo) ``` -Updated on October 4th, 2016. +Updated on March 3rd, 2019, from [Cargo 0.34.0](https://github.com/rust-lang/cargo/releases/tag/0.34.0). diff --git a/plugins/cargo/_cargo b/plugins/cargo/_cargo index 54e709ca0..395c517cd 100644 --- a/plugins/cargo/_cargo +++ b/plugins/cargo/_cargo @@ -1,23 +1,37 @@ #compdef cargo -typeset -A opt_args autoload -U regexp-replace -_cargo() { +zstyle -T ':completion:*:*:cargo:*' tag-order && \ + zstyle ':completion:*:*:cargo:*' tag-order 'common-commands' +_cargo() { +local context state state_descr line +typeset -A opt_args + +# leading items in parentheses are an exclusion list for the arguments following that arg +# See: http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-Functions +# - => exclude all other options +# 1 => exclude positional arg 1 +# * => exclude all other args +# +blah => exclude +blah _arguments \ '(- 1 *)'{-h,--help}'[show help message]' \ + '(- 1 *)--list[list installed commands]' \ '(- 1 *)'{-V,--version}'[show version information]' \ - '(- 1 *)'--list'[list installed commands]' \ - '(- 1 *)'--explain'[Run `rustc --explain CODE`]' \ - '(- 1 *)'{-v,--verbose}'[use verbose output]' \ - '(- 1 *)'--color'[colorization option]' \ - '(- 1 *)'--frozen'[Require Cargo.lock and cache are up to date]' \ - '(- 1 *)'--locked'[Require Cargo.lock is up to date]' \ - '1: :_cargo_cmds' \ + {-v,--verbose}'[use verbose output]' \ + --color'[colorization option]' \ + '(+beta +nightly)+stable[use the stable toolchain]' \ + '(+stable +nightly)+beta[use the beta toolchain]' \ + '(+stable +beta)+nightly[use the nightly toolchain]' \ + '1: :->command' \ '*:: :->args' case $state in + command) + _alternative 'common-commands:common:_cargo_cmds' 'all-commands:all:_cargo_all_cmds' + ;; + args) case $words[1] in bench) @@ -54,6 +68,23 @@ case $state in '--color=:colorization option:(auto always never)' \ ;; + check) + _arguments \ + '--features=[space separated feature list]' \ + '--all-features[enable all available features]' \ + '(-h, --help)'{-h,--help}'[show help message]' \ + '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ + "${command_scope_spec[@]}" \ + '--manifest-path=[path to manifest]: :_files -/' \ + '--no-default-features[do not check the default features]' \ + '(-p,--package)'{-p=,--package=}'[package to check]:packages:_get_package_names' \ + '--release=[check in release mode]' \ + '--target=[target triple]' \ + '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ + '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ + '--color=:colorization option:(auto always never)' \ + ;; + clean) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ @@ -105,7 +136,7 @@ case $state in git-checkout) _arguments \ '(-h, --help)'{-h,--help}'[show help message]' \ - 'q(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ + '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--reference=[REF]' \ '--url=[URL]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ @@ -142,10 +173,10 @@ case $state in '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'[number of parallel jobs, defaults to # of CPUs]' \ '--no-default-features[do not build the default features]' \ - '--path=[local filesystem path to crate to install]' \ + '--path=[local filesystem path to crate to install]: :_files -/' \ '(-q, --quiet)'{-q,--quiet}'[no output printed to stdout]' \ '--rev=[specific commit to use when installing from git]' \ - '--root=[directory to install packages into]' \ + '--root=[directory to install packages into]: :_files -/' \ '--tag=[tag to use when installing from git]' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--vers=[version to install from crates.io]' \ @@ -270,7 +301,7 @@ case $state in '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to fetch dependencies for]' \ + '--manifest-path=[path to the manifest to fetch dependencies for]: :_files -/' \ '--no-default-features[do not compile default features for the package]' \ '(-p, --package)'{-p,--package}'=[profile to compile for]' \ '--profile=[profile to build the selected target for]' \ @@ -288,7 +319,7 @@ case $state in '--all-features[enable all available features]' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-j, --jobs)'{-j,--jobs}'=[number of parallel jobs, defaults to # of CPUs]' \ - '--manifest-path=[path to the manifest to document]' \ + '--manifest-path=[path to the manifest to document]: :_files -/' \ '--no-default-features[do not build the `default` feature]' \ '--open[open the docs in a browser after the operation]' \ '(-p, --package)'{-p,--package}'=[package to document]' \ @@ -327,6 +358,15 @@ case $state in '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ '--color=:colorization option:(auto always never)' \ '1: :_test_names' \ + '(--doc --bin --example --test --bench)--lib[only test library]' \ + '(--lib --bin --example --test --bench)--doc[only test documentation]' \ + '(--lib --doc --example --test --bench)--bin=[binary name]' \ + '(--lib --doc --bin --test --bench)--example=[example name]' \ + '(--lib --doc --bin --example --bench)--test=[test name]' \ + '(--lib --doc --bin --example --test)--bench=[benchmark name]' \ + '--message-format:error format:(human json short)' \ + '--frozen[require lock and cache up to date]' \ + '--locked[require lock up to date]' ;; uninstall) @@ -335,7 +375,7 @@ case $state in '--color=:colorization option:(auto always never)' \ '(-h, --help)'{-h,--help}'[show help message]' \ '(-q, --quiet)'{-q,--quiet}'[less output printed to stdout]' \ - '--root=[directory to uninstall packages from]' \ + '--root=[directory to uninstall packages from]: :_files -/' \ '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \ ;; @@ -386,19 +426,20 @@ esac _cargo_cmds(){ local -a commands;commands=( 'bench:execute all benchmarks of a local package' -'build:compile the current project' +'build:compile the current package' +'check:check the current package without compiling' 'clean:remove generated artifacts' 'doc:build package documentation' 'fetch:fetch package dependencies' 'generate-lockfile:create lockfile' 'git-checkout:git checkout' 'help:get help for commands' -'init:create new project in current directory' +'init:create new package in current directory' 'install:install a Rust binary' 'locate-project:print "Cargo.toml" location' 'login:login to remote server' -'metadata:the metadata for a project in json' -'new:create a new project' +'metadata:the metadata for a package in json' +'new:create a new package' 'owner:manage the owners of a crate on the registry' 'package:assemble local package into a distributable tarball' 'pkgid:print a fully qualified package specification' @@ -415,8 +456,12 @@ local -a commands;commands=( 'version:show version information' 'yank:remove pushed file from index' ) -_describe 'command' commands +_describe -t common-commands 'common commands' commands +} +_cargo_all_cmds(){ +local -a commands;commands=($(cargo --list)) +_describe -t all-commands 'all commands' commands } @@ -484,7 +529,7 @@ _benchmark_names() _get_names_from_array "bench" } -# These flags are mutally exclusive specifiers for the scope of a command; as +# These flags are mutually exclusive specifiers for the scope of a command; as # they are used in multiple places without change, they are expanded into the # appropriate command's `_arguments` where appropriate. set command_scope_spec @@ -496,5 +541,4 @@ command_scope_spec=( '(--bench --bin --example --lib)--test=[test name]' ) - _cargo diff --git a/plugins/catimg/README.md b/plugins/catimg/README.md new file mode 100644 index 000000000..2fc28a1c6 --- /dev/null +++ b/plugins/catimg/README.md @@ -0,0 +1,35 @@ +# catimg + +Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) + +## Requirements + +- `convert` (ImageMagick) + +## Enabling the plugin + +1. Open your `.zshrc` file and add `catimg` in the plugins section: + + ```zsh + plugins=( + # all your enabled plugins + catimg + ) + ``` + +2. Reload the source file or restart your Terminal session: + + ```console + $ source ~/.zshrc + $ + ``` + +## Functions + +| Function | Description | +| -------- | ---------------------------------------- | +| `catimg` | Displays the given image on the terminal | + +## Usage examples + +[![asciicast](https://asciinema.org/a/204702.png)](https://asciinema.org/a/204702) diff --git a/plugins/catimg/catimg.plugin.zsh b/plugins/catimg/catimg.plugin.zsh index cb92f5986..ca46444cc 100644 --- a/plugins/catimg/catimg.plugin.zsh +++ b/plugins/catimg/catimg.plugin.zsh @@ -1,10 +1,10 @@ ################################################################################ # catimg script by Eduardo San Martin Morote aka Posva # -# http://posva.net # +# https://posva.net # # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # -# Github: https://github.com/posva/catimg # +# GitHub: https://github.com/posva/catimg # ################################################################################ diff --git a/plugins/catimg/catimg.sh b/plugins/catimg/catimg.sh old mode 100755 new mode 100644 index cd0f2e333..713a03291 --- a/plugins/catimg/catimg.sh +++ b/plugins/catimg/catimg.sh @@ -1,10 +1,10 @@ ################################################################################ # catimg script by Eduardo San Martin Morote aka Posva # -# http://posva.net # +# https://posva.net # # # # Ouput the content of an image to the stdout using the 256 colors of the # # terminal. # -# Github: https://github.com/posva/catimg # +# GitHub: https://github.com/posva/catimg # ################################################################################ function help() { diff --git a/plugins/celery/README.md b/plugins/celery/README.md new file mode 100644 index 000000000..d2597f702 --- /dev/null +++ b/plugins/celery/README.md @@ -0,0 +1,9 @@ +# Celery + +This plugin provides completion for [Celery](http://www.celeryproject.org/). + +To use it add celery to the plugins array in your zshrc file. + +```bash +plugins=(... celery) +``` diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index 998d92098..f7fedb5f2 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -111,5 +111,11 @@ function chruby_prompt_info() { } # complete on installed rubies -_chruby() { compadd $(chruby | tr -d '* ') } +_chruby() { + compadd $(chruby | tr -d '* ') + local default_path='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' + if PATH=${default_path} type ruby &> /dev/null; then + compadd system + fi +} compdef _chruby chruby diff --git a/plugins/chucknorris/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/README.md b/plugins/chucknorris/README.md new file mode 100644 index 000000000..be7b97e24 --- /dev/null +++ b/plugins/chucknorris/README.md @@ -0,0 +1,20 @@ +# chucknorris + +Chuck Norris fortunes plugin for oh-my-zsh + +**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff) + +To use it add `chucknorris` to the plugins array in you zshrc file. + +```zsh +plugins=(... chucknorris) +``` + + +Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD. + + +| Command | Description | +| ----------- | ------------------------------- | +| `chuck` | Print random Chuck Norris quote | +| `chuck_cow` | Print quote in cowthink | diff --git a/plugins/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. % -With the rising cost of gasoline, Chuck Norris is beginning to worry about his drinking habit. +Chuck Norris can turn toast back into bread % -The square root of Chuck Norris is pain. Do not try to square Chuck Norris, the result is death. +Chuck Norris started Chuck Norris. % -Chuck Norris' testicles do not produce sperm. They produce tiny white ninjas that recognize only one mission: seek and destroy. +Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming % -To be or not to be? That is the question. The answer? Chuck Norris. +Chuck Norris killed Kemper % -Chuck Norris has never been in a fight, ever. Do you call one roundhouse kick to the face a fight? +Did you here about the boy who cried Chuck Norris? % -There are two types of people in the world... people that suck, and Chuck Norris. +Chuck Norris can't perform Hadoukens, he IS a Hadouken % -Chuck Norris never wet his bed as a child. The bed wet itself out of fear. +Behind every successful man is Chuck Norris % -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? +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -70% of a human's weight is water. 70% of Chuck Norris' weight is his dick. +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. % -Jean-Claude Van Damme once kicked Chuck Norris' ass. He was then awakened from his dream by a roundhouse kick to the face. +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. % -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. +Outer space exists because it's afraid to be on the same planet with Chuck Norris. % -Chuck Norris uses 8'x10' sheets of plywood as toilet paper. +Chuck Norris does not sleep. He waits. % -Noah was the only man notified before Chuck Norris relieved himself in the Atlantic Ocean. +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. % -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. +Chuck Norris is the reason why Waldo is hiding. % -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. +Chuck Norris counted to infinity - twice. % -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. +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. % -Chuck Norris eats steak for every single meal. Most times he forgets to kill the cow. +There is no chin behind Chuck Norris’ beard. There is only another fist. % -The First Law of Thermodynamics states that energy can neither be created nor destroyed... unless it meets Chuck Norris. +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. % -Chuck Norris doesn't go on the internet, he has every internet site stored in his memory. He refreshes webpages by blinking. +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. % -Fact: Chuck Norris doesn't consider it sex if the woman survives. +Chuck Norris' hand is the only hand that can beat a Royal Flush. % -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. +Chuck Norris can lead a horse to water AND make it drink. % -Chuck Norris knows everything there is to know - Except for the definition of mercy. +Chuck Norris doesn’t wear a watch. HE decides what time it is. % -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 can slam a revolving door. % -Chuck Norris never has to wax his skis because they're always slick with blood. +Chuck Norris does not get frostbite. Chuck Norris bites frost. % -When you say "no one's perfect", Chuck Norris takes this as a personal insult. +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. % -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. +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. % -182,000 Americans die from Chuck Norris-related accidents every year. +If you spell Chuck Norris in Scrabble, you win. Forever. % -Paper beats rock, rock beats scissors, and scissors beats paper, but Chuck Norris beats all 3 at the same time. +Guns don't kill people. Chuck Norris kills people. % -Jesus can walk on water, but Chuck Norris can walk on Jesus. +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. % -All roads lead to Chuck Norris. And by the transitive property, a roundhouse kick to the face. +The chief export of Chuck Norris is Pain. % -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. +Chuck Norris has two speeds. Walk, and Kill. % -July 4th is Independence day. And the day Chuck Norris was born. Coincidence? i think not. +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. % -Chuck Norris never goes to the dentist because his teeth are unbreakable. His enemies never go to the dentist because they have no teeth. +Chuck Norris drives an ice cream truck covered in human skulls. % -In the medical community, death is referred to as "Chuck Norris Disease" +Chuck Norris is my Homeboy. % -Chuck Norris was once in a knife fight, and the knife lost. +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. % -If you work in an office with Chuck Norris, don't ask him for his three-hole-punch. +Chuck Norris uses pepper spray to spice up his steaks. % -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 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 First rule of Chuck Norris is: you do not talk about Chuck Norris. +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. % -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 is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. % -When Chuck Norris plays Monopoly, it affects the actual world economy. +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. % -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. +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. % -Chuck Norris drinks napalm to quell his heartburn. +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. % -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. +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. % -As an infant, Chuck Norris' parents gave him a toy hammer. He gave the world Stonehenge. +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 once ordered a steak in a restaurant. The steak did what it was told. +The quickest way to a man's heart is with Chuck Norris' fist. % -Most people fear the Reaper. Chuck Norris considers him "a promising Rookie". +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. % -There are only two things that can cut diamonds: other diamonds, and Chuck Norris. +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. % -President Roosevelt once rode his horse 100 miles. Chuck Norris carried his the same distance in half the time. +Chuck Norris can win a game of Connect Four in only three moves. % -Chuck Norris once ate four 30lb bowling balls without chewing. +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. % -What many people dont know is chuck norris is the founder of planned parenthood. Not even unborn children can escape his wrath. +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. % -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. +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. % -Chuck Norris qualified with a top speed of 324 mph at the Daytona 500, without a car. +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. % -Chuck Norris likes his coffee half and half: half coffee grounds, half wood-grain alcohol. +Chuck Norris doesn’t wash his clothes, he disembowels them. % -Chuck Norris uses tabasco sauce instead of visine. +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. % -The chemical formula for the highly toxic cyanide ion is CN-. These are also Chuck Norris' initials. This is not a coincidence. +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. % -Chuck Norris' credit cards have no limit. Last weekend, he maxed them out. +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. % -Think of a hot woman. Chuck Norris did her. +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." % -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. +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. % -Chuck Norris sleeps with a pillow under his gun. +The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death % -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 doesn't read. He just stares at the book until he gets the information he wants. % -Chuck Norris doesn't chew gum. Chuck Norris chews tin foil. +Why didn't the chicken cross the road? Because Chuck Norris got to it first. % -Aliens DO indeed exist. They just know better than to visit a planet that Chuck Norris is on. +When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000. % -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. +Chuck Norris can milk an alligator % -Every time Chuck Norris smiles, someone dies. Unless he smiles while he's roundhouse kicking someone in the face. Then two people die. +Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it % -Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. +Chuck Norris once proved p^~p by induction on his beard hairs. % -There's an order to the universe: space, time, Chuck Norris.... Just kidding, Chuck Norris is first. +The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. % -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 can bake in a Freezer. % -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. +Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick. % -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 once had a weak moment, just to know what it felt like. % -Chuck Norris doesn't see dead people. He makes people dead. +Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima? % -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. +Chuck Norris has made a 148 break a snooker. % -For undercover police work, Chuck Norris pins his badge underneath his shirt, directly into his chest. +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -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. +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. % -We live in an expanding universe. All of it is trying to get away from Chuck Norris. +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. % -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!" +Outer space exists because it's afraid to be on the same planet with 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 does not sleep. He waits. % -The word 'Kill' was invented by Chuck Norris. Other words were 'Die', 'Beer', and 'What'. +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. % -Chuck Norris is a vegetarian. Meaning, he does not eat animals until first he puts them into vegetative state with his fists. +Chuck Norris is the reason why Waldo is hiding. % -The 11th commandment is "Thou shalt not piss off Chuck Norris" This commandment is rarely enforced, as it is impossible to accomplish. +Chuck Norris counted to infinity - twice. % -Chuck Norris is his own line at the DMV. +There is no chin behind Chuck Norris’ beard. There is only another fist. % -Two wrongs don't make a right. Unless you're Chuck Norris. Then two wrongs make a roundhouse kick to the face. +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. % -Who let the dogs out? Chuck Norris let the dogs out... and then roundhouse kicked them through an Oldsmobile. +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. % -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. +Chuck Norris' hand is the only hand that can beat a Royal Flush. % -When Chuck Norris goes to out to eat, he orders a whole chicken, but he only eats its soul. +Chuck Norris can lead a horse to water AND make it drink. % -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 doesn’t wear a watch. HE decides what time it is. % -Chuck Norris has never won an Academy Award for acting... because he's not acting. +Chuck Norris can slam a revolving door. % -If Chuck Norris wants your opinion, he'll beat it into you. +Chuck Norris does not get frostbite. Chuck Norris bites frost. % -Not everyone that Chuck Norris is mad at gets killed. Some get away. They are called astronauts. +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. % -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. +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. % -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. +If you spell Chuck Norris in Scrabble, you win. Forever. % -Godzilla is a Japanese rendition of Chuck Norris' first visit to Tokyo. +Guns don't kill people. Chuck Norris kills people. % -They once made a Chuck Norris toilet paper, but there was a problem-- It wouldn't take shit from anybody. +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. % -Chuck Norris once rode a nine foot grizzly bear through an automatic car wash, instead of taking a shower. +The chief export of Chuck Norris is Pain. % -"Sweating bullets" is literally what happens when Chuck Norris gets too hot. +Chuck Norris has two speeds. Walk, and Kill. % -Chuck Norris' sperm can be seen with the naked eye. Each one is the size of a quarter. +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. % -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?" +Chuck Norris drives an ice cream truck covered in human skulls. % -Chuck Norris doesn't daydream. He's too busy giving other people nightmares. +Chuck Norris is my Homeboy. % -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. +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. % -There are no such things as tornados. Chuck Norris just hates trailer parks. +Chuck Norris uses pepper spray to spice up his steaks. % -Chuck Norris' Penis is a third degree blackbelt, and an honorable 32nd-degree mason. +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 does not follow fashion trends, they follow him. But then he turns around and kicks their ass. Nobody follows Chuck Norris. +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. % -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 is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. % -Chuck Norris' roundhouse kick is so powerful, it can be seen from outer space by the naked eye. +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. % -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. +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. % -Chuck Norris once participated in the running of the bulls. He walked. +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. % -The Drummer for Def Leppard's only got one arm. Chuck Norris needed a back scratcher. +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 was the orginal sculptor of Mount Rushmore. He completed the entire project using only a bottle opener and a drywall trowel. +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 once rode a bull, and nine months later it had a calf. +The quickest way to a man's heart is with Chuck Norris' fist. % -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. +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. % -For Spring Break '05, Chuck Norris drove to Madagascar, riding a chariot pulled by two electric eels. +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. % -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. +Chuck Norris can win a game of Connect Four in only three moves. % -Chuck Norris has banned rainbows from the state of North Dakota. +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. % -Divide Chuck Norris by zero and you will in fact get one........one bad-ass motherfucker that is. +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. % -TNT was originally developed by Chuck Norris to cure indigestion. +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. % -After returning from World War 2 unscathed, Bob Dole was congratulated by Chuck Norris with a handshake. The rest is history. +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. % -Chuck Norris runs on batteries. Specifically, Die Hards. +Chuck Norris doesn’t wash his clothes, he disembowels them. % -"Let the Bodies Hit the Floor" was originally written as Chuck Norris' theme song. +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 never have a heart attack. His heart isn't nearly foolish enough to attack him. +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. % -Only Chuck Norris can prevent forest fires. +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. % -When Chuck Norris makes a burrito, its main ingredient is real toes. +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 not Irish. His hair is soaked in the blood of his victims. +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. % -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. +http://chucknorrisfacts.com/ is built in Drupal because Chuck Norris knows a good CMS when he sees one. % -Chuck Norris' dick is so big, it has it's own dick, and that dick is still bigger than yours. +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". % -They say curiosity killed the cat. This is false. Chuck Norris killed the cat. Every single one of them. +Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you. % -There is no such thing as a lesbian, just a woman who has never met Chuck Norris. +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. % -Chuck Norris crossed the road. No one has ever dared question his motives. +The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live. % -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. +Only Chuck Norris can win the mind game, 'cause he never minds. % -One time, at band camp, Chuck Norris ate a percussionist. +Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning. % -Chuck Norris doesn't say "who's your daddy", because he knows the answer. +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 originally wrote the first dictionary. The definition for each word is as follows - A swift roundhouse kick to the face. +Chuck Norris doesn't need a bulletproof vest to be bulletproof % -Love does not hurt. Chuck Norris does. +When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money. % -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. +Merlin was Chuck Norris' assistant. % -Chuck Norris once round-house kicked a salesman. Over the phone. +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. % -The pen is mighter than the sword, but only if the pen is held by Chuck Norris. +Those who ignore history, are doomed by Chuck Norris. % -Chuck Norris doesn't kill two birds with one stone. Chuck Norris kills all birds, with two stones. The ones in his pants. +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -Chuck Norris knows the last digit of pi. +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. % -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. +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. % -The air around Chuck Norris is always a balmy 78 degrees. +Outer space exists because it's afraid to be on the same planet with Chuck Norris. % -When Chuck Norris wants an egg, he cracks open a chicken. +Chuck Norris does not sleep. He waits. % -Chuck Norris plays racquetball with a waffle iron and a bowling ball. +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. % -According to the Bible, God created the universe in six days. Before that, Chuck Norris created God by snapping his fingers. +Chuck Norris is the reason why Waldo is hiding. % -Chuck Norris doesn't believe in ravioli. He stuffs a live turtle with beef and smothers it in pig's blood. +Chuck Norris counted to infinity - twice. % -Count from one to ten. That's how long it would take Chuck Norris to kill you...Fourty seven times. +There is no chin behind Chuck Norris’ beard. There is only another fist. % -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. +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. % -Chuck Norris is not Politically Correct. He is just Correct. Always. +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. % -Mr. T pities the fool. Chuck Norris rips the fool's fucking head off. +Chuck Norris' hand is the only hand that can beat a Royal Flush. % -Chuck Norris had to stop washing his clothes in the ocean. The tsunamis were killing people. +Chuck Norris can lead a horse to water AND make it drink. % -Chuck Norris has volunteered to remain on earth after the Rapture; he will spend his time fighting the Anti-Christ. +Chuck Norris doesn’t wear a watch. HE decides what time it is. % -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 can slam a revolving door. % -Chuck Norris is the only known mammal in history to have an opposable thumb. On his penis. +Chuck Norris does not get frostbite. Chuck Norris bites frost. % -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. +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. % -Chuck Norris' favorite cereal is Kellogg's Nails 'N' Gravel. +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. % -In the first Jurassic Park movie, the Tyrannosaurus Rex wasn't chasing the jeep. Chuck Norris was chasing the Tyrannosaurus AND the jeep. +If you spell Chuck Norris in Scrabble, you win. Forever. % -Chuck Norris has never been accused of murder for the simple fact that his roundhouse kicks are recognized world-wide as "acts of God." +Guns don't kill people. Chuck Norris kills people. % -"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 theory of evolution. Just a list of animals Chuck Norris allows to live. % -Chuck Norris does not wear a condom. Because there is no such thing as protection from Chuck Norris. +The chief export of Chuck Norris is Pain. % -Chuck Norris once had sex with a cigarette machine in the Osaka airport. +Chuck Norris has two speeds. Walk, and Kill. % -Rules of fighting: 1) Don't bring a knife to a gun fight. 2) Don't bring a gun to a Chuck Norris fight. +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. % -Chuck Norris is the only man who has, literally, beaten the odds. With his fists. +Chuck Norris drives an ice cream truck covered in human skulls. % -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 is my Homeboy. % -Chuck Norris wipes his ass with chain mail and sandpaper. +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. % -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 uses pepper spray to spice up his steaks. % -Chuck Norris describes human beings as "a sociable holder for blood and guts". +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 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. +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. % -Chuck Norris likes his ice like he likes his skulls: crushed. +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. % -Chuck Norris can kick through all 6 degrees of separation, hitting anyone, anywhere, in the face, at any time. +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. % -Most tough men eat nails for breakfast. chuck Norris does all of his grocery shopping at Home Depot. +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. % -Chuck Norris did not "lose" his virginity, he stalked it and then destroyed it with extreme prejudice. +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. % -Everything King Midas touches turnes to gold. Everything Chuck Norris touches turns up dead. +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' pulse is measured on the richter scale. +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. % -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." +The quickest way to a man's heart is with Chuck Norris' fist. % -Chuck Norris once roundhouse-kicked a ten dollar bill into 200 nickels. +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. % -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. +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. % -Chuck Norris' penis has a Hemi. +Chuck Norris can win a game of Connect Four in only three moves. % -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. +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. % -Chuck Norris CAN in fact 'raise the roof'. And he can do it with one hand. +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. % -Kenny G is allowed to live because Chuck Norris doesn't kill women. +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. % -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. +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. % -For Chuck Norris, every street is "one way". HIS WAY. +Chuck Norris doesn’t wash his clothes, he disembowels them. % -There are now five cup sizes at Starbucks: Short, Tall, Grande, Venti, and Chuck Norris. +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. % -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 will attain statehood in 2009. His state flower will be the Magnolia. % -Chuck Norris once created a flamethrower by urinating into a lighter. +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. % -Instead of having a cigarette after sex, Chuck Norris heads outside and brands his cattle. +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 actually built the stairway to heaven. +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. % -Whoever said "only the good die young" was probably in Chuck Norris's kindergarten class. +Some kids pee their name in snow. Chuck Norris pees his name in concrete. % -Chuck Norris once skewered a man with the Eiffel tower. +The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.” % -The best part of waking up, is not Folgers in your cup, but knowing that Chuck Norris didn't kill you in your sleep. +Chuck Norris created Heavy Metal when he was upset % -Chuck Norris doesn't own a can opener, he just chews through the can. +Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. % -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. +When things go bump in the night.... it's Chuck Norris % -Chuck Norris needs a monkeywrench and a blowtorch to masturbate. +Chuck Norris fed the Hunger Games % -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 played "Got your Nose" with Voldemort and won. % -Chuck Norris invented all 32 letters of the alphabet. +Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife % -Remember The Ultimate Warrior? He quit wrestling because Chuck Norris wanted his nickname back. +Chuck Norris doesn't let it go. % -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. +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. % -Chuck Norris actually owns IBM. It was an extremely hostile takeover. +Whatever Chuck Norris wants, it will instantly appear. % -He, who laughs last, laughs best. He who laughs at Chuck Norris ? dies. +Chuck Norris once cut a knife with a stick of butter. % -Chuck Norris is like a dog, not only because he can smell fear, but because he can piss on whatever the fuck he wants. +Chuck Norris shops at Sam's Club, but leaves without having his receipt checked % -Chuck Norris can jump-start a car using jumper cables attached to his nipples. +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -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 doesn't read books. He stares them down until he gets the information he wants. % -Chuck Norris doesn't have blood. He is filled with magma. +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 +% +Chuck Norris roundhouse kicks people in the face first and asks questions later. +% +Chuck Norris is the only one who can tear a facebook page! +% +Chuck Norris doesn't need air, he is air +% +Chuck Norris once tried to teach a fat, stupid kid Martial Arts. Unsuccessfully. The kid grew up to be Steven Seagal. +% +Achievement Unlocked: Chuck Norris of Death +% +Chuck Norris is the ghost in paranormal activity. +% +Chuck Norris can't get fired by Donald Trump +% +Ozzy Osbourne once accidentally bit the head off a live bat - Chuck Norris once deliberately bit the head off a live pterodactyl. +% +Note to self: Don’t be the cashier to tell Chuck Norris his coupons have expired. +% +Chuck Norris was what Willis was talking about. +% +Chuck Norris is entitiled to his own facts. +% +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. +% +While visiting the hexagon, Chuck Norris was asked to demonstrate his famous roundhouse kick. Henceforth, it has been known as the Pentagon. +% +When Chuck Norris played the card game War with a friend, France surrendered. +% +If Goliath listened to Chuck Norris he would have won. +% +Chuck Norris can defuse bomb even if he cut the wrong wire +% +Chuck Norris sleeps in Seattle. +% +Chuck Norris shot a man with a knife +% +The dictionary references Chuck Norris several times, he is metioned under Fear, Law, Order and Chucktatorship. +% +Chuck Norris CAN balance the light-switch between ON and OFF. +% +If Chuck was ever captured, he could win a game of Russian Roulette with six bullets in the revolver, he would shoot everyone else! +% +In a rain storm Chuck Norris stays dry. Rain drops are scared to hit him. +% +Chuck Norris is the reason tumbleweeds tumble +% +The Earth was almost destroyed by a 50 km wide asteroid in 1984, but Chuck Norris roundhouse kicked it into the Sun. +% +Chuck Norris can terminate a repeating decimal. +% +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 look for fun. The fun looks for Chuck Norris. +% +Chuck Norris starts his day with 6 live chickens two cows, three pigs and a boiling hot cup of pure fury +% +The only word that rhymes with orange is Chuck Norris +% +Everyone is so scared of Chuck Norris that they kiss his arse by writing these facts, too right they should +% +gmail@chucknorris.com +% +Chuck Norris play's Texas hold em with Zeus, every second Wednesday of the month +% +Chuck Norris has killed the Dead Sea +% +On the keyboard there is no control button because Chuck Norris is always in control. +% +The truth hurts dosen't it, Chuck Norris' truth kills. +% +Chuck Norris sent a BBM to an iphone. +% +When Presidents speak, their nation listens. When Chuck Norris blinks, the whole World listens. +% +Chuck Norris once cried just to see what it was like. The end result was the creation of life. +% +Chuck Norris is the reason that the world will end in 2012. He was getting bored with the Earth +% +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. +% +Only Chuck Norris is stronger than an Altoid. +% +Chuck Norris has a battlecruiser AND a car. +% +Chuck Norris burnt a fire proof vest, UNDERWATER! +% +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 doesn't cheat death, he beats it fair and square. +% +When Chuck Norris roundhouse-kicks you HE decides when you will feel the impact . +% +Chuck Norris made the big bang just by clicking his fingers +% +Trick me once, shame on you, trick Chuck Norris.....rest in peace. +% +Chuck Norris doesn't fight. He gives motivational seminars to die on their own to avoid a roundhouse kick to the face. +% +This one time at band camp... BAM! Chuck Norris. +% +Chuck Norris protects his body guards. +% +Chuck Norris watched the first steps on the moon... From his summer home on Mars +% +The Earth is made up of two-thirds water and one-third Chuck Norris. % diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh index 99252f690..3b363c81b 100644 --- a/plugins/cloudapp/cloudapp.plugin.zsh +++ b/plugins/cloudapp/cloudapp.plugin.zsh @@ -1,2 +1,6 @@ -#!/bin/zsh -alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb +alias cloudapp="${0:a:h}/cloudapp.rb" + +# Ensure only the owner can access the credentials file +if [[ -f ~/.cloudapp ]]; then + chmod 600 ~/.cloudapp +fi diff --git a/plugins/cloudfoundry/README.md b/plugins/cloudfoundry/README.md new file mode 100644 index 000000000..89dd9d1ce --- /dev/null +++ b/plugins/cloudfoundry/README.md @@ -0,0 +1,58 @@ +# Cloudfoundry Plugin + +This plugin is intended to offer a few simple aliases for regular users of the [Cloud Foundry Cli][1]. Most are just simple aliases that will save a bit of typing. Others include mini functions and or accept parameters. Take a look at the table below for details. + +| Alias | Command | Description | +|----------|-----------------------------|--------------------------------------------------------------------------| +| cfl | `cf login` | Login to Cloud Foundry | +| cft | `cf target` | Target the cli at a specific Org/Space in Cloud Foundry | +| cfa | `cf apps` | List all applications in the current Org/Space | +| cfs | `cf services` | List all services in the current Org/Space | +| cfm | `cf marketplace` | List the services available in the Marketplace | +| cfp | `cf push` | Push your application code to Cloud Foundry | +| cfcs | `cf create-service` | Create a service based on a Marketplace offering | +| cfbs | `cf bind-service` | Bind an application to a service you created | +| cfus | `cf unbind-service` | Unbind a service from an application | +| cfds | `cf delete-service` | Delete a service you no longer have bound | +| cfup | `cf cups` | Create a "user-provided-service" | +| cflg | `cf logs` | Tail the logs of an application (requires ) | +| cfr | `cf routes` | List all the routes in the current Space | +| cfe | `cf env` | Show the environment variables for an application (requires ) | +| cfsh | `cf ssh` | Attach to a running container (requires an etc.) | +| cfsc | `cf scale` | Scale an application (requires an etc.) | +| cfev | `cf events` | Show the application events (requires ) | +| cfdor | `cf delete-orphaned-routes` | Delete routes that are no longer bound to applications | +| cfbpk | `cf buildpacks` | List the available buildpacks | +| cfdm | `cf domains` | List the domains associates with this Cloud Foundry foundation | +| cfsp | `cf spaces` | List all the Spaces in the current Org | +| cfap | `cf app` | Show the details of a deployed application (requires ) | +| cfh. | `export CF_HOME=$PWD/.cf` | Set the current directory as CF_HOME | +| cfh~ | `export CF_HOME=~/.cf` | Set the user's root directory as CF_HOME | +| cfhu | `unset CF_HOME` | Unsets CF_HOME | +| cfpm | `cf push -f` | Push an application using a manifest (requires location) | +| cflr | `cf logs --recent` | Show the recent logs (requires ) | +| cfsrt | `cf start` | Start an application (requires ) | +| cfstp | `cf stop` | Stop an application (requires ) | +| cfstg | `cf restage` | Restage an application (requires ) | +| cfdel | `cf delete` | Delete an application (requires ) | +| cfsrtall | - | Start all apps that are currently in the "Stopped" state | +| cfstpall | - | Stop all apps that are currently in the "Started" state | + +For help and advice on what any of the commands does, consult the built in `cf` help functions as follows:- + +```bash +cf help # List the most popular and commonly used commands +cf help -a # Complete list of all possible commands +cf --help # Help on a specific command including arguments and examples +``` + +Alternatively, seek out the [online documentation][3]. And don't forget, there are loads of great [community plugins for the cf-cli][4] command line tool that can greatly extend its power and usefulness. + +## Contributors + +Contributed to `oh_my_zsh` by [benwilcock][2]. + +[1]: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html +[2]: https://github.com/benwilcock +[3]: https://docs.cloudfoundry.org/cf-cli/getting-started.html +[4]: https://plugins.cloudfoundry.org/ diff --git a/plugins/cloudfoundry/cloudfoundry.plugin.zsh b/plugins/cloudfoundry/cloudfoundry.plugin.zsh new file mode 100644 index 000000000..b6715787e --- /dev/null +++ b/plugins/cloudfoundry/cloudfoundry.plugin.zsh @@ -0,0 +1,34 @@ +# Some Useful CloudFoundry Aliases & Functions +alias cfl="cf login" +alias cft="cf target" +alias cfa="cf apps" +alias cfs="cf services" +alias cfm="cf marketplace" +alias cfp="cf push" +alias cfcs="cf create-service" +alias cfbs="cf bind-service" +alias cfus="cf unbind-service" +alias cfds="cf delete-service" +alias cfup="cf cups" +alias cflg="cf logs" +alias cfr="cf routes" +alias cfe="cf env" +alias cfsh="cf ssh" +alias cfsc="cf scale" +alias cfev="cf events" +alias cfdor="cf delete-orphaned-routes" +alias cfbpk="cf buildpacks" +alias cfdm="cf domains" +alias cfsp="cf spaces" +function cfap() { cf app $1 } +function cfh.() { export CF_HOME=$PWD/.cf } +function cfh~() { export CF_HOME=~/.cf } +function cfhu() { unset CF_HOME } +function cfpm() { cf push -f $1 } +function cflr() { cf logs $1 --recent } +function cfsrt() { cf start $1 } +function cfstp() { cf stop $1 } +function cfstg() { cf restage $1 } +function cfdel() { cf delete $1 } +function cfsrtall() {cf apps | awk '/stopped/ { system("cf start " $1)}'} +function cfstpall() {cf apps | awk '/started/ { system("cf stop " $1)}'} diff --git a/plugins/coffee/_coffee b/plugins/coffee/_coffee index 10b6b8164..5e52b30e6 100644 --- a/plugins/coffee/_coffee +++ b/plugins/coffee/_coffee @@ -1,6 +1,6 @@ #compdef coffee # ------------------------------------------------------------------------------ -# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users +# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ # Description # ----------- # -# Completion script for Coffee.js v0.6.11 (http://coffeejs.org) +# Completion script for Coffee.js v0.6.11 (https://coffeescript.org) # # ------------------------------------------------------------------------------ # Authors diff --git a/plugins/colorize/README.md b/plugins/colorize/README.md new file mode 100644 index 000000000..71fa87861 --- /dev/null +++ b/plugins/colorize/README.md @@ -0,0 +1,29 @@ +# colorize + +With this plugin you can syntax-highlight file contents of over 300 supported languages and other text formats. + +Colorize will highlight the content based on the filename extension. If it can't find a syntax-highlighting +method for a given extension, it will try to find one by looking at the file contents. If no highlight method +is found it will just cat the file normally, without syntax highlighting. + +To use it, add colorize to the plugins array of your zshrc file: +``` +plugins=(... colorize) +``` + +## Usage + +* `ccat [files]`: colorize the contents of the file (or files, if more than one are provided). + If no arguments are passed it will colorize the standard input or stdin. + +* `cless [files]`: colorize the contents of the file (or files, if more than one are provided) and + open less. If no arguments are passed it will colorize the standard input or stdin. + +Note that `cless` will behave as less when provided more than one file: you have to navigate files with +the commands `:n` for next and `:p` for previous. The downside is that less options are not supported. +But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`. +In the latter form, the file contents will be concatenated and presented by less as a single file. + +## Requirements + +You have to install Pygments first: [pygments.org](http://pygments.org/download/) diff --git a/plugins/colorize/colorize.plugin.zsh b/plugins/colorize/colorize.plugin.zsh index b97dffe43..bec9a2ac6 100644 --- a/plugins/colorize/colorize.plugin.zsh +++ b/plugins/colorize/colorize.plugin.zsh @@ -1,29 +1,49 @@ -# Plugin for highlighting file content -# Plugin highlights file content based on the filename extension. -# If no highlighting method supported for given extension then it tries -# guess it by looking for file content. - -#easier alias to use plugin +# easier alias to use the plugin alias ccat='colorize_via_pygmentize' +alias cless='colorize_via_pygmentize_less' colorize_via_pygmentize() { - if [ ! -x "$(which pygmentize)" ]; then - echo "package \'Pygments\' is not installed!" - return -1 + if ! (( $+commands[pygmentize] )); then + echo "package 'Pygments' is not installed!" + return 1 fi + # pygmentize stdin if no arguments passed if [ $# -eq 0 ]; then - pygmentize -g $@ + pygmentize -g + return $? fi - for FNAME in $@ + # guess lexer from file extension, or + # guess it from file contents if unsuccessful + local FNAME lexer + for FNAME in "$@" do - filename=$(basename "$FNAME") - lexer=`pygmentize -N \"$filename\"` - if [ "Z$lexer" != "Ztext" ]; then - pygmentize -l $lexer "$FNAME" + lexer=$(pygmentize -N "$FNAME") + if [[ $lexer != text ]]; then + pygmentize -l "$lexer" "$FNAME" else pygmentize -g "$FNAME" fi done } + +colorize_via_pygmentize_less() ( + # this function is a subshell so tmp_files can be shared to cleanup function + declare -a tmp_files + + cleanup () { + [[ ${#tmp_files} -gt 0 ]] && rm -f "${tmp_files[@]}" + exit + } + trap 'cleanup' EXIT HUP TERM INT + + while (( $# != 0 )); do #TODO: filter out less opts + tmp_file="$(mktemp -t "tmp.colorize.XXXX.$(sed 's/\//./g' <<< "$1")")" + tmp_files+=("$tmp_file") + colorize_via_pygmentize "$1" > "$tmp_file" + shift 1 + done + + less -f "${tmp_files[@]}" +) diff --git a/plugins/command-not-found/README.md b/plugins/command-not-found/README.md new file mode 100644 index 000000000..1cf4ba66e --- /dev/null +++ b/plugins/command-not-found/README.md @@ -0,0 +1,32 @@ +# command-not-found plugin + +This plugin uses the command-not-found package for zsh to provide suggested packages to be installed if a command cannot be found. + +To use it, add `command-not-found` to the plugins array of your zshrc file: + +```zsh +plugins=(... command-not-found) +``` + +An example of how this plugin works in Ubuntu: +``` +$ mutt +The program 'mutt' can be found in the following packages: + * mutt + * mutt-kz + * mutt-patched +Try: sudo apt install +``` + +### Supported platforms + +It works out of the box with the command-not-found packages for: + +- [Ubuntu](https://www.porcheron.info/command-not-found-for-zsh/) +- [Debian](https://packages.debian.org/search?keywords=command-not-found) +- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found) +- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found) +- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound) +- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found) + +You can add support for other platforms by submitting a Pull Request. diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index 0e2f2133f..dd1186e44 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -1,5 +1,5 @@ # Uses the command-not-found package zsh support -# as seen in http://www.porcheron.info/command-not-found-for-zsh/ +# as seen in https://www.porcheron.info/command-not-found-for-zsh/ # this is installed in Ubuntu [[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found @@ -31,3 +31,10 @@ if type brew &> /dev/null; then eval "$(brew command-not-found-init)"; fi fi + +# NixOS command-not-found support +if [ -x /run/current-system/sw/bin/command-not-found ]; then + command_not_found_handler () { + /run/current-system/sw/bin/command-not-found $@ + } +fi diff --git a/plugins/common-aliases/common-aliases.plugin.zsh b/plugins/common-aliases/common-aliases.plugin.zsh index 742798f27..785a09c63 100644 --- a/plugins/common-aliases/common-aliases.plugin.zsh +++ b/plugins/common-aliases/common-aliases.plugin.zsh @@ -13,7 +13,7 @@ alias lS='ls -1FSsh' alias lart='ls -1Fcart' alias lrt='ls -1Fcrt' -alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file +alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file alias grep='grep --color' alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' @@ -44,8 +44,6 @@ alias p='ps -f' alias sortnr='sort -n -r' alias unexport='unset' -alias whereami=display_info - alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' diff --git a/plugins/composer/README.md b/plugins/composer/README.md new file mode 100644 index 000000000..2b4bae579 --- /dev/null +++ b/plugins/composer/README.md @@ -0,0 +1,29 @@ +# composer + +This plugin provides completion for [composer](https://getcomposer.org/), as well as aliases +for frequent composer commands. It also adds Composer's global binaries to the PATH, using +Composer if available. + +To use it add `composer` to the plugins array in your zshrc file. + +```zsh +plugins=(... composer) +``` + +## Aliases + +| Alias | Command | Description | +| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- | +| `c` | composer | Starts composer | +| `csu` | composer self-update | Updates composer to the latest version | +| `cu` | composer update | Updates composer dependencies and `composer.lock` file | +| `cr` | composer require | Adds new packages to `composer.json` | +| `crm` | composer remove | Removes packages from `composer.json` | +| `ci` | composer install | Resolves and installs dependencies from `composer.json` | +| `ccp` | composer create-project | Create new project from an existing package | +| `cdu` | composer dump-autoload | Updates the autoloader | +| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) | +| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory | +| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory | +| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory | +| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory | diff --git a/plugins/composer/composer.plugin.zsh b/plugins/composer/composer.plugin.zsh index d00813e39..634961023 100644 --- a/plugins/composer/composer.plugin.zsh +++ b/plugins/composer/composer.plugin.zsh @@ -51,5 +51,10 @@ 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 global config bin-dir --absolute 2>/dev/null) +# Add Composer's global binaries to PATH, using Composer if available. +if (( $+commands[composer] )); then + export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null) +else + [ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin + [ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin +fi 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 ` to copy the file named `filename`. diff --git a/plugins/cpanm/README.md b/plugins/cpanm/README.md new file mode 100644 index 000000000..3803e3e00 --- /dev/null +++ b/plugins/cpanm/README.md @@ -0,0 +1,9 @@ +# Cpanm + +This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)). + +To use it add cpanm to the plugins array in your zshrc file. + + ```bash +plugins=(... cpanm) +``` diff --git a/plugins/cpanm/_cpanm b/plugins/cpanm/_cpanm index 58451d35a..ff9ae1c15 100644 --- a/plugins/cpanm/_cpanm +++ b/plugins/cpanm/_cpanm @@ -6,9 +6,6 @@ # # Current supported cpanm version: 1.4000 (Tue Mar 8 01:00:49 PST 2011) # -# The latest code is always located at: -# https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm -# local arguments curcontext="$curcontext" typeset -A opt_args diff --git a/plugins/dash/dash.plugin.zsh b/plugins/dash/dash.plugin.zsh new file mode 100644 index 000000000..b00d4877e --- /dev/null +++ b/plugins/dash/dash.plugin.zsh @@ -0,0 +1,86 @@ +# Usage: dash [keyword:]query +dash() { open dash://"$*" } +compdef _dash dash + +_dash() { + # No sense doing this for anything except the 2nd position and if we haven't + # specified which docset to query against + if [[ $CURRENT -eq 2 && ! "$words[2]" =~ ":" ]]; then + local -a _all_docsets + _all_docsets=() + # Use defaults to get the array of docsets from preferences + # Have to smash it into one big line so that each docset is an element of + # our DOCSETS array + DOCSETS=("${(@f)$(defaults read com.kapeli.dashdoc docsets | tr -d '\n' | grep -oE '\{.*?\}')}") + + # remove all newlines since defaults prints so pretty like + # Now get each docset and output each on their own line + for doc in "$DOCSETS[@]"; do + # Only output docsets that are actually enabled + if [[ "`echo $doc | grep -Eo \"isEnabled = .*?;\" | sed 's/[^01]//g'`" == "0" ]]; then + continue + fi + + keyword='' + + # Order of preference as explained to me by @kapeli via email + KEYWORD_LOCATORS=(keyword suggestedKeyword platform) + for locator in "$KEYWORD_LOCATORS[@]"; do + # Echo the docset, try to find the appropriate keyword + # Strip doublequotes and colon from any keyword so that everything has the + # same format when output (we'll add the colon in the completion) + keyword=`echo $doc | grep -Eo "$locator = .*?;" | sed -e "s/$locator = \(.*\);/\1/" -e "s/[\":]//g"` + if [[ ! -z "$keyword" ]]; then + # if we fall back to platform, we should do some checking per @kapeli + if [[ "$locator" == "platform" ]]; then + # Since these are the only special cases right now, let's not do the + # expensive processing unless we have to + if [[ "$keyword" == "python" || "$keyword" == "java" || \ + "$keyword" == "qt" || "$keyword" == "cocs2d" ]]; then + docsetName=`echo $doc | grep -Eo "docsetName = .*?;" | sed -e "s/docsetName = \(.*\);/\1/" -e "s/[\":]//g"` + if [[ "$keyword" == "python" ]]; then + if [[ "$docsetName" == "Python 2" ]]; then + keyword="python2" + elif [[ "$docsetName" == "Python 3" ]]; then + keyword="python3" + fi + elif [[ "$keyword" == "java" ]]; then + if [[ "$docsetName" == "Java SE7" ]]; then + keyword="java7" + elif [[ "$docsetName" == "Java SE6" ]]; then + keyword="java6" + elif [[ "$docsetName" == "Java SE8" ]]; then + keyword="java8" + fi + elif [[ "$keyword" == "qt" ]]; then + if [[ "$docsetName" == "Qt 5" ]]; then + keyword="qt5" + elif [[ "$docsetName" == "Qt 4" ]]; then + keyword="qt4" + elif [[ "$docsetName" == "Qt" ]]; then + keyword="qt4" + fi + elif [[ "$keyword" == "cocos2d" ]]; then + if [[ "$docsetName" == "Cocos3D" ]]; then + keyword="cocos3d" + fi + fi + fi + fi + + # Bail once we have a match + break + fi + done + + # If we have a keyword, add it to the list! + if [[ ! -z "$keyword" ]]; then + _all_docsets+=($keyword) + fi + done + + # special thanks to [arx] on #zsh for getting me sorted on this piece + compadd -qS: -- "$_all_docsets[@]" + return + fi +} diff --git a/plugins/debian/README.md b/plugins/debian/README.md new file mode 100644 index 000000000..a676674dc --- /dev/null +++ b/plugins/debian/README.md @@ -0,0 +1,75 @@ +# debian + +This plugin provides debian related zsh aliases. +To use it add `debian` to the plugins array in your zshrc file. + +```zsh +plugins=(... debian) +``` + +## Common Aliases + +| Alias | Command | Description | +| -------- | ------------------------------------------------------------------------------|--------------------------------------------------------------------------- | +| `age` | apt-get | Command line tool for handling packages | +| `api` | aptitude | Same functionality as `apt-get`, provides extra options while installation | +| `acs` | apt-cache search | Command line tool for searching apt software package cache | +| `aps` | aptitude search | Searches installed packages using aptitude | +| `as` | aptitude -F \"* %p -> %d \n(%v/%V)\" \ -no-gui --disable-columns search | - | +| `afs` | apt-file search --regexp | Search file in packages | +| `asrc` | apt-get source | Fetch source packages through `apt-get` | +| `app` | apt-cache policy | Displays priority of package sources | + +## Superuser Operations Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------- | +| `aac` | sudo $apt_pref autoclean | Clears out the local repository of retrieved package files | +| `abd` | sudo $apt_pref build-dep | Installs all dependencies for building packages | +| `ac` | sudo $apt_pref clean | Clears out the local repository of retrieved package files except lock files | +| `ad` | sudo $apt_pref update | Updates the package lists for upgrades for packages | +| `adg` | sudo $apt_pref update && sudo $apt_pref $apt_upgr | Update and upgrade packages | +| `adu` | sudo $apt_pref update && sudo $apt_pref dist-upgrade | Smart upgrade that handles dependencies | +| `afu` | sudo apt-file update | Update the files in packages | +| `au` | sudo $apt_pref $apt_upgr | - | +| `ai` | sudo $apt_pref install | Command-line tool to install package | +| `ail` | sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install | Install all packages given on the command line while using only the first word of each line | +| `ap` | sudo $apt_pref purge | Removes packages along with configuration files | +| `ar` | sudo $apt_pref remove | Removes packages, keeps the configuration files | +| `ads` | sudo apt-get dselect-upgrade | Installs packages from list and removes all not in the list | +| `dia` | sudo dpkg -i ./*.deb | Install all .deb files in the current directory | +| `di` | sudo dpkg -i | Install all .deb files in the current directory | +| `kclean` | sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`)) | Remove ALL kernel images and headers EXCEPT the one in use | + +- `$apt_pref` - Use apt or aptitude if installed, fallback is apt-get. +- `$apt_upgr` - Use upgrade. + +## Aliases - Commands using `su` + +| Alias | Command | +| -------- | ------------------------------------------------------------------------------| +| `aac` | su -ls \'$apt_pref autoclean\' root | +| `ac` | su -ls \'$apt_pref clean\' root | +| `ad` | su -lc \'$apt_pref update\' root | +| `adg` | su -lc \'$apt_pref update && aptitude $apt_upgr\' root | +| `adu` | su -lc \'$apt_pref update && aptitude dist-upgrade\' root | +| `afu` | su -lc "apt-file update | +| `ag` | su -lc \'$apt_pref $apt_upgr\' root | +| `dia` | su -lc "dpkg -i ./*.deb" root | + +## Miscellaneous Aliases + +| Alias | Command | Description | +| -------- | -------------------------------------------------|---------------------------------------- | +| `allpkgs`| aptitude search -F "%p" --disable-columns ~i | Display all installed packages | +| `mydeb` | time dpkg-buildpackage -rfakeroot -us -uc | Create a basic .deb package | + +## Functions + +| Fucntion | Description | +|-----------------------|-------------------------------------------------------------------------------| +| `apt-copy` | Create a simple script that can be used to 'duplicate' a system | +| `apt-history` | Displays apt history for a command | +| `kerndeb` | Builds kernel packages | +| `apt-list-packages` | List packages by size | + diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 19966b6ac..654b692d2 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -5,9 +5,12 @@ # # Debian-related zsh aliases and functions for zsh -# Use aptitude if installed, or apt-get if not. +# Use apt or aptitude if installed, fallback is apt-get # You can just set apt_pref='apt-get' to override it. -if [[ -e $( which -p aptitude 2>&1 ) ]]; then +if [[ -e $( which -p apt 2>&1 ) ]]; then + apt_pref='apt' + apt_upgr='upgrade' +elif [[ -e $( which -p aptitude 2>&1 ) ]]; then apt_pref='aptitude' apt_upgr='safe-upgrade' else @@ -176,7 +179,7 @@ apt-copy() { # apt-history remove # apt-history rollback # apt-history list -# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html +# Based On: https://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html apt-history () { case "$1" in install) diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md new file mode 100644 index 000000000..3ac162f05 --- /dev/null +++ b/plugins/dircycle/README.md @@ -0,0 +1,78 @@ +# dircycle + +Plugin for cycling through the directory stack + +This plugin enables directory navigation similar to using back and forward on browsers or common file explorers like Finder or Nautilus. It uses a small zle trick that lets you cycle through your directory stack left or right using Ctrl + Shift + Left / Right . This is useful when moving back and forth between directories in development environments, and can be thought of as kind of a nondestructive pushd/popd. + +## Enabling the plugin + +1. Open your `.zshrc` file and add `dircycle` in the plugins section: + + ```zsh + plugins=( + # all your enabled plugins + dircycle + ) + ``` + +2. Reload the source file or restart your Terminal session: + + ```console + $ source ~/.zshrc + $ + ``` + +## Usage Examples + +Say you opened these directories on the terminal: + +```console +~$ cd Projects +~/Projects$ cd Hacktoberfest +~/Projects/Hacktoberfest$ cd oh-my-zsh +~/Projects/Hacktoberfest/oh-my-zsh$ dirs -v +0 ~/Projects/Hacktoberfest/oh-my-zsh +1 ~/Projects/Hacktoberfest +2 ~/Projects +3 ~ +``` + +By pressing Ctrl + Shift + Left, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`. + +And by pressing Ctrl + Shift + Right, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`. + +Here's a example history table with the same accessed directories like above: + +| Current `$CWD` | Key press | New `$CWD` | +| --------------- | ----------------------------------------------------- | --------------- | +| `oh-my-zsh` | Ctrl + Shift + Left | `Hacktoberfest` | +| `Hacktoberfest` | Ctrl + Shift + Left | `Projects` | +| `Projects` | Ctrl + Shift + Left | `~` | +| `~` | Ctrl + Shift + Right | `Projects` | +| `Projects` | Ctrl + Shift + Right | `Hacktoberfest` | +| `Hacktoberfest` | Ctrl + Shift + Right | `oh-my-zsh` | +| `oh-my-zsh` | Ctrl + Shift + Right | `~` | + +Note the last traversal, when pressing Ctrl + Shift + Right on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`. + +Here's an asciinema cast demonstrating the example above: + +[![asciicast](https://asciinema.org/a/204406.png)](https://asciinema.org/a/204406) + +## Functions + +| Function | Description | +| -------------------- | --------------------------------------------------------------------------------------------------------- | +| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on Ctrl + Shift + Left | +| `insert-cycledright` | Change `$CWD` to the next known stack, binded on Ctrl + Shift + Right | + +## Rebinding keys + +You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to Alt + Shift + Left / Right in `xterm-256color`: + +```zsh +bindkey '^[[1;4D' insert-cycledleft +bindkey '^[[1;4C' insert-cycledright +``` + +You can get the bindkey sequence by pressing Ctrl + V, then pressing the keyboard shortcut you want to use. diff --git a/plugins/dircycle/dircycle.plugin.zsh b/plugins/dircycle/dircycle.plugin.zsh index 8c58cab4c..bb69f6b3f 100644 --- a/plugins/dircycle/dircycle.plugin.zsh +++ b/plugins/dircycle/dircycle.plugin.zsh @@ -9,31 +9,36 @@ # pushd -N: start counting from right of `dirs' output switch-to-dir () { - [[ ${#dirstack} -eq 0 ]] && return + setopt localoptions nopushdminus + [[ ${#dirstack} -eq 0 ]] && return 1 while ! builtin pushd -q $1 &>/dev/null; do # We found a missing directory: pop it out of the dir stack builtin popd -q $1 # Stop trying if there are no more directories in the dir stack - [[ ${#dirstack} -eq 0 ]] && break + [[ ${#dirstack} -eq 0 ]] && return 1 done } insert-cycledleft () { - emulate -L zsh - setopt nopushdminus + switch-to-dir +1 || return - switch-to-dir +1 + local fn + for fn (chpwd $chpwd_functions precmd $precmd_functions); do + (( $+functions[$fn] )) && $fn + done zle reset-prompt } zle -N insert-cycledleft insert-cycledright () { - emulate -L zsh - setopt nopushdminus + switch-to-dir -0 || return - switch-to-dir -0 + local fn + for fn (chpwd $chpwd_functions precmd $precmd_functions); do + (( $+functions[$fn] )) && $fn + done zle reset-prompt } zle -N insert-cycledright diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md new file mode 100644 index 000000000..511f2be17 --- /dev/null +++ b/plugins/dirhistory/README.md @@ -0,0 +1,17 @@ +# Dirhistory plugin + +This plugin adds keyboard shortcuts for navigating directory history and hierarchy. + +To use it, add `dirhistory` to the plugins array in your zshrc file: + +```zsh +plugins=(... dirhistory) +``` +## Keyboard Shortcuts + +| Shortcut | Description | +|-----------------------------------|-----------------------------------------------------------| +| alt + left | Go to previous directory | +| alt + right | Undo alt + left | +| alt + up | Move into the parent directory | +| alt + down | Move into the first child directory by alphabetical order | diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8138872bc..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=() @@ -120,7 +124,9 @@ zle -N dirhistory_zle_dirhistory_back bindkey "\e[3D" dirhistory_zle_dirhistory_back bindkey "\e[1;3D" dirhistory_zle_dirhistory_back # Mac teminal (alt+left/right) -bindkey "^[b" dirhistory_zle_dirhistory_back +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + bindkey "^[b" dirhistory_zle_dirhistory_back +fi # Putty: bindkey "\e\e[D" dirhistory_zle_dirhistory_back # GNU screen: @@ -129,8 +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 -bindkey "^[f" 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/dirpersist/README.md b/plugins/dirpersist/README.md new file mode 100644 index 000000000..9880bc563 --- /dev/null +++ b/plugins/dirpersist/README.md @@ -0,0 +1,9 @@ +# Dirpersist plugin + +This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file. + +To use it, add `dirpersist` to the plugins array in your zshrc file: + +```zsh +plugins=(... dirpersist) +``` diff --git a/plugins/django/README.md b/plugins/django/README.md new file mode 100644 index 000000000..415f6b7ea --- /dev/null +++ b/plugins/django/README.md @@ -0,0 +1,56 @@ +# Django plugin + +This plugin adds completion and hints for the [Django Project](https://www.djangoproject.com/) `manage.py` commands +and options. + +To use it, add `django` to the plugins array in your zshrc file: + +```zsh +plugins=(... django) +``` + +## Usage + +```zsh +$> python manage.py (press here) +``` + +Would result in: + +```zsh +cleanup -- remove old data from the database +compilemessages -- compile .po files to .mo for use with gettext +createcachetable -- creates table for SQL cache backend +createsuperuser -- create a superuser +dbshell -- run command-line client for the current database +diffsettings -- display differences between the current settings and Django defaults +dumpdata -- output contents of database as a fixture +flush -- execute 'sqlflush' on the current database +inspectdb -- output Django model module for tables in database +loaddata -- install the named fixture(s) in the database +makemessages -- pull out all strings marked for translation +reset -- executes 'sqlreset' for the given app(s) +runfcgi -- run this project as a fastcgi +runserver -- start a lightweight web server for development +... +``` + +If you want to see the options available for a specific command, try: + +```zsh +$> python manage.py makemessages (press here) +``` + +And that would result in: + +```zsh +--all -a -- re-examine all code and templates +--domain -d -- domain of the message files (default: "django") +--extensions -e -- file extension(s) to examine (default: ".html") +--help -- display help information +--locale -l -- locale to process (default: all) +--pythonpath -- directory to add to the Python path +--settings -- python path to settings module +... +``` + diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh index 29a51d29d..86558ff2e 100644 --- a/plugins/django/django.plugin.zsh +++ b/plugins/django/django.plugin.zsh @@ -154,7 +154,7 @@ _managepy-makemessages(){ "--no-default-ignore[Don't ignore the common glob-style patterns 'CVS', '.*', '*~' and '*.pyc'.]" \ "--no-wrap[Don't break long message lines into several lines.]" \ "--no-location[Don't write '#: filename:line' lines.]" \ - '--no-obsolete[emove obsolete message strings.]' \ + '--no-obsolete[Remove obsolete message strings.]' \ '--keep-pot[Keep .pot file after making messages.]' \ $nul_args && ret=0 } diff --git a/plugins/dnf/README.md b/plugins/dnf/README.md old mode 100755 new mode 100644 diff --git a/plugins/docker-compose/README.md b/plugins/docker-compose/README.md index d3fcb29fe..07a87bc81 100644 --- a/plugins/docker-compose/README.md +++ b/plugins/docker-compose/README.md @@ -1,4 +1,29 @@ -# Docker-compose plugin for oh my zsh +# Docker-compose -A copy of the completion script from the [docker-compose](https://github.com/docker/compose/blob/master/contrib/completion/zsh/_docker-compose) git repo. +This plugin provides completion for [docker-compose](https://docs.docker.com/compose/) as well as some +aliases for frequent docker-compose commands. +To use it, add docker-compose to the plugins array of your zshrc file: +``` +plugins=(... docker-compose) +``` + +## Aliases + +| Alias | Command | Description | +|-----------|--------------------------|------------------------------------------------------------------| +| dco | `docker-compose` | Docker-compose main command | +| dcb | `docker-compose build` | Build containers | +| dce | `docker-compose exec` | Execute command inside a container | +| dcps | `docker-compose ps` | List containers | +| dcrestart | `docker-compose restart` | Restart container | +| dcrm | `docker-compose rm` | Remove container | +| dcr | `docker-compose run` | Run a command in container | +| dcstop | `docker-compose stop` | Stop a container | +| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service | +| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon | +| dcdn | `docker-compose down` | Stop and remove containers | +| dcl | `docker-compose logs` | Show logs of container | +| dclf | `docker-compose logs -f` | Show logs and follow output | +| dcpull | `docker-compose pull` | Pull image of a service | +| dcstart | `docker-compose start` | Start a container | diff --git a/plugins/docker-compose/_docker-compose b/plugins/docker-compose/_docker-compose index c0a54cced..808b068a3 100644 --- a/plugins/docker-compose/_docker-compose +++ b/plugins/docker-compose/_docker-compose @@ -23,7 +23,7 @@ __docker-compose_all_services_in_compose_file() { local already_selected local -a services already_selected=$(echo $words | tr " " "|") - __docker-compose_q config --services \ + __docker-compose_q ps --services "$@" \ | grep -Ev "^(${already_selected})$" } @@ -31,125 +31,42 @@ __docker-compose_all_services_in_compose_file() { __docker-compose_services_all() { [[ $PREFIX = -* ]] && return 1 integer ret=1 - services=$(__docker-compose_all_services_in_compose_file) + services=$(__docker-compose_all_services_in_compose_file "$@") _alternative "args:services:($services)" && ret=0 return ret } -# All services that have an entry with the given key in their docker-compose.yml section -__docker-compose_services_with_key() { - local already_selected - local -a buildable - already_selected=$(echo $words | tr " " "|") - # flatten sections to one line, then filter lines containing the key and return section name. - __docker-compose_q config \ - | sed -n -e '/^services:/,/^[^ ]/p' \ - | sed -n 's/^ //p' \ - | awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' \ - | grep " \+$1:" \ - | cut -d: -f1 \ - | grep -Ev "^(${already_selected})$" -} - # All services that are defined by a Dockerfile reference __docker-compose_services_from_build() { [[ $PREFIX = -* ]] && return 1 - integer ret=1 - buildable=$(__docker-compose_services_with_key build) - _alternative "args:buildable services:($buildable)" && ret=0 - - return ret + __docker-compose_services_all --filter source=build } # All services that are defined by an image __docker-compose_services_from_image() { [[ $PREFIX = -* ]] && return 1 - integer ret=1 - pullable=$(__docker-compose_services_with_key image) - _alternative "args:pullable services:($pullable)" && ret=0 - - return ret -} - -__docker-compose_get_services() { - [[ $PREFIX = -* ]] && return 1 - integer ret=1 - local kind - declare -a running paused stopped lines args services - - docker_status=$(docker ps > /dev/null 2>&1) - if [ $? -ne 0 ]; then - _message "Error! Docker is not running." - return 1 - fi - - kind=$1 - shift - [[ $kind =~ (stopped|all) ]] && args=($args -a) - - lines=(${(f)"$(_call_program commands docker $docker_options ps $args)"}) - services=(${(f)"$(_call_program commands docker-compose 2>/dev/null $compose_options ps -q)"}) - - # 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 - lines=(${lines[2,-1]}) - - # Container ID - local line s name - local -a names - for line in $lines; do - if [[ ${services[@]} == *"${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}"* ]]; then - names=(${(ps:,:)${${line[${begin[NAMES]},-1]}%% *}}) - for name in $names; do - s="${${name%_*}#*_}:${(l:15:: :::)${${line[${begin[CREATED]},${end[CREATED]}]/ ago/}%% ##}}" - s="$s, ${line[${begin[CONTAINER ID]},${end[CONTAINER ID]}]%% ##}" - s="$s, ${${${line[${begin[IMAGE]},${end[IMAGE]}]}/:/\\:}%% ##}" - if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = Exit* ]]; then - stopped=($stopped $s) - else - if [[ ${line[${begin[STATUS]},${end[STATUS]}]} = *\(Paused\)* ]]; then - paused=($paused $s) - fi - running=($running $s) - fi - done - fi - done - - [[ $kind =~ (running|all) ]] && _describe -t services-running "running services" running "$@" && ret=0 - [[ $kind =~ (paused|all) ]] && _describe -t services-paused "paused services" paused "$@" && ret=0 - [[ $kind =~ (stopped|all) ]] && _describe -t services-stopped "stopped services" stopped "$@" && ret=0 - - return ret + __docker-compose_services_all --filter source=image } __docker-compose_pausedservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services paused "$@" + __docker-compose_services_all --filter status=paused } __docker-compose_stoppedservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services stopped "$@" + __docker-compose_services_all --filter status=stopped } __docker-compose_runningservices() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services running "$@" + __docker-compose_services_all --filter status=running } __docker-compose_services() { [[ $PREFIX = -* ]] && return 1 - __docker-compose_get_services all "$@" + __docker-compose_services_all } __docker-compose_caching_policy() { @@ -196,9 +113,12 @@ __docker-compose_subcommand() { $opts_help \ "*--build-arg=[Set build-time variables for one service.]:=: " \ '--force-rm[Always remove intermediate containers.]' \ - '--memory[Memory limit for the build container.]' \ + '(--quiet -q)'{--quiet,-q}'[Curb build output]' \ + '(--memory -m)'{--memory,-m}'[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.]' \ + '--compress[Compress the build context using gzip.]' \ + '--parallel[Build images in parallel.]' \ '*:services:__docker-compose_services_from_build' && ret=0 ;; (bundle) @@ -213,7 +133,8 @@ __docker-compose_subcommand() { '(--quiet -q)'{--quiet,-q}"[Only validate the configuration, don't print anything.]" \ '--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 + '--volumes[Print the volume names, one per line.]' \ + '--hash[Print the service config hash, one per line. Set "service1,service2" for a list of specified services.]' \ && ret=0 ;; (create) _arguments \ @@ -222,11 +143,12 @@ __docker-compose_subcommand() { $opts_no_recreate \ $opts_no_build \ "(--no-build)--build[Build images before creating containers.]" \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (down) _arguments \ $opts_help \ + $opts_timeout \ "--rmi[Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the \`image\` field.]:type:(all local)" \ '(-v --volumes)'{-v,--volumes}"[Remove named volumes declared in the \`volumes\` section of the Compose file and anonymous volumes attached to containers.]" \ $opts_remove_orphans && ret=0 @@ -235,16 +157,18 @@ __docker-compose_subcommand() { _arguments \ $opts_help \ '--json[Output events as a stream of json objects]' \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (exec) _arguments \ $opts_help \ '-d[Detached mode: Run command in the background.]' \ '--privileged[Give extended privileges to the process.]' \ - '(-u --user)'{-u,--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: ' \ + '*'{-e,--env}'[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \ + '(-w --workdir)'{-w,--workdir=}'[Working directory inside the container]:workdir: ' \ '(-):running services:__docker-compose_runningservices' \ '(-):command: _command_names -e' \ '*::arguments: _normal' && ret=0 @@ -252,12 +176,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 - ;; + (images) + _arguments \ + $opts_help \ + '-q[Only display IDs]' \ + '*:services:__docker-compose_services' && ret=0 + ;; (kill) _arguments \ $opts_help \ @@ -271,7 +195,7 @@ __docker-compose_subcommand() { $opts_no_color \ '--tail=[Number of lines to show from the end of the logs for each container.]:number of lines: ' \ '(-t --timestamps)'{-t,--timestamps}'[Show timestamps]' \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (pause) _arguments \ @@ -290,12 +214,16 @@ __docker-compose_subcommand() { _arguments \ $opts_help \ '-q[Only display IDs]' \ - '*:services:__docker-compose_services_all' && ret=0 + '--filter KEY=VAL[Filter services by a property]:=:' \ + '*:services:__docker-compose_services' && ret=0 ;; (pull) _arguments \ $opts_help \ '--ignore-pull-failures[Pull what it can and ignores images with pull failures.]' \ + '--no-parallel[Disable parallel pulling]' \ + '(-q --quiet)'{-q,--quiet}'[Pull without printing progress information]' \ + '--include-deps[Also pull services declared as dependencies]' \ '*:services:__docker-compose_services_from_image' && ret=0 ;; (push) @@ -317,6 +245,7 @@ __docker-compose_subcommand() { $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: ' \ + '*'{-l,--label}'[KEY=VAL Add or override a label (can be used multiple times)]:label KEY=VAL: ' \ '--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \ '--name=[Assign a name to the container]:name: ' \ '(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \ @@ -326,6 +255,7 @@ __docker-compose_subcommand() { '(-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: ' \ + "--use-aliases[Use the services network aliases in the network(s) the container connects to]" \ '(-):services:__docker-compose_services' \ '(-):command: _command_names -e' \ '*::arguments: _normal' && ret=0 @@ -369,8 +299,10 @@ __docker-compose_subcommand() { "(--no-build)--build[Build images before starting containers.]" \ "(-d)--abort-on-container-exit[Stops all containers if any container was stopped. Incompatible with -d.]" \ '(-t --timeout)'{-t,--timeout}"[Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)]:seconds: " \ + '--scale[SERVICE=NUM Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.]:service scale SERVICE=NUM: ' \ + '--exit-code-from=[Return the exit code of the selected service container. Implies --abort-on-container-exit]:service:__docker-compose_services' \ $opts_remove_orphans \ - '*:services:__docker-compose_services_all' && ret=0 + '*:services:__docker-compose_services' && ret=0 ;; (version) _arguments \ @@ -409,8 +341,11 @@ _docker-compose() { '(- :)'{-h,--help}'[Get help]' \ '*'{-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]' \ + "--compatibility[If set, Compose will attempt to convert keys in v3 files to their non-Swarm equivalent]" \ '(- :)'{-v,--version}'[Print version and exit]' \ + '--verbose[Show more output]' \ + '--log-level=[Set log level]:level:(DEBUG INFO WARNING ERROR CRITICAL)' \ + '--no-ansi[Do not print ANSI control characters]' \ '(-H --host)'{-H,--host}'[Daemon socket to connect to]:host:' \ '--tls[Use TLS; implied by --tlsverify]' \ '--tlscacert=[Trust certs signed only by this CA]:ca path:' \ @@ -421,7 +356,7 @@ _docker-compose() { '(-): :->command' \ '(-)*:: :->option-or-argument' && ret=0 - local -a relevant_compose_flags relevant_docker_flags compose_options docker_options + local -a relevant_compose_flags relevant_compose_repeatable_flags relevant_docker_flags compose_options docker_options relevant_compose_flags=( "--file" "-f" @@ -435,6 +370,10 @@ _docker-compose() { "--skip-hostname-check" ) + relevant_compose_repeatable_flags=( + "--file" "-f" + ) + relevant_docker_flags=( "--host" "-H" "--tls" @@ -452,9 +391,18 @@ _docker-compose() { fi fi if [[ -n "${relevant_compose_flags[(r)$k]}" ]]; then - compose_options+=$k - if [[ -n "$opt_args[$k]" ]]; then - compose_options+=$opt_args[$k] + if [[ -n "${relevant_compose_repeatable_flags[(r)$k]}" ]]; then + values=("${(@s/:/)opt_args[$k]}") + for value in $values + do + compose_options+=$k + compose_options+=$value + done + else + compose_options+=$k + if [[ -n "$opt_args[$k]" ]]; then + compose_options+=$opt_args[$k] + fi fi fi done diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh index 24bea318b..9ffe1edf6 100644 --- a/plugins/docker-compose/docker-compose.plugin.zsh +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -18,6 +18,7 @@ alias dcrm='docker-compose rm' alias dcr='docker-compose run' alias dcstop='docker-compose stop' alias dcup='docker-compose up' +alias dcupd='docker-compose up -d' alias dcdn='docker-compose down' alias dcl='docker-compose logs' alias dclf='docker-compose logs -f' diff --git a/plugins/docker-machine/_docker-machine b/plugins/docker-machine/_docker-machine new file mode 100644 index 000000000..7c19ba8e7 --- /dev/null +++ b/plugins/docker-machine/_docker-machine @@ -0,0 +1,359 @@ +#compdef docker-machine +# Description +# ----------- +# zsh completion for docker-machine +# https://github.com/leonhartX/docker-machine-zsh-completion +# ------------------------------------------------------------------------- +# Version +# ------- +# 0.1.1 +# ------------------------------------------------------------------------- +# Authors +# ------- +# * Ke Xu +# ------------------------------------------------------------------------- +# Inspiration +# ----------- +# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion +# * @ilkka _docker-machine + + +__docker-machine_get_hosts() { + [[ $PREFIX = -* ]] && return 1 + local state + declare -a hosts + state=$1; shift + if [[ $state != all ]]; then + hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"}) + else + hosts=(${(f)"$(_call_program commands docker-machine ls -q)"}) + fi + _describe 'host' hosts "$@" && ret=0 + return ret +} + +__docker-machine_hosts_with_state() { + declare -a hosts + hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"}) + _describe 'host' hosts +} + +__docker-machine_hosts_all() { + __docker-machine_get_hosts all "$@" +} + +__docker-machine_hosts_running() { + __docker-machine_get_hosts Running "$@" +} + +__docker-machine_get_swarm() { + declare -a swarms + swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"}) + _describe 'swarm' swarms +} + +__docker-machine_hosts_and_files() { + _alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files' +} + +__docker-machine_filters() { + [[ $PREFIX = -* ]] && return 1 + integer ret=1 + + if compset -P '*='; then + case "${${words[-1]%=*}#*=}" in + (driver) + _describe -t driver-filter-opts "driver filter" opts_driver && ret=0 + ;; + (swarm) + __docker-machine_get_swarm && ret=0 + ;; + (state) + opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error') + _describe -t state-filter-opts "state filter" opts_state && ret=0 + ;; + (name) + __docker-machine_hosts_all && ret=0 + ;; + (label) + _message 'label' && ret=0 + ;; + *) + _message 'value' && ret=0 + ;; + esac + else + opts=('driver' 'swarm' 'state' 'name' 'label') + _describe -t filter-opts "filter" opts -qS "=" && ret=0 + fi + return ret +} + +__get_swarm_discovery() { + declare -a masters serivces + local service + services=() + masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}')) + for master in $masters; do + service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}} + services=($services $service) + done + _describe -t services "swarm service" services && ret=0 + return ret +} + +__get_create_argument() { + typeset -g docker_machine_driver + if [[ CURRENT -le 2 ]]; then + docker_machine_driver="none" + elif [[ CURRENT > 2 && $words[CURRENT-2] = '-d' || $words[CURRENT-2] = '--driver' ]]; then + docker_machine_driver=$words[CURRENT-1] + elif [[ $words[CURRENT-1] =~ '^(-d|--driver)=' ]]; then + docker_machine_driver=${${words[CURRENT-1]}/*=/} + fi + local driver_opt_cmd + local -a opts_provider opts_common opts_read_argument + opts_read_argument=( + ": :->argument" + ) + opts_common=( + $opts_help \ + '(--driver -d)'{--driver=,-d=}'[Driver to create machine with]:dirver:->driver-option' \ + '--engine-install-url=[Custom URL to use for engine installation]:url' \ + '*--engine-opt=[Specify arbitrary flags to include with the created engine in the form flag=value]:flag' \ + '*--engine-insecure-registry=[Specify insecure registries to allow with the created engine]:registry' \ + '*--engine-registry-mirror=[Specify registry mirrors to use]:mirror' \ + '*--engine-label=[Specify labels for the created engine]:label' \ + '--engine-storage-driver=[Specify a storage driver to use with the engine]:storage-driver:->storage-driver-option' \ + '*--engine-env=[Specify environment variables to set in the engine]:environment' \ + '--swarm[Configure Machine with Swarm]' \ + '--swarm-image=[Specify Docker image to use for Swarm]:image' \ + '--swarm-master[Configure Machine to be a Swarm master]' \ + '--swarm-discovery=[Discovery service to use with Swarm]:service:->swarm-service' \ + '--swarm-strategy=[Define a default scheduling strategy for Swarm]:strategy:(spread binpack random)' \ + '*--swarm-opt=[Define arbitrary flags for swarm]:flag' \ + '*--swarm-join-opt=[Define arbitrary flags for Swarm join]:flag' \ + '--swarm-host=[ip/socket to listen on for Swarm master]:host' \ + '--swarm-addr=[addr to advertise for Swarm (default: detect and use the machine IP)]:address' \ + '--swarm-experimental[Enable Swarm experimental features]' \ + '*--tls-san=[Support extra SANs for TLS certs]:option' + ) + driver_opt_cmd="docker-machine create -d $docker_machine_driver | grep $docker_machine_driver | sed -e 's/\(--.*\)\ *\[\1[^]]*\]/*\1/g' -e 's/\(\[[^]]*\)/\\\\\\1\\\\/g' -e 's/\".*\"\(.*\)/\1/g' | awk '{printf \"%s[\", \$1; for(i=2;i<=NF;i++) {printf \"%s \", \$i}; print \"]\"}'" + if [[ $docker_machine_driver != "none" ]]; then + opts_provider=(${(f)"$(_call_program commands $driver_opt_cmd)"}) + _arguments \ + $opts_provider \ + $opts_read_argument \ + $opts_common && ret=0 + else + _arguments $opts_common && ret=0 + fi + case $state in + (driver-option) + _describe -t driver-option "driver" opts_driver && ret=0 + ;; + (storage-driver-option) + _describe -t storage-driver-option "storage driver" opts_storage_driver && ret=0 + ;; + (swarm-service) + __get_swarm_discovery && ret=0 + ;; + (argument) + ret=0 + ;; + esac + return ret +} + + +__docker-machine_subcommand() { + local -a opts_help + opts_help=("(- :)--help[Print usage]") + local -a opts_only_host opts_driver opts_storage_driver opts_stragery + opts_only_host=( + "$opts_help" + "*:host:__docker-machine_hosts_all" + ) + opts_driver=('amazonec2' 'azure' 'digitalocean' 'exoscale' 'generic' 'google' 'hyperv' 'none' 'openstack' 'rackspace' 'softlayer' 'virtualbox' 'vmwarefusion' 'vmwarevcloudair' 'vmwarevsphere') + opts_storage_driver=('overlay' 'aufs' 'btrfs' 'devicemapper' 'vfs' 'zfs') + integer ret=1 + + case "$words[1]" in + (active) + _arguments \ + $opts_help \ + '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' && ret=0 + ;; + (config) + _arguments \ + $opts_help \ + '--swarm[Display the Swarm config instead of the Docker daemon]' \ + "*:host:__docker-machine_hosts_all" && ret=0 + ;; + (create) + __get_create_argument + ;; + (env) + _arguments \ + $opts_help \ + '--swarm[Display the Swarm config instead of the Docker daemon]' \ + '--shell=[Force environment to be configured for a specified shell: \[fish, cmd, powershell\], default is auto-detect]:shell' \ + '(--unset -u)'{--unset,-u}'[Unset variables instead of setting them]' \ + '--no-proxy[Add machine IP to NO_PROXY environment variable]' \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (help) + _arguments ':subcommand:__docker-machine_commands' && ret=0 + ;; + (inspect) + _arguments \ + $opts_help \ + '(--format -f)'{--format=,-f=}'[Format the output using the given go template]:template' \ + '*:host:__docker-machine_hosts_all' && ret=0 + ;; + (ip) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (kill) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (ls) + _arguments \ + $opts_help \ + '(--quiet -q)'{--quiet,-q}'[Enable quiet mode]' \ + '*--filter=[Filter output based on conditions provided]:filter:->filter-options' \ + '(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' \ + '(--format -f)'{--format=,-f=}'[Pretty-print machines using a Go template]:template' && ret=0 + case $state in + (filter-options) + __docker-machine_filters && ret=0 + ;; + esac + ;; + (provision) + _arguments $opts_only_host && ret=0 + ;; + (regenerate-certs) + _arguments \ + $opts_help \ + '(--force -f)'{--force,-f}'[Force rebuild and do not prompt]' \ + '*:host:__docker-machine_hosts_all' && ret=0 + ;; + (restart) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (rm) + _arguments \ + $opts_help \ + '(--force -f)'{--force,-f}'[Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)]' \ + '-y[Assumes automatic yes to proceed with remove, without prompting further user confirmation]' \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (scp) + _arguments \ + $opts_help \ + '(--recursive -r)'{--recursive,-r}'[Copy files recursively (required to copy directories))]' \ + '*:files:__docker-machine_hosts_and_files' && ret=0 + ;; + (ssh) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + (start) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (status) + _arguments $opts_only_host && ret=0 + ;; + (stop) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_with_state' && ret=0 + ;; + (upgrade) + _arguments $opts_only_host && ret=0 + ;; + (url) + _arguments \ + $opts_help \ + '*:host:__docker-machine_hosts_running' && ret=0 + ;; + esac + + return ret +} + + +__docker-machine_commands() { + local cache_policy + + zstyle -s ":completion:${curcontext}:" cache-policy cache_policy + if [[ -z "$cache_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy __docker-machine_caching_policy + fi + + if ( [[ ${+_docker_machine_subcommands} -eq 0 ]] || _cache_invalid docker_machine_subcommands) \ + && ! _retrieve_cache docker_machine_subcommands; + then + local -a lines + lines=(${(f)"$(_call_program commands docker-machine 2>&1)"}) + _docker_machine_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/$'\t'##/:}) + (( $#_docker_machine_subcommands > 0 )) && _store_cache docker_machine_subcommands _docker_machine_subcommands + fi + _describe -t docker-machine-commands "docker-machine command" _docker_machine_subcommands +} + +__docker-machine_caching_policy() { + oldp=( "$1"(Nmh+1) ) + (( $#oldp )) +} + +_docker-machine() { + if [[ $service != docker-machine ]]; then + _call_function - _$service + return + fi + + local curcontext="$curcontext" state line + integer ret=1 + typeset -A opt_args + + _arguments -C \ + "(- :)"{-h,--help}"[Show help]" \ + "(-D --debug)"{-D,--debug}"[Enable debug mode]" \ + '(-s --stroage-path)'{-s,--storage-path}'[Configures storage path]:file:_files' \ + '--tls-ca-cert[CA to verify remotes against]:file:_files' \ + '--tls-ca-key[Private key to generate certificates]:file:_files' \ + '--tls-client-cert[Client cert to use for TLS]:file:_files' \ + '--tls-client-key[Private key used in client TLS auth]:file:_files' \ + '--github-api-token[Token to use for requests to the Github API]' \ + '--native-ssh[Use the native (Go-based) SSH implementation.]' \ + '--bugsnag-api-token[BugSnag API token for crash reporting]' \ + '(- :)'{-v,--version}'[Print the version]' \ + "(-): :->command" \ + "(-)*:: :->option-or-argument" && ret=0 + + case $state in + (command) + __docker-machine_commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*:*}:docker-machine-$words[1]: + __docker-machine_subcommand && ret=0 + ret=0 + ;; + esac + + return ret +} + +_docker-machine "$@" diff --git a/plugins/docker/_docker b/plugins/docker/_docker index 0c20cf28e..54b5e59c5 100644 --- a/plugins/docker/_docker +++ b/plugins/docker/_docker @@ -431,7 +431,7 @@ __docker_complete_events_filter() { integer ret=1 declare -a opts - opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'type' 'volume') + opts=('container' 'daemon' 'event' 'image' 'label' 'network' 'scope' 'type' 'volume') if compset -P '*='; then case "${${words[-1]%=*}#*=}" in @@ -450,9 +450,9 @@ __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) @@ -461,6 +461,11 @@ __docker_complete_events_filter() { (network) __docker_complete_networks && ret=0 ;; + (scope) + local -a scope_opts + scope_opts=('local' 'swarm') + _describe -t scope-filter-opts "scope filter options" scope_opts && ret=0 + ;; (type) local -a type_opts type_opts=('container' 'daemon' 'image' 'network' 'volume') @@ -612,6 +617,7 @@ __docker_container_subcommand() { "($help)*--dns=[Custom DNS servers]:DNS server: " "($help)*--dns-option=[Custom DNS options]:DNS option: " "($help)*--dns-search=[Custom DNS search domains]:DNS domains: " + "($help)*--domainname=[Container NIS domain name]:domainname:_hosts" "($help)*"{-e=,--env=}"[Environment variables]:environment variable: " "($help)--entrypoint=[Overwrite the default entrypoint of the image]:entry point: " "($help)*--env-file=[Read environment variables from a file]:environment file:_files" @@ -889,7 +895,7 @@ __docker_container_subcommand() { $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 -i --interactive)"{-i,--interactive}"[Attach container's stdin]" \ "($help -)*:containers:__docker_complete_stopped_containers" && ret=0 ;; (stats) @@ -923,7 +929,7 @@ __docker_container_subcommand() { local state _arguments $(__docker_arguments) \ $opts_help \ - opts_create_run_update \ + $opts_create_run_update \ "($help -)*: :->values" && ret=0 case $state in (values) @@ -2209,7 +2215,7 @@ __docker_stack_subcommand() { _arguments $(__docker_arguments) \ $opts_help \ "($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \ - "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file]:compose file:_files -g \"*.(yml|yaml)\"" \ + "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \ "($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \ "($help -):stack:__docker_complete_stacks" && ret=0 ;; @@ -2280,6 +2286,9 @@ __docker_swarm_subcommand() { $opts_help \ "($help)--advertise-addr=[Advertised address]:ip\:port: " \ "($help)--data-path-addr=[Data path IP or interface]:ip " \ + "($help)--data-path-port=[Data Path Port]:port " \ + "($help)--default-addr-pool=[Default address pool]" \ + "($help)--default-addr-pool-mask-length=[Default address pool subnet mask length]" \ "($help)--autolock[Enable manager autolocking]" \ "($help)--availability=[Availability of the node]:availability:(active drain pause)" \ "($help)--cert-expiry=[Validity period for node certificates]:duration: " \ @@ -3024,4 +3033,4 @@ _docker "$@" # indent-tabs-mode: nil # sh-basic-offset: 4 # End: -# vim: ft=zsh sw=4 ts=4 et \ No newline at end of file +# vim: ft=zsh sw=4 ts=4 et diff --git a/plugins/doctl/README.md b/plugins/doctl/README.md new file mode 100644 index 000000000..a81e90b0a --- /dev/null +++ b/plugins/doctl/README.md @@ -0,0 +1,9 @@ +# Doctl + +This plugin provides completion for [Doctl](https://github.com/digitalocean/doctl). + +To use it add doctl to the plugins array in your zshrc file. + +```bash +plugins=(... doctl) +``` diff --git a/plugins/doctl/doctl.plugin.zsh b/plugins/doctl/doctl.plugin.zsh new file mode 100644 index 000000000..d23ed085c --- /dev/null +++ b/plugins/doctl/doctl.plugin.zsh @@ -0,0 +1,9 @@ +# Autocompletion for doctl, the command line tool for DigitalOcean service +# +# doctl project: https://github.com/digitalocean/doctl +# +# Author: https://github.com/HalisCz + +if [ $commands[doctl] ]; then + source <(doctl completion zsh) +fi diff --git a/plugins/dotenv/README.md b/plugins/dotenv/README.md index ade09fbb2..e880e9d69 100644 --- a/plugins/dotenv/README.md +++ b/plugins/dotenv/README.md @@ -2,19 +2,19 @@ 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. +Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://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) +plugins=(... dotenv) ``` ## Usage -Create `.env` file inside your project directory and put your local ENV variables there. +Create `.env` file inside your project root directory and put your ENV variables there. For example: ```sh @@ -30,5 +30,16 @@ SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f MONGO_URI=mongodb://127.0.0.1:27017 PORT=3001 ``` +You can even mix both formats, although it's probably a bad idea. -**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. +## Version Control + +**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only. + +## Disclaimer + +This plugin only sources the `.env` file. Nothing less, nothing more. It doesn't do any checks. It's designed to be the fastest and simplest option. You're responsible for the `.env` file content. You can put some code (or weird symbols) there, but do it on your own risk. `dotenv` is the basic tool, yet it does the job. + +If you need more advanced and feature-rich ENV management, check out these awesome projects: +* [direnv](https://github.com/direnv/direnv) +* [zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv) diff --git a/plugins/dotenv/dotenv.plugin.zsh b/plugins/dotenv/dotenv.plugin.zsh index 9dd784229..b701b5596 100644 --- a/plugins/dotenv/dotenv.plugin.zsh +++ b/plugins/dotenv/dotenv.plugin.zsh @@ -1,10 +1,19 @@ -#!/bin/zsh - source_env() { if [[ -f .env ]]; then - source .env + # test .env syntax + zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2 + + if [[ -o a ]]; then + source .env + else + set -a + source .env + set +a + fi fi } autoload -U add-zsh-hook add-zsh-hook chpwd source_env + +source_env diff --git a/plugins/droplr/README.md b/plugins/droplr/README.md index 25cf61db7..6daa2540d 100644 --- a/plugins/droplr/README.md +++ b/plugins/droplr/README.md @@ -16,4 +16,4 @@ Author: [Fabio Fernandes](https://github.com/fabiofl) - Upload a file: `droplr ./path/to/file/` -- Shorten a link: `droplr http://example.com` +- Shorten a link: `droplr https://example.com` diff --git a/plugins/drush/README.md b/plugins/drush/README.md new file mode 100644 index 000000000..df7b82bdd --- /dev/null +++ b/plugins/drush/README.md @@ -0,0 +1,83 @@ +# Drush + +## Description +This plugin offers aliases and functions to make the work with drush easier and more productive. + +To enable it, add the `drush` to your `plugins` array in `~/.zshrc`: + +``` +plugins=(... drush) +``` + +## Aliases +| Alias | Description | Command | +|-------|-----------------------------------------------------------------------|-----------------------------| +| dr | Display drush help | drush | +| drca | Clear all drupal caches. | drush cc all | +| drcb | Clear block cache. | drush cc block | +| drcg | Clear registry cache. | drush cc registry | +| drcj | Clear css-js cache. | drush cc css-js | +| drcm | Clear menu cache. | drush cc menu | +| drcml | Clear module-list cache. | drush cc module-list | +| drcr | Run all cron hooks in all active modules for specified site. | drush core-cron | +| drct | Clear theme-registry cache. | drush cc theme-registry | +| drcv | Clear views cache. (Make sure that the views module is enabled) | drush cc views | +| drdmp | Backup database in a new dump.sql file | drush drush sql-dump --ordered-dump --result-file=dump.sql| +| drf | Display features status | drush features | +| drfr | Revert a feature module on your site. | drush features-revert -y | +| drfu | Update a feature module on your site. | drush features-update -y | +| drfra | Revert all enabled feature module on your site. | drush features-revert-all | +| drif | Flush all derived images. | drush image-flush --all | +| drpm | Show a list of available modules. | drush pm-list --type=module | +| drst | Provides a birds-eye view of the current Drupal installation, if any. | drush core-status | +| drup | Apply any database updates required (as with running update.php). | drush updatedb | +| drups | List any pending database updates. | drush updatedb-status | +| drv | Show drush version. | drush version | +| drvd | Delete a variable. | drush variable-del | +| drvg | Get a list of some or all site variables and values. | drush variable-get | +| drvs | Set a variable. | drush variable-set | + +## Functions + +### dren +Download and enable one or more extensions (modules or themes). +Must be invoked with one or more parameters. e.g.: +`dren devel` or `dren devel module_filter views` + +### drf +Edit drushrc, site alias, and Drupal settings.php files. +Can be invoked with one or without parameters. e.g.: +`drf 1` + +### dris +Disable one or more extensions (modules or themes) +Must be invoked with one or more parameters. e.g.: +`dris devel` or `dris devel module_filter views` + +### drpu +Uninstall one or more modules. +Must be invoked with one or more parameters. e.g.: +`drpu devel` or `drpu devel module_filter views` + +### drnew +Creates a brand new drupal website. +Note: As soon as the installation is complete, drush will print a username and a random password into the terminal: +``` +Installation complete. User name: admin User password: cf7t8yqNEm +``` + +## Additional features + +### Autocomplete +The [completion script for drush](https://github.com/drush-ops/drush/blob/8.0.1/drush.complete.sh) comes enabled with this plugin. +So, it is possible to type a command: +``` +drush sql +``` + +And as soon as the tab key is pressed, the script will display the available commands: +``` +drush sql +sqlc sql-conf sql-create sql-dump sql-query sql-sanitize +sql-cli sql-connect sql-drop sqlq sqlsan sql-sync +``` diff --git a/plugins/drush/drush.complete.sh b/plugins/drush/drush.complete.sh new file mode 100644 index 000000000..38b882ec3 --- /dev/null +++ b/plugins/drush/drush.complete.sh @@ -0,0 +1,50 @@ +# BASH completion script for Drush. +# +# Place this in your /etc/bash_completion.d/ directory or source it from your +# ~/.bash_completion or ~/.bash_profile files. Alternatively, source +# examples/example.bashrc instead, as it will automatically find and source +# this file. +# +# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file +# and source it. +# +# autoload bashcompinit +# bashcompinit +# source /path/to/your/drush.complete.sh + +# Ensure drush is available. +which drush > /dev/null || alias drush &> /dev/null || return + +__drush_ps1() { + f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$" + if [ -f $f ] + then + __DRUPAL_SITE=$(cat "$f") + else + __DRUPAL_SITE="$DRUPAL_SITE" + fi + + # Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a + # __drush_ps1_colorize_alias() function for color hints in your Drush PS1 + # prompt. See example.prompt.sh for an example implementation. + if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then + __drush_ps1_colorize_alias + fi + + [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" +} + +# Completion function, uses the "drush complete" command to retrieve +# completions for a specific command line COMP_WORDS. +_drush_completion() { + # Set IFS to newline (locally), since we only use newline separators, and + # need to retain spaces (or not) after completions. + local IFS=$'\n' + # The '< /dev/null' is a work around for a bug in php libedit stdin handling. + # Note that libedit in place of libreadline in some distributions. See: + # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 + COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) +} + +# Register our completion function. We include common short aliases for Drush. +complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php diff --git a/plugins/drush/drush.plugin.zsh b/plugins/drush/drush.plugin.zsh new file mode 100644 index 000000000..8a20d79f2 --- /dev/null +++ b/plugins/drush/drush.plugin.zsh @@ -0,0 +1,104 @@ +# Drush support. + +function dren() { + drush en $@ -y +} + +function dris() { + drush pm-disable $@ -y +} + +function drpu() { + drush pm-uninstall $@ -y +} + +function drf() { + if [[ $1 == "" ]] then + drush core-config + else + drush core-config --choice=$1 + fi +} + +function drfi() { + if [[ $1 == "fields" ]]; then + drush field-info fields + elif [[ $1 == "types" ]]; then + drush field-info types + else + drush field-info + fi +} + +function drnew() { + + cd ~ + echo "Website's name: " + read WEBSITE_NAME + + HOST=http://$(hostname -i)/ + + if [[ $WEBSITE_NAME == "" ]] then + MINUTES=$(date +%M:%S) + WEBSITE_NAME="Drupal-$MINUTES" + echo "Your website will be named: $WEBSITE_NAME" + fi + + drush dl drupal --drupal-project-rename=$WEBSITE_NAME + + echo "Type your localhost directory: (Leave empty for /var/www/html/)" + read DIRECTORY + + if [[ $DIRECTORY == "" ]] then + DIRECTORY="/var/www/html/" + fi + + echo "Moving to $DIRECTORY$WEBSITE_NAME" + sudo mv $WEBSITE_NAME $DIRECTORY + cd $DIRECTORY$WEBSITE_NAME + + echo "Database's user: " + read DATABASE_USR + echo "Database's password: " + read -s DATABASE_PWD + echo "Database's name for your project: " + read DATABASE + + DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" + drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME + + open_command $HOST$WEBSITE_NAME + echo "Done" + +} + +# Aliases, sorted alphabetically. +alias dr="drush" +alias drca="drush cc all" # Deprecated for Drush 8 +alias drcb="drush cc block" # Deprecated for Drush 8 +alias drcg="drush cc registry" # Deprecated for Drush 8 +alias drcj="drush cc css-js" +alias drcm="drush cc menu" +alias drcml="drush cc module-list" +alias drcr="drush core-cron" +alias drct="drush cc theme-registry" +alias drcv="drush cc views" +alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql" +alias drf="drush features" +alias drfr="drush features-revert -y" +alias drfu="drush features-update -y" +alias drfra="drush features-revert-all" +alias drif="drush image-flush --all" +alias drpm="drush pm-list --type=module" +alias drst="drush core-status" +alias drup="drush updatedb" +alias drups="drush updatedb-status" +alias drv="drush version" +alias drvd="drush variable-del" +alias drvg="drush variable-get" +alias drvs="drush variable-set" + +# Enable drush autocomplete support +autoload bashcompinit +bashcompinit +source $(dirname $0)/drush.complete.sh diff --git a/plugins/emacs/README.md b/plugins/emacs/README.md new file mode 100644 index 000000000..c8e33b5ab --- /dev/null +++ b/plugins/emacs/README.md @@ -0,0 +1,30 @@ +# Emacs plugin + +This plugin utilizes the Emacs daemon capability, allowing the user to quickly open frames, whether they are opened in a terminal via a ssh connection, or X frames opened on the same host. The plugin also provides some aliases for such operations. + +- You don't have the cost of starting Emacs all the time anymore +- Opening a file is as fast as Emacs does not have anything else to do. +- You can share opened buffered across opened frames. +- Configuration changes made at runtime are applied to all frames. + +**NOTE:** requires Emacs 24 and newer. + +To use it, add emacs to the plugins array in your zshrc file: + +```zsh +plugins=(... emacs) +``` + +## Aliases + +The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that is just a wrapper around [`emacsclient`](https://www.emacswiki.org/emacs/EmacsClient). + +| Alias | Command | Description | +|--------|----------------------------------------------------|----------------------------------------------------------------| +| emacs | `$EMACS_LAUNCHER --no-wait` | Opens a temporary emacsclient frame | +| e | `emacs` | Same as emacs alias | +| te | `$EMACS_LAUNCHER -nw` | Open terminal emacsclient | +| eeval | `$EMACS_LAUNCHER --eval` | Same as `M-x eval` but from outside Emacs | +| eframe | `emacsclient --alternate-editor "" --create-frame` | Create new X frame | +| efile | - | Print the path to the file open in the current buffer | +| ecd | - | Print the directory of the file open in the the current buffer | diff --git a/plugins/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/ember-cli/README.md b/plugins/ember-cli/README.md index 1f92bba32..b46373619 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -1,8 +1,8 @@ # Ember CLI -**Maintainers:** [BilalBudhani](http://www.github.com/BilalBudhani), [eubenesa](http://www.github.com/eubenesa) +**Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa), [scottkidder](https://github.com/scottkidder] -Ember CLI (http://www.ember-cli.com/) +Ember CLI (https://www.ember-cli.com/) ### List of Aliases @@ -17,5 +17,6 @@ Alias | Ember-CLI command **ein** | *ember init* **ei** | *ember install* **et** | *ember test* +**ets** | *ember test --serve* **eu** | *ember update* **ev** | *ember version* diff --git a/plugins/ember-cli/ember-cli.plugin.zsh b/plugins/ember-cli/ember-cli.plugin.zsh index a0f346829..67842c120 100644 --- a/plugins/ember-cli/ember-cli.plugin.zsh +++ b/plugins/ember-cli/ember-cli.plugin.zsh @@ -1,5 +1,5 @@ # Ember CLI -# Visit http://www.ember-cli.com/ to view user guide +# Visit https://www.ember-cli.com/ to view user guide alias es='ember serve' alias ea='ember addon' @@ -10,6 +10,7 @@ alias eh='ember help' alias ein='ember init' alias ei='ember install' alias et='ember test' +alias ets='ember test --serve' alias eu='ember update' # version diff --git a/plugins/emoji-clock/README.md b/plugins/emoji-clock/README.md new file mode 100644 index 000000000..4934f380b --- /dev/null +++ b/plugins/emoji-clock/README.md @@ -0,0 +1,14 @@ +# emoji-clock + +The plugin displays current time as an emoji symbol with half hour accuracy. + +To use it, add `emoji-clock` to the plugins array of your zshrc file: +``` +plugins=(... emoji-clock) +``` + +## Features + +| Function | Description | +|-------------------|----------------------------------------------------------------------| +| `emoji-clock` | Displays current time in clock emoji symbol with half hour accuracy | diff --git a/plugins/emoji/README.md b/plugins/emoji/README.md index 889e567e6..8b8860a86 100644 --- a/plugins/emoji/README.md +++ b/plugins/emoji/README.md @@ -71,7 +71,7 @@ PROMPT="$surfer > " ## Technical Details -The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at http://www.unicode.org/reports/tr51/index.html. +The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at https://www.unicode.org/reports/tr51/index.html. The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke) @@ -108,7 +108,7 @@ The `$emoji_skintone` associative array maps skin tone IDs to the variation sele echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]" ``` -Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](http://www.unicode.org/reports/tr51/index.html#Diversity) for details. +Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](https://www.unicode.org/reports/tr51/index.html#Diversity) for details. ## TODO @@ -130,6 +130,6 @@ This does *not* mean that it should use Gemoji at run time. None of the `zsh` pl #### ZWJ combining function -One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](http://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences). +One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](https://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences). These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears. diff --git a/plugins/emoji/emoji-data.txt b/plugins/emoji/emoji-data.txt index 7b4c015f7..2d6d64e2b 100644 --- a/plugins/emoji/emoji-data.txt +++ b/plugins/emoji/emoji-data.txt @@ -17,7 +17,7 @@ # none: not applicable # Field 4 — Emoji_Sources: # one or more values from {z, a, j, w, x} -# see the key in http://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources +# see the key in https://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources # NA: not applicable # Comment — currently contains the version where the character was first encoded, # followed by: @@ -1200,7 +1200,7 @@ 1F1F2 1F1ED ; emoji ; L2 ; none ; x # V6.0 (🇲🇭) flag for Marshall Islands 1F1F2 1F1F0 ; emoji ; L2 ; none ; x # V6.0 (🇲🇰) flag for Macedonia 1F1F2 1F1F1 ; emoji ; L2 ; none ; x # V6.0 (🇲🇱) flag for Mali -1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar +1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar 1F1F2 1F1F3 ; emoji ; L2 ; none ; x # V6.0 (🇲🇳) flag for Mongolia 1F1F2 1F1F4 ; emoji ; L2 ; none ; x # V6.0 (🇲🇴) flag for Macau 1F1F2 1F1F5 ; emoji ; L2 ; none ; x # V6.0 (🇲🇵) flag for Northern Mariana Islands diff --git a/plugins/emoji/update_emoji.pl b/plugins/emoji/update_emoji.pl index 04f3ce8e7..8034052b7 100644 --- a/plugins/emoji/update_emoji.pl +++ b/plugins/emoji/update_emoji.pl @@ -5,15 +5,15 @@ # This script generates the emoji.plugin.zsh emoji definitions from the Unicode # character data for the emoji characters. # -# The data file can be found at http://unicode.org/Public/emoji/latest/emoji-data.txt -# as referenced in Unicode TR51 (http://www.unicode.org/reports/tr51/index.html). +# The data file can be found at https://unicode.org/Public/emoji/latest/emoji-data.txt +# as referenced in Unicode TR51 (https://www.unicode.org/reports/tr51/index.html). # # This is known to work with the data file from version 1.0. It may not work with later # versions if the format changes. In particular, this reads line comments to get the # emoji character name and unicode version. # # Country names have punctuation and other non-letter characters removed from their name, -# to avoid possible complications with having to escape the strings when using them as +# to avoid possible complications with having to escape the strings when using them as # array subscripts. The definition file seems to use some combining characters like accents # that get stripped during this process. @@ -41,7 +41,7 @@ sub process_emoji_data_file { # # This contains the definition for: # \$emoji - which maps character names to Unicode characters -# \$emoji_flags - maps country names to Unicode flag characters using region indicators +# \$emoji_flags - maps country names to Unicode flag characters using region indicators # Main emoji typeset -gAH emoji @@ -63,7 +63,7 @@ typeset -gAH emoji_mod next if /^\s*#/ or /^\s*$/; if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) { - my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name) + my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name) = ($1, $2, $3, $4, $5, $6, $7); #print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n"; my @code_points = split /\s+/, $code; @@ -84,7 +84,7 @@ typeset -gAH emoji_mod if ($flag_country) { $outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n"); } else { - $outfh->print("emoji[$omz_name]=\$'$zsh_code'\n"); + $outfh->print("emoji[$omz_name]=\$'$zsh_code'\n"); } # Modifiers are included in both the main set and their separate map, # because they have a standalone representation as a color swatch. 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/encode64/README.md b/plugins/encode64/README.md new file mode 100644 index 000000000..9850da85f --- /dev/null +++ b/plugins/encode64/README.md @@ -0,0 +1,69 @@ +# encode64 + +Alias plugin for encoding or decoding using `base64` command + +## Functions and Aliases + +| Function | Alias | Description | +| ---------- | ----- | ------------------------------ | +| `encode64` | `e64` | Encodes given data to base64 | +| `decode64` | `d64` | Decodes given data from base64 | + +## Enabling plugin + +1. Edit your `.zshrc` file and add `encode64` to the list of plugins: + + ```sh + plugins=( + # ...other enabled plugins + encode64 + ) + ``` + +2. Restart your terminal session or reload configuration by running: + + ```sh + source ~/.zshrc + ``` + +## Usage and examples + +### Encoding + +- From parameter + + ```console + $ encode64 "oh-my-zsh" + b2gtbXktenNo + $ e64 "oh-my-zsh" + b2gtbXktenNo + ``` + +- From piping + + ```console + $ echo "oh-my-zsh" | encode64 + b2gtbXktenNo== + $ echo "oh-my-zsh" | e64 + b2gtbXktenNo== + ``` + +### Decoding + +- From parameter + + ```console + $ decode64 b2gtbXktenNo + oh-my-zsh% + $ d64 b2gtbXktenNo + oh-my-zsh% + ``` + +- From piping + + ```console + $ echo "b2gtbXktenNoCg==" | decode64 + oh-my-zsh + $ echo "b2gtbXktenNoCg==" | decode64 + oh-my-zsh + ``` diff --git a/plugins/extract/README.md b/plugins/extract/README.md index c6bdd36dd..83b878c32 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -19,6 +19,7 @@ plugins=(... extract) | `7z` | 7zip file | | `Z` | Z archive (LZW) | | `apk` | Android app file | +| `aar` | Android library file | | `bz2` | Bzip2 file | | `deb` | Debian package | | `gz` | Gzip file | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 172425d2c..33d49fcc5 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|xpi|xz|zip)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 34f8d8710..5e9b9ff24 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -29,7 +29,7 @@ extract() { success=0 extract_dir="${1:t:r}" - case "$1" in + case "${1:l}" in (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; (*.tar.xz|*.txz) @@ -45,8 +45,8 @@ extract() { (*.bz2) bunzip2 "$1" ;; (*.xz) unxz "$1" ;; (*.lzma) unlzma "$1" ;; - (*.Z) uncompress "$1" ;; - (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;; + (*.z) uncompress "$1" ;; + (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) diff --git a/plugins/fabric/README.md b/plugins/fabric/README.md new file mode 100644 index 000000000..cf0fa81f4 --- /dev/null +++ b/plugins/fabric/README.md @@ -0,0 +1,9 @@ +# Fabric + +This plugin provides completion for [Fabric](https://www.fabfile.org/). + +To use it add fabric to the plugins array in your zshrc file. + +```bash +plugins=(... fabric) +``` diff --git a/plugins/fabric/fabric.plugin.zsh b/plugins/fabric/fabric.plugin.zsh index aca411329..e69de29bb 100644 --- a/plugins/fabric/fabric.plugin.zsh +++ b/plugins/fabric/fabric.plugin.zsh @@ -1 +0,0 @@ -# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete. diff --git a/plugins/fancy-ctrl-z/README.md b/plugins/fancy-ctrl-z/README.md index a7670fa2c..f1b1dfa5c 100644 --- a/plugins/fancy-ctrl-z/README.md +++ b/plugins/fancy-ctrl-z/README.md @@ -1,10 +1,10 @@ # Use Ctrl-Z to switch back to Vim -I frequently need to execute random command in my shell. To achieve it I pause +I frequently need to execute random commands in my shell. To achieve it I pause Vim by pressing Ctrl-z, type command and press fg to switch back to Vim. -The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back +The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back to Vim. I could not find a solution, so I developed one on my own that -works wonderfully with ZSH +works wonderfully with ZSH. Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ diff --git a/plugins/fasd/fasd.plugin.zsh b/plugins/fasd/fasd.plugin.zsh index 2c302f74d..36a0428a7 100644 --- a/plugins/fasd/fasd.plugin.zsh +++ b/plugins/fasd/fasd.plugin.zsh @@ -6,6 +6,7 @@ if [ $commands[fasd] ]; then # check if fasd is installed source "$fasd_cache" unset fasd_cache - alias v="f -e $EDITOR" - alias o='a -e open_command' + alias v="f -e \"$EDITOR\"" + alias o='a -e xdg-open' + alias j='zz' fi diff --git a/plugins/fd/README.md b/plugins/fd/README.md new file mode 100644 index 000000000..aabd624b8 --- /dev/null +++ b/plugins/fd/README.md @@ -0,0 +1,13 @@ +# fd + +This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`. + +To use it, add `fd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fd) +``` + +Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0). + +Updated on Febrary 13th, 2019. diff --git a/plugins/fd/_fd b/plugins/fd/_fd new file mode 100644 index 000000000..7a4c38753 --- /dev/null +++ b/plugins/fd/_fd @@ -0,0 +1,83 @@ +#compdef fd fdfind + +autoload -U is-at-least + +_fd() { + typeset -A opt_args + typeset -a _arguments_options + local ret=1 + + if is-at-least 5.2; then + _arguments_options=(-s -S -C) + else + _arguments_options=(-s -C) + fi + + local context curcontext="$curcontext" state line + _arguments "${_arguments_options[@]}" \ +'-d+[Set maximum search depth (default: none)]' \ +'--max-depth=[Set maximum search depth (default: none)]' \ +'--maxdepth=[See --max-depth]' \ +'*-t+[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*--type=[Filter by type: file (f), directory (d), symlink (l), +executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \ +'*-e+[Filter by file extension]' \ +'*--extension=[Filter by file extension]' \ +'-x+[Execute a command for each search result]' \ +'--exec=[Execute a command for each search result]' \ +'(-x --exec)-X+[Execute a command with all search results at once]' \ +'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \ +'*-E+[Exclude entries that match the given glob pattern]' \ +'*--exclude=[Exclude entries that match the given glob pattern]' \ +'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \ +'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \ +'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \ +'-j+[Set number of threads to use for searching & executing]' \ +'--threads=[Set number of threads to use for searching & executing]' \ +'*-S+[Limit results based on the size of files.]' \ +'*--size=[Limit results based on the size of files.]' \ +'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \ +'--changed-within=[Filter by file modification time (newer than)]' \ +'--changed-before=[Filter by file modification time (older than)]' \ +'*--search-path=[(hidden)]' \ +'-H[Search hidden files and directories]' \ +'--hidden[Search hidden files and directories]' \ +'-I[Do not respect .(git|fd)ignore files]' \ +'--no-ignore[Do not respect .(git|fd)ignore files]' \ +'--no-ignore-vcs[Do not respect .gitignore files]' \ +'*-u[Alias for no-ignore and/or hidden]' \ +'-s[Case-sensitive search (default: smart case)]' \ +'--case-sensitive[Case-sensitive search (default: smart case)]' \ +'-i[Case-insensitive search (default: smart case)]' \ +'--ignore-case[Case-insensitive search (default: smart case)]' \ +'-F[Treat the pattern as a literal string]' \ +'--fixed-strings[Treat the pattern as a literal string]' \ +'-a[Show absolute instead of relative paths]' \ +'--absolute-path[Show absolute instead of relative paths]' \ +'-L[Follow symbolic links]' \ +'--follow[Follow symbolic links]' \ +'-p[Search full path (default: file-/dirname only)]' \ +'--full-path[Search full path (default: file-/dirname only)]' \ +'-0[Separate results by the null character]' \ +'--print0[Separate results by the null character]' \ +'--show-errors[Enable display of filesystem errors]' \ +'-h[Prints help information]' \ +'--help[Prints help information]' \ +'-V[Prints version information]' \ +'--version[Prints version information]' \ +'::pattern -- the search pattern, a regular expression (optional):_files' \ +'::path -- the root directory for the filesystem search (optional):_files' \ +&& ret=0 + +} + +(( $+functions[_fd_commands] )) || +_fd_commands() { + local commands; commands=( + + ) + _describe -t commands 'fd commands' commands "$@" +} + +_fd "$@" diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md index f384b0ffd..6594799b3 100644 --- a/plugins/fedora/README.md +++ b/plugins/fedora/README.md @@ -1,3 +1 @@ -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). - +The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead. diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh deleted file mode 100644 index eddc3627b..000000000 --- a/plugins/fedora/fedora.plugin.zsh +++ /dev/null @@ -1,16 +0,0 @@ -## 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 diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh new file mode 120000 index 000000000..16a214313 --- /dev/null +++ b/plugins/fedora/fedora.plugin.zsh @@ -0,0 +1 @@ +../dnf/dnf.plugin.zsh \ No newline at end of file diff --git a/plugins/firewalld/firewalld.plugin.zsh b/plugins/firewalld/firewalld.plugin.zsh index bfbf6f48f..5b1090636 100644 --- a/plugins/firewalld/firewalld.plugin.zsh +++ b/plugins/firewalld/firewalld.plugin.zsh @@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent" function fwl () { # converts output to zsh array () # @f flag split on new line - zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}") + zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}") for i in $zones; do sudo firewall-cmd --zone $i --list-all diff --git a/plugins/forklift/README.md b/plugins/forklift/README.md index 6c5cbab23..6c4ce1e81 100644 --- a/plugins/forklift/README.md +++ b/plugins/forklift/README.md @@ -4,7 +4,7 @@ Plugin for ForkLift, an FTP application for OS X. ### Requirements -* [ForkLift](http://www.binarynights.com/forklift/) +* [ForkLift](https://binarynights.com/) ### Usage diff --git a/plugins/forklift/forklift.plugin.zsh b/plugins/forklift/forklift.plugin.zsh index 692ca5790..274c4a822 100644 --- a/plugins/forklift/forklift.plugin.zsh +++ b/plugins/forklift/forklift.plugin.zsh @@ -1,6 +1,6 @@ # Open folder in ForkLift.app or ForkLift2.app from console # Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de -# Updated to support ForkLift2 by Johan Kaving +# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving # # Usage: # fl [] @@ -24,46 +24,84 @@ function fl { fi osascript 2>&1 1>/dev/null <=2.0)| `https://angular.io/?search=` | +| angularjs(1.x)| `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | aurajs | `http://aurajs.com/api/#stq=` | | bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | -| bootsnipp | `http://bootsnipp.com/search?q=` | -| caniuse | `http://caniuse.com/#search=` | -| codepen | `http://codepen.io/search?q=` | +| bootsnipp | `https://bootsnipp.com/search?q=` | +| caniuse | `https://caniuse.com/#search=` | +| codepen | `https://codepen.io/search?q=` | | compassdoc | `http://compass-style.org/search?q=` | | cssflow | `http://www.cssflow.com/search?q=` | | dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | -| emberjs | `http://emberjs.com/api/#stp=1&stq=` | +| emberjs | `https://emberjs.com/api/#stp=1&stq=` | | fontello | `http://fontello.com/#search=` | | html5please | `http://html5please.com/#` | | jquery | `https://api.jquery.com/?s=` | @@ -51,7 +52,7 @@ Available search contexts are: | qunit | `https://api.qunitjs.com/?s=` | | reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | | smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | -| stackoverflow | `http://stackoverflow.com/search?q=` | +| stackoverflow | `https://stackoverflow.com/search?q=` | | unheap | `http://www.unheap.com/?s=` | If you want to have another context, open an Issue and tell us! @@ -62,4 +63,4 @@ If you want to have another context, open an Issue and tell us! **Wilson Mendes (willmendesneto)** + + -+ ++ diff --git a/plugins/frontend-search/_frontend-search.sh b/plugins/frontend-search/_frontend-search.sh index 9aad76f76..573aa3aae 100644 --- a/plugins/frontend-search/_frontend-search.sh +++ b/plugins/frontend-search/_frontend-search.sh @@ -33,7 +33,8 @@ function _frontend() { 'unheap: Search in unheap website' 'bem: Search in BEM website' 'smacss: Search in SMACSS website' - 'angularjs: Search in Angular website' + 'angular: Search in Angular website for Angular 2.x' + 'angularjs: Search in Angular website for Angular 1.x' 'reactjs: Search in React website' 'emberjs: Search in Ember website' 'stackoverflow: Search in StackOverflow website' @@ -99,6 +100,9 @@ function _frontend() { smacss) _describe -t points "Warp points" frontend_points && ret=0 ;; + angular) + _describe -t points "Warp points" frontend_points && ret=0 + ;; angularjs) _describe -t points "Warp points" frontend_points && ret=0 ;; diff --git a/plugins/frontend-search/frontend-search.plugin.zsh b/plugins/frontend-search/frontend-search.plugin.zsh index 3fd49ab8e..bef5992a3 100644 --- a/plugins/frontend-search/frontend-search.plugin.zsh +++ b/plugins/frontend-search/frontend-search.plugin.zsh @@ -1,3 +1,4 @@ +alias angular='frontend angular' alias angularjs='frontend angularjs' alias aurajs='frontend aurajs' alias bem='frontend bem' @@ -26,16 +27,17 @@ function frontend() { # define search context URLS typeset -A urls urls=( + angular 'https://angular.io/?search=' angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q=' aurajs 'http://aurajs.com/api/#stq=' bem 'https://google.com/search?as_sitesearch=bem.info&as_q=' - bootsnipp 'http://bootsnipp.com/search?q=' - caniuse 'http://caniuse.com/#search=' - codepen 'http://codepen.io/search?q=' + bootsnipp 'https://bootsnipp.com/search?q=' + caniuse 'https://caniuse.com/#search=' + codepen 'https://codepen.io/search?q=' compassdoc 'http://compass-style.org/search?q=' cssflow 'http://www.cssflow.com/search?q=' dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' - emberjs 'http://emberjs.com/api/#stp=1&stq=' + emberjs 'https://emberjs.com/api/#stp=1&stq=' fontello 'http://fontello.com/#search=' html5please 'http://html5please.com/#' jquery 'https://api.jquery.com/?s=' @@ -45,7 +47,7 @@ function frontend() { qunit 'https://api.qunitjs.com/?s=' reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q=' - stackoverflow 'http://stackoverflow.com/search?q=' + stackoverflow 'https://stackoverflow.com/search?q=' unheap 'http://www.unheap.com/?s=' ) @@ -57,9 +59,9 @@ function frontend() { print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website," print -P "and %Ucontext%u is one of the following:" print -P "" - print -P " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow," - print -P " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs," - print -P " qunit, reactjs, smacss, stackoverflow, unheap" + print -P " angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen," + print -P " compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery," + print -P " lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap" print -P "" print -P "For example: frontend npmjs mocha (or just: npmjs mocha)." print -P "" @@ -73,17 +75,17 @@ function frontend() { echo "" echo "Valid contexts are:" echo "" - echo " angularjs, aurajs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, " - echo " dartlang, emberjs, fontello, html5please, jquery, lodash, mdn, npmjs, " - echo " qunit, reactjs, smacss, stackoverflow, unheap" + echo " angular (>= 2.0), angularjs (1.x), aurajs, bem, bootsnipp, caniuse, codepen," + echo " compassdoc, cssflow, dartlang, emberjs, fontello, html5please, jquery," + echo " lodash, mdn, npmjs, qunit, reactjs, smacss, stackoverflow, unheap" echo "" return 1 fi # build search url: - # join arguments passed with '+', then append to search context URL + # join arguments passed with '%20', then append to search context URL # TODO substitute for proper urlencode method - url="${urls[$1]}${(j:+:)@[2,-1]}" + url="${urls[$1]}${(j:%20:)@[2,-1]}" echo "Opening $url ..." diff --git a/plugins/fzf/README.md b/plugins/fzf/README.md new file mode 100644 index 000000000..b3a434347 --- /dev/null +++ b/plugins/fzf/README.md @@ -0,0 +1,19 @@ +# fzf + +This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings + +```zsh +# Set fzf installation directory path +export FZF_BASE=/path/to/fzf/install/dir + +# Uncomment the following line to disable fuzzy completion +# export DISABLE_FZF_AUTO_COMPLETION="true" + +# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C) +# export DISABLE_FZF_KEY_BINDINGS="true" + +plugins=( + ... + fzf +) +``` diff --git a/plugins/fzf/fzf.plugin.zsh b/plugins/fzf/fzf.plugin.zsh new file mode 100644 index 000000000..27e2d9246 --- /dev/null +++ b/plugins/fzf/fzf.plugin.zsh @@ -0,0 +1,57 @@ +test -d "${FZF_BASE}" && fzf_base="${FZF_BASE}" + +if [[ -z "${fzf_base}" ]]; then + fzfdirs=( + "${HOME}/.fzf" + "/usr/local/opt/fzf" + "/usr/share/fzf" + ) + for dir in ${fzfdirs}; do + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + break + fi + done + + if [[ -z "${fzf_base}" ]]; then + if (( ${+commands[brew]} )) && dir="$(brew --prefix fzf 2>/dev/null)"; then + if [[ -d "${dir}" ]]; then + fzf_base="${dir}" + fi + fi + fi +fi + +if [[ -n "${fzf_base}" ]]; then + + # Fix fzf shell directory for Archlinux package + if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then + fzf_shell="${fzf_base}" + else + fzf_shell="${fzf_base}/shell" + fi + + # Setup fzf + # --------- + if ! (( ${+commands[fzf]} )) && [[ ! "$PATH" == *$fzf_base/bin* ]]; then + export PATH="$PATH:$fzf_base/bin" + fi + + # Auto-completion + # --------------- + if [[ ! "$DISABLE_FZF_AUTO_COMPLETION" == "true" ]]; then + [[ $- == *i* ]] && source "${fzf_shell}/completion.zsh" 2> /dev/null + fi + + # Key bindings + # ------------ + if [[ ! "$DISABLE_FZF_KEY_BINDINGS" == "true" ]]; then + source "${fzf_shell}/key-bindings.zsh" + fi + +else + print "[oh-my-zsh] fzf plugin: Cannot find fzf installation directory.\n"\ + "Please add \`export FZF_BASE=/path/to/fzf/install/dir\` to your .zshrc" >&2 +fi + +unset fzf_base fzf_shell dir fzfdirs diff --git a/plugins/geeknote/README.md b/plugins/geeknote/README.md index a6b50e27f..3f2353112 100644 --- a/plugins/geeknote/README.md +++ b/plugins/geeknote/README.md @@ -1,6 +1,6 @@ ## ZSH-Geeknote -[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh). +[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh. Plugins provides: diff --git a/plugins/gem/README.md b/plugins/gem/README.md new file mode 100644 index 000000000..decd87ba3 --- /dev/null +++ b/plugins/gem/README.md @@ -0,0 +1,17 @@ +# Gem plugin + +This plugin adds completions and aliases for [Gem](https://rubygems.org/). The completions include the common `gem` subcommands as well as the installed gems in the current directory. + +To use it, add `gem` to the plugins array in your zshrc file: + +```zsh +plugins=(... gem) +``` + +## Aliases + +| Alias | Command | Description | +|----------------------|-------------------------------|--------------------------------------------| +| gemb | `gem build *.gemspec` | Build a gem from a gemspec | +| gemp | `gem push *.gem` | Push a gem up to the gem server | +| gemy [gem] [version] | `gem yank [gem] -v [version]` | Remove a pushed gem version from the index | diff --git a/plugins/git-auto-fetch/README.md b/plugins/git-auto-fetch/README.md new file mode 100644 index 000000000..35f3c2f71 --- /dev/null +++ b/plugins/git-auto-fetch/README.md @@ -0,0 +1,31 @@ +# Git auto-fetch + +Automatically fetches all changes from all remotes while you are working in git-initialized directory. + +#### Usage + +Add `git-auto-fetch` to the plugins array in your zshrc file: + +```shell +plugins=(... git-auto-fetch) +``` + +Every time you launch a command in your shell all remotes will be fetched in background. +By default autofetch will be triggered only if last fetch was done at least 60 seconds ago. +You can change fetch interval in your .zshrc: +``` +GIT_AUTO_FETCH_INTERVAL=1200 #in seconds +``` +Log of `git fetch --all` will be saved into `.git/FETCH_LOG` + + +#### Toggle auto fetch per folder +If you are using mobile connection or for any other reason you can disable git-auto-fetch for any folder: + +```shell +$ cd to/your/project +$ git-auto-fetch +disabled +$ git-auto-fetch +enabled +``` diff --git a/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh new file mode 100644 index 000000000..1d20bc04b --- /dev/null +++ b/plugins/git-auto-fetch/git-auto-fetch.plugin.zsh @@ -0,0 +1,27 @@ +GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60} + +function git-fetch-all { + (`git rev-parse --is-inside-work-tree 2>/dev/null` && + dir=`git rev-parse --git-dir` && + [[ ! -f $dir/NO_AUTO_FETCH ]] && + (( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) && + git fetch --all &>! $dir/FETCH_LOG &) +} + +function git-auto-fetch { + `git rev-parse --is-inside-work-tree 2>/dev/null` || return + guard="`git rev-parse --git-dir`/NO_AUTO_FETCH" + + (rm $guard 2>/dev/null && + echo "${fg_bold[green]}enabled${reset_color}") || + (touch $guard && + echo "${fg_bold[red]}disabled${reset_color}") +} + +eval "override-git-auto-fetch-$(declare -f zle-line-init)" + +function zle-line-init () { + git-fetch-all + override-git-auto-fetch-zle-line-init +} +zle -N zle-line-init diff --git a/plugins/git-extras/README.md b/plugins/git-extras/README.md index 8f12e297e..987f0d800 100644 --- a/plugins/git-extras/README.md +++ b/plugins/git-extras/README.md @@ -1,6 +1,6 @@ # git-extras -This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras). +This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras). ## Setup notes diff --git a/plugins/git-extras/git-extras.plugin.zsh b/plugins/git-extras/git-extras.plugin.zsh index 0dcd630e8..b86d7c5b6 100644 --- a/plugins/git-extras/git-extras.plugin.zsh +++ b/plugins/git-extras/git-extras.plugin.zsh @@ -2,7 +2,7 @@ # Description # ----------- # -# Completion script for git-extras (http://github.com/tj/git-extras). +# Completion script for git-extras (https://github.com/tj/git-extras). # # This depends on and reuses some of the internals of the _git completion # function that ships with zsh itself. It will not work with the _git that ships @@ -19,8 +19,8 @@ # Inspirations # ----------- # -# * git-extras (http://github.com/tj/git-extras) -# * git-flow-completion (http://github.com/bobthecow/git-flow-completion) +# * git-extras (https://github.com/tj/git-extras) +# * git-flow-completion (https://github.com/bobthecow/git-flow-completion) # # ------------------------------------------------------------------------------ @@ -47,6 +47,14 @@ __gitex_commits() { _describe -t commits commit commits && ret=0 } +__gitex_remote_names() { + local expl + declare -a remote_names + remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"}) + __git_command_successful || return + _wanted remote-names expl remote-name compadd $* - $remote_names +} + __gitex_tag_names() { local expl declare -a tag_names @@ -69,7 +77,11 @@ __gitex_specific_branch_names() { declare -a branch_names branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/}) __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names + _wanted branch-names expl branch-name compadd - $branch_names +} + +__gitex_chore_branch_names() { + __gitex_specific_branch_names 'chore' } __gitex_feature_branch_names() { @@ -102,6 +114,11 @@ __gitex_author_names() { } # subcommands +_git-authors() { + _arguments -C \ + '(--list -l)'{--list,-l}'[show authors]' \ + '--no-email[without email]' \ +} _git-bug() { local curcontext=$curcontext state line ret=1 @@ -126,8 +143,16 @@ _git-bug() { _arguments -C \ ':branch-name:__gitex_bug_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' } @@ -136,6 +161,40 @@ _git-changelog() { '(-l --list)'{-l,--list}'[list commits]' \ } +_git-chore() { + local curcontext=$curcontext state line ret=1 + declare -A opt_args + + _arguments -C \ + ': :->command' \ + '*:: :->option-or-argument' && ret=0 + + case $state in + (command) + declare -a commands + commands=( + 'finish:merge and delete the chore branch' + ) + _describe -t commands command commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + (finish) + _arguments -C \ + ':branch-name:__gitex_chore_branch_names' + ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; + esac + return 0 + esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' +} _git-contrib() { @@ -149,6 +208,27 @@ _git-count() { '--all[detailed commit count]' } +_git-create-branch() { + local curcontext=$curcontext state line + _arguments -C \ + ': :->command' \ + '*:: :->option-or-argument' + + case "$state" in + (command) + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + case $line[1] in + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; + esac + esac +} _git-delete-branch() { _arguments \ @@ -220,10 +300,17 @@ _git-feature() { _arguments -C \ ':branch-name:__gitex_feature_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac -} + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' +} _git-graft() { _arguments \ @@ -231,14 +318,39 @@ _git-graft() { ':dest-branch-name:__gitex_branch_names' } +_git-guilt() { + _arguments -C \ + '(--email -e)'{--email,-e}'[display author emails instead of names]' \ + '(--ignore-whitespace -w)'{--ignore-whitespace,-w}'[ignore whitespace only changes]' \ + '(--debug -d)'{--debug,-d}'[output debug information]' \ + '-h[output usage information]' +} _git-ignore() { _arguments -C \ '(--local -l)'{--local,-l}'[show local gitignore]' \ - '(--global -g)'{--global,-g}'[show global gitignore]' + '(--global -g)'{--global,-g}'[show global gitignore]' \ + '(--private -p)'{--private,-p}'[show repo gitignore]' } +_git-ignore() { + _arguments -C \ + '(--append -a)'{--append,-a}'[append .gitignore]' \ + '(--replace -r)'{--replace,-r}'[replace .gitignore]' \ + '(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \ + '(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \ + '(--search -s)'{--search,-s}'[search word in available types]' +} + + +_git-merge-into() { + _arguments '--ff-only[merge only fast-forward]' + _arguments \ + ':src:__gitex_branch_names' \ + ':dest:__gitex_branch_names' +} + _git-missing() { _arguments \ ':first-branch-name:__gitex_branch_names' \ @@ -269,8 +381,16 @@ _git-refactor() { _arguments -C \ ':branch-name:__gitex_refactor_branch_names' ;; + -r|--remote ) + _arguments -C \ + ':remote-name:__gitex_remote_names' + ;; esac + return 0 esac + + _arguments \ + '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' } @@ -279,6 +399,23 @@ _git-squash() { ':branch-name:__gitex_branch_names' } +_git-stamp() { + _arguments -C \ + '(--replace -r)'{--replace,-r}'[replace stamps with same id]' +} + +_git-standup() { + _arguments -C \ + '-a[Specify the author of commits. Use "all" to specify all authors.]' \ + '-d[Show history since N days ago]' \ + '-D[Specify the date format displayed in commit history]' \ + '-f[Fetch commits before showing history]' \ + '-g[Display GPG signed info]' \ + '-h[Display help message]' \ + '-L[Enable the inclusion of symbolic links]' \ + '-m[The depth of recursive directory search]' +} + _git-summary() { _arguments '--line[summarize with lines rather than commits]' __gitex_commits @@ -291,45 +428,71 @@ _git-undo(){ '(--hard -h)'{--hard,-h}'[wipes your commit(s)]' } -zstyle ':completion:*:*:git:*' user-commands \ +zstyle -g existing_user_commands ':completion:*:*:git:*' user-commands + +zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \ alias:'define, search and show aliases' \ - archive-file:'export the current HEAD of the git repository to a archive' \ + archive-file:'export the current head of the git repository to an archive' \ + authors:'generate authors report' \ back:'undo and stage latest commits' \ - bug:'create a bug branch' \ - changelog:'populate changelog file with commits since the previous tag' \ - commits-since:'list commits since a given date' \ - contrib:'display author contributions' \ - count:'count commits' \ - create-branch:'create local and remote branch' \ - delete-branch:'delete local and remote branch' \ - delete-merged-branches:'delete merged branches'\ - delete-submodule:'delete submodule' \ - delete-tag:'delete local and remote tag' \ - effort:'display effort statistics' \ - extras:'git-extras' \ - feature:'create a feature branch' \ - fork:'fork a repo on github' \ - fresh-branch:'create empty local branch' \ - gh-pages:'create the GitHub Pages branch' \ - graft:'merge commits from source branch to destination branch' \ - ignore:'add patterns to .gitignore' \ - info:'show info about the repository' \ - local-commits:'list unpushed commits on the local branch' \ + bug:'create bug branch' \ + bulk:'run bulk commands' \ + changelog:'generate a changelog report' \ + chore:'create chore branch' \ + clear-soft:'soft clean up a repository' \ + clear:'rigorously clean up a repository' \ + commits-since:'show commit logs since some date' \ + contrib:'show user contributions' \ + count:'show commit count' \ + create-branch:'create branches' \ + delete-branch:'delete branches' \ + delete-merged-branches:'delete merged branches' \ + delete-submodule:'delete submodules' \ + delete-tag:'delete tags' \ + delta:'lists changed files' \ + effort:'show effort statistics on file(s)' \ + extras:'awesome git utilities' \ + feature:'create/merge feature branch' \ + force-clone:'overwrite local repositories with clone' \ + fork:'fork a repo on GitHub' \ + fresh-branch:'create fresh branches' \ + gh-pages:'create the GitHub pages branch' \ + graft:'merge and destroy a given branch' \ + guilt:'calculate change between two revisions' \ + ignore-io:'get sample gitignore file' \ + ignore:'add .gitignore patterns' \ + info:'returns information on current repository' \ + local-commits:'list local commits' \ lock:'lock a file excluded from version control' \ locked:'ls files that have been locked' \ + merge-into:'merge one branch into another' \ + merge-repo:'merge two repo histories' \ missing:'show commits missing from another branch' \ + mr:'checks out a merge request locally' \ + obliterate:'rewrite past commits to remove some files' \ pr:'checks out a pull request locally' \ + psykorebase:'rebase a branch with a merge commit' \ + pull-request:'create pull request to GitHub project' \ + reauthor:'replace the author and/or committer identities in commits and tags' \ rebase-patch:'rebases a patch' \ - refactor:'create a refactor branch' \ + refactor:'create refactor branch' \ release:'commit, tag and push changes to the repository' \ + rename-branch:'rename a branch' \ rename-tag:'rename a tag' \ - repl:'read-eval-print-loop' \ + repl:'git read-eval-print-loop' \ reset-file:'reset one file' \ root:'show path of root' \ - setup:'setup a git repository' \ + scp:'copy files to ssh compatible `git-remote`' \ + sed:'replace patterns in git-controlled files' \ + setup:'set up a git repository' \ + show-merged-branches:'show merged branches' \ show-tree:'show branch tree of commit history' \ - squash:'merge commits from source branch into the current one as a single commit' \ - summary:'repository summary' \ - touch:'one step creation of new files' \ - undo:'remove the latest commit' \ + show-unmerged-branches:'show unmerged branches' \ + squash:'import changes from a branch' \ + stamp:'stamp the last commit message' \ + standup:'recall the commit history' \ + summary:'show repository summary' \ + sync:'sync local branch with remote branch' \ + touch:'touch and add file to the index' \ + undo:'remove latest commits' \ unlock:'unlock a file excluded from version control' diff --git a/plugins/git-flow-avh/README.md b/plugins/git-flow-avh/README.md new file mode 100644 index 000000000..0768d93ea --- /dev/null +++ b/plugins/git-flow-avh/README.md @@ -0,0 +1,19 @@ +# git-flow (AVH Edition) plugin + +This plugin adds completion for the [git-flow (AVH Edition)](https://github.com/petervanderdoes/gitflow-avh). +The AVH Edition of the git extensions that provides high-level repository operations for [Vincent Driessen's branching model](https://nvie.com/posts/a-successful-git-branching-model/). + +To use it, add `git-flow-avh` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-flow-avh) +``` + +## Requirements + +1. The git-flow tool has to be [installed](https://github.com/petervanderdoes/gitflow-avh#installing-git-flow) + separately. + +2. You have to use zsh's git completion instead of the git project's git completion. This is typically + done by default so you don't need to do anything else. If you installed git with Homebrew you + might have to uninstall the git completion it's bundled with. diff --git a/plugins/git-flow-avh/git-flow-avh.plugin.zsh b/plugins/git-flow-avh/git-flow-avh.plugin.zsh index ba98fff01..860ca55c5 100644 --- a/plugins/git-flow-avh/git-flow-avh.plugin.zsh +++ b/plugins/git-flow-avh/git-flow-avh.plugin.zsh @@ -1,419 +1,526 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-flow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest verion. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-flow-completion.zsh -# -# c. Or, use this file as a oh-my-zsh plugin. -# - _git-flow () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) - local -a subcommands - subcommands=( - 'init:Initialize a new git repo with support for the branching model.' - 'feature:Manage your feature branches.' - 'config:Manage your configuration.' - 'release:Manage your release branches.' - 'hotfix:Manage your hotfix branches.' - 'support:Manage your support branches.' - 'version:Shows version information.' - 'finish:Finish the branch you are currently on.' - 'delete:Delete the branch you are currently on.' - 'publish:Publish the branch you are currently on.' - ) - _describe -t commands 'git flow' subcommands - ;; + local -a subcommands + subcommands=( + 'init:Initialize a new git repo with support for the branching model.' + 'feature:Manage your feature branches.' + 'bugfix:Manage your bugfix branches.' + 'config:Manage your configuration.' + 'release:Manage your release branches.' + 'hotfix:Manage your hotfix branches.' + 'support:Manage your support branches.' + 'version:Shows version information.' + 'finish:Finish the branch you are currently on.' + 'delete:Delete the branch you are currently on.' + 'publish:Publish the branch you are currently on.' + 'rebase:Rebase the branch you are currently on.' + ) + _describe -t commands 'git flow' subcommands + ;; - (options) - case $line[1] in + (options) + case $line[1] in - (init) - _arguments \ - -f'[Force setting of gitflow branches, even if already configured]' - ;; + (init) + _arguments \ + -f'[Force setting of gitflow branches, even if already configured]' + ;; - (version) - ;; + (version) + ;; - (hotfix) - __git-flow-hotfix - ;; + (hotfix) + __git-flow-hotfix + ;; - (release) - __git-flow-release - ;; + (release) + __git-flow-release + ;; - (feature) - __git-flow-feature - ;; - (config) - __git-flow-config - ;; + (feature) + __git-flow-feature + ;; + (bugfix) + __git-flow-bugfix + ;; - esac - ;; - esac + (config) + __git-flow-config + ;; + + esac + ;; + esac } __git-flow-release () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) - local -a subcommands - subcommands=( - 'start:Start a new release branch.' - 'finish:Finish a release branch.' - 'list:List all your release branches. (Alias to `git flow release`)' - 'publish:Publish release branch to remote.' - 'track:Checkout remote release branch.' - 'delete:Delete a release branch.' - ) - _describe -t commands 'git flow release' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; + local -a subcommands + subcommands=( + 'start:Start a new release branch.' + 'finish:Finish a release branch.' + 'list:List all your release branches. (Alias to `git flow release`)' + 'publish:Publish release branch to remote.' + 'track:Checkout remote release branch.' + 'rebase:Rebase from integration branch.' + 'delete:Delete a release branch.' + ) + _describe -t commands 'git flow release' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; - (options) - case $line[1] in + (options) + case $line[1] in - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':version:__git_flow_version_list' - ;; + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':version:__git_flow_version_list' + ;; - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':version:__git_flow_version_list' - ;; + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':version:__git_flow_version_list' + ;; - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':version:__git_flow_version_list' - ;; + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':version:__git_flow_version_list' + ;; - (publish) - _arguments \ - ':version:__git_flow_version_list' - ;; + (publish) + _arguments \ + ':version:__git_flow_version_list' + ;; - (track) - _arguments \ - ':version:__git_flow_version_list' - ;; + (track) + _arguments \ + ':version:__git_flow_version_list' + ;; - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-hotfix () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) - local -a subcommands - subcommands=( - 'start:Start a new hotfix branch.' - 'finish:Finish a hotfix branch.' - 'delete:Delete a hotfix branch.' - 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' - ) - _describe -t commands 'git flow hotfix' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; + local -a subcommands + subcommands=( + 'start:Start a new hotfix branch.' + 'finish:Finish a hotfix branch.' + 'delete:Delete a hotfix branch.' + 'rebase:Rebase from integration branch.' + 'list:List all your hotfix branches. (Alias to `git flow hotfix`)' + 'rename:Rename a hotfix branch.' + ) + _describe -t commands 'git flow hotfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; - (options) - case $line[1] in + (options) + case $line[1] in - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':hotfix:__git_flow_version_list'\ - ':branch-name:__git_branch_names' - ;; + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':hotfix:__git_flow_version_list'\ + ':branch-name:__git_branch_names' + ;; - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -s'[Sign the release tag cryptographically]'\ - -u'[Use the given GPG-key for the digital signature (implies -s)]'\ - -m'[Use the given tag message]'\ - -p'[Push to $ORIGIN after performing finish]'\ - ':hotfix:__git_flow_hotfix_list' - ;; + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -s'[Sign the release tag cryptographically]'\ + -u'[Use the given GPG-key for the digital signature (implies -s)]'\ + -m'[Use the given tag message]'\ + -p'[Push to $ORIGIN after performing finish]'\ + ':hotfix:__git_flow_hotfix_list' + ;; - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':hotfix:__git_flow_hotfix_list' - ;; + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':hotfix:__git_flow_hotfix_list' + ;; - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-feature () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) - local -a subcommands - subcommands=( - 'start:Start a new feature branch.' - 'finish:Finish a feature branch.' - 'delete:Delete a feature branch.' - 'list:List all your feature branches. (Alias to `git flow feature`)' - 'publish:Publish feature branch to remote.' - 'track:Checkout remote feature branch.' - 'diff:Show all changes.' - 'rebase:Rebase from integration branch.' - 'checkout:Checkout local feature branch.' - 'pull:Pull changes from remote.' - ) - _describe -t commands 'git flow feature' subcommands - _arguments \ - -v'[Verbose (more) output]' - ;; + local -a subcommands + subcommands=( + 'start:Start a new feature branch.' + 'finish:Finish a feature branch.' + 'delete:Delete a feature branch.' + 'list:List all your feature branches. (Alias to `git flow feature`)' + 'publish:Publish feature branch to remote.' + 'track:Checkout remote feature branch.' + 'diff:Show all changes.' + 'rebase:Rebase from integration branch.' + 'checkout:Checkout local feature branch.' + 'pull:Pull changes from remote.' + 'rename:Rename a feature branch.' + ) + _describe -t commands 'git flow feature' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; - (options) - case $line[1] in + (options) + case $line[1] in - (start) - _arguments \ - -F'[Fetch from origin before performing finish]'\ - ':feature:__git_flow_feature_list'\ - ':branch-name:__git_branch_names' - ;; + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':feature:__git_flow_feature_list'\ + ':branch-name:__git_branch_names' + ;; - (finish) - _arguments \ - -F'[Fetch from origin before performing finish]' \ - -r'[Rebase instead of merge]'\ - ':feature:__git_flow_feature_list' - ;; + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':feature:__git_flow_feature_list' + ;; - (delete) - _arguments \ - -f'[Force deletion]' \ - -r'[Delete remote branch]' \ - ':feature:__git_flow_feature_list' - ;; + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':feature:__git_flow_feature_list' + ;; - (publish) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; + (publish) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; - (track) - _arguments \ - ':feature:__git_flow_feature_list'\ - ;; + (track) + _arguments \ + ':feature:__git_flow_feature_list'\ + ;; - (diff) - _arguments \ - ':branch:__git_branch_names'\ - ;; + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; - (rebase) - _arguments \ - -i'[Do an interactive rebase]' \ - ':branch:__git_branch_names' - ;; + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; - (checkout) - _arguments \ - ':branch:__git_flow_feature_list'\ - ;; + (checkout) + _arguments \ + ':branch:__git_flow_feature_list'\ + ;; - (pull) - _arguments \ - ':remote:__git_remotes'\ - ':branch:__git_branch_names' - ;; + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; - *) - _arguments \ - -v'[Verbose (more) output]' - ;; - esac - ;; - esac + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac +} + +__git-flow-bugfix () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=( + 'start:Start a new bugfix branch.' + 'finish:Finish a bugfix branch.' + 'delete:Delete a bugfix branch.' + 'list:List all your bugfix branches. (Alias to `git flow bugfix`)' + 'publish:Publish bugfix branch to remote.' + 'track:Checkout remote bugfix branch.' + 'diff:Show all changes.' + 'rebase:Rebase from integration branch.' + 'checkout:Checkout local bugfix branch.' + 'pull:Pull changes from remote.' + 'rename:Rename a bugfix branch.' + ) + _describe -t commands 'git flow bugfix' subcommands + _arguments \ + -v'[Verbose (more) output]' + ;; + + (options) + case $line[1] in + + (start) + _arguments \ + -F'[Fetch from origin before performing finish]'\ + ':bugfix:__git_flow_bugfix_list'\ + ':branch-name:__git_branch_names' + ;; + + (finish) + _arguments \ + -F'[Fetch from origin before performing finish]' \ + -r'[Rebase instead of merge]'\ + ':bugfix:__git_flow_bugfix_list' + ;; + + (delete) + _arguments \ + -f'[Force deletion]' \ + -r'[Delete remote branch]' \ + ':bugfix:__git_flow_bugfix_list' + ;; + + (publish) + _arguments \ + ':bugfix:__git_flow_bugfix_list'\ + ;; + + (track) + _arguments \ + ':bugfix:__git_flow_bugfix_list'\ + ;; + + (diff) + _arguments \ + ':branch:__git_branch_names'\ + ;; + + (rebase) + _arguments \ + -i'[Do an interactive rebase]' \ + ':branch:__git_branch_names' + ;; + + (checkout) + _arguments \ + ':branch:__git_flow_bugfix_list'\ + ;; + + (pull) + _arguments \ + ':remote:__git_remotes'\ + ':branch:__git_branch_names' + ;; + + *) + _arguments \ + -v'[Verbose (more) output]' + ;; + esac + ;; + esac } __git-flow-config () { - local curcontext="$curcontext" state line - typeset -A opt_args + local curcontext="$curcontext" state line + typeset -A opt_args - _arguments -C \ - ':command:->command' \ - '*::options:->options' + _arguments -C \ + ':command:->command' \ + '*::options:->options' - case $state in - (command) + case $state in + (command) - local -a subcommands - subcommands=( - 'list:List the configuration. (Alias to `git flow config`)' - 'set:Set the configuration option' - ) - _describe -t commands 'git flow config' subcommands - ;; + local -a subcommands + subcommands=( + 'list:List the configuration. (Alias to `git flow config`)' + 'set:Set the configuration option' + ) + _describe -t commands 'git flow config' subcommands + ;; - (options) - case $line[1] in + (options) + case $line[1] in - (set) - _arguments \ - --local'[Use repository config file]' \ - --global'[Use global config file]'\ - --system'[Use system config file]'\ - --file'[Use given config file]'\ - ':option:(master develop feature hotfix release support versiontagprefix)' - ;; + (set) + _arguments \ + --local'[Use repository config file]' \ + --global'[Use global config file]'\ + --system'[Use system config file]'\ + --file'[Use given config file]'\ + ':option:(master develop feature hotfix release support versiontagprefix)' + ;; - *) - _arguments \ - --local'[Use repository config file]' \ - --global'[Use global config file]'\ - --system'[Use system config file]'\ - --file'[Use given config file]' - ;; - esac - ;; - esac + *) + _arguments \ + --local'[Use repository config file]' \ + --global'[Use global config file]'\ + --system'[Use system config file]'\ + --file'[Use given config file]' + ;; + esac + ;; + esac } __git_flow_version_list () { - local expl - declare -a versions + local expl + declare -a versions - versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted versions expl 'version' compadd $versions + _wanted versions expl 'version' compadd $versions } __git_flow_feature_list () { - local expl - declare -a features + local expl + declare -a features - features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted features expl 'feature' compadd $features + _wanted features expl 'feature' compadd $features +} + +__git_flow_bugfix_list () +{ + local expl + declare -a bugfixes + + bugfixes=(${${(f)"$(_call_program bugfixes git flow bugfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return + + _wanted bugfixes expl 'bugfix' compadd $bugfixes } __git_remotes () { - local expl gitdir remotes + local expl gitdir remotes - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful || return + gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) + __git_command_successful || return - remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) - __git_command_successful || return + remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]}) + __git_command_successful || return - # TODO: Should combine the two instead of either or. - if (( $#remotes > 0 )); then - _wanted remotes expl remote compadd $* - $remotes - else - _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" - fi + # TODO: Should combine the two instead of either or. + if (( $#remotes > 0 )); then + _wanted remotes expl remote compadd $* - $remotes + else + _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*" + fi } __git_flow_hotfix_list () { - local expl - declare -a hotfixes + local expl + declare -a hotfixes - hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) - __git_command_successful || return + hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}}) + __git_command_successful || return - _wanted hotfixes expl 'hotfix' compadd $hotfixes + _wanted hotfixes expl 'hotfix' compadd $hotfixes } __git_branch_names () { - local expl - declare -a branch_names + local expl + declare -a branch_names - branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful || return + branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) + __git_command_successful || return - _wanted branch-names expl branch-name compadd $* - $branch_names + _wanted branch-names expl branch-name compadd $* - $branch_names } __git_command_successful () { - if (( ${#pipestatus:#0} > 0 )); then - _message 'not a git repository' - return 1 - fi - return 0 + if (( ${#pipestatus:#0} > 0 )); then + _message 'not a git repository' + return 1 + fi + return 0 } zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations' diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md index f37f418db..5d8049e3b 100644 --- a/plugins/git-flow/README.md +++ b/plugins/git-flow/README.md @@ -10,22 +10,23 @@ plugins=(... git-flow) ## Aliases -More information about `git-flow` commands: +More information about `git-flow` commands: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments -| Alias | Command | Description | -|---------|---------------------------|----------------------------------------| -| `gfl` | `git flow` | Git-Flow command | -| `gfli` | `git flow init` | Initialize git-flow repository | -| `gcd` | `git checkout develop` | Check out develop branch | -| `gch` | `git checkout hotfix` | Check out hotfix branch | -| `gcr` | `git checkout release` | Check out release branch | -| `gflf` | `git flow feature` | List existing feature branches | -| `gflh` | `git flow hotfix` | List existing hotfix branches | -| `gflr` | `git flow release` | List existing release branches | -| `gflfs` | `git flow feature start` | Start a new feature: `gflfs ` | -| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs ` | -| `gflrs` | `git flow release start` | Start a new release: `gflrs ` | -| `gflff` | `git flow feature finish` | Finish feature: `gflff ` | -| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | -| `gflrf` | `git flow release finish` | Finish release: `gflrf ` | +| Alias | Command | Description | +|---------|----------------------------|----------------------------------------| +| `gfl` | `git flow` | Git-Flow command | +| `gfli` | `git flow init` | Initialize git-flow repository | +| `gcd` | `git checkout develop` | Check out develop branch | +| `gch` | `git checkout hotfix` | Check out hotfix branch | +| `gcr` | `git checkout release` | Check out release branch | +| `gflf` | `git flow feature` | List existing feature branches | +| `gflh` | `git flow hotfix` | List existing hotfix branches | +| `gflr` | `git flow release` | List existing release branches | +| `gflfs` | `git flow feature start` | Start a new feature: `gflfs ` | +| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs ` | +| `gflrs` | `git flow release start` | Start a new release: `gflrs ` | +| `gflff` | `git flow feature finish` | Finish feature: `gflff ` | +| `gflfp` | `git flow feature publish` | Publish feature: `gflfp ` | +| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | +| `gflrf` | `git flow release finish` | Finish release: `gflrf ` | diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 5f5e4aa73..eab969d8a 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -33,6 +33,7 @@ alias gflfs='git flow feature start' alias gflhs='git flow hotfix start' alias gflrs='git flow release start' alias gflff='git flow feature finish' +alias gflfp='git flow feature publish' alias gflhf='git flow hotfix finish' alias gflrf='git flow release finish' alias gflfp='git flow feature publish' diff --git a/plugins/git-hubflow/README.md b/plugins/git-hubflow/README.md new file mode 100644 index 000000000..dada60d78 --- /dev/null +++ b/plugins/git-hubflow/README.md @@ -0,0 +1,24 @@ +# git-hubflow plugin + +This plugin adds completion for [HubFlow](https://datasift.github.io/gitflow/) (GitFlow for GitHub), as well as some +aliases for common commands. HubFlow is a git extension to make it easy to use GitFlow with GitHub. Based on the +original gitflow extension for git. + +The hubflow tool has to be [installed](https://github.com/datasift/gitflow#installation) separately. + +To use it, add `git-hubflow` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-hubflow) +``` + +## Aliases + +| Alias | Command | Description | +|-------|------------------|------------------------------------------------------------------| +| ghf | `git hf` | Print command overview | +| ghff | `git hf feature` | Manage your feature branches | +| ghfr | `git hf release` | Manage your release branches | +| ghfh | `git hf hotfix` | Manage your hotfix branches | +| ghfs | `git hf support` | Manage your support branches | +| ghfu | `git hf update` | Pull upstream changes down into your master and develop branches | diff --git a/plugins/git-hubflow/git-hubflow.plugin.zsh b/plugins/git-hubflow/git-hubflow.plugin.zsh index b0157c7a1..50d7b23ce 100644 --- a/plugins/git-hubflow/git-hubflow.plugin.zsh +++ b/plugins/git-hubflow/git-hubflow.plugin.zsh @@ -1,25 +1,3 @@ -#!zsh -# -# Installation -# ------------ -# -# To achieve git-hubflow completion nirvana: -# -# 0. Update your zsh's git-completion module to the newest version. -# From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD -# -# 1. Install this file. Either: -# -# a. Place it in your .zshrc: -# -# b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in -# your .zshrc: -# -# source ~/.git-hubflow-completion.zsh -# -# c. Or, use this file as an oh-my-zsh plugin. -# - alias ghf='git hf' alias ghff='git hf feature' alias ghfr='git hf release' @@ -97,8 +75,8 @@ __git-hf-release () 'finish:Finish a release branch.' 'list:List all your release branches. (Alias to `git hf release`)' 'cancel:Cancel release' - 'push:Push release to github' - 'pull:Pull release from github' + 'push:Push release to GitHub' + 'pull:Pull release from GitHub' 'track:Track release' ) _describe -t commands 'git hf release' subcommands @@ -155,8 +133,8 @@ __git-hf-hotfix () 'list:List all your hotfix branches. (Alias to `git hf hotfix`)' 'publish:Publish the hotfix branch.' 'track:Track the hotfix branch.' - 'pull:Pull the hotfix from github.' - 'push:Push the hotfix to github.' + 'pull:Pull the hotfix from GitHub.' + 'push:Push the hotfix to GitHub.' 'cancel:Cancel the hotfix.' ) _describe -t commands 'git hf hotfix' subcommands @@ -217,8 +195,8 @@ __git-hf-feature () 'diff:Diff' 'rebase:Rebase feature branch against develop' 'checkout:Checkout feature' - 'pull:Pull feature branch from github' - 'push:Push feature branch to github' + 'pull:Pull feature branch from GitHub' + 'push:Push feature branch to GitHub' 'cancel:Cancel feature' ) _describe -t commands 'git hf feature' subcommands diff --git a/plugins/git-prompt/README.md b/plugins/git-prompt/README.md new file mode 100644 index 000000000..e3b2d623a --- /dev/null +++ b/plugins/git-prompt/README.md @@ -0,0 +1,61 @@ +# git-prompt plugin + +A `zsh` prompt that displays information about the current git repository. In particular: +the branch name, difference with remote branch, number of files staged or changed, etc. + +To use it, add `git-prompt` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-prompt) +``` + +See the [original repository](https://github.com/olivierverdier/zsh-git-prompt). + +## Examples + +The prompt may look like the following: + +- `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged +- `(status|●2)`: on branch `status`, 2 files staged +- `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked +- `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed +- `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean +- `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean + +## Prompt Structure + +By default, the general appearance of the prompt is: + +``` +(|) +``` + +The symbols are as follows: + +### Local Status Symbols + +| Symbol | Meaning | +|--------|--------------------------------| +| ✔ | repository clean | +| ●n | there are `n` staged files | +| ✖n | there are `n` unmerged files | +| ✚n | there are `n` unstaged files | +| … | there are some untracked files | + +### Branch Tracking Symbols + +| Symbol | Meaning | +|--------|---------------------------------------------------------------| +| ↑n | ahead of remote by `n` commits | +| ↓n | behind remote by `n` commits | +| ↓m↑n | branches diverged: other by `m` commits, yours by `n` commits | + +## Customisation + +- Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching. +- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`) + to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)` + to see what variables are available. + + +**Enjoy!** diff --git a/plugins/git-prompt/git-prompt.plugin.zsh b/plugins/git-prompt/git-prompt.plugin.zsh index 5175bf70f..76ac2e62b 100644 --- a/plugins/git-prompt/git-prompt.plugin.zsh +++ b/plugins/git-prompt/git-prompt.plugin.zsh @@ -1,6 +1,3 @@ -# ZSH Git Prompt Plugin from: -# http://github.com/olivierverdier/zsh-git-prompt - __GIT_PROMPT_DIR="${0:A:h}" ## Hook function definitions diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index a8eb8284b..390a50a6f 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from __future__ import print_function +import os import sys import re import shlex @@ -22,7 +23,7 @@ def get_tagname_or_hash(): tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1] if tagname: - return tagname + return tagname.replace(' ', '') elif hash_: return hash_ return None @@ -30,7 +31,7 @@ def get_tagname_or_hash(): # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind -po = Popen(['git', 'status', '--porcelain', '--branch'], stdout=PIPE, stderr=PIPE) +po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE) stdout, sterr = po.communicate() if po.returncode != 0: sys.exit(0) # Not a git repository @@ -41,7 +42,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 fa0c06500..b82d49b5e 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -44,12 +44,14 @@ alias ga='git add' alias gaa='git add --all' alias gapa='git add --patch' alias gau='git add --update' +alias gav='git add --verbose' alias gap='git apply' alias gb='git branch' alias gba='git branch -a' alias gbd='git branch -d' alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' +alias gbD='git branch -D' alias gbl='git blame -b -w' alias gbnm='git branch --no-merged' alias gbr='git branch --remote' @@ -70,8 +72,8 @@ alias gcam='git commit -a -m' alias gcsm='git commit -s -m' alias gcb='git checkout -b' alias gcf='git config --list' -alias gcl='git clone --recursive' -alias gclean='git clean -fd' +alias gcl='git clone --recurse-submodules' +alias gclean='git clean -id' alias gpristine='git reset --hard && git clean -dfx' alias gcm='git checkout master' alias gcd='git checkout develop' @@ -88,6 +90,7 @@ 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 gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' @@ -109,8 +112,8 @@ ggf() { git push --force origin "${b:=$1}" } ggfl() { -[[ "$#" != 1 ]] && local b="$(git_current_branch)" -git push --force-with-lease origin "${b:=$1}" + [[ "$#" != 1 ]] && local b="$(git_current_branch)" + git push --force-with-lease origin "${b:=$1}" } compdef _git ggf=git-checkout @@ -152,10 +155,10 @@ compdef _git ggu=git-checkout alias ggpur='ggu' compdef _git ggpur=git-checkout -alias ggpull='git pull origin $(git_current_branch)' +alias ggpull='git pull origin "$(git_current_branch)"' compdef _git ggpull=git-checkout -alias ggpush='git push origin $(git_current_branch)' +alias ggpush='git push origin "$(git_current_branch)"' compdef _git ggpush=git-checkout alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' @@ -180,8 +183,11 @@ 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(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'" +alias glols="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat" +alias glod="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'" +alias glods="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short" +alias glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%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" @@ -196,6 +202,8 @@ alias gma='git merge --abort' alias gp='git push' alias gpd='git push --dry-run' +alias gpf='git push --force-with-lease' +alias gpf!='git push --force' alias gpoat='git push origin --all && git push origin --tags' compdef _git gpoat=git-push alias gpu='git push upstream' @@ -206,43 +214,58 @@ alias gra='git remote add' alias grb='git rebase' alias grba='git rebase --abort' alias grbc='git rebase --continue' +alias grbd='git rebase develop' alias grbi='git rebase -i' alias grbm='git rebase master' alias grbs='git rebase --skip' -alias grh='git reset HEAD' -alias grhh='git reset HEAD --hard' +alias grh='git reset' +alias grhh='git reset --hard' +alias groh='git reset origin/$(git_current_branch) --hard' +alias grm='git rm' +alias grmc='git rm --cached' alias grmv='git remote rename' alias grrm='git remote remove' alias grset='git remote set-url' -alias grt='cd $(git rev-parse --show-toplevel || echo ".")' +alias grt='cd "$(git rev-parse --show-toplevel || echo .)"' alias gru='git reset --' alias grup='git remote update' alias grv='git remote -v' alias gsb='git status -sb' alias gsd='git svn dcommit' +alias gsh='git show' alias gsi='git submodule init' alias gsps='git show --pretty=short --show-signature' alias gsr='git svn rebase' alias gss='git status -s' alias gst='git status' -alias gsta='git stash save' + +# use the default stash push on git 2.13 and newer +autoload -Uz is-at-least +is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')" \ + && alias gsta='git stash push' \ + || alias gsta='git stash save' + alias gstaa='git stash apply' alias gstc='git stash clear' alias gstd='git stash drop' alias gstl='git stash list' alias gstp='git stash pop' alias gsts='git stash show --text' +alias gstall='git stash --all' alias gsu='git submodule update' alias gts='git tag -s' alias gtv='git tag | sort -V' +alias gtl='gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl' alias gunignore='git update-index --no-assume-unchanged' alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' alias gup='git pull --rebase' alias gupv='git pull --rebase -v' +alias gupa='git pull --rebase --autostash' +alias gupav='git pull --rebase --autostash -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-- [skip ci]"' +alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' diff --git a/plugins/gitfast/README.md b/plugins/gitfast/README.md new file mode 100644 index 000000000..84e35d77c --- /dev/null +++ b/plugins/gitfast/README.md @@ -0,0 +1,15 @@ +# Gitfast plugin + +This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version.. + +To use it, add `gitfast` to the plugins array in your zshrc file: + +```zsh +plugins=(... gitfast) +``` + +## Aliases + +An earlier version of the plugin also loaded the git plugin. If you want to keep those +aliases enable the [git plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git) +as well. diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 6d1b4ecc7..78a6dbb3d 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -9,7 +9,7 @@ # # If your script is somewhere else, you can configure it on your ~/.zshrc: # -# zstyle ':completion:*:*:git:*' script ~/.git-completion.sh +# zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh # # The recommended way to install this script is to copy to '~/.zsh/_git', and # then add the following to your ~/.zshrc file: @@ -67,6 +67,15 @@ __gitcomp () esac } +__gitcomp_direct () +{ + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -Q -- ${=1} && _ret=0 +} + __gitcomp_nl () { emulate -L zsh diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 8ce6b5c5f..d93441747 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -28,27 +28,55 @@ # completion style. For example '!f() { : git commit ; ... }; f' will # tell the completion to use commit completion. This also works with aliases # of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". +# +# You can set the following environment variables to influence the behavior of +# the completion routines: +# +# GIT_COMPLETION_CHECKOUT_NO_GUESS +# +# When set to "1", do not include "DWIM" suggestions in git-checkout +# completion (e.g., completing "foo" when "origin/foo" exists). case "$COMP_WORDBREAKS" in *:*) : great ;; *) COMP_WORDBREAKS="$COMP_WORDBREAKS:" esac +# Discovers the path to the git repository taking any '--git-dir=' and +# '-C ' options into account and stores it in the $__git_repo_path +# variable. +__git_find_repo_path () +{ + if [ -n "$__git_repo_path" ]; then + # we already know where it is + return + fi + + if [ -n "${__git_C_args-}" ]; then + __git_repo_path="$(git "${__git_C_args[@]}" \ + ${__git_dir:+--git-dir="$__git_dir"} \ + rev-parse --absolute-git-dir 2>/dev/null)" + elif [ -n "${__git_dir-}" ]; then + test -d "$__git_dir" && + __git_repo_path="$__git_dir" + elif [ -n "${GIT_DIR-}" ]; then + test -d "${GIT_DIR-}" && + __git_repo_path="$GIT_DIR" + elif [ -d .git ]; then + __git_repo_path=.git + else + __git_repo_path="$(git rev-parse --git-dir 2>/dev/null)" + fi +} + +# Deprecated: use __git_find_repo_path() and $__git_repo_path instead # __gitdir accepts 0 or 1 arguments (i.e., location) # returns location of .git repo __gitdir () { if [ -z "${1-}" ]; then - if [ -n "${__git_dir-}" ]; then - echo "$__git_dir" - elif [ -n "${GIT_DIR-}" ]; then - test -d "${GIT_DIR-}" || return 1 - echo "$GIT_DIR" - elif [ -d .git ]; then - echo .git - else - git rev-parse --git-dir 2>/dev/null - fi + __git_find_repo_path || return 1 + echo "$__git_repo_path" elif [ -d "$1/.git" ]; then echo "$1/.git" else @@ -56,6 +84,14 @@ __gitdir () fi } +# Runs git with all the options given as argument, respecting any +# '--git-dir=' and '-C ' options present on the command line +__git () +{ + git ${__git_C_args:+"${__git_C_args[@]}"} \ + ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null +} + # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -185,6 +221,20 @@ _get_comp_words_by_ref () } fi +# Fills the COMPREPLY array with prefiltered words without any additional +# processing. +# Callers must take care of providing only words that match the current word +# to be completed and adding any prefix and/or suffix (trailing space!), if +# necessary. +# 1: List of newline-separated matching completion words, complete with +# prefix and suffix. +__gitcomp_direct () +{ + local IFS=$'\n' + + COMPREPLY=($1) +} + __gitcompappend () { local x i=${#COMPREPLY[@]} @@ -283,11 +333,11 @@ __gitcomp_file () __git_ls_files_helper () { if [ "$2" == "--committable" ]; then - git -C "$1" diff-index --name-only --relative HEAD + __git -C "$1" diff-index --name-only --relative HEAD else # NOTE: $2 is not quoted in order to support multiple options - git -C "$1" ls-files --exclude-standard $2 - fi 2>/dev/null + __git -C "$1" ls-files --exclude-standard $2 + fi } @@ -299,99 +349,195 @@ __git_ls_files_helper () # slash. __git_index_files () { - local dir="$(__gitdir)" root="${2-.}" file + local root="${2-.}" file - if [ -d "$dir" ]; then - __git_ls_files_helper "$root" "$1" | - while read -r file; do - case "$file" in - ?*/*) echo "${file%%/*}" ;; - *) echo "$file" ;; - esac - done | sort | uniq - fi + __git_ls_files_helper "$root" "$1" | + while read -r file; do + case "$file" in + ?*/*) echo "${file%%/*}" ;; + *) echo "$file" ;; + esac + done | sort | uniq } +# Lists branches from the local repository. +# 1: A prefix to be added to each listed branch (optional). +# 2: List only branches matching this word (optional; list all branches if +# unset or empty). +# 3: A suffix to be appended to each listed branch (optional). __git_heads () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/heads - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/heads/$cur_*" "refs/heads/$cur_*/**" } +# Lists tags from the local repository. +# Accepts the same positional parameters as __git_heads() above. __git_tags () { - local dir="$(__gitdir)" - if [ -d "$dir" ]; then - git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ - refs/tags - return - fi + local pfx="${1-}" cur_="${2-}" sfx="${3-}" + + __git for-each-ref --format="${pfx//\%/%%}%(refname:strip=2)$sfx" \ + "refs/tags/$cur_*" "refs/tags/$cur_*/**" } -# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments -# presence of 2nd argument means use the guess heuristic employed -# by checkout for tracking branches +# Lists refs from the local (by default) or from a remote repository. +# It accepts 0, 1 or 2 arguments: +# 1: The remote to list refs from (optional; ignored, if set but empty). +# Can be the name of a configured remote, a path, or a URL. +# 2: In addition to local refs, list unique branches from refs/remotes/ for +# 'git checkout's tracking DWIMery (optional; ignored, if set but empty). +# 3: A prefix to be added to each listed ref (optional). +# 4: List only refs matching this word (optional; list all refs if unset or +# empty). +# 5: A suffix to be appended to each listed ref (optional; ignored, if set +# but empty). +# +# Use __git_complete_refs() instead. __git_refs () { - local i hash dir="$(__gitdir "${1-}")" track="${2-}" + local i hash dir track="${2-}" + local list_refs_from=path remote="${1-}" local format refs - if [ -d "$dir" ]; then - case "$cur" in + local pfx="${3-}" cur_="${4-$cur}" sfx="${5-}" + local match="${4-}" + local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers + + __git_find_repo_path + dir="$__git_repo_path" + + if [ -z "$remote" ]; then + if [ -z "$dir" ]; then + return + fi + else + if __git_is_configured_remote "$remote"; then + # configured remote takes precedence over a + # local directory with the same name + list_refs_from=remote + elif [ -d "$remote/.git" ]; then + dir="$remote/.git" + elif [ -d "$remote" ]; then + dir="$remote" + else + list_refs_from=url + fi + fi + + if [ "$list_refs_from" = path ]; then + if [[ "$cur_" == ^* ]]; then + pfx="$pfx^" + fer_pfx="$fer_pfx^" + cur_=${cur_#^} + match=${match#^} + fi + case "$cur_" in refs|refs/*) format="refname" - refs="${cur%/*}" + refs=("$match*" "$match*/**") track="" ;; *) for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do - if [ -e "$dir/$i" ]; then echo $i; fi + case "$i" in + $match*) + if [ -e "$dir/$i" ]; then + echo "$pfx$i$sfx" + fi + ;; + esac done - format="refname:short" - refs="refs/tags refs/heads refs/remotes" + format="refname:strip=2" + refs=("refs/tags/$match*" "refs/tags/$match*/**" + "refs/heads/$match*" "refs/heads/$match*/**" + "refs/remotes/$match*" "refs/remotes/$match*/**") ;; esac - git --git-dir="$dir" for-each-ref --format="%($format)" \ - $refs + __git_dir="$dir" __git for-each-ref --format="$fer_pfx%($format)$sfx" \ + "${refs[@]}" if [ -n "$track" ]; then # employ the heuristic used by git checkout # Try to find a remote branch that matches the completion word # but only output if the branch name is unique - local ref entry - git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \ - "refs/remotes/" | \ - while read -r entry; do - eval "$entry" - ref="${ref#*/}" - if [[ "$ref" == "$cur"* ]]; then - echo "$ref" - fi - done | sort | uniq -u + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + --sort="refname:strip=3" \ + "refs/remotes/*/$match*" "refs/remotes/*/$match*/**" | \ + uniq -u fi return fi - case "$cur" in + case "$cur_" in refs|refs/*) - git ls-remote "$dir" "$cur*" 2>/dev/null | \ + __git ls-remote "$remote" "$match*" | \ while read -r hash i; do case "$i" in *^{}) ;; - *) echo "$i" ;; + *) echo "$pfx$i$sfx" ;; esac done ;; *) - echo "HEAD" - git for-each-ref --format="%(refname:short)" -- \ - "refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##" + if [ "$list_refs_from" = remote ]; then + case "HEAD" in + $match*) echo "${pfx}HEAD$sfx" ;; + esac + __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ + "refs/remotes/$remote/$match*" \ + "refs/remotes/$remote/$match*/**" + else + local query_symref + case "HEAD" in + $match*) query_symref="HEAD" ;; + esac + __git ls-remote "$remote" $query_symref \ + "refs/tags/$match*" "refs/heads/$match*" \ + "refs/remotes/$match*" | + while read -r hash i; do + case "$i" in + *^{}) ;; + refs/*) echo "$pfx${i#refs/*/}$sfx" ;; + *) echo "$pfx$i$sfx" ;; # symbolic refs + esac + done + fi ;; esac } +# Completes refs, short and long, local and remote, symbolic and pseudo. +# +# Usage: __git_complete_refs [