diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md index 7c1cb89..076c355 100644 --- a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,6 @@ --- name: Bug report -about: Create a report to help us improve Oh My Zsh -labels: 'Type: support' +about: Create a report to help us improve --- @@ -11,26 +10,29 @@ an issue where no sections have been filled will be deleted without comment. --> **Describe the bug** -A clear description of what the bug is. + **To Reproduce** -Steps to reproduce the behavior, for example: -1. Enable this plugin '...' -2. Run command '...' or try the autocomplete command '...' + **Expected behavior** -A brief description of what should happen. + -**Screenshots and/or Recordings** -If applicable, add screenshots to help explain your problem. -You can also record an asciinema session: https://asciinema.org/ +**Screenshots or recordings** + -**Desktop (please complete the following information):** - - OS / Distro: [e.g. Arch Linux, macOS] - - Latest ohmyzsh Update?: [e.g. Yes/No] - - ZSH Version: [e.g. 5.6] +**System:** + - OS: [e.g. macOS] + - Zsh version [e.g. 5.6] - Terminal emulator [e.g. iTerm2] **Additional context** -Add any other context about the problem here. This can be themes, plugins, custom configs. + diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md index 346eaba..d9c324a 100644 --- a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md @@ -11,16 +11,16 @@ an issue where no sections have been filled will be deleted without comment. --> **Is your feature request related to a particular plugin or theme? If so, specify it.** -The name of the plugin or theme that you would like us to improve. [...] + **Is your feature request related to a problem? Please describe.** -A description of what the problem is. Ex. I'm always frustrated when [...] + **Describe the solution you'd like** -A description of what you want to happen. + **Describe alternatives you've considered** -A description of any alternative solutions or features you've considered. This can also include other plugins or aliases. + **Additional context** -Add any other context or screenshots about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at. + diff --git a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md index d263841..3c69a7d 100644 --- a/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md +++ b/zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md @@ -5,6 +5,8 @@ labels: 'Type: support' --- + diff --git a/zsh/.oh-my-zsh/.github/workflows/check-suite.yml b/zsh/.oh-my-zsh/.github/workflows/check-suite.yml new file mode 100644 index 0000000..3a7ad35 --- /dev/null +++ b/zsh/.oh-my-zsh/.github/workflows/check-suite.yml @@ -0,0 +1,36 @@ +name: Check Suite +on: + pull_request: + types: + - opened + - synchronize + branches: + - master + push: + branches: + - master + +jobs: + tests: + name: Run tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Set up git repository + uses: actions/checkout@v2 + - name: Install zsh + if: runner.os == 'Linux' + run: sudo apt-get update; sudo apt-get install zsh + - name: Test installer + run: sh ./tools/install.sh + - name: Check syntax + run: | + for file in ./oh-my-zsh.sh \ + ./lib/*.zsh \ + ./plugins/*/*.plugin.zsh \ + ./plugins/*/_* \ + ./themes/*.zsh-theme; do + zsh -n "$file" || return 1 + done diff --git a/zsh/.oh-my-zsh/README.md b/zsh/.oh-my-zsh/README.md index 9fa0c20..fddc7c2 100644 --- a/zsh/.oh-my-zsh/README.md +++ b/zsh/.oh-my-zsh/README.md @@ -14,9 +14,9 @@ Finally, you'll begin to get the sort of attention that you have always felt you To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord. -[![CI](https://github.com/ohmyzsh/ohmyzsh/workflows/CI/badge.svg)](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI) +![Check Suite](https://github.com/ohmyzsh/ohmyzsh/workflows/Check%20Suite/badge.svg) [![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh) -[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/ohmyzsh) +[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN) ## Getting Started @@ -25,7 +25,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi * A Unix-like operating system: macOS, Linux, BSD. On Windows: WSL is preferred, but cygwin or msys also mostly work. * [Zsh](https://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (run `zsh --version` to confirm), check the following instructions here: [Installing ZSH](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) * `curl` or `wget` should be installed -* `git` should be installed (recommended v1.7.2 or higher) +* `git` should be installed ### Basic Installation @@ -133,12 +133,6 @@ ZSH_THEME_RANDOM_CANDIDATES=( ) ``` -If you only know which themes you don't like, you can add them similarly to a blacklist: - -```shell -ZSH_THEME_RANDOM_BLACKLIST=(pygmalion tjkirch_mod) -``` - ### FAQ If you have some more questions or issues, you might find a solution in our [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ). diff --git a/zsh/.oh-my-zsh/custom/themes/powerlevel10k b/zsh/.oh-my-zsh/custom/themes/powerlevel10k deleted file mode 160000 index 05eaf81..0000000 --- a/zsh/.oh-my-zsh/custom/themes/powerlevel10k +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 05eaf8162c0a83c38bb210e888358d5bdc3aef90 diff --git a/zsh/.oh-my-zsh/lib/clipboard.zsh b/zsh/.oh-my-zsh/lib/clipboard.zsh index 122145f..5bba11d 100644 --- a/zsh/.oh-my-zsh/lib/clipboard.zsh +++ b/zsh/.oh-my-zsh/lib/clipboard.zsh @@ -3,23 +3,10 @@ # This file has support for doing system clipboard copy and paste operations # from the command line in a generic cross-platform fashion. # -# This is uses essentially the same heuristic as neovim, with the additional -# special support for Cygwin. -# See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121 -# -# - pbcopy, pbpaste (macOS) -# - cygwin (Windows running Cygwin) -# - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set) -# - xclip (if $DISPLAY is set) -# - xsel (if $DISPLAY is set) -# - lemonade (for SSH) https://github.com/pocke/lemonade -# - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/ -# - win32yank (Windows) -# - tmux (if $TMUX is set) -# -# Defines two functions, clipcopy and clippaste, based on the detected platform. -## -# +# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other +# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the +# "system clipboard", and the X Windows `xclip` command must be installed. + # clipcopy - Copy data to clipboard # # Usage: @@ -28,8 +15,41 @@ # # clipcopy - copies a file's contents to clipboard # -## -# +function clipcopy() { + emulate -L zsh + local file=$1 + if [[ $OSTYPE == darwin* ]]; then + if [[ -z $file ]]; then + pbcopy + else + cat $file | pbcopy + fi + elif [[ $OSTYPE == (cygwin|msys)* ]]; then + if [[ -z $file ]]; then + cat > /dev/clipboard + else + cat $file > /dev/clipboard + fi + else + if (( $+commands[xclip] )); then + if [[ -z $file ]]; then + xclip -in -selection clipboard + else + xclip -in -selection clipboard $file + fi + elif (( $+commands[xsel] )); then + if [[ -z $file ]]; then + xsel --clipboard --input + else + cat "$file" | xsel --clipboard --input + fi + else + print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 + return 1 + fi + fi +} + # clippaste - "Paste" data from clipboard to stdout # # Usage: @@ -47,61 +67,20 @@ # # # Paste to a file # clippaste > file.txt -# -function detect-clipboard() { +function clippaste() { emulate -L zsh - - if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then - function clipcopy() { pbcopy < "${1:-/dev/stdin}"; } - function clippaste() { pbpaste; } - elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then - function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } - function clippaste() { cat /dev/clipboard; } - elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then - function clipcopy() { wl-copy < "${1:-/dev/stdin}"; } - function clippaste() { wl-paste; } - elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then - function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } - function clippaste() { xclip -out -selection clipboard; } - elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then - function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; } - function clippaste() { xsel --clipboard --output; } - elif (( ${+commands[lemonade]} )); then - function clipcopy() { lemonade copy < "${1:-/dev/stdin}"; } - function clippaste() { lemonade paste; } - elif (( ${+commands[doitclient]} )); then - function clipcopy() { doitclient wclip < "${1:-/dev/stdin}"; } - function clippaste() { doitclient wclip -r; } - elif (( ${+commands[win32yank]} )); then - function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; } - function clippaste() { win32yank -o; } - elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then - function clipcopy() { termux-clipboard-set "${1:-/dev/stdin}"; } - function clippaste() { termux-clipboard-get; } - elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then - function clipcopy() { tmux load-buffer "${1:--}"; } - function clippaste() { tmux save-buffer -; } - elif [[ $(uname -r) = *icrosoft* ]]; then - function clipcopy() { clip.exe < "${1:-/dev/stdin}"; } - function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } + if [[ $OSTYPE == darwin* ]]; then + pbpaste + elif [[ $OSTYPE == (cygwin|msys)* ]]; then + cat /dev/clipboard else - function _retry_clipboard_detection_or_fail() { - local clipcmd="${1}"; shift - if detect-clipboard; then - "${clipcmd}" "$@" - else - print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 - return 1 - fi - } - function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; } - function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; } - return 1 + if (( $+commands[xclip] )); then + xclip -out -selection clipboard + elif (( $+commands[xsel] )); then + xsel --clipboard --output + else + print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2 + return 1 + fi fi } - -# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set, -# which is not really an error. If the user calls them, they will attempt to redetect -# (for example, perhaps the user has now installed xclip) and then either print an error -# or proceed successfully. -detect-clipboard || true diff --git a/zsh/.oh-my-zsh/lib/completion.zsh b/zsh/.oh-my-zsh/lib/completion.zsh index 43927a2..c7db2eb 100644 --- a/zsh/.oh-my-zsh/lib/completion.zsh +++ b/zsh/.oh-my-zsh/lib/completion.zsh @@ -41,8 +41,8 @@ fi zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories # Use caching so that commands like apt and dpkg complete are useable -zstyle ':completion:*' use-cache yes -zstyle ':completion:*' cache-path $ZSH_CACHE_DIR +zstyle ':completion::complete:*' use-cache 1 +zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR # Don't complete uninteresting users zstyle ':completion:*:*:*:users' ignored-patterns \ @@ -71,6 +71,3 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then zle -N expand-or-complete-with-dots bindkey "^I" expand-or-complete-with-dots fi - -# automatically load bash completion functions -autoload -U +X bashcompinit && bashcompinit diff --git a/zsh/.oh-my-zsh/lib/diagnostics.zsh b/zsh/.oh-my-zsh/lib/diagnostics.zsh index 001de42..9c9905e 100644 --- a/zsh/.oh-my-zsh/lib/diagnostics.zsh +++ b/zsh/.oh-my-zsh/lib/diagnostics.zsh @@ -192,19 +192,19 @@ function _omz_diag_dump_one_big_text() { command ls -ld ~/.oh* builtin echo builtin echo oh-my-zsh git state: - (builtin cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]") + (cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]") if [[ $verbose -ge 1 ]]; then - (builtin cd $ZSH && git reflog --date=default | command grep pull) + (cd $ZSH && git reflog --date=default | command grep pull) fi builtin echo if [[ -e $ZSH_CUSTOM ]]; then local custom_dir=$ZSH_CUSTOM if [[ -h $custom_dir ]]; then - custom_dir=$(builtin cd $custom_dir && pwd -P) + custom_dir=$(cd $custom_dir && pwd -P) fi builtin echo "oh-my-zsh custom dir:" builtin echo " $ZSH_CUSTOM ($custom_dir)" - (builtin cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print) + (cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print) builtin echo fi diff --git a/zsh/.oh-my-zsh/lib/functions.zsh b/zsh/.oh-my-zsh/lib/functions.zsh index 678e29c..61dfa47 100644 --- a/zsh/.oh-my-zsh/lib/functions.zsh +++ b/zsh/.oh-my-zsh/lib/functions.zsh @@ -3,12 +3,11 @@ function zsh_stats() { } function uninstall_oh_my_zsh() { - env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh" + env ZSH=$ZSH sh $ZSH/tools/uninstall.sh } function upgrade_oh_my_zsh() { - env ZSH="$ZSH" sh "$ZSH/tools/upgrade.sh" - command rm -rf "$ZSH/log/update.lock" + env ZSH=$ZSH sh $ZSH/tools/upgrade.sh } function take() { @@ -89,7 +88,7 @@ function default() { # 0 if the env variable exists, 3 if it was set # function env_default() { - [[ ${parameters[$1]} = *-export* ]] && return 0 + (( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0 export "$1=$2" && return 3 } diff --git a/zsh/.oh-my-zsh/lib/git.zsh b/zsh/.oh-my-zsh/lib/git.zsh index 00cb00b..2054fe2 100644 --- a/zsh/.oh-my-zsh/lib/git.zsh +++ b/zsh/.oh-my-zsh/lib/git.zsh @@ -199,12 +199,3 @@ function git_current_user_name() { function git_current_user_email() { command git config user.email 2>/dev/null } - -# Output the name of the root directory of the git repository -# Usage example: $(git_repo_name) -function git_repo_name() { - local repo_path - if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then - echo ${repo_path:t} - fi -} diff --git a/zsh/.oh-my-zsh/lib/grep.zsh b/zsh/.oh-my-zsh/lib/grep.zsh index a725e0f..abc1650 100644 --- a/zsh/.oh-my-zsh/lib/grep.zsh +++ b/zsh/.oh-my-zsh/lib/grep.zsh @@ -1,41 +1,28 @@ -__GREP_CACHE_FILE="$ZSH_CACHE_DIR"/grep-alias +# is x grep argument available? +grep-flag-available() { + echo | grep $1 "" >/dev/null 2>&1 +} -# See if there's a cache file modified in the last day -__GREP_ALIAS_CACHES=("$__GREP_CACHE_FILE"(Nm-1)) -if [[ -n "$__GREP_ALIAS_CACHES" ]]; then - source "$__GREP_CACHE_FILE" -else - grep-flags-available() { - command grep "$@" "" &>/dev/null <<< "" - } +GREP_OPTIONS="" - # Ignore these folders (if the necessary grep flags are available) - EXC_FOLDERS="{.bzr,CVS,.git,.hg,.svn,.idea,.tox}" - - # Check for --exclude-dir, otherwise check for --exclude. If --exclude - # isn't available, --color won't be either (they were released at the same - # time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007 - if grep-flags-available --color=auto --exclude-dir=.cvs; then - GREP_OPTIONS="--color=auto --exclude-dir=$EXC_FOLDERS" - elif grep-flags-available --color=auto --exclude=.cvs; then - GREP_OPTIONS="--color=auto --exclude=$EXC_FOLDERS" - fi - - if [[ -n "$GREP_OPTIONS" ]]; then - # export grep, egrep and fgrep settings - alias grep="grep $GREP_OPTIONS" - alias egrep="egrep $GREP_OPTIONS" - alias fgrep="fgrep $GREP_OPTIONS" - - # write to cache file if cache directory is writable - if [[ -w "$ZSH_CACHE_DIR" ]]; then - alias -L grep egrep fgrep >| "$__GREP_CACHE_FILE" - fi - fi - - # Clean up - unset GREP_OPTIONS EXC_FOLDERS - unfunction grep-flags-available +# color grep results +if grep-flag-available --color=auto; then + GREP_OPTIONS+=" --color=auto" fi -unset __GREP_CACHE_FILE __GREP_ALIAS_CACHES +# ignore VCS folders (if the necessary grep flags are available) +VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}" + +if grep-flag-available --exclude-dir=.cvs; then + GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS" +elif grep-flag-available --exclude=.cvs; then + GREP_OPTIONS+=" --exclude=$VCS_FOLDERS" +fi + +# export grep settings +alias grep="grep $GREP_OPTIONS" + +# clean up +unset GREP_OPTIONS +unset VCS_FOLDERS +unfunction grep-flag-available diff --git a/zsh/.oh-my-zsh/lib/history.zsh b/zsh/.oh-my-zsh/lib/history.zsh index 0ee8cfe..52e45bf 100644 --- a/zsh/.oh-my-zsh/lib/history.zsh +++ b/zsh/.oh-my-zsh/lib/history.zsh @@ -27,8 +27,8 @@ esac ## History file configuration [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history" -[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000 -[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000 +HISTSIZE=50000 +SAVEHIST=10000 ## History command configuration setopt extended_history # record timestamp of command in HISTFILE @@ -36,4 +36,5 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee 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/zsh/.oh-my-zsh/lib/misc.zsh b/zsh/.oh-my-zsh/lib/misc.zsh index a5d3af9..61571af 100644 --- a/zsh/.oh-my-zsh/lib/misc.zsh +++ b/zsh/.oh-my-zsh/lib/misc.zsh @@ -3,15 +3,15 @@ autoload -Uz is-at-least # *-magic is known buggy in some versions; disable if so if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then for d in $fpath; do - if [[ -e "$d/url-quote-magic" ]]; then - if is-at-least 5.1; then - autoload -Uz bracketed-paste-magic - zle -N bracketed-paste bracketed-paste-magic - fi - autoload -Uz url-quote-magic - zle -N self-insert url-quote-magic - break - fi + if [[ -e "$d/url-quote-magic" ]]; then + if is-at-least 5.1; then + autoload -Uz bracketed-paste-magic + zle -N bracketed-paste bracketed-paste-magic + fi + autoload -Uz url-quote-magic + zle -N self-insert url-quote-magic + break + fi done fi @@ -25,7 +25,7 @@ env_default 'LESS' '-R' alias _='sudo ' ## more intelligent acking for ubuntu users -if (( $+commands[ack-grep] )); then +if which ack-grep &> /dev/null; then alias afind='ack-grep -il' else alias afind='ack -il' diff --git a/zsh/.oh-my-zsh/lib/spectrum.zsh b/zsh/.oh-my-zsh/lib/spectrum.zsh index d5c22a8..312ab22 100644 --- a/zsh/.oh-my-zsh/lib/spectrum.zsh +++ b/zsh/.oh-my-zsh/lib/spectrum.zsh @@ -1,3 +1,4 @@ +#! /bin/zsh # A script to make using 256 colors in zsh less painful. # P.C. Shyamshankar # Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/ @@ -5,31 +6,32 @@ typeset -AHg FX FG BG FX=( - reset "%{%}" - bold "%{%}" no-bold "%{%}" - italic "%{%}" no-italic "%{%}" - underline "%{%}" no-underline "%{%}" - blink "%{%}" no-blink "%{%}" - reverse "%{%}" no-reverse "%{%}" + reset "%{%}" + bold "%{%}" no-bold "%{%}" + italic "%{%}" no-italic "%{%}" + underline "%{%}" no-underline "%{%}" + blink "%{%}" no-blink "%{%}" + reverse "%{%}" no-reverse "%{%}" ) for color in {000..255}; do - FG[$color]="%{[38;5;${color}m%}" - BG[$color]="%{[48;5;${color}m%}" + FG[$color]="%{[38;5;${color}m%}" + BG[$color]="%{[48;5;${color}m%}" done + +ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} + # Show all 256 colors with color number function spectrum_ls() { - local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} for code in {000..255}; do - print -P -- "$code: $FG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}" done } # Show all 256 colors where the background is set to specific color function spectrum_bls() { - local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris} for code in {000..255}; do - print -P -- "$code: $BG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}" + print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}" done } diff --git a/zsh/.oh-my-zsh/lib/termsupport.zsh b/zsh/.oh-my-zsh/lib/termsupport.zsh index 3f71eb0..f5e367f 100644 --- a/zsh/.oh-my-zsh/lib/termsupport.zsh +++ b/zsh/.oh-my-zsh/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi) + cygwin|xterm*|putty*|rxvt*|ansi) print -Pn "\e]2;$2:q\a" # set window name print -Pn "\e]1;$1:q\a" # set tab name ;; @@ -32,10 +32,10 @@ function title { # Try to use terminfo to set the title # If the feature is available set title if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then - echoti tsl - print -Pn "$1" - echoti fsl - fi + echoti tsl + print -Pn "$1" + echoti fsl + fi fi ;; esac @@ -50,52 +50,22 @@ fi # Runs before showing the prompt function omz_termsupport_precmd { - [[ "$DISABLE_AUTO_TITLE" == true ]] && return + emulate -L zsh + + if [[ "$DISABLE_AUTO_TITLE" == true ]]; then + return + fi + title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } # Runs before executing the command function omz_termsupport_preexec { - [[ "$DISABLE_AUTO_TITLE" == true ]] && return - emulate -L zsh setopt extended_glob - # split command into array of arguments - local -a cmdargs - cmdargs=("${(z)2}") - # if running fg, extract the command from the job description - if [[ "${cmdargs[1]}" = fg ]]; then - # get the job id from the first argument passed to the fg command - local job_id jobspec="${cmdargs[2]#%}" - # logic based on jobs arguments: - # http://zsh.sourceforge.net/Doc/Release/Jobs-_0026-Signals.html#Jobs - # https://www.zsh.org/mla/users/2007/msg00704.html - case "$jobspec" in - <->) # %number argument: - # use the same passed as an argument - job_id=${jobspec} ;; - ""|%|+) # empty, %% or %+ argument: - # use the current job, which appears with a + in $jobstates: - # suspended:+:5071=suspended (tty output) - job_id=${(k)jobstates[(r)*:+:*]} ;; - -) # %- argument: - # use the previous job, which appears with a - in $jobstates: - # suspended:-:6493=suspended (signal) - job_id=${(k)jobstates[(r)*:-:*]} ;; - [?]*) # %?string argument: - # use $jobtexts to match for a job whose command *contains* - job_id=${(k)jobtexts[(r)*${(Q)jobspec}*]} ;; - *) # %string argument: - # use $jobtexts to match for a job whose command *starts with* - job_id=${(k)jobtexts[(r)${(Q)jobspec}*]} ;; - esac - - # override preexec function arguments with job command - if [[ -n "${jobtexts[$job_id]}" ]]; then - 1="${jobtexts[$job_id]}" - 2="${jobtexts[$job_id]}" - fi + if [[ "$DISABLE_AUTO_TITLE" == true ]]; then + return fi # cmd name only, or if this is sudo or ssh, the next cmd @@ -121,13 +91,12 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then function update_terminalapp_cwd() { emulate -L zsh - # Percent-encode the host and path names. - local URL_HOST URL_PATH - URL_HOST="$(omz_urlencode -P $HOST)" || return 1 - URL_PATH="$(omz_urlencode -P $PWD)" || return 1 + # Percent-encode the pathname. + local URL_PATH="$(omz_urlencode -P $PWD)" + [[ $? != 0 ]] && return 1 # Undocumented Terminal.app-specific control sequence - printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH" + printf '\e]7;%s\a' "file://$HOST$URL_PATH" } # Use a precmd hook instead of a chpwd hook to avoid contaminating output diff --git a/zsh/.oh-my-zsh/oh-my-zsh.sh b/zsh/.oh-my-zsh/oh-my-zsh.sh index 4b4191c..c3fae6e 100644 --- a/zsh/.oh-my-zsh/oh-my-zsh.sh +++ b/zsh/.oh-my-zsh/oh-my-zsh.sh @@ -4,6 +4,11 @@ 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 ZSH_CACHE_DIR=$ZSH_CACHE_DIR DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh @@ -56,17 +61,6 @@ if [ -z "$ZSH_COMPDUMP" ]; then ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" fi -# Construct zcompdump OMZ metadata -zcompdump_revision="#omz revision: $(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null)" -zcompdump_fpath="#omz fpath: $fpath" - -# Delete the zcompdump file if OMZ zcompdump metadata changed -if ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null \ - || ! command grep -q -Fx "$zcompdump_fpath" "$ZSH_COMPDUMP" 2>/dev/null; then - command rm -f "$ZSH_COMPDUMP" - zcompdump_refresh=1 -fi - if [[ $ZSH_DISABLE_COMPFIX != true ]]; then source $ZSH/lib/compfix.zsh # If completion insecurities exist, warn the user @@ -78,19 +72,6 @@ else compinit -u -C -d "${ZSH_COMPDUMP}" fi -# Append zcompdump metadata if missing -if (( $zcompdump_refresh )); then - # Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error - # See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489 - tee -a "$ZSH_COMPDUMP" &>/dev/null <` as well as ``. - -| Function | Command | -| ------------------------- | --------------------------------- | -| ardu [URL or revision_id] | `arc diff --update` [revision_id] | -| arpa [URL or revision_id] | `arc patch` [revision_id] | diff --git a/zsh/.oh-my-zsh/plugins/arcanist/arcanist.plugin.zsh b/zsh/.oh-my-zsh/plugins/arcanist/arcanist.plugin.zsh index 88e6713..3f4eb07 100644 --- a/zsh/.oh-my-zsh/plugins/arcanist/arcanist.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/arcanist/arcanist.plugin.zsh @@ -9,29 +9,13 @@ alias arco='arc cover' alias arci='arc commit' alias ard='arc diff' -alias ardc='arc diff --create' alias ardnu='arc diff --nounit' alias ardnupc='arc diff --nounit --plan-changes' alias ardpc='arc diff --plan-changes' -alias ardp='arc diff --preview' # creates a new diff in the phab interface alias are='arc export' alias arh='arc help' alias arl='arc land' alias arli='arc lint' alias arls='arc list' - -# -# Functions -# (sorted alphabetically) -# - -ardu() { - # Both `ardu https://arcanist-url.com/`, and `ardu ` work. - arc diff --update "${1:t}" -} - -arpa() { - # Both `arpa https://arcanist-url.com/`, and `arpa ` work. - arc patch "${1:t}" -} +alias arpa='arc patch' diff --git a/zsh/.oh-my-zsh/plugins/archlinux/README.md b/zsh/.oh-my-zsh/plugins/archlinux/README.md index 5882c76..ff2b6a4 100644 --- a/zsh/.oh-my-zsh/plugins/archlinux/README.md +++ b/zsh/.oh-my-zsh/plugins/archlinux/README.md @@ -1,13 +1,5 @@ # Archlinux plugin -This plugin adds some aliases and functions to work with Arch Linux. - -To use it, add `archlinux` to the plugins array in your zshrc file: - -```zsh -plugins=(... archlinux) -``` - ## Features #### YAY @@ -127,7 +119,7 @@ plugins=(... archlinux) | 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 -F | 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 | diff --git a/zsh/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh b/zsh/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh index 2d0c51b..e0101c7 100644 --- a/zsh/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh @@ -149,7 +149,7 @@ 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 -F' +alias pacfiles='pacman -Fs' alias pacls='pacman -Ql' alias pacown='pacman -Qo' @@ -208,7 +208,7 @@ function pacmansignkeys() { if (( $+commands[xdg-open] )); then function pacweb() { pkg="$1" - infos="$(LANG=C pacman -Si "$pkg")" + infos="$(pacman -Si "$pkg")" if [[ -z "$infos" ]]; then return fi diff --git a/zsh/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh b/zsh/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh index c386d57..38b2255 100644 --- a/zsh/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/asdf/asdf.plugin.zsh @@ -3,7 +3,7 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" ASDF_COMPLETIONS="$ASDF_DIR/completions" # If not found, check for Homebrew package -if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && (( $+commands[brew] )); then +if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then ASDF_DIR="$(brew --prefix asdf)" ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d" fi diff --git a/zsh/.oh-my-zsh/plugins/autoenv/README.md b/zsh/.oh-my-zsh/plugins/autoenv/README.md index 5dfb5fb..de38817 100644 --- a/zsh/.oh-my-zsh/plugins/autoenv/README.md +++ b/zsh/.oh-my-zsh/plugins/autoenv/README.md @@ -7,14 +7,8 @@ To use it, add `autoenv` to the plugins array in your zshrc file: ```zsh plugins=(... autoenv) ``` - -## Functions - -* `use_env()`: creates and/or activates a virtualenv. For use in `.env` files. - See the source code for details. - ## Requirements In order to make this work, you will need to have the autoenv installed. -More info on the usage and install at [the project's homepage](https://github.com/inishchith/autoenv). +More info on the usage and install: https://github.com/inishchith/autoenv diff --git a/zsh/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh index bd03cf4..3c1b0fa 100644 --- a/zsh/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh @@ -1,39 +1,12 @@ -# Initialization: activate autoenv or report its absence +# Activates autoenv or reports its failure () { -local d autoenv_dir install_locations if ! type autoenv_init >/dev/null; then - # Check if activate.sh is in $PATH - if (( $+commands[activate.sh] )); then - autoenv_dir="${commands[activate.sh]:h}" - fi - - # Locate autoenv installation - if [[ -z $autoenv_dir ]]; then - install_locations=( - ~/.autoenv - ~/.local/bin - /usr/local/opt/autoenv - /usr/local/bin - /usr/share/autoenv-git - ~/Library/Python/bin - ) - for d ( $install_locations ); do - if [[ -e $d/activate.sh ]]; then - autoenv_dir=$d - break - fi - done - fi - - # Look for Homebrew path as a last resort - if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then - d=$(brew --prefix)/opt/autoenv + for d (~/.autoenv ~/.local/bin /usr/local/opt/autoenv /usr/local/bin); do if [[ -e $d/activate.sh ]]; then autoenv_dir=$d + break fi - fi - - # Complain if autoenv is not installed + done if [[ -z $autoenv_dir ]]; then cat <&2 -------- AUTOENV --------- @@ -44,7 +17,6 @@ In the meantime the autoenv plugin is DISABLED. END return 1 fi - # Load autoenv source $autoenv_dir/activate.sh fi } @@ -55,17 +27,17 @@ fi # It only performs an action if the requested virtualenv is not the current one. use_env() { - local venv - venv="$1" - if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then - if workon | grep -q "$venv"; then - workon "$venv" - else - echo -n "Create virtualenv $venv now? (Yn) " - read answer - if [[ "$answer" == "Y" ]]; then - mkvirtualenv "$venv" - fi + typeset venv + venv="$1" + if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then + if workon | grep -q "$venv"; then + workon "$venv" + else + echo -n "Create virtualenv $venv now? (Yn) " + read answer + if [[ "$answer" == "Y" ]]; then + mkvirtualenv "$venv" + fi + fi fi - fi } diff --git a/zsh/.oh-my-zsh/plugins/autojump/README.md b/zsh/.oh-my-zsh/plugins/autojump/README.md index 750ff56..18ff793 100644 --- a/zsh/.oh-my-zsh/plugins/autojump/README.md +++ b/zsh/.oh-my-zsh/plugins/autojump/README.md @@ -8,4 +8,4 @@ To use it, add `autojump` to the plugins array in your zshrc file: plugins=(... autojump) ``` -**Note:** you have to [install autojump](https://github.com/wting/autojump#installation) first. +More info on the usage: https://github.com/wting/autojump diff --git a/zsh/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh b/zsh/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh index f40b0e9..d80c888 100644 --- a/zsh/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh @@ -29,6 +29,6 @@ if (( ! found && $+commands[brew] )); then fi fi -(( ! found )) && echo '[oh-my-zsh] autojump not found. Please install it first.' +(( ! found )) && echo '[oh-my-zsh] autojump script not found' unset autojump_paths file found diff --git a/zsh/.oh-my-zsh/plugins/aws/aws.plugin.zsh b/zsh/.oh-my-zsh/plugins/aws/aws.plugin.zsh index 4b54464..5673113 100644 --- a/zsh/.oh-my-zsh/plugins/aws/aws.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/aws/aws.plugin.zsh @@ -31,12 +31,12 @@ function aws_change_access_key() { echo Insert the credentials when asked. asp "$1" || return 1 - AWS_PAGER="" aws iam create-access-key - AWS_PAGER="" aws configure --profile "$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_PAGER="" aws iam list-access-keys + aws iam list-access-keys } function aws_profiles() { @@ -62,45 +62,36 @@ fi # Load awscli completions -# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back -if [[ -x /usr/local/bin/aws_completer ]]; then - autoload -Uz bashcompinit && bashcompinit - complete -C aws_completer aws -else - function _awscli-homebrew-installed() { - # check if Homebrew is installed - (( $+commands[brew] )) || return 1 +function _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 - # NixOS - elif [[ -e "${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh" ]]; then - _aws_zsh_completer_path="${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh" - # RPM - else - _aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh - fi + # 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 +} - [[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path - unset _aws_zsh_completer_path _brew_prefix +# 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/zsh/.oh-my-zsh/plugins/battery/battery.plugin.zsh b/zsh/.oh-my-zsh/plugins/battery/battery.plugin.zsh index 755ec8d..6b66847 100644 --- a/zsh/.oh-my-zsh/plugins/battery/battery.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/battery/battery.plugin.zsh @@ -11,21 +11,22 @@ # Modified to add support for FreeBSD # ########################################### -if [[ "$OSTYPE" = darwin* ]]; then - - function battery_is_charging() { - ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes' - } +if [[ "$OSTYPE" = darwin* ]] ; then function battery_pct() { - local battery_status="$(ioreg -rc AppleSmartBattery)" - local -i capacity=$(sed -n -e '/MaxCapacity/s/^.*"MaxCapacity"\ =\ //p' <<< $battery_status) - local -i current=$(sed -n -e '/CurrentCapacity/s/^.*"CurrentCapacity"\ =\ //p' <<< $battery_status) - echo $(( current * 100 / capacity )) + local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" + typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //') + typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //') + integer i=$(((currentcapacity/maxcapacity) * 100)) + echo $i + } + + function plugged_in() { + [ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ] } function battery_pct_remaining() { - if battery_is_charging; then + if plugged_in ; then echo "External Power" else battery_pct @@ -34,9 +35,9 @@ if [[ "$OSTYPE" = darwin* ]]; then function battery_time_remaining() { local smart_battery_status="$(ioreg -rc "AppleSmartBattery")" - if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then - timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') - if [ $timeremaining -gt 720 ]; then + if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then + timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //') + if [ $timeremaining -gt 720 ] ; then echo "::" else echo "~$((timeremaining / 60)):$((timeremaining % 60))" @@ -47,36 +48,39 @@ if [[ "$OSTYPE" = darwin* ]]; then } function battery_pct_prompt () { - local battery_pct color - if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then - battery_pct=$(battery_pct_remaining) - if [[ $battery_pct -gt 50 ]]; then + if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then + b=$(battery_pct_remaining) + if [ $b -gt 50 ] ; then color='green' - elif [[ $battery_pct -gt 20 ]]; then + elif [ $b -gt 20 ] ; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}" + echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}" else echo "∞" fi } -elif [[ "$OSTYPE" = freebsd* ]]; then + function battery_is_charging() { + [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] + } + +elif [[ "$OSTYPE" = freebsd* ]] ; then function battery_is_charging() { [[ $(sysctl -n hw.acpi.battery.state) -eq 2 ]] } function battery_pct() { - if (( $+commands[sysctl] )); then - sysctl -n hw.acpi.battery.life + if (( $+commands[sysctl] )) ; then + echo "$(sysctl -n hw.acpi.battery.life)" fi } function battery_pct_remaining() { - if ! battery_is_charging; then + if [ ! $(battery_is_charging) ] ; then battery_pct else echo "External Power" @@ -84,46 +88,45 @@ elif [[ "$OSTYPE" = freebsd* ]]; then } function battery_time_remaining() { - local remaining_time remaining_time=$(sysctl -n hw.acpi.battery.time) - if [[ $remaining_time -ge 0 ]]; then - ((hour = $remaining_time / 60 )) - ((minute = $remaining_time % 60 )) - printf %02d:%02d $hour $minute + if [[ $remaining_time -ge 0 ]] ; then + # calculation from https://www.unix.com/shell-programming-and-scripting/23695-convert-minutes-hours-minutes-seconds.html + ((hour=$remaining_time/60)) + ((minute=$remaining_time-$hour*60)) + echo $hour:$minute fi } function battery_pct_prompt() { - local battery_pct color - battery_pct=$(battery_pct_remaining) - if battery_is_charging; then - echo "∞" - else - if [[ $battery_pct -gt 50 ]]; then + b=$(battery_pct_remaining) + if [ ! $(battery_is_charging) ] ; then + if [ $b -gt 50 ] ; then color='green' - elif [[ $battery_pct -gt 20 ]]; then + elif [ $b -gt 20 ] ; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" + echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" + else + echo "∞" fi } -elif [[ "$OSTYPE" = linux* ]]; then +elif [[ "$OSTYPE" = linux* ]] ; then function battery_is_charging() { - ! acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -q '^Battery.*Discharging' + ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] } function battery_pct() { - if (( $+commands[acpi] )); then - acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Full|(Disc|C)harging)' | cut -f2 -d ',' | tr -cd '[:digit:]' + if (( $+commands[acpi] )) ; then + echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')" fi } function battery_pct_remaining() { - if ! battery_is_charging; then + if [ ! $(battery_is_charging) ] ; then battery_pct else echo "External Power" @@ -131,81 +134,76 @@ elif [[ "$OSTYPE" = linux* ]]; then } function battery_time_remaining() { - if ! battery_is_charging; then - acpi 2>/dev/null | command grep -v "rate information unavailable" | cut -f3 -d ',' + if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + echo $(acpi 2>/dev/null | cut -f3 -d ',') fi } function battery_pct_prompt() { - local battery_pct color - battery_pct=$(battery_pct_remaining) - if battery_is_charging; then - echo "∞" - else - if [[ $battery_pct -gt 50 ]]; then + b=$(battery_pct_remaining) + if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then + if [ $b -gt 50 ] ; then color='green' - elif [[ $battery_pct -gt 20 ]]; then + elif [ $b -gt 20 ] ; then color='yellow' else color='red' fi - echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}" + echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}" + else + echo "∞" fi } else # Empty functions so we don't cause errors in prompts - function battery_is_charging { false } - function battery_pct \ - battery_pct_remaining \ - battery_time_remaining \ - battery_pct_prompt { } + function battery_pct_remaining() { + } + + function battery_time_remaining() { + } + + function battery_pct_prompt() { + } fi function battery_level_gauge() { - local gauge_slots=${BATTERY_GAUGE_SLOTS:-10} - local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))} - local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))} - local color_green=${BATTERY_COLOR_GREEN:-%F{green}} - local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}} - local color_red=${BATTERY_COLOR_RED:-%F{red}} - local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}} - local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['} - local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'} - local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'} - local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'} - local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow} - local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'} + local gauge_slots=${BATTERY_GAUGE_SLOTS:-10}; + local green_threshold=${BATTERY_GREEN_THRESHOLD:-6}; + local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-4}; + local color_green=${BATTERY_COLOR_GREEN:-%F{green}}; + local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}}; + local color_red=${BATTERY_COLOR_RED:-%F{red}}; + local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}}; + local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['}; + local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'}; + local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}; + local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}; + local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}; + local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}; - local battery_remaining_percentage=$(battery_pct) - local filled empty gauge_color + local battery_remaining_percentage=$(battery_pct); if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then - filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 )) - empty=$(( $gauge_slots - $filled )) + local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots))); + local empty=$(($gauge_slots - $filled)); - if [[ $filled -gt $green_threshold ]]; then - gauge_color=$color_green - elif [[ $filled -gt $yellow_threshold ]]; then - gauge_color=$color_yellow - else - gauge_color=$color_red + if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green; + elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow; + else local gauge_color=$color_red; fi else - filled=$gauge_slots - empty=0 - filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'} + local filled=$gauge_slots; + local empty=0; + filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}; fi - local charging=' ' - battery_is_charging && charging=$charging_symbol + local charging=' ' && battery_is_charging && charging=$charging_symbol; - # Charging status and prefix - print -n ${charging_color}${charging}${color_reset}${battery_prefix}${gauge_color} - # Filled slots - [[ $filled -gt 0 ]] && printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled} - # Empty slots + printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%} + printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled} [[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty} - # Suffix - print -n ${color_reset}${battery_suffix}${color_reset} + printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%} } + + diff --git a/zsh/.oh-my-zsh/plugins/bower/README.md b/zsh/.oh-my-zsh/plugins/bower/README.md index 8877fbd..743b6a0 100644 --- a/zsh/.oh-my-zsh/plugins/bower/README.md +++ b/zsh/.oh-my-zsh/plugins/bower/README.md @@ -4,7 +4,7 @@ This plugin adds completion for [Bower](https://bower.io/) and a few useful alia To use it, add `bower` to the plugins array in your zshrc file: -```zsh +``` plugins=(... bower) ``` @@ -15,3 +15,4 @@ plugins=(... bower) | 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/zsh/.oh-my-zsh/plugins/brew/README.md b/zsh/.oh-my-zsh/plugins/brew/README.md index 44af052..c129a76 100644 --- a/zsh/.oh-my-zsh/plugins/brew/README.md +++ b/zsh/.oh-my-zsh/plugins/brew/README.md @@ -3,27 +3,19 @@ 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: - -```zsh +``` plugins=(... brew) ``` ## Aliases -| Alias | Command | Description | -|----------|-------------------------------------------------------------|---------------------------------------------------------------------| -| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | -| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | -| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | -| `bubo` | `brew update && brew outdated` | Update Homebrew and all formulae, then list outdated formulae. | -| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae, then run cleanup. | -| `bubu` | `bubo && bubc` | Do the last two operations above. | -| `bcubo` | `brew update && brew cask outdated` | Update Homebrew and alll formulae, then list outdated casks. | -| `bcubc` | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Update outdated casks, then run cleanup. | - -## Completion - -With the release of Homebrew 1.0, they decided to bundle the zsh completion as part of the -brew installation, so we no longer ship it with the brew plugin; now it only has brew -aliases. If you find that brew completion no longer works, make sure you have your Homebrew -installation fully up to date. +| 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/zsh/.oh-my-zsh/plugins/brew/brew.plugin.zsh b/zsh/.oh-my-zsh/plugins/brew/brew.plugin.zsh index fdea76c..cfbaa34 100644 --- a/zsh/.oh-my-zsh/plugins/brew/brew.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/brew/brew.plugin.zsh @@ -6,3 +6,19 @@ 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: + cat <<-'EOF' + + With the advent of their 1.0 release, Homebrew has decided to bundle + the zsh completion as part of the brew installation, so we no longer + ship it with the brew plugin; now it only has brew aliases. + + If you find that brew completion no longer works, make sure you have + your Homebrew installation fully up to date. + + You will only see this message once. + EOF + print -P '%f' +fi diff --git a/zsh/.oh-my-zsh/plugins/bundler/README.md b/zsh/.oh-my-zsh/plugins/bundler/README.md index a3bceb0..9f211b0 100644 --- a/zsh/.oh-my-zsh/plugins/bundler/README.md +++ b/zsh/.oh-my-zsh/plugins/bundler/README.md @@ -1,9 +1,7 @@ # Bundler -- Adds completion for basic bundler commands - -- Adds short aliases for common bundler commands - - `ba` aliased to `bundle add` +- adds completion for basic bundler commands +- adds short aliases for common bundler commands - `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` @@ -12,12 +10,9 @@ - `bout` aliased to `bundle outdated` - `bu` aliased to `bundle update` - `bi` aliased to `bundle install --jobs=` (only for bundler `>= 1.4.0`) - - `bcn` aliased to `bundle clean` - - `bck` aliased to `bundle check` - -- Adds a wrapper for common gems: - - Looks for a binstub under `./bin/` and executes it (if present) - - Calls `bundle exec ` otherwise +- adds a wrapper for common gems: + - looks for a binstub under `./bin/` and executes it (if present) + - calls `bundle exec ` otherwise 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`, `rubocop`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`. @@ -29,24 +24,20 @@ Please use the exact name of the executable and not the gem name. ### Add additional gems to be wrapped Add this before the plugin-list in your `.zshrc`: - ```sh BUNDLED_COMMANDS=(rubocop) plugins=(... bundler ...) ``` - This will add the wrapper for the `rubocop` gem (i.e. the executable). ### Exclude gems from being wrapped Add this before the plugin-list in your `.zshrc`: - ```sh UNBUNDLED_COMMANDS=(foreman spin) plugins=(... bundler ...) ``` - This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped. ## Excluded gems diff --git a/zsh/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh b/zsh/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh index 65b0ffa..665cb5e 100644 --- a/zsh/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh @@ -1,4 +1,3 @@ -alias ba="bundle add" alias be="bundle exec" alias bl="bundle list" alias bp="bundle package" @@ -7,7 +6,6 @@ alias bout="bundle outdated" alias bu="bundle update" alias bi="bundle_install" alias bcn="bundle clean" -alias bck="bundle check" bundled_commands=( annotate diff --git a/zsh/.oh-my-zsh/plugins/cake/README.md b/zsh/.oh-my-zsh/plugins/cake/README.md index 2c2a280..aad92a3 100644 --- a/zsh/.oh-my-zsh/plugins/cake/README.md +++ b/zsh/.oh-my-zsh/plugins/cake/README.md @@ -10,6 +10,6 @@ plugins=(... cake) ## Note -This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory. +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/zsh/.oh-my-zsh/plugins/catimg/README.md b/zsh/.oh-my-zsh/plugins/catimg/README.md index 8f26880..42b59a6 100644 --- a/zsh/.oh-my-zsh/plugins/catimg/README.md +++ b/zsh/.oh-my-zsh/plugins/catimg/README.md @@ -2,16 +2,28 @@ Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg) -To use it, add `catimg` to the plugins array in your zshrc file: - -```zsh -plugins=(... 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. Restart the shell or restart your Terminal session: + + ```console + $ exec zsh + $ + ``` + ## Functions | Function | Description | diff --git a/zsh/.oh-my-zsh/plugins/chucknorris/README.md b/zsh/.oh-my-zsh/plugins/chucknorris/README.md index 35f9891..be7b97e 100644 --- a/zsh/.oh-my-zsh/plugins/chucknorris/README.md +++ b/zsh/.oh-my-zsh/plugins/chucknorris/README.md @@ -1,6 +1,6 @@ # chucknorris -Chuck Norris fortunes plugin for oh-my-zsh. Perfectly suitable as MOTD. +Chuck Norris fortunes plugin for oh-my-zsh **Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff) @@ -10,31 +10,11 @@ To use it add `chucknorris` to the plugins array in you zshrc file. plugins=(... chucknorris) ``` -## Usage + +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 | - -Example: output of `chuck_cow`: - -``` -Last login: Fri Jan 30 23:12:26 on ttys001 - ______________________________________ -( When Chuck Norris plays Monopoly, it ) -( affects the actual world economy. ) - -------------------------------------- - o ^__^ - o (oo)\_______ - (__)\ )\/\ - ||----w | - || || -``` - -## Requirements - -- `fortune` -- `cowsay` if using `chuck_cow` - -Available via homebrew, apt, ... diff --git a/zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris b/zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris index 1f4ca7a..2a13b06 100644 --- a/zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris +++ b/zsh/.oh-my-zsh/plugins/chucknorris/fortunes/chucknorris @@ -1,636 +1,2544 @@ -King Kong climbed the Empire State building in fear of Chuck Norris who was downstairs at the time. -% -"2012" is code for, Chuck Norris when he is pissed. -% -"The Big Chuck Norris Roundhouse-Kick Theory" -% -"The wind cries Chuck Norris" -% -"Walker Texas Ranger: The Movie 3-D" was considered by Warner Brothers; however the technology to create the visual effects will never be possible. -% -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. -% -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. -% -Achievement Unlocked: Chuck Norris of Death -% -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. -% -Aliens fear that Chuck Norris might abduct them. -% -An angry glare from Chuck Norris is known to kill on the spot. -% -Behind every successful man is Chuck Norris -% -Beware of dogs... Dogs, beware of Chuck Norris. -% -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! -% -CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. -% -Casinos pay Chuck Norris not to play at anything or wish anyone good luck. -% -Chuck Norris - the new standard. -% -Chuck Norris CAN balance the light-switch between ON and OFF. -% -Chuck Norris CAN believe it's not butter -% -Chuck Norris CAN spell with an I before E even after C. -% -Chuck Norris Can Play the Theme from the Twilight Zone with His Beard -% -Chuck Norris Can Power Solar Panels. At Night. -% -Chuck Norris Watches "the Nat.Geo. Specials" on Discovery Channel -% -Chuck Norris bowled a 301 after constructing another pin out of his beard hair -% -Chuck Norris burnt a fire proof vest, UNDERWATER! -% -Chuck Norris can French kiss his elbow. -% -Chuck Norris can bake in a Freezer. -% -Chuck Norris can defuse bomb even if he cut the wrong wire -% -Chuck Norris can dig a hole in air. -% -Chuck Norris can divide by zero. -% -Chuck Norris can do a regime change with a roundhouse kick. -% -Chuck Norris can fit 10 gallons of water in a 5 gallon water bucket -% -Chuck Norris can grill a popsicle -% -Chuck Norris can lead a horse to water AND make it drink. -% -Chuck Norris can make his own megazord "The Chuck Norris Roundhouse Kickers Ultimate Super Awesome Megazord" -% -Chuck Norris can milk an alligator -% -Chuck Norris can play the death waltz with his chin. -% -Chuck Norris can roundhouse kick someone through a window without breaking the glass -% -Chuck Norris can roundhouse-kick round houses into squares. -% -Chuck Norris can rub two fires together and make a stick! -% -Chuck Norris can see in 3D with just one eye. -% -Chuck Norris can shoot a person 28 times with an unloaded gun. -% -Chuck Norris can slam a revolving door. -% -Chuck Norris can terminate a repeating decimal. -% -Chuck Norris can turn toast back into bread -% -Chuck Norris can win a game of Connect Four in only three moves. -% -Chuck Norris can win in a top spinning tournament with a cube -% -Chuck Norris can't get fired by Donald Trump -% -Chuck Norris can't perform Hadoukens, he IS a Hadouken -% -Chuck Norris checks under his bed for Fedor Emelianenko because he takes Fedor to the vet regularly. -% -Chuck Norris counted to infinity - twice. -% -Chuck Norris created Heavy Metal when he was upset -% -Chuck Norris does not get frostbite. Chuck Norris bites frost. -% -Chuck Norris does not have a cell phone because he hears everything -% -Chuck Norris does not sleep. He waits. -% -Chuck Norris does not teabag the ladies. He potato-sacks them. -% -Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint. -% -Chuck Norris doesn't call the wrong number, you just answer the wrong phone. -% -Chuck Norris doesn't cheat death, he beats it fair and square. -% -Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. -% -Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it -% -Chuck Norris doesn't exhale. The air runs desperately scared out of his lungs. -% -Chuck Norris doesn't fight. He gives motivational seminars to die on their own to avoid a roundhouse kick to the face. -% -Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. -% -Chuck Norris doesn't let it go. -% -Chuck Norris doesn't like Mudkipz -% -Chuck Norris doesn't look for fun. The fun looks for Chuck Norris. -% -Chuck Norris doesn't need a bulletproof vest to be bulletproof -% -Chuck Norris doesn't need a bulletproof vest. He catches them with his bare hands. -% -Chuck Norris doesn't need air, he is air -% -Chuck Norris doesn't need sunglasses, the sun needs Chuck Norris glasses -% -Chuck Norris doesn't need to brush his teeth, his spit acts as a bleach. +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. % -Chuck Norris doesn't read. He just stares at the book until he gets the information he wants. -% -Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down! -% -Chuck Norris doesn't brew up tea. He sucks the bag. -% -Chuck Norris doesn't eat salad, he eats vegetarians -% -Chuck Norris doesn't wash his clothes, he disembowels them. -% -Chuck Norris doesn't wear a watch. HE decides what time it is. -% -Chuck Norris doesn't carry a list. He always knows what to do. -% -Chuck Norris drives an ice cream truck covered in human skulls. -% -Chuck Norris drowned a man ON LAND. -% -Chuck Norris fed the Hunger Games -% -Chuck Norris found the hay in the needle stack. -% -Chuck Norris found the last digit of pie -% -Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife -% -Chuck Norris has a battle cruiser AND a car. -% -Chuck Norris has killed the Dead Sea -% -Chuck Norris has made a 148 break a snooker. -% -Chuck Norris has two speeds. Walk, and Kill. -% -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 is Chuck Norris -% -Chuck Norris is allowed two carry-ons. -% -Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. -% -Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick. -% -Chuck Norris is entitled to his own facts. -% -Chuck Norris is my Homeboy. -% -Chuck Norris is overra... -% -Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. -% -Chuck Norris is so hard, he uses diamonds as stress balls. -% -Chuck Norris is so scary he makes Sharks swim backwards away from him -% -Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. -% -Chuck Norris is the ghost in paranormal activity. -% -Chuck Norris is the life of parties he doesn't attend. -% -Chuck Norris is the meaning of life. Too bad he's also the meaning of death. -% -Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. -% -Chuck Norris is the only one who can tear a facebook page! -% -Chuck Norris is the reason that the world will end in 2012. He was getting bored with the Earth -% -Chuck Norris is the reason tumbleweeds tumble -% -Chuck Norris is the reason why Waldo is hiding. -% -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 isn't allowed at the zoo because when he's there the animals are terriefied to come out their cages -% -Chuck Norris isn't appropriate...appropriate isn't Chuck Norris -% -Chuck Norris killed Kemper -% -Chuck Norris likes everyone on the earth, cause everyone he didn't like... Is dead... -% -Chuck Norris made a statue bleed. -% -Chuck Norris made the big bang just by clicking his fingers -% -Chuck Norris never trains, because he's Chuck Norris. -% -Chuck Norris once asked a man to turn down his music, he refused, that man's baby was born deaf. -% -Chuck Norris once cried just to see what it was like. The end result was the creation of life. -% -Chuck Norris once cut a knife with a stick of butter. -% -Chuck Norris once got a 200 yard punt return -% -Chuck Norris once had a pet monkey........his name was KING KONG -% -Chuck Norris once had a street named after him. But the name removed at once, because nobody crosses Chuck Norris, and lives -% -Chuck Norris once had a weak moment, just to know what it felt like. -% -Chuck Norris once played Duck Duck Goose with a group of Kindergarteners. Only one kid made it to first grade -% -Chuck Norris once proved p^~p by induction on his beard hairs. -% -Chuck Norris once punched the ground to stop an earthquake. The resulting aftershock caused the BP oil spill -% -Chuck Norris once round-house kicked a salesman. Over the phone. -% -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 rounhouse kicked a football ...... it is now considered as a planet -% -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 once thought he was wrong. He was, however, mistaken. -% -Chuck Norris once tried to teach a fat, stupid kid Martial Arts. Unsuccessfully. The kid grew up to be Steven Seagal. -% -Chuck Norris once walked down a street with his fists in his pockets. He was then arrested for concealing two deadly weapons. -% -Chuck Norris once won the tour de france riding a " big wheel" -% -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 owns all number 1 pencils. -% -Chuck Norris pees Adamantium -% -Chuck Norris play's Texas hold em with Zeus, every second Wednesday of the month -% -Chuck Norris played "Got your Nose" with Voldemort and won. -% -Chuck Norris played the game of thrones and won -% -Chuck Norris protects his body guards. -% -Chuck Norris rolled a 20 on a 6 sided die. -% -Chuck Norris roundhouse kicks people in the face first and asks questions later. -% -Chuck Norris sent a BBM to an iphone. -% -Chuck Norris shops at Sam's Club, but leaves without having his receipt checked -% -Chuck Norris shot a man with a knife -% -Chuck Norris sleeps in Seattle. -% -Chuck Norris splattered tiger blood and Adonis' dna on Charlie Sheen with 1 roundhouse kick! -% -Chuck Norris started Chuck Norris. -% -Chuck Norris starts his day with 6 live chickens two cows, three pigs and a boiling hot cup of pure fury -% -Chuck Norris thretened to kill Michael Jackson, MJ got so scared to turned white. -% -Chuck Norris told me to put this here. -% -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 uses pepper spray to spice up his steaks. -% -Chuck Norris was heard in a soundproof room! -% -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 was originally in Mortal Kombat, but that version was deleted because no one can beat Chuck Norris in a fight. -% -Chuck Norris was the image used for Papa Smurf. -% -Chuck Norris was the reason why the Great Wall of China was constructed. It failed miserably. -% -Chuck Norris was what Willis was talking about. -% -Chuck Norris wasn't born on his birthday -% -Chuck Norris watched the first steps on the moon... From his summer home on Mars -% -Chuck Norris went up the creek without a paddle... or a canoe -% -Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. -% -Chuck Norris wins NASCAR races with all right turns. -% -Chuck Norris won a stepdance contest by standing on his hands -% -Chuck Norris yells at Drill Sergeants -% -Chuck Norris' dog pick up after him. -% -Chuck Norris' films are factual documentaries. -% -Chuck Norris' first job was as a paperboy. There were no survivors. -% -Chuck Norris' glass is never half full or half empty. It stays full even after he takes a drink. -% -Chuck Norris' hand is the only hand that can beat a Royal Flush. -% -Chuck Norris' personal airplane is called Air Force Chuck -% -Chuck Norris. Enough said. -% -Chuck Norris: even Naruto can't believe it -% -Chunk Norris can make sour milk turn fresh -% -Contrary to popular beleif, Rome WAS built in a day, by Chuck Norris. -% -Contrary to popular belief, America is not a democracy, it is a Chucktatorship. -% -Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. -% -Cops don't need a badges in their wallets but only a picture of Chuck Norris. -% -Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. -% -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. -% -Did you here about the boy who cried Chuck Norris? -% -Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning. -% -Dog the Bounty Hunter can't track Chuck Norris down. -% -Don't get Chuck Norris angry, last time somebody did that Chuck Norris made the Grand Canyon. -% -During the Civil War Chuck Norris was a slave, his master would often beg him for mercy -% -Earth's rotation is purely governed by the direction that Chuck Norris is walking. -% -Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming -% -Every line in a Chuck Norris haiku is "A roundhouse kick to the face." And they all have the correct number of syllables. -% -Every phobia known to man has a phobia of Chuck Norris -% -Every time there's an earthquake, you know Chuck Norris is hungry. The earthquake is caused by his stomach growling. -% -Everyone is so scared of Chuck Norris that they kiss his arse by writing these facts, too right they should -% -Evolution's driving mechanism is nature's desperate attempt to escape Chuck Norris. -% -Fear of spiders is aracnaphobia, fear of tight spaces is chlaustraphobia, fear of Chuck Norris is called Logic -% -Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. -% -Ghosts can see Chuck Norris -% -Guns don't kill people. Chuck Norris kills people. -% -How much wood could a woodchuck chuck if a woodchuck could chuck wood? No woodchuck could chuck Chuck's wood! -% -If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass. -% -If Chuck Norris were to get into a fight with another Chuck Norris, Chuck Norris would win. -% -If Chuck was ever captured, he could win a game of Russian Roulette with six bullets in the revolver, he would shoot everyone else! -% -If God doesn't know, Chuck does -% -If Goliath listened to Chuck Norris he would have won. -% -If at first you don't succeed, you're not Chuck Norris. -% -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. -% -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. -% -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. -% -If you spell Chuck Norris in Scrabble, you win. Forever. -% -In 1945 The US army asked if they could clone Chuck Norris. instead he said he could sort out the Japanese. -% -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. -% -In a rain storm Chuck Norris stays dry. Rain drops are scared to hit him. -% -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 the back of the book of world records, it says "All records are held by Chuck Norris. The ones listed are in second place." -% -James Bond has a license to kill. He got it from Chuck Norris. -% -Jedis are now taught to use the "Chuck" -% -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. -% -Machiavelli said it is better to be feared than loved because he was inspired by Chuck Norris. -% -May the Force be with Chuck Norris... for it's own good. -% -Merlin was Chuck Norris' assistant. -% -More of a question than a fact: in a fight between Chuck Norris and Gordan Freeman who would win? -% -Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. -% -Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima? -% -Note to self: Don't be the cashier to tell Chuck Norris his coupons have expired. -% -On the keyboard there is no control button because Chuck Norris is always in control. -% -Once upon a time, Chuck Norris found himself in a town called Shit Creek.....He opened a Paddle Store. -% -One glance from Chuck Norris and snow turns itself yellow. -% -One time a test cheated on Chuck Norris. -% -Only Chuck Norris can win the mind game, 'cause he never minds. -% -Only Chuck Norris is stronger than an Altoid. +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. % -Ozzy Osbourne once accidentally bit the head off a live bat - Chuck Norris once deliberately bit the head off a live pterodactyl. +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. +% +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. % 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. % -Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +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. % -Simon doesn't say...Chuck Norris says. +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. % -Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.? +If you spell Chuck Norris in Scrabble, you win. Forever. % -Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you. -% -Some kids pee their name in snow. Chuck Norris pees his name in concrete. -% -Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. -% -Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. -% -Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on 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 -% -That's not an eclipse....that's the sun hiding from Chuck Norris. -% -The Beatles are on iTunes because Chuck Norris bought a Mac. -% -The Earth is made up of two-thirds water and one-third Chuck Norris. -% -The Earth was almost destroyed by a 50 km wide asteroid in 1984, but Chuck Norris roundhouse kicked it into the Sun. -% -The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. -% -The Jone's are trying to keep up with Chuck Norris -% -The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.” -% -The answer to life, the universe and everything isnt 42. It's Chuck Norris. -% -The apple falls far from the tree, when a roundhouse kick is taken to the trunk. -% -The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live. -% -The chief export of Chuck Norris is Pain. -% -The dictionary references Chuck Norris several times, he is metioned under Fear, Law, Order and Chucktatorship. -% -The kids said when Chuck was eating Trix cereal ´´silly Chuck, Trix are for kids´´...what happened next?..............................Darfur happened. -% -The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. -% -The letters in Chuck Norris cannot be unscrambled. -% -The meaning of life is Chuck Norris -% -The only place where the Starship Enterprise refuses to boldly go is Chuck Norris' planet...which is all of them. -% -The only reason that USA lost the 2011 world cup to Japan is because Chuck Norris wasn't there. -% -The only sure things are Death and Taxes, and when Chuck Norris goes to work for the IRS, they'll be the same thing. -% -The only way sharks will come near CN underwater is when CN is inside of a cage. -% -The only word that rhymes with orange is Chuck Norris -% -The planes in 9/11 were not hijacked. Chuck Norris was just playing with his old radio controller. -% -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". -% -The quickest way to a man's heart is with Chuck Norris' fist. -% -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 red phone in the oval office...Rings directly to Chuck Norris Cell Phone -% -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. -% -The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death -% -The sun only rises every morning because Chuck Norris allows it to. -% -The truth hurts, doesn't it? Chuck Norris' truth kills. -% -There is no chin behind Chuck Norris' beard. There is only another fist. -% -There is no chin behind Chuck Norris' beard. There is only another fist. -% -There is no limbo, only a world that doesn't know of Chuck Norris -% -There is no such thing as being hard its called the Chuck Norris factor. -% -There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up. +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. % -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. % -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 has two speeds. Walk, and Kill. % -This one time at band camp... BAM! Chuck Norris. +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. % -Those who ignore history, are doomed by Chuck Norris. +Chuck Norris drives an ice cream truck covered in human skulls. % -Trick me once, shame on you, trick Chuck Norris.....rest in peace. +Chuck Norris is my Homeboy. % -Unlike Jack Bauer, Chuck Norris doesn't need bullets. A quick roundhouse to the face kills twice as fast. +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. % -Walker: Texas Ranger went into syndication before the first episode was shot. +Chuck Norris uses pepper spray to spice up his steaks. % -What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +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. % -Whatever Chuck Norris wants, it will instantly appear. +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. % -When Betty White gets angry, she turns into the Hulk. When Valerie Bertinelli gets mad, she turns into Chuck Norris. +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 creates a login, it tells him "password not strong enough", he types in his name and it tells him "password too strong." +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. % -When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. % -When Chuck Norris drinks water, the water automatically pasteurized. +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. % -When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money. -% -When Chuck Norris goes to rodeos, bulls ride him. -% -When Chuck Norris goes to the library, he looks for the guinness book of records in the comedy section. -% -When Chuck Norris inhales helium, his voice doesn't change. -% -When Chuck Norris performs a roundhouse kick, he's actually measuring the circumference of the universe. -% -When Chuck Norris played the card game War with a friend, France surrendered. -% -When Chuck Norris pokes the Pillsbury Doughboy, it's not a laughing matter. -% -When Chuck Norris roundhouse-kicks you HE decides when you will feel the impact . +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. % -When Chuck Norris tosses a coin, it lands on both head and tail. +The quickest way to a man's heart is with Chuck Norris' fist. % -When God said "Let there be light!", Chuck Norris said "Only for half the day +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. % -When President Roosevelt dropped the atomic bomb on Hiroshima, he did so only because it was more human then sending Chuck Norris. +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. % -When Presidents speak, their nation listens. When Chuck Norris blinks, the whole World listens. +Chuck Norris can win a game of Connect Four in only three moves. % -When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part. +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. % -When chuck Norris was in school, he made his PE teacher run laps. +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. % -When does Chuck Norris run out of shotgun bullets?.....whenever he wants to. +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. % -When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000. +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 can win in a top spinning tournament with a cube +% +Beware of dogs... Dogs, beware of Chuck Norris. +% +Chuck Norris can dig a hole in air. +% +The apple falls far from the tree, when a roundhouse kick is taken to the trunk. +% +Chuck Norris - the new standard. +% +Chuck Norris told me to put this here. +% +Chuck Norris doesn't exhale. The air runs desperately scared out of his lungs. +% +Fear of spiders is aracnaphobia, fear of tight spaces is chlaustraphobia, fear of Chuck Norris is called Logic +% +When Chuck Norris goes to rodeos, bulls ride him. +% +Chuck Norris once walked down a street with his fists in his pockets. He was then arrested for concealing two deadly weapons. +% +The meaning of life is Chuck Norris +% +Chuck Norris is the meaning of life. Too bad he's also the meaning of death. +% +If God doesn't know, Chuck does +% +Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint. +% +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. % When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. % -When things go bump in the night.... it's Chuck Norris +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. % -While visiting the hexagon, Chuck Norris was asked to demonstrate his famous roundhouse kick. Henceforth, it has been known as the Pentagon. +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. +% +When God said "Let there be light!", Chuck Norris said "Only for half the day +% +Chuck Norris went up the creek without a paddle... or a canoe +% +Chuck Norris once asked a man to turn down his music, he refused, that man's baby was born deaf. +% +Chuck Norris found the hay in the needle stack. +% +Chuck Norris doesn't need to brush his teeth, his spit acts as a bleach. +% +Chuck Norris once had a street named after him. But the name removed at once, because nobody crosses Chuck Norris, and lives +% +The planes in 9/11 were not hijacked. Chuck Norris was just playing with his old radio controller. +% +Machiavelli said it is better to be feared than loved because he was inspired by Chuck Norris. +% +Chuck Norris Can Play the Theme from the Twilight Zone with His Beard +% +Chuck Norris pees Adamantium +% +The Beatles are on iTunes because Chuck Norris bought a Mac. +% +Chuck Norris once rounhouse kicked a football ...... it is now considered as a planet +% +Chuck Norris yells at Drill Sergeants +% +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. +% +If at first you don't succeed, you're not Chuck Norris. +% +If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass. +% +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. +% +Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.? +% +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. +% +There is no such thing as being hard its called the Chuck Norris factor. +% +When Chuck Norris goes to the library, he looks for the guinness book of records in the comedy section. +% +Chuck Norris can shoot a person 28 times with an unloaded gun. +% +Chuck Norris' personal airplane is called Air Force Chuck +% +The letters in Chuck Norris cannot be unscrambled. +% +Cops don't need a badges in their wallets but only a picture of Chuck Norris. +% +Chuck Norris was the reason why the Great Wall of China was constructed. It failed miserably. +% +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. +% +The red phone in the oval office...Rings directly to Chuck Norris Cell Phone +% +The only way sharks will come near CN underwater is when CN is inside of a cage. +% +Chuck Norris uses a real mouse to move the cursor, type on the keyboard, write e-mails, code entire websites, use photoshop, bring coffee. +% +If Chuck Norris were to get into a fight with another Chuck Norris, Chuck Norris would win. +% +"2012" is code for, Chuck Norris when he is pissed. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +In 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 can turn toast back into bread +% +Chuck Norris started Chuck Norris. +% +Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming +% +Chuck Norris killed Kemper +% +Did you here about the boy who cried Chuck Norris? +% +Chuck Norris can't perform Hadoukens, he IS a Hadouken +% +Behind every successful man is Chuck Norris +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +The square root of Chuck Norris is pain. Do not try to square Chuck Norris. The result is death +% +Chuck Norris doesn't read. He just stares at the book until he gets the information he wants. % Why didn't the chicken cross the road? Because Chuck Norris got to it first. % -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. +When taking the SAT, write "Chuck Norris" for every answer. You will score over 8000. % -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 can milk an alligator +% +Chuck Norris doesn't eat, he just sucks the energy out of food by staring at it +% +Chuck Norris once proved p^~p by induction on his beard hairs. +% +The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. +% +Chuck Norris can bake in a Freezer. +% +Chuck Norris is currently suing any broadway theater that plays "The Nutcracker". He claims its an infringement on his "other" roundhouse kick. +% +Chuck Norris once had a weak moment, just to know what it felt like. +% +Note to everyone: Please do not give beans to Chuck Norris or do you want another atombomb on hiroshima? +% +Chuck Norris has made a 148 break a snooker. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. % http://chucknorrisfacts.com/ is built in Drupal because Chuck Norris knows a good CMS when he sees one. % +The producers of the movie "The Last Airbender" are now in talks with Chuck Norris in Order to star him in their next sequal "The Last Skull Bender". +% +Some boots were made for walking. Some boots may walk all over you, but Chuck Norris' boot walk THROUGH you. +% +World War II began because Chuck Norris took a nap. When he woke up, Hitler found out and killed himself out of fear Chuck Norris would kill him. +% +The best part of waking up is not Folgers in your cup, it's knowing that Chuck Norris let you live. +% +Only Chuck Norris can win the mind game, 'cause he never minds. +% +Do you know why Chuck Norris didn't star in The Expandebles? Because all the others guys would have surrended at the beginning. +% +Bruce Lee didn't defeat Chuck Norris. Chuck hit Bruce with a Delayed roundhouse kick that was so fast that Lee only felt the impact a year later! +% +Chuck Norris doesn't need a bulletproof vest to be bulletproof +% +When Chuck Norris goes to Vegas, he doesn't have to gamble. The casinos just give him stacks of money. +% +Merlin was Chuck Norris' assistant. +% +If you put in the correct cheat code in Halo 2, you can have Master Cheif play without his helmet; revealing to be Chuck Norris. +% +Those who ignore history, are doomed by Chuck Norris. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Some kids pee their name in snow. Chuck Norris pees his name in concrete. +% +The Matrix Trilogy would have ended on the first movie if Keanu Reeves said, “I know Chuck Norris.” +% +Chuck Norris created Heavy Metal when he was upset +% +Some people ask for a Kleenex when they sneeze, Chuck Norris asks for a body bag. +% +When things go bump in the night.... it's Chuck Norris +% +Chuck Norris fed the Hunger Games +% +Chuck Norris played "Got your Nose" with Voldemort and won. +% +Chuck Norris had a knife thrown at him............ the knife didn't impale him, he impaled the knife +% +Chuck Norris doesn't let it go. +% +You know Chuck Norris' pet lizard, right? Last I heard, he was in the movie "Godzilla". Oh, and his pet turtle starred in "Gamera" as well. +% +Whatever Chuck Norris wants, it will instantly appear. +% +Chuck Norris once cut a knife with a stick of butter. +% +Chuck Norris shops at Sam's Club, but leaves without having his receipt checked +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +In 1945 The US army asked if they could clone Chuck Norris. instead he said he could sort out the Japanese. +% +One glance from Chuck Norris and snow turns itself yellow. +% +Chuck Norris checks under his bed for Fedor Emelianenko because he takes Fedor to the vet regularly. +% +Chuck Norris was the image used for Papa Smurf. +% +Chuck Norris is so scary he makes Sharks swim backwards away from him +% +When Chuck Norris tosses a coin, it lands on both head and tail. +% +Chuck Norris found the last digit of pie +% +Chuck Norris Watches "the Nat.Geo. Specials" on Discovery Channel +% +James Bond has a license to kill. He got it from Chuck Norris. +% +Chuck Norris is Chuck Norris +% +"The Big Chuck Norris Roundhouse-Kick Theory" +% +That's not an eclipse....that's the sun hiding from Chuck Norris. +% +Chuck Norris doesn't like Mudkipz +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Chuck Norris doesn’t eat salad, he eats vegetarians +% +Every time there's an earthquake, you know Chuck Norris is hungry. The earthquake is caused by his stomach growling. +% +Chuck Norris wasn't born on his birthday +% +One time a test cheated on Chuck Norris. +% +Chuck Norris won a stepdance contest by standing on his hands +% +Chuck Norris thretened to kill Michael Jackson, MJ got so scared to turned white. +% +When Steven Seagal kills a ninja, he only takes its hide. When Chuck Norris kills a ninja, he uses every part. +% +Chuck Norris is the life of parties he dosen't attend +% +Chuck Norris can rub two fires together and make a stick! +% +Contrary to popular beleif, Rome WAS built in a day, by Chuck Norris. +% +Chuck Norris rolled a 20 on a 6 sided die. +% +When chuck Norris was in school, he made his PE teacher run laps. +% +Chuck Norris wins NASCAR races with all right turns. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Chuck Norris is waiting for Mt. St. Helens to erupt again. He's hoping the lava is hot enough to soften his beard so he can shave for the first time. +% +Chuck Norris is overra... +% +Chuck Norris was originally in Mortal Kombat, but that version was deleted because no one can beat Chuck Norris in a fight. +% +Chuck Norris likes everyone on the earth, cause everyone he didn't like... Is dead... +% +Chunk Norris can make sour milk turn fresh +% +There is no limbo, only a world that doesn't know of Chuck Norris +% +Chuck Norris CAN believe it's not butter +% +Dog the Bounty Hunter can't track Chuck Norris down. +% +Abraham Lincoln didn't die because he was shot, Chuck Norris roundhouse-kicked so fast his foot went back in time and killed Abraham Lincoln. +% +When Chuck Norris inhales helium, his voice doesn't change. +% +When Chuck Norris drinks water, the water automatically pasteurized. +% +Chuck Norris once punched the ground to stop an earthquake. The resulting aftershock caused the BP oil spill +% +Chuck Norris can play the death waltz with his chin. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +More of a question than a fact: in a fight between Chuck Norris and Gordan Freeman who would win? +% +Chuck Norris once round-house kicked a salesman. Over the phone. +% +Chuck Norris can grill a popsicle +% +Chuck Norris' films are factual documentaries. +% +Casinos pay Chuck Norris not to play at anything or wish anyone good luck. +% +Chuck Norris once got a 200 yard punt return +% +Every line in a Chuck Norris haiku is "A roundhouse kick to the face." And they all have the correct number of syllables. +% +An angry glare from Chuck Norris is known to kill on the spot. +% +Evolution's driving mechanism is nature's desperate attempt to escape Chuck Norris. +% +When President Roosevelt dropped the atomic bomb on Hiroshima, he did so only because it was more human then sending Chuck Norris. +% +Don't get Chuck Norris angry, last time somebody did that Chuck Norris made the Grand Canyon. +% +In Texas, there are five sizes for fountain drinks: small, medium, large, Texas sized, and Chuck Norris Sized. It is a cup made of a human skull. +% +After Chuck counted to infinity the first time, he vowed to count to infinity a second time....by counting the bodies of those previously roundhoused. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Taking Karate Lessons = $100, Buying MMA DVD's= $150, Subscribing to a UFC event = $50, Getting a Roundhouse Kick from Chuck Norris = PRICELESS +% +Chuck Norris played the game of thrones and won +% +Chuck Norris doesn't need sunglasses, the sun needs Chuck Norris glasses +% +Chuck Norris doesn't call the wrong number, you just answer the wrong phone. +% +Chuck Norris once won the tour de france riding a " big wheel" +% +May the Force be with Chuck Norris... for it's own good. +% +Chuck Norris once played Duck Duck Goose with a group of Kindergarteners. Only one kid made it to first grade +% +During the Civil War Chuck Norris was a slave, his master would often beg him for mercy +% +Chuck Norris' glass is never half full or half empty. It stays full even after he takes a drink. +% + King Kong climbed the Empire State building in fear of Chuck Norris who was downstairs at the time. +% +Chuck Norris can French kiss his elbow. +% +Chuck Norris never trains, because he's Chuck Norris. +% +Every phobia known to man has a phobia of Chuck Norris +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Once upon a time, Chuck Norris found himself in a town called Shit Creek.....He opened a Paddle Store. +% +Chuck Norris Can Power Solar Panels. At Night. +% +When Betty White gets angry, she turns into the Hulk. When Valerie Bertinelli gets mad, she turns into Chuck Norris. +% +Chuck Norris is so hard, he uses diamonds as stress balls. +% +Chuck Norris can roundhouse kick someone through a window without breaking the glass +% +Chuck Norris. Enough said. +% +The letters in Chuck Norris cannot be unscrambled. +% +Chuck Norris once taught a class of martial arts.Unfortunately Chuck had forgiven to take elephant tranquilizers and killed every one just by saluting +% +Chuck Norris was heard in a soundproof room! +% +Chuck Norris can see in 3D with just one eye. +% +Chuck Norris owns all number 1 pencils. +% +Staring at Chuck Norris for extended periods of time without proper eye protection will cause blindess, and possibly foot sized brusies on the face. +% +Chuck Norris doesn’t brew up tea. He sucks the bag. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +They say death by a 1000 lashes was the most painful way to die, that was before they got roundhouse kicked in the face by Chuck Norris +% +Chuck Norris made a statue bleed. +% +Dead bodies were found of people that are still alive. These people will cross Chuck Norris in the future and will be round-house kicked back in time. +% +The reason why batman only comes out at night is because he's afraid he might encounter Chuck Norris in the Morning and afternoon. +% +The kids said when Chuck was eating Trix cereal ´´silly Chuck, Trix are for kids´´...what happened next?..............................Darfur happened. +% +Chuck Norris can roundhouse-kick round houses into squares. +% +Chuck Norris is allowed two carry-ons. +% +Chuck Norris can divide by zero. +% +Chuck Norris does not have a cell phone because he hears everything +% +Chuck Norris isn't appropriate...appropriate isn't Chuck Norris +% +Earth's rotation is purely governed by the direction that Chuck Norris is walking. +% +Chuck Norris drowned a man ON LAND. +% +The Jone's are trying to keep up with Chuck Norris +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Chuck Norris bowled a 301 after constructing another pin out of his beard hair +% +The only reason that USA lost the 2011 world cup to Japan is because Chuck Norris wasn't there. +% +Unlike Jack Bauer, Chuck Norris doesn't need bullets. A quick roundhouse to the face kills twice as fast. +% +There is no such thing as global warming. Chuck Norris was cold, so he turned the sun up. +% +Chuck Norris' dog pick up after him. +% +Jedis are now taught to use the "Chuck" +% +Chuck Norris dosent carry a list. He always knows what to do. +% +When Chuck Norris performs a roundhouse kick, he's actually measuring the circumference of the universe. +% +Walker: Texas Ranger went into syndication before the first episode was shot. +% +Chuck Norris doesn't throw up if he drinks too much. Chuck Norris throws down! +% +"Walker Texas Ranger: The Movie 3-D" was considered by Warner Brothers; however the technology to create the visual effects will never be possible. +% +When Chuck Norris creates a login, it tells him "password not strong enough", he types in his name and it tells him "password too strong." +% +Chuck Norris isn't allowed at the zoo because when he's there the animals are terriefied to come out their cages +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Aliens fear that Chuck Norris might abduct them. +% +Chuck Norris splattered tiger blood and Adonis' dna on Charlie Sheen with 1 roundhouse kick! +% +How much wood could a woodchuck chuck if a woodchuck could chuck wood? No woodchuck could chuck Chuck's wood! +% +The sun only rises every morning because Chuck Norris allows it to. +% +Chuck Norris can do a regime change with a roundhouse kick. +% +Chuck Norris CAN spell with an I before E even after C. +% +Ghosts can see Chuck Norris +% +The answer to life, the universe and everything isnt 42. It's Chuck Norris. +% +When Chuck Norris pokes the Pillsbury Doughboy, it's not a laughing matter. +% +Chuck Norris once thought he was wrong. He was, however, mistaken. +% +Ever wonder what really happened to the dinosaurs? They all dug their own graves when they heard Chuck Norris was coming +% +"The wind cries Chuck Norris" +% +Chuck Norris doesn't need a bulletproof vest. He catches them with his bare hands. +% +When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris. +% +Chuck Norris doesn't read books. He stares them down until he gets the information he wants. +% +There is no theory of evolution. Just a list of creatures Chuck Norris has allowed to live. +% +Outer space exists because it's afraid to be on the same planet with Chuck Norris. +% +Chuck Norris does not sleep. He waits. +% +Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs. +% +Chuck Norris is the reason why Waldo is hiding. +% +Chuck Norris counted to infinity - twice. +% +There is no chin behind Chuck Norris’ beard. There is only another fist. +% +When Chuck Norris does a pushup, he isn't lifting himself up, he's pushing the Earth down. +% +Chuck Norris is so fast, he can run around the world and punch himself in the back of the head. +% +Chuck Norris' hand is the only hand that can beat a Royal Flush. +% +Chuck Norris can lead a horse to water AND make it drink. +% +Chuck Norris doesn’t wear a watch. HE decides what time it is. +% +Chuck Norris can slam a revolving door. +% +Chuck Norris does not get frostbite. Chuck Norris bites frost. +% +Remember the Soviet Union? They decided to quit after watching a DeltaForce marathon on Satellite TV. +% +Contrary to popular belief, America is not a democracy, it is a Chucktatorship. +% +If you spell Chuck Norris in Scrabble, you win. Forever. +% +Guns don't kill people. Chuck Norris kills people. +% +There is no theory of evolution. Just a list of animals Chuck Norris allows to live. +% +The chief export of Chuck Norris is Pain. +% +Chuck Norris has two speeds. Walk, and Kill. +% +The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer. +% +Chuck Norris drives an ice cream truck covered in human skulls. +% +Chuck Norris is my Homeboy. +% +Chuck Norris doesn't go hunting.... CHUCK NORRIS GOES KILLING. +% +Chuck Norris uses pepper spray to spice up his steaks. +% +Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light, went back in time, and killed Amelia Earhart while she was flying over the Pacific Ocean. +% +Crop circles are Chuck Norris' way of telling the world that sometimes corn needs to lie down. +% +Chuck Norris is ten feet tall, weighs two-tons, breathes fire, and could eat a hammer and take a shotgun blast standing. +% +The Great Wall of China was originally created to keep Chuck Norris out. It failed miserably. +% +Contrary to popular belief, Chuck Norris, not the box jellyfish of northern Australia, is the most venomous creature on earth. +% +Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous. +% +If you ask Chuck Norris what time it is, he always says, "Two seconds 'til." After you ask, "Two seconds 'til what?" he roundhouse kicks you in the face. +% +When Chuck Norris sends in his taxes, he sends blank forms and includes only a picture of himself, crouched and ready to attack. Chuck Norris has not had to pay taxes, ever. +% +The quickest way to a man's heart is with Chuck Norris' fist. +% +Chuck Norris invented Kentucky Fried Chicken's famous secret recipe, with eleven herbs and spices. But nobody ever mentions the twelfth ingredient: Fear. +% +CNN was originally created as the "Chuck Norris Network" to update Americans with on-the-spot ass kicking in real-time. +% +Chuck Norris can win a game of Connect Four in only three moves. +% +What was going through the minds of all of Chuck Norris' victims before they died? His shoe. +% +Chuck Norris is the only man to ever defeat a brick wall in a game of tennis. +% +Police label anyone attacking Chuck Norris as a Code 45-11.... a suicide. +% +Chuck Norris doesn't churn butter. He roundhouse kicks the cows and the butter comes straight out. +% +Chuck Norris doesn’t wash his clothes, he disembowels them. +% +A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. +% +Chuck Norris will attain statehood in 2009. His state flower will be the Magnolia. +% +Someone once videotaped Chuck Norris getting pissed off. It was called Walker: Texas Chain Saw Massacre. +% +Chuck Norris originally appeared in the "Street Fighter II" video game, but was removed by Beta Testers because every button caused him to do a roundhouse kick. When asked bout this "glitch," Norris replied, "That's no glitch." +% +Fool me once, shame on you. Fool Chuck Norris once and he will roundhouse you in the face. +% +Chuck Norris: even Naruto can't believe it +% +Chuck Norris can fit 10 gallons of water in a 5 gallon water bucket +% +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/zsh/.oh-my-zsh/plugins/cloudapp/README.md b/zsh/.oh-my-zsh/plugins/cloudapp/README.md index fc9fc32..62975a6 100644 --- a/zsh/.oh-my-zsh/plugins/cloudapp/README.md +++ b/zsh/.oh-my-zsh/plugins/cloudapp/README.md @@ -4,8 +4,8 @@ To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: -```zsh -plugins=(... cloudapp) +``` +plugins=(... dash) ``` ## Requirements diff --git a/zsh/.oh-my-zsh/plugins/coffee/README.md b/zsh/.oh-my-zsh/plugins/coffee/README.md index 2baade8..d6cd074 100644 --- a/zsh/.oh-my-zsh/plugins/coffee/README.md +++ b/zsh/.oh-my-zsh/plugins/coffee/README.md @@ -1,4 +1,4 @@ -# Coffeescript Plugin +## Coffeescript Plugin This plugin provides aliases for quickly compiling and previewing your coffeescript code. diff --git a/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md b/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md index f34941e..d9f6acb 100644 --- a/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md +++ b/zsh/.oh-my-zsh/plugins/colored-man-pages/README.md @@ -8,9 +8,6 @@ To use it, add `colored-man-pages` to the plugins array in your zshrc file: plugins=(... colored-man-pages) ``` -It will also automatically colorize man pages displayed by `dman` or `debman`, -from [`debian-goodies`](https://packages.debian.org/stable/debian-goodies). - You can also try to color other pages by prefixing the respective command with `colored`: ```zsh diff --git a/zsh/.oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh b/zsh/.oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh index ec51847..f74105d 100644 --- a/zsh/.oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh @@ -31,9 +31,6 @@ function colored() { "$@" } -# Colorize man and dman/debman (from debian-goodies) -function man \ - dman \ - debman { - colored $0 "$@" +function man() { + colored man "$@" } diff --git a/zsh/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh b/zsh/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh index 81d76e6..dd1186e 100644 --- a/zsh/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh @@ -26,8 +26,10 @@ fi # OSX command-not-found support # https://github.com/Homebrew/homebrew-command-not-found -if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then - source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' +if type brew &> /dev/null; then + if brew command command-not-found-init > /dev/null 2>&1; then + eval "$(brew command-not-found-init)"; + fi fi # NixOS command-not-found support diff --git a/zsh/.oh-my-zsh/plugins/common-aliases/common-aliases.plugin.zsh b/zsh/.oh-my-zsh/plugins/common-aliases/common-aliases.plugin.zsh index 023b1a5..785a09c 100644 --- a/zsh/.oh-my-zsh/plugins/common-aliases/common-aliases.plugin.zsh +++ b/zsh/.oh-my-zsh/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} ${ZDOTDIR:-$HOME}/.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} ' @@ -50,7 +50,6 @@ alias mv='mv -i' # zsh is able to auto-do some kungfoo # depends on the SUFFIX :) -autoload -Uz is-at-least if is-at-least 4.2.0; then # open browser on urls if [[ -n "$BROWSER" ]]; then diff --git a/zsh/.oh-my-zsh/plugins/compleat/README.md b/zsh/.oh-my-zsh/plugins/compleat/README.md index af0e383..630c915 100644 --- a/zsh/.oh-my-zsh/plugins/compleat/README.md +++ b/zsh/.oh-my-zsh/plugins/compleat/README.md @@ -3,7 +3,6 @@ This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion. To use it, add compleat to the plugins array in your zshrc file: - -```zsh +``` plugins=(... compleat) ``` diff --git a/zsh/.oh-my-zsh/plugins/composer/README.md b/zsh/.oh-my-zsh/plugins/composer/README.md index 7a5f725..2b4bae5 100644 --- a/zsh/.oh-my-zsh/plugins/composer/README.md +++ b/zsh/.oh-my-zsh/plugins/composer/README.md @@ -12,20 +12,18 @@ 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 -o` | 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 | -| `co` | `composer outdated` | Shows a list of installed packages with available updates | -| `cod` | `composer outdated --direct` | Shows a list of installed packages with available updates which are direct dependencies | +| 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/zsh/.oh-my-zsh/plugins/composer/composer.plugin.zsh b/zsh/.oh-my-zsh/plugins/composer/composer.plugin.zsh index 330360c..6349610 100644 --- a/zsh/.oh-my-zsh/plugins/composer/composer.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/composer/composer.plugin.zsh @@ -15,16 +15,20 @@ _composer_get_required_list () { } _composer () { - local curcontext="$curcontext" state line - typeset -A opt_args - _arguments \ - '*:: :->subcmds' + local curcontext="$curcontext" state line + typeset -A opt_args + _arguments \ + '1: :->command'\ + '*: :->args' - if (( CURRENT == 1 )) || ( ((CURRENT == 2)) && [ "$words[1]" = "global" ] ) ; then - compadd $(_composer_get_command_list) - else - compadd $(_composer_get_required_list) - fi + case $state in + command) + compadd $(_composer_get_command_list) + ;; + *) + compadd $(_composer_get_required_list) + ;; + esac } compdef _composer composer @@ -39,29 +43,17 @@ alias crm='composer remove' alias ci='composer install' alias ccp='composer create-project' alias cdu='composer dump-autoload' -alias cdo='composer dump-autoload -o' +alias cdo='composer dump-autoload --optimize-autoloader' alias cgu='composer global update' alias cgr='composer global require' alias cgrm='composer global remove' -alias co='composer outdated' -alias cod='composer outdated --direct' # install composer in the current directory alias cget='curl -s https://getcomposer.org/installer | php' # Add Composer's global binaries to PATH, using Composer if available. if (( $+commands[composer] )); then - _retrieve_cache composer - - if [[ -z $__composer_bin_dir ]]; then - __composer_bin_dir=$(composer global config bin-dir --absolute 2>/dev/null) - _store_cache composer __composer_bin_dir - fi - - # Add Composer's global binaries to PATH - export PATH="$PATH:$__composer_bin_dir" - - unset __composer_bin_dir + 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 diff --git a/zsh/.oh-my-zsh/plugins/copybuffer/copybuffer.plugin.zsh b/zsh/.oh-my-zsh/plugins/copybuffer/copybuffer.plugin.zsh index 483ed5a..cc205d4 100644 --- a/zsh/.oh-my-zsh/plugins/copybuffer/copybuffer.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/copybuffer/copybuffer.plugin.zsh @@ -1,9 +1,9 @@ # copy the active line from the command line buffer -# onto the system clipboard +# onto the system clipboard (requires clipcopy plugin) copybuffer () { if which clipcopy &>/dev/null; then - printf "%s" "$BUFFER" | clipcopy + echo $BUFFER | clipcopy else echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly." fi diff --git a/zsh/.oh-my-zsh/plugins/copyfile/README.md b/zsh/.oh-my-zsh/plugins/copyfile/README.md index a110b83..53138ad 100644 --- a/zsh/.oh-my-zsh/plugins/copyfile/README.md +++ b/zsh/.oh-my-zsh/plugins/copyfile/README.md @@ -3,8 +3,7 @@ Puts the contents of a file in your system clipboard so you can paste it anywhere. To use, add `copyfile` to your plugins array: - -```zsh +``` plugins=(... copyfile) ``` diff --git a/zsh/.oh-my-zsh/plugins/cpanm/README.md b/zsh/.oh-my-zsh/plugins/cpanm/README.md index 13e93d0..3803e3e 100644 --- a/zsh/.oh-my-zsh/plugins/cpanm/README.md +++ b/zsh/.oh-my-zsh/plugins/cpanm/README.md @@ -1,9 +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. - -```zsh + + ```bash plugins=(... cpanm) ``` diff --git a/zsh/.oh-my-zsh/plugins/dirhistory/README.md b/zsh/.oh-my-zsh/plugins/dirhistory/README.md index 2236507..511f2be 100644 --- a/zsh/.oh-my-zsh/plugins/dirhistory/README.md +++ b/zsh/.oh-my-zsh/plugins/dirhistory/README.md @@ -7,7 +7,6 @@ To use it, add `dirhistory` to the plugins array in your zshrc file: ```zsh plugins=(... dirhistory) ``` - ## Keyboard Shortcuts | Shortcut | Description | @@ -16,24 +15,3 @@ plugins=(... dirhistory) | alt + right | Undo alt + left | | alt + up | Move into the parent directory | | alt + down | Move into the first child directory by alphabetical order | - -## Usage - -This plugin allows you to navigate the history of previous current-working-directories 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. MAC users may alternately use OPT-LEFT and OPT-RIGHT. - -Also, navigate directory **hierarchy** using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented). ALT-UP moves to higher hierarchy (shortcut for 'cd ..'). ALT-DOWN moves into the first directory found in alphabetical order (useful to navigate long empty directories e.g. java packages) - -For example, if the shell was started, and the following commands were entered: - -```shell -cd ~ -cd /usr -cd share -cd doc -``` - -Then entering ALT-LEFT at the prompt would change directory from /usr/share/doc to /usr/share, then if pressed again to /usr/, then ~. If ALT-RIGHT were pressed the directory would be changed to /usr/ again. - -After that, ALT-DOWN will probably go to /usr/bin (depends on your /usr structure), ALT-UP will return to /usr, then ALT-UP will get you to / - -**Currently the max history size is 30**. The navigation should work for xterm, PuTTY xterm mode, GNU screen, and on MAC with alternate keys as mentioned above. diff --git a/zsh/.oh-my-zsh/plugins/dirpersist/README.md b/zsh/.oh-my-zsh/plugins/dirpersist/README.md index 792fb4b..9880bc5 100644 --- a/zsh/.oh-my-zsh/plugins/dirpersist/README.md +++ b/zsh/.oh-my-zsh/plugins/dirpersist/README.md @@ -1,7 +1,6 @@ # 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. +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: diff --git a/zsh/.oh-my-zsh/plugins/django/README.md b/zsh/.oh-my-zsh/plugins/django/README.md index 1740e55..415f6b7 100644 --- a/zsh/.oh-my-zsh/plugins/django/README.md +++ b/zsh/.oh-my-zsh/plugins/django/README.md @@ -34,3 +34,23 @@ 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/zsh/.oh-my-zsh/plugins/dnf/README.md b/zsh/.oh-my-zsh/plugins/dnf/README.md index dc0d1e0..f9ef496 100644 --- a/zsh/.oh-my-zsh/plugins/dnf/README.md +++ b/zsh/.oh-my-zsh/plugins/dnf/README.md @@ -1,14 +1,10 @@ -# dnf plugin +## Description -This plugin makes `dnf` usage easier by adding aliases for the most common commands. +This plugin makes `dnf` usage easier by adding aliases for the most +common commands. -`dnf` is the new package manager for RPM-based distributions, which replaces `yum`. - -To use it, add `dnf` to the plugins array in your zshrc file: - -```zsh -plugins=(... dnf) -``` +`dnf` is the new package manager for RPM-based distributions, which +replaces `yum`. ## Aliases diff --git a/zsh/.oh-my-zsh/plugins/docker-compose/README.md b/zsh/.oh-my-zsh/plugins/docker-compose/README.md index 1105e03..07a87bc 100644 --- a/zsh/.oh-my-zsh/plugins/docker-compose/README.md +++ b/zsh/.oh-my-zsh/plugins/docker-compose/README.md @@ -4,8 +4,7 @@ This plugin provides completion for [docker-compose](https://docs.docker.com/com aliases for frequent docker-compose commands. To use it, add docker-compose to the plugins array of your zshrc file: - -```zsh +``` plugins=(... docker-compose) ``` diff --git a/zsh/.oh-my-zsh/plugins/docker/README.md b/zsh/.oh-my-zsh/plugins/docker/README.md index 241a6a4..4d9f3ae 100644 --- a/zsh/.oh-my-zsh/plugins/docker/README.md +++ b/zsh/.oh-my-zsh/plugins/docker/README.md @@ -3,7 +3,6 @@ This plugin adds auto-completion for [docker](https://www.docker.com/). To use it add `docker` to the plugins array in your zshrc file. - ```zsh plugins=(... docker) ``` diff --git a/zsh/.oh-my-zsh/plugins/docker/_docker b/zsh/.oh-my-zsh/plugins/docker/_docker index 10c19e2..54b5e59 100644 --- a/zsh/.oh-my-zsh/plugins/docker/_docker +++ b/zsh/.oh-my-zsh/plugins/docker/_docker @@ -9,7 +9,6 @@ # - Felix Riedel # - Steve Durrheimer # - Vincent Bernat -# - Rohan Verma # # license: # @@ -605,7 +604,6 @@ __docker_container_subcommand() { "($help)*--blkio-weight-device=[Block IO (relative device weight)]:device:Block IO weight: " "($help)*--cap-add=[Add Linux capabilities]:capability: " "($help)*--cap-drop=[Drop Linux capabilities]:capability: " - "($help)--cgroupns=[Cgroup namespace mode to use]:cgroup namespace mode: " "($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: " "($help)--cidfile=[Write the container ID to the file]:CID file:_files" "($help)--cpus=[Number of CPUs (default 0.000)]:cpus: " @@ -678,7 +676,6 @@ __docker_container_subcommand() { "($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: " "($help)--memory-reservation=[Memory soft limit]:Memory limit: " "($help)--memory-swap=[Total memory limit with swap]:Memory limit: " - "($help)--pids-limit[Tune container pids limit (set -1 for unlimited)]" "($help)--restart=[Restart policy]:restart policy:(no on-failure always unless-stopped)" ) opts_help=("(: -)--help[Print usage]") @@ -804,7 +801,7 @@ __docker_container_subcommand() { "($help -l --latest)"{-l,--latest}"[Show only the latest created container]" \ "($help -n --last)"{-n=,--last=}"[Show n last created containers (includes all states)]:n:(1 5 10 25 50)" \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show container IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ "($help -s --size)"{-s,--size}"[Display total file sizes]" \ "($help)--since=[Show only containers created since...]:containers:__docker_complete_containers" && ret=0 ;; @@ -835,7 +832,7 @@ __docker_container_subcommand() { _arguments $(__docker_arguments) \ $opts_help \ "($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \ - "($help -)*:containers:__docker_complete_containers" && ret=0 + "($help -)*:containers:__docker_complete_containers_ids" && ret=0 ;; (rm) local state @@ -1027,7 +1024,7 @@ __docker_image_subcommand() { $opts_help \ "($help -H --human)"{-H,--human}"[Print sizes and dates in human readable format]" \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ "($help -)*: :__docker_complete_images" && ret=0 ;; (import) @@ -1059,7 +1056,7 @@ __docker_image_subcommand() { "($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_images_filters" \ "($help)--format=[Pretty-print images using a Go template]:template: " \ "($help)--no-trunc[Do not truncate output]" \ - "($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \ + "($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \ "($help -): :__docker_complete_repositories" && ret=0 ;; (prune) @@ -1079,7 +1076,6 @@ __docker_image_subcommand() { (push) _arguments $(__docker_arguments) \ $opts_help \ - "($help -a --all-tags)"{-a,--all-tags}"[Push all tagged images in the repository]" \ "($help)--disable-content-trust[Skip image signing]" \ "($help -): :__docker_complete_images" && ret=0 ;; @@ -1290,7 +1286,7 @@ __docker_network_subcommand() { "($help)--no-trunc[Do not truncate the output]" \ "($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_network_complete_ls_filters" \ "($help)--format=[Pretty-print networks using a Go template]:template: " \ - "($help -q --quiet)"{-q,--quiet}"[Only display network IDs]" && ret=0 + "($help -q --quiet)"{-q,--quiet}"[Only display numeric IDs]" && ret=0 ;; (prune) _arguments $(__docker_arguments) \ @@ -2218,6 +2214,7 @@ __docker_stack_subcommand() { (deploy|up) _arguments $(__docker_arguments) \ $opts_help \ + "($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \ "($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, 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 @@ -2671,7 +2668,6 @@ __docker_subcommand() { "($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_complete_log_options" \ "($help)--max-concurrent-downloads[Set the max concurrent downloads for each pull]" \ "($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \ - "($help)--max-download-attempts[Set the max download attempts for each pull]" \ "($help)--mtu=[Network MTU]:mtu:(0 576 1420 1500 9000)" \ "($help)--oom-score-adjust=[Set the oom_score_adj for the daemon]:oom-score:(-500)" \ "($help -p --pidfile)"{-p=,--pidfile=}"[Path to use for daemon PID file]:PID file:_files" \ @@ -2787,7 +2783,7 @@ __docker_subcommand() { $opts_help \ "($help -p --password)"{-p=,--password=}"[Password]:password: " \ "($help)--password-stdin[Read password from stdin]" \ - "($help -u --username)"{-u=,--username=}"[Username]:username: " \ + "($help -u --user)"{-u=,--user=}"[Username]:username: " \ "($help -)1:server: " && ret=0 ;; (logout) diff --git a/zsh/.oh-my-zsh/plugins/dotenv/README.md b/zsh/.oh-my-zsh/plugins/dotenv/README.md index f661247..cac5524 100644 --- a/zsh/.oh-my-zsh/plugins/dotenv/README.md +++ b/zsh/.oh-my-zsh/plugins/dotenv/README.md @@ -4,7 +4,9 @@ Automatically load your project ENV variables from `.env` file when you `cd` int 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. -To use it, add `dotenv` to the plugins array in your zshrc file: +## Installation + +Just add the plugin to your `.zshrc`: ```sh plugins=(... dotenv) @@ -15,63 +17,32 @@ plugins=(... dotenv) Create `.env` file inside your project root directory and put your ENV variables there. For example: - ```sh export AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a export SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f export MONGO_URI=mongodb://127.0.0.1:27017 export PORT=3001 ``` - `export` is optional. This format works as well: - ```sh AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f MONGO_URI=mongodb://127.0.0.1:27017 PORT=3001 ``` - You can even mix both formats, although it's probably a bad idea. -## Settings - ### ZSH_DOTENV_FILE You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`. If the variable isn't set, the plugin will default to use `.env`. For example, this will make the plugin look for files named `.dotenv` and load them: -```zsh +``` # in ~/.zshrc, before Oh My Zsh is sourced: ZSH_DOTENV_FILE=.dotenv ``` -### ZSH_DOTENV_PROMPT - -Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message. -You can also choose the `Always` option when prompted to always allow sourcing the .env file -in that directory. See the next section for more details. - -### ZSH_DOTENV_ALLOWED_LIST - -The default behavior of the plugin is to always ask whether to source a dotenv file. There's -a **Y**es, **N**o, and **A**lways option. If you choose Always, the directory of the .env file -will be added to an allowed list. If a directory is found in this list, the plugin won't ask -for confirmation and will instead source the .env file directly. - -This allowed list is saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list`. If you want -to change that location, change the `$ZSH_DOTENV_ALLOWED_LIST` variable, like so: - -```zsh -# in ~/.zshrc, before Oh My Zsh is sourced: -ZSH_DOTENV_ALLOWED_LIST=/path/to/dotenv/allowed/list -``` - -This file is just a list of directories allowed, separated by a newline character. If you want -to disallow a directory, just edit this file and remove the line for the directory you want to -disallow. - ## 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. @@ -81,6 +52,5 @@ disallow. 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/zsh/.oh-my-zsh/plugins/dotenv/dotenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/dotenv/dotenv.plugin.zsh index ac3210d..89763d0 100644 --- a/zsh/.oh-my-zsh/plugins/dotenv/dotenv.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/dotenv/dotenv.plugin.zsh @@ -1,46 +1,23 @@ -## Settings - -# Filename of the dotenv file to look for -: ${ZSH_DOTENV_FILE:=.env} - -# Path to the file containing allowed paths -: ${ZSH_DOTENV_ALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-allowed.list"} - - -## Functions - source_env() { if [[ -f $ZSH_DOTENV_FILE ]]; then - if [[ "$ZSH_DOTENV_PROMPT" != false ]]; then - local confirmation dirpath="${PWD:A}" - - # make sure there is an allowed file - touch "$ZSH_DOTENV_ALLOWED_LIST" - - # check if current directory's .env file is allowed or ask for confirmation - if ! grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then - # print same-line prompt and output newline character if necessary - echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways) " - read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo - - # check input - case "$confirmation" in - [nN]) return ;; - [aA]) echo "$dirpath" >> "$ZSH_DOTENV_ALLOWED_LIST" ;; - *) ;; # interpret anything else as a yes - esac - fi - fi - # test .env syntax zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2 - setopt localoptions allexport - source $ZSH_DOTENV_FILE + if [[ -o a ]]; then + source $ZSH_DOTENV_FILE + else + set -a + source $ZSH_DOTENV_FILE + set +a + fi fi } autoload -U add-zsh-hook add-zsh-hook chpwd source_env +if [[ -z $ZSH_DOTENV_FILE ]]; then + ZSH_DOTENV_FILE=.env +fi + source_env diff --git a/zsh/.oh-my-zsh/plugins/dotnet/README.md b/zsh/.oh-my-zsh/plugins/dotnet/README.md index 7554b4e..7a6d6a9 100644 --- a/zsh/.oh-my-zsh/plugins/dotnet/README.md +++ b/zsh/.oh-my-zsh/plugins/dotnet/README.md @@ -10,14 +10,12 @@ plugins=(... dotnet) ## Aliases -| Alias | Command | Description | -|-------|------------------|-------------------------------------------------------------------| -| dn | dotnet new | Create a new .NET project or file. | -| dr | dotnet run | Build and run a .NET project output. | -| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. | -| dw | dotnet watch | Watch for source file changes and restart the dotnet command. | -| dwr | dotnet watch run | Watch for source file changes and restart the `run` command. | -| ds | dotnet sln | Modify Visual Studio solution files. | -| da | dotnet add | Add a package or reference to a .NET project. | -| dp | dotnet pack | Create a NuGet package. | -| dng | dotnet nuget | Provides additional NuGet commands. | +| Alias | Command | Description | +|-------|--------------|-------------------------------------------------------------------| +| dn | dotnet new | Create a new .NET project or file. | +| dr | dotnet run | Build and run a .NET project output. | +| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. | +| ds | dotnet sln | Modify Visual Studio solution files. | +| da | dotnet add | Add a package or reference to a .NET project. | +| dp | dotnet pack | Create a NuGet package. | +| dng | dotnet nuget | Provides additional NuGet commands. | \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/dotnet/dotnet.plugin.zsh b/zsh/.oh-my-zsh/plugins/dotnet/dotnet.plugin.zsh index 6bd4b7a..8b9a45a 100644 --- a/zsh/.oh-my-zsh/plugins/dotnet/dotnet.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/dotnet/dotnet.plugin.zsh @@ -1,31 +1,116 @@ -# This scripts is copied from (MIT License): -# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh +# --------------------------------------------------------------------- # +# Aliases and Completions for .NET Core (https://dotnet.microsoft.com/) # +# Author: Shaun Tabone (https://github.com/xontab) # +# --------------------------------------------------------------------- # -_dotnet_zsh_complete() -{ - local completions=("$(dotnet complete "$words")") +# Helper function to cache and load completions +local cache_base_path="${ZSH_CACHE_DIR}/dotnet_" +_dotnet_cache_completion() { + local cache="${cache_base_path}$(echo $1)_completion" + if [[ ! -f $cache ]]; then + $2 $cache + fi - # If the completion list is empty, just continue with filename selection - if [ -z "$completions" ] - then - _arguments '*::arguments: _normal' - return - fi - - # This is not a variable assigment, don't remove spaces! - _values = "${(ps:\n:)completions}" + [[ -f $cache ]] && cat $cache } -compdef _dotnet_zsh_complete dotnet +_dotnet_cache_completion_cleanup() { + local cache="${cache_base_path}$(echo $1)_completion" + rm -f $cache +} -# Aliases bellow are here for backwards compatibility -# added by Shaun Tabone (https://github.com/xontab) +# --------------------------------------------------------------------- # +# dotnet new # +# ALIAS: dn # +# --------------------------------------------------------------------- # +_dotnet_new_completion() { + if [ $commands[dotnet] ]; then + dotnet new -l | tail -n +21 | sed 's/ \+/:/g' | cut -d : -f 2 >$1 + fi +} + +_dotnet_new_completion_cached() { + _dotnet_cache_completion 'new' _dotnet_new_completion +} + +_dotnet_cache_completion_cleanup 'new' alias dn='dotnet new' + +# --------------------------------------------------------------------- # +# dotnet # +# --------------------------------------------------------------------- # +_dotnet() { + if [ $CURRENT -eq 2 ]; then + _arguments \ + '--diagnostics[Enable diagnostic output.]' \ + '--help[Show command line help.]' \ + '--info[Display .NET Core information.]' \ + '--list-runtimes[Display the installed runtimes.]' \ + '--list-sdks[Display the installed SDKs.]' \ + '--version[Display .NET Core SDK version in use.]' + + _values \ + 'add[Add a package or reference to a .NET project.]' \ + 'build[Build a .NET project.]' \ + 'build-server[Interact with servers started by a build.]' \ + 'clean[Clean build outputs of a .NET project.]' \ + 'help[Show command line help.]' \ + 'list[List project references of a .NET project.]' \ + 'msbuild[Run Microsoft Build Engine (MSBuild) commands.]' \ + 'new[Create a new .NET project or file.]' \ + 'nuget[Provides additional NuGet commands.]' \ + 'pack[Create a NuGet package.]' \ + 'publish[Publish a .NET project for deployment.]' \ + 'remove[Remove a package or reference from a .NET project.]' \ + 'restore[Restore dependencies specified in a .NET project.]' \ + 'run[Build and run a .NET project output.]' \ + 'sln[Modify Visual Studio solution files.]' \ + 'store[Store the specified assemblies in the runtime package store.]' \ + 'test[Run unit tests using the test runner specified in a .NET project.]' \ + 'tool[Install or manage tools that extend the .NET experience.]' \ + 'vstest[Run Microsoft Test Engine (VSTest) commands.]' \ + 'dev-certs[Create and manage development certificates.]' \ + 'fsi[Start F# Interactive / execute F# scripts.]' \ + 'sql-cache[SQL Server cache command-line tools.]' \ + 'user-secrets[Manage development user secrets.]' \ + 'watch[Start a file watcher that runs a command when files change.]' + return + fi + + if [ $CURRENT -eq 3 ]; then + case ${words[2]} in + "new") + compadd -X ".NET Installed Templates" $(_dotnet_new_completion_cached) + return + ;; + "sln") + _values \ + 'add[Add one or more projects to a solution file.]' \ + 'list[List all projects in a solution file.]' \ + 'remove[Remove one or more projects from a solution file.]' + return + ;; + "nuget") + _values \ + 'delete[Deletes a package from the server.]' \ + 'locals[Clears or lists local NuGet resources such as http requests cache, packages folder, plugin operations cache or machine-wide global packages folder.]' \ + 'push[Pushes a package to the server and publishes it.]' + return + ;; + esac + fi + + _arguments '*::arguments: _normal' +} + +compdef _dotnet dotnet + +# --------------------------------------------------------------------- # +# Other Aliases # +# --------------------------------------------------------------------- # alias dr='dotnet run' alias dt='dotnet test' -alias dw='dotnet watch' -alias dwr='dotnet watch run' alias ds='dotnet sln' alias da='dotnet add' alias dp='dotnet pack' diff --git a/zsh/.oh-my-zsh/plugins/encode64/README.md b/zsh/.oh-my-zsh/plugins/encode64/README.md index a83a3d3..66fc7cb 100644 --- a/zsh/.oh-my-zsh/plugins/encode64/README.md +++ b/zsh/.oh-my-zsh/plugins/encode64/README.md @@ -1,12 +1,6 @@ # encode64 -Alias plugin for encoding or decoding using `base64` command. - -To use it, add `encode64` to the plugins array in your zshrc file: - -```zsh -plugins=(... encode64) -``` +Alias plugin for encoding or decoding using `base64` command ## Functions and Aliases @@ -15,6 +9,23 @@ plugins=(... encode64) | `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 restart the shell: + + ```sh + exec zsh + ``` + ## Usage and examples ### Encoding diff --git a/zsh/.oh-my-zsh/plugins/fabric/README.md b/zsh/.oh-my-zsh/plugins/fabric/README.md index f121d2e..cf0fa81 100644 --- a/zsh/.oh-my-zsh/plugins/fabric/README.md +++ b/zsh/.oh-my-zsh/plugins/fabric/README.md @@ -4,6 +4,6 @@ This plugin provides completion for [Fabric](https://www.fabfile.org/). To use it add fabric to the plugins array in your zshrc file. -```zsh +```bash plugins=(... fabric) ``` diff --git a/zsh/.oh-my-zsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh b/zsh/.oh-my-zsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh index 82b9688..8ab2979 100644 --- a/zsh/.oh-my-zsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh @@ -1,10 +1,10 @@ fancy-ctrl-z () { if [[ $#BUFFER -eq 0 ]]; then BUFFER="fg" - zle accept-line -w + zle accept-line else - zle push-input -w - zle clear-screen -w + zle push-input + zle clear-screen fi } zle -N fancy-ctrl-z diff --git a/zsh/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh b/zsh/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh index 6538d09..ec2e518 100644 --- a/zsh/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh @@ -1,16 +1,12 @@ -# check if fasd is installed -if (( ! ${+commands[fasd]} )); then - return -fi +if [ $commands[fasd] ]; then # check if fasd is installed + fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" + if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init auto >| "$fasd_cache" + fi + source "$fasd_cache" + unset fasd_cache -fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" -if [[ "$commands[fasd]" -nt "$fasd_cache" || ! -s "$fasd_cache" ]]; then - fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \ - zsh-wcomp zsh-wcomp-install >| "$fasd_cache" + alias v='f -e "$EDITOR"' + alias o='a -e xdg-open' + alias j='zz' fi -source "$fasd_cache" -unset fasd_cache - -alias v='f -e "$EDITOR"' -alias o='a -e xdg-open' -alias j='zz' diff --git a/zsh/.oh-my-zsh/plugins/fastfile/fastfile.plugin.zsh b/zsh/.oh-my-zsh/plugins/fastfile/fastfile.plugin.zsh index ccbbce3..a4229e4 100644 --- a/zsh/.oh-my-zsh/plugins/fastfile/fastfile.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/fastfile/fastfile.plugin.zsh @@ -5,7 +5,7 @@ # If they are not set yet, they will be # overwritten with their default values -default fastfile_dir "${HOME}/.fastfile" +default fastfile_dir "${HOME}/.fastfile/" default fastfile_var_prefix "§" ########################### @@ -78,7 +78,7 @@ function fastfile_print() { # (=> fastfle_print) for each shortcut # function fastfile_ls() { - for f in "${fastfile_dir}"/*(NF); do + for f in "${fastfile_dir}"/*; do file=`basename "$f"` # To enable simpler handeling of spaces in file names varkey=`echo "$file" | tr " " "_"` @@ -104,7 +104,7 @@ function fastfile_rm() { # Generate the aliases for the shortcuts # function fastfile_sync() { - for f in "${fastfile_dir}"/*(NF); do + for f in "${fastfile_dir}"/*; do file=`basename "$f"` # To enable simpler handeling of spaces in file names varkey=`echo "$file" | tr " " "_"` diff --git a/zsh/.oh-my-zsh/plugins/fbterm/README.md b/zsh/.oh-my-zsh/plugins/fbterm/README.md index 70ce56d..eec33d7 100644 --- a/zsh/.oh-my-zsh/plugins/fbterm/README.md +++ b/zsh/.oh-my-zsh/plugins/fbterm/README.md @@ -3,8 +3,7 @@ This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm) if on a real TTY (`/dev/tty*`). -To use it, add `fbterm` to the plugins array of your zshrc file: - -```zsh +To use it, add fbterm to the plugins array of your zshrc file: +``` plugins=(... fbterm) ``` diff --git a/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh b/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh deleted file mode 100644 index 226506c..0000000 --- a/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh +++ /dev/null @@ -1,3 +0,0 @@ -print -P "%F{yellow}The 'fedora' plugin is deprecated. Use the '%Udnf%u' plugin instead.%f" - -source "$ZSH/plugins/dnf/dnf.plugin.zsh" diff --git a/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh b/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh new file mode 120000 index 0000000..16a2143 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/fedora/fedora.plugin.zsh @@ -0,0 +1 @@ +../dnf/dnf.plugin.zsh \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/forklift/README.md b/zsh/.oh-my-zsh/plugins/forklift/README.md index 7dfd8bf..6c4ce1e 100644 --- a/zsh/.oh-my-zsh/plugins/forklift/README.md +++ b/zsh/.oh-my-zsh/plugins/forklift/README.md @@ -1,23 +1,15 @@ -# forklift +## forklift Plugin for ForkLift, an FTP application for OS X. -To use it, add `forklift` to the plugins array in your zshrc file: - -```zsh -plugins=(... forklift) -``` - -## Requirements +### Requirements * [ForkLift](https://binarynights.com/) -## Usage +### Usage -`fl []` +fl [*file_or_folder*] * If `fl` is called without arguments then the current folder is opened in ForkLift. This is equivalent to `fl .`. -* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift - -* If `fl` is called with a non-directory file as the argument, then the file's parent directory is opened. +* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift. If called with a non-directory file as the argument, then the file's parent directory is opened. diff --git a/zsh/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh b/zsh/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh index 8588948..274c4a8 100644 --- a/zsh/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh @@ -1,7 +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 ForkLift 2 and ForkLift 3 by Johan Kaving -# Updated to support ForkLift from Setapp by Paul Rudkin # # Usage: # fl [] @@ -25,13 +24,6 @@ function fl { fi osascript 2>&1 1>/dev/null < +# HomePage : http://www.geeknote.me +# Version : 0.1 +# Tag : [ shell, zsh, completion, evernote ] +# Copyright : © 2014 by Ján Koščo, +# Released under current GPL license. +# --------------- ------------------------------------------------------------ local -a _1st_arguments _1st_arguments=( - 'login':'Authorize in Evernote.' - 'logout':'Logout from Evernote.' - 'settings':'Show and edit current settings.' - 'create':'Create note in Evernote.' - 'edit':'Edit note in Evernote.' - 'find':'Search notes in Evernote.' - 'show':'Output note in the terminal.' - 'remove':'Remove note from Evernote.' - 'notebook-list':'Show the list of existing notebooks in your Evernote.' - 'notebook-create':'Create new notebook.' - 'notebook-edit':'Edit/rename notebook.' - 'tag-list':'Show the list of existing tags in your Evernote.' - 'tag-create':'Create new tag.' - 'tag-edit':'Edit/rename tag.' - 'user':'Show information about active user.' + 'login' + 'logout' + 'settings' + 'create' + 'edit' + 'find' + 'show' + 'remove' + 'notebook-list' + 'notebook-create' + 'notebook-edit' + 'tag-list' + 'tag-create' + 'tag-edit' + 'tag-remove' + 'gnsync' + 'user' ) _arguments '*:: :->command' if (( CURRENT == 1 )); then - _describe -t commands "geeknote command" _1st_arguments - return + _describe -t commands "geeknote command" _1st_arguments + return fi local -a _command_args case "$words[1]" in - login) - __login ;; - logout) - __logout ;; - settings) - __settings ;; - create) - __create ;; - edit) - __edit ;; - find) - __find ;; - show) - __show ;; - remove) - __remove ;; - notebook-list) - __notebook-list ;; - notebook-create) - __notebook-create ;; - notebook-edit) - __notebook-edit ;; - tag-list) - __tag-list ;; - tag-create) - __tag-create ;; - tag-edit) - __tag-edit ;; - user) - __user ;; -esac + user) + _command_args=( + '(--full)--full' \ + ) + ;; + logout) + _command_args=( + '(--force)--force' \ + ) + ;; + settings) + _command_args=( + '(--editor)--editor' \ + ) + ;; + create) + _command_args=( + '(-t|--title)'{-t,--title}'[note title]' \ + '(-c|--content)'{-c,--content}'[note content]' \ + '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ + ) + ;; + edit) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + '(-t|--title)'{-t,--title}'[note title]' \ + '(-c|--content)'{-c,--content}'[note content]' \ + '(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \ + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \ + ) + ;; + remove) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + '(--force)--force' \ + ) + ;; + show) + _command_args=( + '(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \ + ) + ;; + find) + _command_args=( + '(-s|--search)'{-s,--search}'[text to search]' \ + '(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \ + '(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \ + '(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \ + '(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \ + '(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \ + '(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \ + '(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \ + ) + ;; + notebook-create) + _command_args=( + '(-t|--title)'{-t,--title}'[notebook title]' \ + ) + ;; + notebook-edit) + _command_args=( + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \ + '(-t|--title)'{-t,--title}'[new notebook title]' \ + ) + ;; + notebook-remove) + _command_args=( + '(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \ + '(--force)--force' \ + ) + ;; + tag-create) + _command_args=( + '(-t|--title)'{-t,--title}'[title of tag]' \ + ) + ;; + tag-edit) + _command_args=( + '(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \ + '(-t|--title)'{-t,--title}'[new tag name]' \ + ) + ;; + tag-remove) + _command_args=( + '(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \ + '(--force)--force' \ + ) + ;; + esac + +_arguments \ + $_command_args \ + && return 0 diff --git a/zsh/.oh-my-zsh/plugins/git-extras/README.md b/zsh/.oh-my-zsh/plugins/git-extras/README.md index 2adc9d4..987f0d8 100644 --- a/zsh/.oh-my-zsh/plugins/git-extras/README.md +++ b/zsh/.oh-my-zsh/plugins/git-extras/README.md @@ -2,16 +2,10 @@ This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras). -To use it, add `git-extras` to the plugins array in your zshrc file: - -```zsh -plugins=(... git-extras) -``` - -## Setup notes +## Setup notes The completions work by augmenting the `_git` completion provided by `zsh`. This only works with the `zsh`-provided `_git`, not the `_git` provided by `git` itself. If you have both `zsh` and `git` installed, you need to make sure that the `zsh`-provided `_git` takes precedence. ### OS X Homebrew Setup -**NOTE:** this no longer works on current Homebrew distributions of git. ~~On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands.~~ +On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands. diff --git a/zsh/.oh-my-zsh/plugins/git-flow/README.md b/zsh/.oh-my-zsh/plugins/git-flow/README.md index 9c25dec..5d8049e 100644 --- a/zsh/.oh-my-zsh/plugins/git-flow/README.md +++ b/zsh/.oh-my-zsh/plugins/git-flow/README.md @@ -1,15 +1,18 @@ # Git-Flow plugin -This plugin adds completion and aliases for the [`git-flow` command](https://github.com/nvie/gitflow). +This plugin adds completion and aliases for the `git-flow` command. More information +at https://github.com/nvie/gitflow. -To use it, add `git-flow` to the plugins array in your zshrc file: - -```zsh +Enable git-flow plugin in your zshrc file: +``` plugins=(... git-flow) ``` ## Aliases +More information about `git-flow` commands: +https://github.com/nvie/gitflow/wiki/Command-Line-Arguments + | Alias | Command | Description | |---------|----------------------------|----------------------------------------| | `gfl` | `git flow` | Git-Flow command | @@ -27,5 +30,3 @@ plugins=(... git-flow) | `gflfp` | `git flow feature publish` | Publish feature: `gflfp ` | | `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | | `gflrf` | `git flow release finish` | Finish release: `gflrf ` | - -[More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments). diff --git a/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md b/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md new file mode 100644 index 0000000..bd73e5d --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-remote-branch/README.md @@ -0,0 +1,14 @@ +# git-remote-branch plugin + +This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch), +or `git_remote_branch`. + +To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file: +``` +plugins=(... git-remote-branch) +``` + +## Deprecation + +[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived), +meaning it's not actively maintained anymore. Use at your own risk. diff --git a/zsh/.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/zsh/.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh new file mode 100644 index 0000000..6c5ab8f --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh @@ -0,0 +1,19 @@ +_git_remote_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) + if [[ -n $ref ]]; then + if (( CURRENT == 2 )); then + # first arg: operation + compadd create publish rename delete track + elif (( CURRENT == 3 )); then + # second arg: remote branch name + remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"` + compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | sed "s/ //g"` + elif (( CURRENT == 4 )); then + # third arg: remote name + compadd `git remote` + fi + else; + _files + fi +} +compdef _git_remote_branch grb diff --git a/zsh/.oh-my-zsh/plugins/git/README.md b/zsh/.oh-my-zsh/plugins/git/README.md index 8642dd0..7878f74 100644 --- a/zsh/.oh-my-zsh/plugins/git/README.md +++ b/zsh/.oh-my-zsh/plugins/git/README.md @@ -10,203 +10,194 @@ plugins=(... git) ## Aliases -| Alias | Command | -|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------| -| g | git | -| ga | git add | -| gaa | git add --all | -| gapa | git add --patch | -| gau | git add --update | -| gav | git add --verbose | -| gap | git apply | -| gapt | git apply --3way | -| gb | git branch | -| gba | git branch -a | -| gbd | git branch -d | -| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*(master\|development\|develop\|devel\|dev)\s*$)" \| command xargs -n 1 git branch -d | -| gbD | git branch -D | -| gbl | git blame -b -w | -| gbnm | git branch --no-merged | -| gbr | git branch --remote | -| gbs | git bisect | -| gbsb | git bisect bad | -| gbsg | git bisect good | -| gbsr | git bisect reset | -| gbss | git bisect start | -| gc | git commit -v | -| gc! | git commit -v --amend | -| gcn! | git commit -v --no-edit --amend | -| gca | git commit -v -a | -| gca! | git commit -v -a --amend | -| gcan! | git commit -v -a --no-edit --amend | -| gcans! | git commit -v -a -s --no-edit --amend | -| gcam | git commit -a -m | -| gcsm | git commit -s -m | -| gcb | git checkout -b | -| gcf | git config --list | -| gcl | git clone --recurse-submodules | -| gclean | git clean -id | -| gpristine | git reset --hard && git clean -dffx | -| gcm | git checkout master | -| gcd | git checkout develop | -| gcmsg | git commit -m | -| gco | git checkout | -| gcount | git shortlog -sn | -| gcp | git cherry-pick | -| gcpa | git cherry-pick --abort | -| gcpc | git cherry-pick --continue | -| gcs | git commit -S | -| gd | git diff | -| gdca | git diff --cached | -| gdcw | git diff --cached --word-diff | -| gdct | git describe --tags $(git rev-list --tags --max-count=1) | -| gds | git diff --staged | -| gdt | git diff-tree --no-commit-id --name-only -r | -| gdnolock | git diff $@ ":(exclude)package-lock.json" ":(exclude)*.lock" | -| gdv | git diff -w $@ \| view - | -| gdw | git diff --word-diff | -| gf | git fetch | -| gfa | git fetch --all --prune | -| gfg | git ls-files \| grep | -| gfo | git fetch origin | -| gg | git gui citool | -| gga | git gui citool --amend | -| ggf | git push --force origin $(current_branch) | -| ggfl | git push --force-with-lease origin $(current_branch) | -| ggl | git pull origin $(current_branch) | -| ggp | git push origin $(current_branch) | -| ggpnp | ggl && ggp | -| ggpull | git pull origin "$(git_current_branch)" | -| ggpur | ggu | -| ggpush | git push origin "$(git_current_branch)" | -| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) | -| ggu | git pull --rebase origin $(current_branch) | -| gpsup | git push --set-upstream origin $(git_current_branch) | -| ghh | git help | -| gignore | git update-index --assume-unchanged | -| gignored | git ls-files -v \| grep "^[[:lower:]]" | -| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk | -| gk | gitk --all --branches | -| gke | gitk --all $(git log -g --pretty=%h) | -| gl | git pull | -| glg | git log --stat | -| glgp | git log --stat -p | -| glgg | git log --graph | -| glgga | git log --graph --decorate --all | -| glgm | git log --graph --max-count=10 | -| glo | git log --oneline --decorate | -| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | -| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat | -| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' | -| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short | -| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all | -| glog | git log --oneline --decorate --graph | -| gloga | git log --oneline --decorate --graph --all | -| glp | git log --pretty=\ | -| gm | git merge | -| gmom | git merge origin/master | -| gmt | git mergetool --no-prompt | -| gmtvim | git mergetool --no-prompt --tool=vimdiff | -| gmum | git merge upstream/master | -| gma | git merge --abort | -| gp | git push | -| gpd | git push --dry-run | -| gpf | git push --force-with-lease | -| gpf! | git push --force | -| gpoat | git push origin --all && git push origin --tags | -| gpu | git push upstream | -| gpv | git push -v | -| gr | git remote | -| gra | git remote add | -| grb | git rebase | -| grba | git rebase --abort | -| grbc | git rebase --continue | -| grbd | git rebase develop | -| grbi | git rebase -i | -| grbm | git rebase master | -| grbs | git rebase --skip | -| grev | git revert | -| grh | git reset | -| grhh | git reset --hard | -| groh | git reset origin/$(git_current_branch) --hard | -| grm | git rm | -| grmc | git rm --cached | -| grmv | git remote rename | -| grrm | git remote remove | -| grs | git restore | -| grset | git remote set-url | -| grss | git restore --source | -| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" | -| gru | git reset -- | -| grup | git remote update | -| grv | git remote -v | -| gsb | git status -sb | -| gsd | git svn dcommit | -| gsh | git show | -| gsi | git submodule init | -| gsps | git show --pretty=short --show-signature | -| gsr | git svn rebase | -| gss | git status -s | -| gst | git status | -| gsta | git stash push | -| gsta | git stash save | -| gstaa | git stash apply | -| gstc | git stash clear | -| gstd | git stash drop | -| gstl | git stash list | -| gstp | git stash pop | -| gsts | git stash show --text | -| gstu | git stash --include-untracked | -| gstall | git stash --all | -| gsu | git submodule update | -| gsw | git switch | -| gswc | git switch -c | -| gts | git tag -s | -| gtv | git tag \| sort -V | -| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl | -| gunignore | git update-index --no-assume-unchanged | -| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 | -| gup | git pull --rebase | -| gupv | git pull --rebase -v | -| gupa | git pull --rebase --autostash | -| gupav | git pull --rebase --autostash -v | -| glum | git pull upstream master | -| gwch | git whatchanged -p --abbrev-commit --pretty=medium | -| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | -| gam | git am | -| gamc | git am --continue | -| gams | git am --skip | -| gama | git am --abort | -| gamscp | git am --show-current-patch | +| Alias | Command | +|:---------------------|:------------------------------------------------------------------------------------------------------------------------------| +| g | git | +| ga | git add | +| gaa | git add --all | +| gapa | git add --patch | +| gau | git add --update | +| gav | git add --verbose | +| gap | git apply | +| gb | git branch | +| gba | git branch -a | +| gbd | git branch -d | +| gbda | git branch --no-color --merged \| command grep -vE "^(\+|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d | +| gbD | git branch -D | +| gbl | git blame -b -w | +| gbnm | git branch --no-merged | +| gbr | git branch --remote | +| gbs | git bisect | +| gbsb | git bisect bad | +| gbsg | git bisect good | +| gbsr | git bisect reset | +| gbss | git bisect start | +| gc | git commit -v | +| gc! | git commit -v --amend | +| gcn! | git commit -v --no-edit --amend | +| gca | git commit -v -a | +| gca! | git commit -v -a --amend | +| gcan! | git commit -v -a --no-edit --amend | +| gcans! | git commit -v -a -s --no-edit --amend | +| gcam | git commit -a -m | +| gcsm | git commit -s -m | +| gcb | git checkout -b | +| gcf | git config --list | +| gcl | git clone --recurse-submodules | +| gclean | git clean -id | +| gpristine | git reset --hard && git clean -dfx | +| gcm | git checkout master | +| gcd | git checkout develop | +| gcmsg | git commit -m | +| gco | git checkout | +| gcount | git shortlog -sn | +| gcp | git cherry-pick | +| gcpa | git cherry-pick --abort | +| gcpc | git cherry-pick --continue | +| gcs | git commit -S | +| gd | git diff | +| gdca | git diff --cached | +| gdcw | git diff --cached --word-diff | +| gdct | git describe --tags $(git rev-list --tags --max-count=1) | +| gds | git diff --staged | +| gdt | git diff-tree --no-commit-id --name-only -r | +| gdv | git diff -w $@ \| view - | +| gdw | git diff --word-diff | +| gf | git fetch | +| gfa | git fetch --all --prune | +| gfg | git ls-files \| grep | +| gfo | git fetch origin | +| gg | git gui citool | +| gga | git gui citool --amend | +| ggf | git push --force origin $(current_branch) | +| ggfl | git push --force-with-lease origin $(current_branch) | +| ggl | git pull origin $(current_branch) | +| ggp | git push origin $(current_branch) | +| ggpnp | ggl && ggp | +| ggpull | git pull origin "$(git_current_branch)" | +| ggpur | ggu | +| ggpush | git push origin "$(git_current_branch)" | +| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) | +| ggu | git pull --rebase origin $(current_branch) | +| gpsup | git push --set-upstream origin $(git_current_branch) | +| ghh | git help | +| gignore | git update-index --assume-unchanged | +| gignored | git ls-files -v \| grep "^[[:lower:]]" | +| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk | +| gk | gitk --all --branches | +| gke | gitk --all $(git log -g --pretty=%h) | +| gl | git pull | +| glg | git log --stat | +| glgp | git log --stat -p | +| glgg | git log --graph | +| glgga | git log --graph --decorate --all | +| glgm | git log --graph --max-count=10 | +| glo | git log --oneline --decorate | +| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | +| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat | +| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' | +| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short | +| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all | +| glog | git log --oneline --decorate --graph | +| gloga | git log --oneline --decorate --graph --all | +| glp | `_git_log_prettily` | +| gm | git merge | +| gmom | git merge origin/master | +| gmt | git mergetool --no-prompt | +| gmtvim | git mergetool --no-prompt --tool=vimdiff | +| gmum | git merge upstream/master | +| gma | git merge --abort | +| gp | git push | +| gpd | git push --dry-run | +| gpf | git push --force-with-lease | +| gpf! | git push --force | +| gpoat | git push origin --all && git push origin --tags | +| gpu | git push upstream | +| gpv | git push -v | +| gr | git remote | +| gra | git remote add | +| grb | git rebase | +| grba | git rebase --abort | +| grbc | git rebase --continue | +| grbd | git rebase develop | +| grbi | git rebase -i | +| grbm | git rebase master | +| grbs | git rebase --skip | +| grev | git revert | +| grh | git reset | +| grhh | git reset --hard | +| groh | git reset origin/$(git_current_branch) --hard | +| grm | git rm | +| grmc | git rm --cached | +| grmv | git remote rename | +| grrm | git remote remove | +| grs | git restore | +| grset | git remote set-url | +| grss | git restore --source | +| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" | +| gru | git reset -- | +| grup | git remote update | +| grv | git remote -v | +| gsb | git status -sb | +| gsd | git svn dcommit | +| gsh | git show | +| gsi | git submodule init | +| gsps | git show --pretty=short --show-signature | +| gsr | git svn rebase | +| gss | git status -s | +| gst | git status | +| gsta | git stash push | +| gsta | git stash save | +| gstaa | git stash apply | +| gstc | git stash clear | +| gstd | git stash drop | +| gstl | git stash list | +| gstp | git stash pop | +| gsts | git stash show --text | +| gstall | git stash --all | +| gsu | git submodule update | +| gsw | git switch | +| gswc | git switch -c | +| gts | git tag -s | +| gtv | git tag \| sort -V | +| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl | +| gunignore | git update-index --no-assume-unchanged | +| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 | +| gup | git pull --rebase | +| gupv | git pull --rebase -v | +| gupa | git pull --rebase --autostash | +| gupav | git pull --rebase --autostash -v | +| glum | git pull upstream master | +| gwch | git whatchanged -p --abbrev-commit --pretty=medium | +| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | -### Deprecated aliases +### Deprecated These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support. -| Alias | Command | Modification | -| :----- | :----------------------------------------------------- | :----------------------------------------------------- | -| gap | `git add --patch` | new alias `gapa` | -| gcl | `git config --list` | new alias `gcf` | -| gdc | `git diff --cached` | new alias `gdca` | -| gdt | `git difftool` | no replacement | -| ggpull | `git pull origin $(current_branch)` | new alias `ggl` (`ggpull` still exists for now though) | -| ggpur | `git pull --rebase origin $(current_branch)` | new alias `ggu` (`ggpur` still exists for now though) | -| ggpush | `git push origin $(current_branch)` | new alias `ggp` (`ggpush` still exists for now though) | -| gk | `gitk --all --branches` | now aliased to `gitk --all --branches` | -| glg | `git log --stat --max-count = 10` | now aliased to `git log --stat --color` | -| glgg | `git log --graph --max-count = 10` | now aliased to `git log --graph --color` | -| gwc | `git whatchanged -p --abbrev-commit --pretty = medium` | new alias `gwch` | +| Alias | Command | Modification | +| :----- | :----------------------------------------------------------------------------------| --------------------------------------------------------------------------------------------------- | +| gap | git add --patch | new alias `gapa` | +| gcl | git config --list | new alias `gcf` | +| gdc | git diff --cached | new alias `gdca` | +| gdt | git difftool | no replacement | +| ggpull | git pull origin $(current_branch) | new alias `ggl` (`ggpull` still exists for now though) | +| ggpur | git pull --rebase origin $(current_branch) | new alias `ggu` (`ggpur` still exists for now though) | +| ggpush | git push origin $(current_branch) | new alias `ggp` (`ggpush` still exists for now though) | +| gk | gitk --all --branches | now aliased to `gitk --all --branches` | +| glg | git log --stat --max-count = 10 | now aliased to `git log --stat --color` | +| glgg | git log --graph --max-count = 10 | now aliased to `git log --graph --color` | +| gwc | git whatchanged -p --abbrev-commit --pretty = medium | new alias `gwch` | ## Functions ### Current -| Command | Description | -|:-----------------------|:---------------------------------------------------------| -| `grename ` | Rename `old` branch to `new`, including in origin remote | -| current_branch | Return the name of the current branch | -| git_current_user_name | Returns the `user.name` config value | -| git_current_user_email | Returns the `user.email` config value | +| Command | Description | +|:-----------------------|:----------------------------------------| +| current_branch | Return the name of the current branch | +| git_current_user_name | Returns the `user.name` config value | +| git_current_user_email | Returns the `user.email` config value | ### Work in Progress (WIP) @@ -218,7 +209,7 @@ These features allow to pause a branch development and switch to another one (_" | gwip | Commit wip branch | | gunwip | Uncommit wip branch | -### Deprecated functions +### Deprecated | Command | Description | Reason | |:-----------------------|:----------------------------------------|:----------------------------------------------------------------| diff --git a/zsh/.oh-my-zsh/plugins/git/git.plugin.zsh b/zsh/.oh-my-zsh/plugins/git/git.plugin.zsh index 1112421..d8c4cff 100644 --- a/zsh/.oh-my-zsh/plugins/git/git.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/git/git.plugin.zsh @@ -38,12 +38,11 @@ alias gapa='git add --patch' alias gau='git add --update' alias gav='git add --verbose' alias gap='git apply' -alias gapt='git apply --3way' 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|development|develop|devel|dev)\s*$)" | command xargs -n 1 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' @@ -67,7 +66,7 @@ alias gcb='git checkout -b' alias gcf='git config --list' alias gcl='git clone --recurse-submodules' alias gclean='git clean -id' -alias gpristine='git reset --hard && git clean -dffx' +alias gpristine='git reset --hard && git clean -dfx' alias gcm='git checkout master' alias gcd='git checkout develop' alias gcmsg='git commit -m' @@ -86,11 +85,6 @@ alias gds='git diff --staged' alias gdt='git diff-tree --no-commit-id --name-only -r' alias gdw='git diff --word-diff' -function gdnolock() { - git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock" -} -compdef _git gdnolock=git-diff - function gdv() { git diff -w "$@" | view - } compdef _git gdv=git-diff @@ -242,7 +236,6 @@ alias gstd='git stash drop' alias gstl='git stash list' alias gstp='git stash pop' alias gsts='git stash show --text' -alias gstu='git stash --include-untracked' alias gstall='git stash --all' alias gsu='git submodule update' alias gsw='git switch' @@ -262,23 +255,3 @@ alias glum='git pull upstream master' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' - -alias gam='git am' -alias gamc='git am --continue' -alias gams='git am --skip' -alias gama='git am --abort' -alias gamscp='git am --show-current-patch' - -function grename() { - if [[ -z "$1" || -z "$2" ]]; then - echo "Usage: $0 old_branch new_branch" - return 1 - fi - - # Rename branch locally - git branch -m "$1" "$2" - # Rename branch in origin remote - if git push origin :"$1"; then - git push --set-upstream origin "$2" - fi -} diff --git a/zsh/.oh-my-zsh/plugins/gitfast/README.md b/zsh/.oh-my-zsh/plugins/gitfast/README.md index fed4b12..23db539 100644 --- a/zsh/.oh-my-zsh/plugins/gitfast/README.md +++ b/zsh/.oh-my-zsh/plugins/gitfast/README.md @@ -1,6 +1,6 @@ # 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. +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: diff --git a/zsh/.oh-my-zsh/plugins/gitfast/_git b/zsh/.oh-my-zsh/plugins/gitfast/_git index 78a6dbb..886bf95 100644 --- a/zsh/.oh-my-zsh/plugins/gitfast/_git +++ b/zsh/.oh-my-zsh/plugins/gitfast/_git @@ -30,7 +30,7 @@ if [ -z "$script" ]; then local -a locations local e locations=( - "$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash" + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash '/etc/bash_completion.d/git' # fedora, old debian '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian '/usr/share/bash-completion/git' # gentoo @@ -39,7 +39,7 @@ if [ -z "$script" ]; then test -f $e && script="$e" && break done fi -ZSH_VERSION='' . "$script" +GIT_SOURCING_ZSH_COMPLETION=y . "$script" __gitcomp () { @@ -93,13 +93,22 @@ __gitcomp_nl_append () compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 } +__gitcomp_file_direct () +{ + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -f -- ${=1} && _ret=0 +} + __gitcomp_file () { emulate -L zsh local IFS=$'\n' compset -P '*[=:]' - compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 + compadd -p "${2-}" -f -- ${=1} && _ret=0 } __git_zsh_bash_func () @@ -223,10 +232,8 @@ _git () if (( $+functions[__${service}_zsh_main] )); then __${service}_zsh_main - elif (( $+functions[__${service}_main] )); then + else emulate ksh -c __${service}_main - elif (( $+functions[_${service}] )); then - emulate ksh -c _${service} fi let _ret && _default && _ret=0 diff --git a/zsh/.oh-my-zsh/plugins/gitfast/git-completion.bash b/zsh/.oh-my-zsh/plugins/gitfast/git-completion.bash index b6ff5dc..e087c4b 100644 --- a/zsh/.oh-my-zsh/plugins/gitfast/git-completion.bash +++ b/zsh/.oh-my-zsh/plugins/gitfast/git-completion.bash @@ -29,13 +29,16 @@ # tell the completion to use commit completion. This also works with aliases # of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". # +# Compatible with bash 3.2.57. +# # 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). +# and git-switch completion (e.g., completing "foo" when "origin/foo" +# exists). case "$COMP_WORDBREAKS" in *:*) : great ;; @@ -92,6 +95,70 @@ __git () ${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null } +# Removes backslash escaping, single quotes and double quotes from a word, +# stores the result in the variable $dequoted_word. +# 1: The word to dequote. +__git_dequote () +{ + local rest="$1" len ch + + dequoted_word="" + + while test -n "$rest"; do + len=${#dequoted_word} + dequoted_word="$dequoted_word${rest%%[\\\'\"]*}" + rest="${rest:$((${#dequoted_word}-$len))}" + + case "${rest:0:1}" in + \\) + ch="${rest:1:1}" + case "$ch" in + $'\n') + ;; + *) + dequoted_word="$dequoted_word$ch" + ;; + esac + rest="${rest:2}" + ;; + \') + rest="${rest:1}" + len=${#dequoted_word} + dequoted_word="$dequoted_word${rest%%\'*}" + rest="${rest:$((${#dequoted_word}-$len+1))}" + ;; + \") + rest="${rest:1}" + while test -n "$rest" ; do + len=${#dequoted_word} + dequoted_word="$dequoted_word${rest%%[\\\"]*}" + rest="${rest:$((${#dequoted_word}-$len))}" + case "${rest:0:1}" in + \\) + ch="${rest:1:1}" + case "$ch" in + \"|\\|\$|\`) + dequoted_word="$dequoted_word$ch" + ;; + $'\n') + ;; + *) + dequoted_word="$dequoted_word\\$ch" + ;; + esac + rest="${rest:2}" + ;; + \") + rest="${rest:1}" + break + ;; + esac + done + ;; + esac + done +} + # The following function is based on code from: # # bash_completion - programmable completion functions for bash 3.2+ @@ -264,9 +331,32 @@ __gitcomp () case "$cur_" in --*=) ;; + --no-*) + local c i=0 IFS=$' \t\n' + for c in $1; do + if [[ $c == "--" ]]; then + continue + fi + c="$c${4-}" + if [[ $c == "$cur_"* ]]; then + case $c in + --*=*|*.) ;; + *) c="$c " ;; + esac + COMPREPLY[i++]="${2-}$c" + fi + done + ;; *) local c i=0 IFS=$' \t\n' for c in $1; do + if [[ $c == "--" ]]; then + c="--no-...${4-}" + if [[ $c == "$cur_"* ]]; then + COMPREPLY[i++]="${2-}$c " + fi + break + fi c="$c${4-}" if [[ $c == "$cur_"* ]]; then case $c in @@ -280,6 +370,48 @@ __gitcomp () esac } +# Clear the variables caching builtins' options when (re-)sourcing +# the completion script. +if [[ -n ${ZSH_VERSION-} ]]; then + unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null +else + unset $(compgen -v __gitcomp_builtin_) +fi + +# This function is equivalent to +# +# __gitcomp "$(git xxx --git-completion-helper) ..." +# +# except that the output is cached. Accept 1-3 arguments: +# 1: the git command to execute, this is also the cache key +# 2: extra options to be added on top (e.g. negative forms) +# 3: options to be excluded +__gitcomp_builtin () +{ + # spaces must be replaced with underscore for multi-word + # commands, e.g. "git remote add" becomes remote_add. + local cmd="$1" + local incl="$2" + local excl="$3" + + local var=__gitcomp_builtin_"${cmd/-/_}" + local options + eval "options=\$$var" + + if [ -z "$options" ]; then + # leading and trailing spaces are significant to make + # option removal work correctly. + options=" $incl $(__git ${cmd/_/ } --git-completion-helper) " || return + + for i in $excl; do + options="${options/ $i / }" + done + eval "$var=\"$options\"" + fi + + __gitcomp "$options" +} + # Variation of __gitcomp_nl () that appends to the existing list of # completion candidates, COMPREPLY. __gitcomp_nl_append () @@ -303,6 +435,24 @@ __gitcomp_nl () __gitcomp_nl_append "$@" } +# Fills the COMPREPLY array with prefiltered paths without any additional +# processing. +# Callers must take care of providing only paths that match the current path +# to be completed and adding any prefix path components, if necessary. +# 1: List of newline-separated matching paths, complete with all prefix +# path components. +__gitcomp_file_direct () +{ + local IFS=$'\n' + + COMPREPLY=($1) + + # use a hack to enable file mode in bash < 4 + compopt -o filenames +o nospace 2>/dev/null || + compgen -f /non-existing-dir/ >/dev/null || + true +} + # Generates completion reply with compgen from newline-separated possible # completion filenames. # It accepts 1 to 3 arguments: @@ -322,7 +472,8 @@ __gitcomp_file () # use a hack to enable file mode in bash < 4 compopt -o filenames +o nospace 2>/dev/null || - compgen -f /non-existing-dir/ > /dev/null + compgen -f /non-existing-dir/ >/dev/null || + true } # Execute 'git ls-files', unless the --committable option is specified, in @@ -332,10 +483,12 @@ __gitcomp_file () __git_ls_files_helper () { if [ "$2" == "--committable" ]; then - __git -C "$1" diff-index --name-only --relative HEAD + __git -C "$1" -c core.quotePath=false diff-index \ + --name-only --relative HEAD -- "${3//\\/\\\\}*" else # NOTE: $2 is not quoted in order to support multiple options - __git -C "$1" ls-files --exclude-standard $2 + __git -C "$1" -c core.quotePath=false ls-files \ + --exclude-standard $2 -- "${3//\\/\\\\}*" fi } @@ -346,17 +499,103 @@ __git_ls_files_helper () # If provided, only files within the specified directory are listed. # Sub directories are never recursed. Path must have a trailing # slash. +# 3: List only paths matching this path component (optional). __git_index_files () { - local root="${2-.}" file + local root="$2" match="$3" - __git_ls_files_helper "$root" "$1" | - while read -r file; do - case "$file" in - ?*/*) echo "${file%%/*}" ;; - *) echo "$file" ;; - esac - done | sort | uniq + __git_ls_files_helper "$root" "$1" "$match" | + awk -F / -v pfx="${2//\\/\\\\}" '{ + paths[$1] = 1 + } + END { + for (p in paths) { + if (substr(p, 1, 1) != "\"") { + # No special characters, easy! + print pfx p + continue + } + + # The path is quoted. + p = dequote(p) + if (p == "") + continue + + # Even when a directory name itself does not contain + # any special characters, it will still be quoted if + # any of its (stripped) trailing path components do. + # Because of this we may have seen the same direcory + # both quoted and unquoted. + if (p in paths) + # We have seen the same directory unquoted, + # skip it. + continue + else + print pfx p + } + } + function dequote(p, bs_idx, out, esc, esc_idx, dec) { + # Skip opening double quote. + p = substr(p, 2) + + # Interpret backslash escape sequences. + while ((bs_idx = index(p, "\\")) != 0) { + out = out substr(p, 1, bs_idx - 1) + esc = substr(p, bs_idx + 1, 1) + p = substr(p, bs_idx + 2) + + if ((esc_idx = index("abtvfr\"\\", esc)) != 0) { + # C-style one-character escape sequence. + out = out substr("\a\b\t\v\f\r\"\\", + esc_idx, 1) + } else if (esc == "n") { + # Uh-oh, a newline character. + # We cant reliably put a pathname + # containing a newline into COMPREPLY, + # and the newline would create a mess. + # Skip this path. + return "" + } else { + # Must be a \nnn octal value, then. + dec = esc * 64 + \ + substr(p, 1, 1) * 8 + \ + substr(p, 2, 1) + out = out sprintf("%c", dec) + p = substr(p, 3) + } + } + # Drop closing double quote, if there is one. + # (There isnt any if this is a directory, as it was + # already stripped with the trailing path components.) + if (substr(p, length(p), 1) == "\"") + out = out substr(p, 1, length(p) - 1) + else + out = out p + + return out + }' +} + +# __git_complete_index_file requires 1 argument: +# 1: the options to pass to ls-file +# +# The exception is --committable, which finds the files appropriate commit. +__git_complete_index_file () +{ + local dequoted_word pfx="" cur_ + + __git_dequote "$cur" + + case "$dequoted_word" in + ?*/*) + pfx="${dequoted_word%/*}/" + cur_="${dequoted_word##*/}" + ;; + *) + cur_="$dequoted_word" + esac + + __gitcomp_file_direct "$(__git_index_files "$1" "$pfx" "$cur_")" } # Lists branches from the local repository. @@ -439,7 +678,7 @@ __git_refs () track="" ;; *) - for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD; do case "$i" in $match*) if [ -e "$dir/$i" ]; then @@ -594,7 +833,7 @@ __git_is_configured_remote () __git_list_merge_strategies () { - git merge -s help 2>&1 | + LANG=C LC_ALL=C git merge -s help 2>&1 | sed -n -e '/[Aa]vailable strategies are: /,/^$/{ s/\.$// s/.*:// @@ -616,9 +855,14 @@ __git_compute_merge_strategies () __git_merge_strategies=$(__git_list_merge_strategies) } +__git_merge_strategy_options="ours theirs subtree subtree= patience + histogram diff-algorithm= ignore-space-change ignore-all-space + ignore-space-at-eol renormalize no-renormalize no-renames + find-renames find-renames= rename-threshold=" + __git_complete_revlist_file () { - local pfx ls ref cur_="$cur" + local dequoted_word pfx ls ref cur_="$cur" case "$cur_" in *..?*:*) return @@ -626,14 +870,18 @@ __git_complete_revlist_file () ?*:*) ref="${cur_%%:*}" cur_="${cur_#*:}" - case "$cur_" in + + __git_dequote "$cur_" + + case "$dequoted_word" in ?*/*) - pfx="${cur_%/*}" - cur_="${cur_##*/}" + pfx="${dequoted_word%/*}" + cur_="${dequoted_word##*/}" ls="$ref:$pfx" pfx="$pfx/" ;; *) + cur_="$dequoted_word" ls="$ref" ;; esac @@ -643,21 +891,10 @@ __git_complete_revlist_file () *) pfx="$ref:$pfx" ;; esac - __gitcomp_nl "$(__git ls-tree "$ls" \ - | sed '/^100... blob /{ - s,^.* ,, - s,$, , - } - /^120000 blob /{ - s,^.* ,, - s,$, , - } - /^040000 tree /{ - s,^.* ,, - s,$,/, - } - s/^.* //')" \ - "$pfx" "$cur_" "" + __gitcomp_file "$(__git ls-tree "$ls" \ + | sed 's/^.* // + s/$//')" \ + "$pfx" "$cur_" ;; *...*) pfx="${cur_%...*}..." @@ -675,26 +912,6 @@ __git_complete_revlist_file () esac } - -# __git_complete_index_file requires 1 argument: -# 1: the options to pass to ls-file -# -# The exception is --committable, which finds the files appropriate commit. -__git_complete_index_file () -{ - local pfx="" cur_="$cur" - - case "$cur_" in - ?*/*) - pfx="${cur_%/*}" - cur_="${cur_##*/}" - pfx="${pfx}/" - ;; - esac - - __gitcomp_file "$(__git_index_files "$1" ${pfx:+"$pfx"})" "$pfx" "$cur_" -} - __git_complete_file () { __git_complete_revlist_file @@ -726,6 +943,7 @@ __git_complete_remote_or_refspec () *) ;; esac ;; + --multiple) no_complete_refspec=1; break ;; -*) ;; *) remote="$i"; break ;; esac @@ -785,136 +1003,30 @@ __git_complete_strategy () -s|--strategy) __gitcomp "$__git_merge_strategies" return 0 + ;; + -X) + __gitcomp "$__git_merge_strategy_options" + return 0 + ;; esac case "$cur" in --strategy=*) __gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}" return 0 ;; + --strategy-option=*) + __gitcomp "$__git_merge_strategy_options" "" "${cur##--strategy-option=}" + return 0 + ;; esac return 1 } -__git_commands () { - if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}" - then - printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}" - else - git help -a|egrep '^ [a-zA-Z0-9]' - fi -} - -__git_list_all_commands () -{ - local i IFS=" "$'\n' - for i in $(__git_commands) - do - case $i in - *--*) : helper pattern;; - *) echo $i;; - esac - done -} - __git_all_commands= __git_compute_all_commands () { test -n "$__git_all_commands" || - __git_all_commands=$(__git_list_all_commands) -} - -__git_list_porcelain_commands () -{ - local i IFS=" "$'\n' - __git_compute_all_commands - for i in $__git_all_commands - do - case $i in - *--*) : helper pattern;; - applymbox) : ask gittus;; - applypatch) : ask gittus;; - archimport) : import;; - cat-file) : plumbing;; - check-attr) : plumbing;; - check-ignore) : plumbing;; - check-mailmap) : plumbing;; - check-ref-format) : plumbing;; - checkout-index) : plumbing;; - column) : internal helper;; - commit-tree) : plumbing;; - count-objects) : infrequent;; - credential) : credentials;; - credential-*) : credentials helper;; - cvsexportcommit) : export;; - cvsimport) : import;; - cvsserver) : daemon;; - daemon) : daemon;; - diff-files) : plumbing;; - diff-index) : plumbing;; - diff-tree) : plumbing;; - fast-import) : import;; - fast-export) : export;; - fsck-objects) : plumbing;; - fetch-pack) : plumbing;; - fmt-merge-msg) : plumbing;; - for-each-ref) : plumbing;; - hash-object) : plumbing;; - http-*) : transport;; - index-pack) : plumbing;; - init-db) : deprecated;; - local-fetch) : plumbing;; - ls-files) : plumbing;; - ls-remote) : plumbing;; - ls-tree) : plumbing;; - mailinfo) : plumbing;; - mailsplit) : plumbing;; - merge-*) : plumbing;; - mktree) : plumbing;; - mktag) : plumbing;; - pack-objects) : plumbing;; - pack-redundant) : plumbing;; - pack-refs) : plumbing;; - parse-remote) : plumbing;; - patch-id) : plumbing;; - prune) : plumbing;; - prune-packed) : plumbing;; - quiltimport) : import;; - read-tree) : plumbing;; - receive-pack) : plumbing;; - remote-*) : transport;; - rerere) : plumbing;; - rev-list) : plumbing;; - rev-parse) : plumbing;; - runstatus) : plumbing;; - sh-setup) : internal;; - shell) : daemon;; - show-ref) : plumbing;; - send-pack) : plumbing;; - show-index) : plumbing;; - ssh-*) : transport;; - stripspace) : plumbing;; - symbolic-ref) : plumbing;; - unpack-file) : plumbing;; - unpack-objects) : plumbing;; - update-index) : plumbing;; - update-ref) : plumbing;; - update-server-info) : daemon;; - upload-archive) : plumbing;; - upload-pack) : plumbing;; - write-tree) : plumbing;; - var) : infrequent;; - verify-pack) : infrequent;; - verify-tag) : plumbing;; - *) echo $i;; - esac - done -} - -__git_porcelain_commands= -__git_compute_porcelain_commands () -{ - test -n "$__git_porcelain_commands" || - __git_porcelain_commands=$(__git_list_porcelain_commands) + __git_all_commands=$(__git --list-cmds=main,others,alias,nohelpers) } # Lists all set config variables starting with the given section prefix, @@ -932,11 +1044,6 @@ __git_pretty_aliases () __git_get_config_variables "pretty" } -__git_aliases () -{ - __git_get_config_variables "alias" -} - # __git_aliased_command requires 1 argument __git_aliased_command () { @@ -1072,12 +1179,14 @@ __git_count_arguments () } __git_whitespacelist="nowarn warn error error-all fix" +__git_patchformat="mbox stgit stgit-series hg mboxrd" +__git_am_inprogress_options="--skip --continue --resolved --abort --quit --show-current-patch" _git_am () { __git_find_repo_path if [ -d "$__git_repo_path"/rebase-apply ]; then - __gitcomp "--skip --continue --resolved --abort" + __gitcomp "$__git_am_inprogress_options" return fi case "$cur" in @@ -1085,13 +1194,13 @@ _git_am () __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" return ;; + --patch-format=*) + __gitcomp "$__git_patchformat" "" "${cur##--patch-format=}" + return + ;; --*) - __gitcomp " - --3way --committer-date-is-author-date --ignore-date - --ignore-whitespace --ignore-space-change - --interactive --keep --no-utf8 --signoff --utf8 - --whitespace= --scissors - " + __gitcomp_builtin am "" \ + "$__git_am_inprogress_options" return esac } @@ -1104,14 +1213,7 @@ _git_apply () return ;; --*) - __gitcomp " - --stat --numstat --summary --check --index - --cached --index-info --reverse --reject --unidiff-zero - --apply --no-add --exclude= - --ignore-whitespace --ignore-space-change - --whitespace= --inaccurate-eof --verbose - --recount --directory= - " + __gitcomp_builtin apply return esac } @@ -1119,11 +1221,12 @@ _git_apply () _git_add () { case "$cur" in + --chmod=*) + __gitcomp "+x -x" "" "${cur##--chmod=}" + return + ;; --*) - __gitcomp " - --interactive --refresh --patch --update --dry-run - --ignore-errors --intent-to-add --force --edit --chmod= - " + __gitcomp_builtin add return esac @@ -1182,6 +1285,8 @@ _git_bisect () esac } +__git_ref_fieldlist="refname objecttype objectsize objectname upstream push HEAD symref" + _git_branch () { local i c=1 only_local_ref="n" has_r="n" @@ -1200,13 +1305,7 @@ _git_branch () __git_complete_refs --cur="${cur##--set-upstream-to=}" ;; --*) - __gitcomp " - --color --no-color --verbose --abbrev= --no-abbrev - --track --no-track --contains --no-contains --merged --no-merged - --set-upstream-to= --edit-description --list - --unset-upstream --delete --move --copy --remotes - --column --no-column --sort= --points-at - " + __gitcomp_builtin branch ;; *) if [ $only_local_ref = "y" -a $has_r = "n" ]; then @@ -1247,11 +1346,7 @@ _git_checkout () __gitcomp "diff3 merge" "" "${cur##--conflict=}" ;; --*) - __gitcomp " - --quiet --ours --theirs --track --no-track --merge - --conflict= --orphan --patch --detach --ignore-skip-worktree-bits - --recurse-submodules --no-recurse-submodules - " + __gitcomp_builtin checkout ;; *) # check if --track, --no-track, or --no-guess was specified @@ -1266,21 +1361,22 @@ _git_checkout () esac } -_git_cherry () -{ - __git_complete_refs -} +__git_cherry_pick_inprogress_options="--continue --quit --abort" _git_cherry_pick () { __git_find_repo_path if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then - __gitcomp "--continue --quit --abort" + __gitcomp "$__git_cherry_pick_inprogress_options" return fi + + __git_complete_strategy && return + case "$cur" in --*) - __gitcomp "--edit --no-commit --signoff --strategy= --mainline" + __gitcomp_builtin cherry-pick "" \ + "$__git_cherry_pick_inprogress_options" ;; *) __git_complete_refs @@ -1292,7 +1388,7 @@ _git_clean () { case "$cur" in --*) - __gitcomp "--dry-run --quiet" + __gitcomp_builtin clean return ;; esac @@ -1305,26 +1401,7 @@ _git_clone () { case "$cur" in --*) - __gitcomp " - --local - --no-hardlinks - --shared - --reference - --quiet - --no-checkout - --bare - --mirror - --origin - --upload-pack - --template= - --depth - --single-branch - --no-tags - --branch - --recurse-submodules - --no-single-branch - --shallow-submodules - " + __gitcomp_builtin clone return ;; esac @@ -1357,16 +1434,7 @@ _git_commit () return ;; --*) - __gitcomp " - --all --author= --signoff --verify --no-verify - --edit --no-edit - --amend --include --only --interactive - --dry-run --reuse-message= --reedit-message= - --reset-author --file= --message= --template= - --cleanup= --untracked-files --untracked-files= - --verbose --quiet --fixup= --squash= - --patch --short --date --allow-empty - " + __gitcomp_builtin commit return esac @@ -1382,11 +1450,7 @@ _git_describe () { case "$cur" in --*) - __gitcomp " - --all --tags --contains --abbrev= --candidates= - --exact-match --debug --long --match --always --first-parent - --exclude --dirty --broken - " + __gitcomp_builtin describe return esac __git_complete_refs @@ -1411,7 +1475,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary --dirstat --dirstat= --dirstat-by-file --dirstat-by-file= --cumulative --diff-algorithm= - --submodule --submodule= + --submodule --submodule= --ignore-submodules " _git_diff () @@ -1439,7 +1503,8 @@ _git_diff () } __git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff - tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare + tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc + codecompare smerge " _git_difftool () @@ -1452,11 +1517,11 @@ _git_difftool () return ;; --*) - __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs - --no-renames --diff-filter= --find-copies-harder - --relative --ignore-submodules - --tool=" + __gitcomp_builtin difftool "$__git_diff_common_options + --base --cached --ours --theirs + --pickaxe-all --pickaxe-regex + --relative --staged + " return ;; esac @@ -1465,12 +1530,6 @@ _git_difftool () __git_fetch_recurse_submodules="yes on-demand no" -__git_fetch_options=" - --quiet --verbose --append --upload-pack --force --keep --depth= - --tags --no-tags --all --prune --dry-run --recurse-submodules= - --unshallow --update-shallow -" - _git_fetch () { case "$cur" in @@ -1478,21 +1537,21 @@ _git_fetch () __gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}" return ;; + --filter=*) + __gitcomp "blob:none blob:limit= sparse:oid=" "" "${cur##--filter=}" + return + ;; --*) - __gitcomp "$__git_fetch_options" + __gitcomp_builtin fetch return ;; esac __git_complete_remote_or_refspec } -__git_format_patch_options=" - --stdout --attach --no-attach --thread --thread= --no-thread - --numbered --start-number --numbered-files --keep-subject --signoff - --signature --no-signature --in-reply-to= --cc= --full-index --binary - --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix= - --inline --suffix= --ignore-if-in-upstream --subject-prefix= - --output-directory --reroll-count --to= --quiet --notes +__git_format_patch_extra_options=" + --full-index --not --all --no-prefix --src-prefix= + --dst-prefix= --notes " _git_format_patch () @@ -1505,7 +1564,7 @@ _git_format_patch () return ;; --*) - __gitcomp "$__git_format_patch_options" + __gitcomp_builtin format-patch "$__git_format_patch_extra_options" return ;; esac @@ -1516,20 +1575,7 @@ _git_fsck () { case "$cur" in --*) - __gitcomp " - --tags --root --unreachable --cache --no-reflogs --full - --strict --verbose --lost-found --name-objects - " - return - ;; - esac -} - -_git_gc () -{ - case "$cur" in - --*) - __gitcomp "--prune --aggressive" + __gitcomp_builtin fsck return ;; esac @@ -1585,21 +1631,7 @@ _git_grep () case "$cur" in --*) - __gitcomp " - --cached - --text --ignore-case --word-regexp --invert-match - --full-name --line-number - --extended-regexp --basic-regexp --fixed-strings - --perl-regexp - --threads - --files-with-matches --name-only - --files-without-match - --max-depth - --count - --and --or --not --all-match - --break --heading --show-function --function-context - --untracked --no-index - " + __gitcomp_builtin grep return ;; esac @@ -1617,17 +1649,16 @@ _git_help () { case "$cur" in --*) - __gitcomp "--all --guides --info --man --web" + __gitcomp_builtin help return ;; esac - __git_compute_all_commands - __gitcomp "$__git_all_commands $(__git_aliases) - attributes cli core-tutorial cvs-migration - diffcore everyday gitk glossary hooks ignore modules - namespaces repository-layout revisions tutorial tutorial-2 - workflows - " + if test -n "$GIT_TESTING_ALL_COMMAND_LIST" + then + __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk" + else + __gitcomp "$(__git --list-cmds=main,nohelpers,alias,list-guide) gitk" + fi } _git_init () @@ -1640,7 +1671,7 @@ _git_init () return ;; --*) - __gitcomp "--quiet --bare --template= --shared --shared=" + __gitcomp_builtin init return ;; esac @@ -1650,13 +1681,7 @@ _git_ls_files () { case "$cur" in --*) - __gitcomp "--cached --deleted --modified --others --ignored - --stage --directory --no-empty-directory --unmerged - --killed --exclude= --exclude-from= - --exclude-per-directory= --exclude-standard - --error-unmatch --with-tree= --full-name - --abbrev --ignored --exclude-per-directory - " + __gitcomp_builtin ls-files return ;; esac @@ -1670,7 +1695,7 @@ _git_ls_remote () { case "$cur" in --*) - __gitcomp "--heads --tags --refs --get-url --symref" + __gitcomp_builtin ls-remote return ;; esac @@ -1679,6 +1704,13 @@ _git_ls_remote () _git_ls_tree () { + case "$cur" in + --*) + __gitcomp_builtin ls-tree + return + ;; + esac + __git_complete_file } @@ -1705,8 +1737,8 @@ __git_log_shortlog_options=" --all-match --invert-grep " -__git_log_pretty_formats="oneline short medium full fuller email raw format:" -__git_log_date_formats="relative iso8601 rfc2822 short local default raw" +__git_log_pretty_formats="oneline short medium full fuller email raw format: mboxrd" +__git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format:" _git_log () { @@ -1794,22 +1826,13 @@ _git_log () __git_complete_revlist } -# Common merge options shared by git-merge(1) and git-pull(1). -__git_merge_options=" - --no-commit --no-stat --log --no-log --squash --strategy - --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit - --verify-signatures --no-verify-signatures --gpg-sign - --quiet --verbose --progress --no-progress -" - _git_merge () { __git_complete_strategy && return case "$cur" in --*) - __gitcomp "$__git_merge_options - --rerere-autoupdate --no-rerere-autoupdate --abort --continue" + __gitcomp_builtin merge return esac __git_complete_refs @@ -1823,7 +1846,7 @@ _git_mergetool () return ;; --*) - __gitcomp "--tool= --prompt --no-prompt" + __gitcomp "--tool= --prompt --no-prompt --gui --no-gui" return ;; esac @@ -1833,7 +1856,7 @@ _git_merge_base () { case "$cur" in --*) - __gitcomp "--octopus --independent --is-ancestor --fork-point" + __gitcomp_builtin merge-base return ;; esac @@ -1844,7 +1867,7 @@ _git_mv () { case "$cur" in --*) - __gitcomp "--dry-run" + __gitcomp_builtin mv return ;; esac @@ -1858,19 +1881,14 @@ _git_mv () fi } -_git_name_rev () -{ - __gitcomp "--tags --all --stdin" -} - _git_notes () { - local subcommands='add append copy edit list prune remove show' + local subcommands='add append copy edit get-ref list merge prune remove show' local subcommand="$(__git_find_on_cmdline "$subcommands")" case "$subcommand,$cur" in ,--*) - __gitcomp '--ref' + __gitcomp_builtin notes ;; ,*) case "$prev" in @@ -1882,21 +1900,14 @@ _git_notes () ;; esac ;; - add,--reuse-message=*|append,--reuse-message=*|\ - add,--reedit-message=*|append,--reedit-message=*) + *,--reuse-message=*|*,--reedit-message=*) __git_complete_refs --cur="${cur#*=}" ;; - add,--*|append,--*) - __gitcomp '--file= --message= --reedit-message= - --reuse-message=' + *,--*) + __gitcomp_builtin notes_$subcommand ;; - copy,--*) - __gitcomp '--stdin' - ;; - prune,--*) - __gitcomp '--dry-run --verbose' - ;; - prune,*) + prune,*|get-ref,*) + # this command does not take a ref, do not complete it ;; *) case "$prev" in @@ -1920,12 +1931,8 @@ _git_pull () return ;; --*) - __gitcomp " - --rebase --no-rebase - --autostash --no-autostash - $__git_merge_options - $__git_fetch_options - " + __gitcomp_builtin pull + return ;; esac @@ -1976,27 +1983,36 @@ _git_push () return ;; --*) - __gitcomp " - --all --mirror --tags --dry-run --force --verbose - --quiet --prune --delete --follow-tags - --receive-pack= --repo= --set-upstream - --force-with-lease --force-with-lease= --recurse-submodules= - " + __gitcomp_builtin push return ;; esac __git_complete_remote_or_refspec } +_git_range_diff () +{ + case "$cur" in + --*) + __gitcomp " + --creation-factor= --no-dual-color + $__git_diff_common_options + " + return + ;; + esac + __git_complete_revlist +} + _git_rebase () { __git_find_repo_path if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then - __gitcomp "--continue --skip --abort --quit --edit-todo" + __gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch" return elif [ -d "$__git_repo_path"/rebase-apply ] || \ [ -d "$__git_repo_path"/rebase-merge ]; then - __gitcomp "--continue --skip --abort --quit" + __gitcomp "--continue --skip --abort --quit --show-current-patch" return fi __git_complete_strategy && return @@ -2008,7 +2024,7 @@ _git_rebase () --*) __gitcomp " --onto --merge --strategy --interactive - --preserve-merges --stat --no-stat + --rebase-merges --preserve-merges --stat --no-stat --committer-date-is-author-date --ignore-date --ignore-whitespace --whitespace= --autosquash --no-autosquash @@ -2016,6 +2032,7 @@ _git_rebase () --autostash --no-autostash --verify --no-verify --keep-empty --root --force-rebase --no-ff + --rerere-autoupdate --exec " @@ -2077,16 +2094,16 @@ _git_send_email () return ;; --*) - __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to + __gitcomp_builtin send-email "--annotate --bcc --cc --cc-cmd --chain-reply-to --compose --confirm= --dry-run --envelope-sender --from --identity --in-reply-to --no-chain-reply-to --no-signed-off-by-cc - --no-suppress-from --no-thread --quiet + --no-suppress-from --no-thread --quiet --reply-to --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port --smtp-encryption= --smtp-user --subject --suppress-cc= --suppress-from --thread --to --validate --no-validate - $__git_format_patch_options" + $__git_format_patch_extra_options" return ;; esac @@ -2119,11 +2136,7 @@ _git_status () return ;; --*) - __gitcomp " - --short --branch --porcelain --long --verbose - --untracked-files= --ignore-submodules= --ignored - --column= --no-column - " + __gitcomp_builtin status return ;; esac @@ -2148,6 +2161,44 @@ _git_status () __git_complete_index_file "$complete_opt" } +_git_switch () +{ + case "$cur" in + --conflict=*) + __gitcomp "diff3 merge" "" "${cur##--conflict=}" + ;; + --*) + __gitcomp_builtin switch + ;; + *) + # check if --track, --no-track, or --no-guess was specified + # if so, disable DWIM mode + local track_opt="--track" only_local_ref=n + if [ "$GIT_COMPLETION_CHECKOUT_NO_GUESS" = "1" ] || + [ -n "$(__git_find_on_cmdline "--track --no-track --no-guess")" ]; then + track_opt='' + fi + # explicit --guess enables DWIM mode regardless of + # $GIT_COMPLETION_CHECKOUT_NO_GUESS + if [ -n "$(__git_find_on_cmdline "--guess")" ]; then + track_opt='--track' + fi + if [ -z "$(__git_find_on_cmdline "-d --detach")" ]; then + only_local_ref=y + else + # --guess --detach is invalid combination, no + # dwim will be done when --detach is specified + track_opt= + fi + if [ $only_local_ref = y -a -z "$track_opt" ]; then + __gitcomp_direct "$(__git_heads "" "$cur" " ")" + else + __git_complete_refs $track_opt + fi + ;; + esac +} + __git_config_get_set_variables () { local prevword word config_file= c=$cword @@ -2170,9 +2221,24 @@ __git_config_get_set_variables () __git config $config_file --name-only --list } +__git_config_vars= +__git_compute_config_vars () +{ + test -n "$__git_config_vars" || + __git_config_vars="$(git help --config-for-completion | sort | uniq)" +} + _git_config () { - case "$prev" in + local varname + + if [ "${BASH_VERSINFO[0]:-0}" -ge 4 ]; then + varname="${prev,,}" + else + varname="$(echo "$prev" |tr A-Z a-z)" + fi + + case "$varname" in branch.*.remote|branch.*.pushremote) __gitcomp_nl "$(__git_remotes)" return @@ -2182,7 +2248,7 @@ _git_config () return ;; branch.*.rebase) - __gitcomp "false true preserve interactive" + __gitcomp "false true merges preserve interactive" return ;; remote.pushdefault) @@ -2228,7 +2294,7 @@ _git_config () return ;; diff.submodule) - __gitcomp "log short" + __gitcomp "$__git_diff_submodule_formats" return ;; help.format) @@ -2239,7 +2305,7 @@ _git_config () __gitcomp "$__git_log_date_formats" return ;; - sendemail.aliasesfiletype) + sendemail.aliasfiletype) __gitcomp "mutt mailrc pine elm gnus" return ;; @@ -2265,32 +2331,25 @@ _git_config () esac case "$cur" in --*) - __gitcomp " - --system --global --local --file= - --list --replace-all - --get --get-all --get-regexp - --add --unset --unset-all - --remove-section --rename-section - --name-only - " + __gitcomp_builtin config return ;; branch.*.*) local pfx="${cur%.*}." cur_="${cur##*.}" - __gitcomp "remote pushremote merge mergeoptions rebase" "$pfx" "$cur_" + __gitcomp "remote pushRemote merge mergeOptions rebase" "$pfx" "$cur_" return ;; branch.*) local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")" - __gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_" + __gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" return ;; guitool.*.*) local pfx="${cur%.*}." cur_="${cur##*.}" __gitcomp " - argprompt cmd confirm needsfile noconsole norescan - prompt revprompt revunmerged title + argPrompt cmd confirm needsFile noConsole noRescan + prompt revPrompt revUnmerged title " "$pfx" "$cur_" return ;; @@ -2319,14 +2378,14 @@ _git_config () local pfx="${cur%.*}." cur_="${cur##*.}" __gitcomp " url proxy fetch push mirror skipDefaultUpdate - receivepack uploadpack tagopt pushurl + receivepack uploadpack tagOpt pushurl " "$pfx" "$cur_" return ;; remote.*) local pfx="${cur%.*}." cur_="${cur#*.}" __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." - __gitcomp_nl_append "pushdefault" "$pfx" "$cur_" + __gitcomp_nl_append "pushDefault" "$pfx" "$cur_" return ;; url.*.*) @@ -2334,332 +2393,14 @@ _git_config () __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" return ;; + *.*) + __git_compute_config_vars + __gitcomp "$__git_config_vars" + ;; + *) + __git_compute_config_vars + __gitcomp "$(echo "$__git_config_vars" | sed 's/\.[^ ]*/./g')" esac - __gitcomp " - add.ignoreErrors - advice.amWorkDir - advice.commitBeforeMerge - advice.detachedHead - advice.implicitIdentity - advice.pushAlreadyExists - advice.pushFetchFirst - advice.pushNeedsForce - advice.pushNonFFCurrent - advice.pushNonFFMatching - advice.pushUpdateRejected - advice.resolveConflict - advice.rmHints - advice.statusHints - advice.statusUoption - advice.ignoredHook - alias. - am.keepcr - am.threeWay - apply.ignorewhitespace - apply.whitespace - branch.autosetupmerge - branch.autosetuprebase - browser. - clean.requireForce - color.branch - color.branch.current - color.branch.local - color.branch.plain - color.branch.remote - color.decorate.HEAD - color.decorate.branch - color.decorate.remoteBranch - color.decorate.stash - color.decorate.tag - color.diff - color.diff.commit - color.diff.frag - color.diff.func - color.diff.meta - color.diff.new - color.diff.old - color.diff.plain - color.diff.whitespace - color.grep - color.grep.context - color.grep.filename - color.grep.function - color.grep.linenumber - color.grep.match - color.grep.selected - color.grep.separator - color.interactive - color.interactive.error - color.interactive.header - color.interactive.help - color.interactive.prompt - color.pager - color.showbranch - color.status - color.status.added - color.status.changed - color.status.header - color.status.localBranch - color.status.nobranch - color.status.remoteBranch - color.status.unmerged - color.status.untracked - color.status.updated - color.ui - commit.cleanup - commit.gpgSign - commit.status - commit.template - commit.verbose - core.abbrev - core.askpass - core.attributesfile - core.autocrlf - core.bare - core.bigFileThreshold - core.checkStat - core.commentChar - core.compression - core.createObject - core.deltaBaseCacheLimit - core.editor - core.eol - core.excludesfile - core.fileMode - core.fsyncobjectfiles - core.gitProxy - core.hideDotFiles - core.hooksPath - core.ignoreStat - core.ignorecase - core.logAllRefUpdates - core.loosecompression - core.notesRef - core.packedGitLimit - core.packedGitWindowSize - core.packedRefsTimeout - core.pager - core.precomposeUnicode - core.preferSymlinkRefs - core.preloadindex - core.protectHFS - core.protectNTFS - core.quotepath - core.repositoryFormatVersion - core.safecrlf - core.sharedRepository - core.sparseCheckout - core.splitIndex - core.sshCommand - core.symlinks - core.trustctime - core.untrackedCache - core.warnAmbiguousRefs - core.whitespace - core.worktree - credential.helper - credential.useHttpPath - credential.username - credentialCache.ignoreSIGHUP - diff.autorefreshindex - diff.external - diff.ignoreSubmodules - diff.mnemonicprefix - diff.noprefix - diff.renameLimit - diff.renames - diff.statGraphWidth - diff.submodule - diff.suppressBlankEmpty - diff.tool - diff.wordRegex - diff.algorithm - difftool. - difftool.prompt - fetch.recurseSubmodules - fetch.unpackLimit - format.attach - format.cc - format.coverLetter - format.from - format.headers - format.numbered - format.pretty - format.signature - format.signoff - format.subjectprefix - format.suffix - format.thread - format.to - gc. - gc.aggressiveDepth - gc.aggressiveWindow - gc.auto - gc.autoDetach - gc.autopacklimit - gc.logExpiry - gc.packrefs - gc.pruneexpire - gc.reflogexpire - gc.reflogexpireunreachable - gc.rerereresolved - gc.rerereunresolved - gc.worktreePruneExpire - gitcvs.allbinary - gitcvs.commitmsgannotation - gitcvs.dbTableNamePrefix - gitcvs.dbdriver - gitcvs.dbname - gitcvs.dbpass - gitcvs.dbuser - gitcvs.enabled - gitcvs.logfile - gitcvs.usecrlfattr - guitool. - gui.blamehistoryctx - gui.commitmsgwidth - gui.copyblamethreshold - gui.diffcontext - gui.encoding - gui.fastcopyblame - gui.matchtrackingbranch - gui.newbranchtemplate - gui.pruneduringfetch - gui.spellingdictionary - gui.trustmtime - help.autocorrect - help.browser - help.format - http.lowSpeedLimit - http.lowSpeedTime - http.maxRequests - http.minSessions - http.noEPSV - http.postBuffer - http.proxy - http.sslCipherList - http.sslVersion - http.sslCAInfo - http.sslCAPath - http.sslCert - http.sslCertPasswordProtected - http.sslKey - http.sslVerify - http.useragent - i18n.commitEncoding - i18n.logOutputEncoding - imap.authMethod - imap.folder - imap.host - imap.pass - imap.port - imap.preformattedHTML - imap.sslverify - imap.tunnel - imap.user - init.templatedir - instaweb.browser - instaweb.httpd - instaweb.local - instaweb.modulepath - instaweb.port - interactive.singlekey - log.date - log.decorate - log.showroot - mailmap.file - man. - man.viewer - merge. - merge.conflictstyle - merge.log - merge.renameLimit - merge.renormalize - merge.stat - merge.tool - merge.verbosity - mergetool. - mergetool.keepBackup - mergetool.keepTemporaries - mergetool.prompt - notes.displayRef - notes.rewrite. - notes.rewrite.amend - notes.rewrite.rebase - notes.rewriteMode - notes.rewriteRef - pack.compression - pack.deltaCacheLimit - pack.deltaCacheSize - pack.depth - pack.indexVersion - pack.packSizeLimit - pack.threads - pack.window - pack.windowMemory - pager. - pretty. - pull.octopus - pull.twohead - push.default - push.followTags - rebase.autosquash - rebase.stat - receive.autogc - receive.denyCurrentBranch - receive.denyDeleteCurrent - receive.denyDeletes - receive.denyNonFastForwards - receive.fsckObjects - receive.unpackLimit - receive.updateserverinfo - remote.pushdefault - remotes. - repack.usedeltabaseoffset - rerere.autoupdate - rerere.enabled - sendemail. - sendemail.aliasesfile - sendemail.aliasfiletype - sendemail.bcc - sendemail.cc - sendemail.cccmd - sendemail.chainreplyto - sendemail.confirm - sendemail.envelopesender - sendemail.from - sendemail.identity - sendemail.multiedit - sendemail.signedoffbycc - sendemail.smtpdomain - sendemail.smtpencryption - sendemail.smtppass - sendemail.smtpserver - sendemail.smtpserveroption - sendemail.smtpserverport - sendemail.smtpuser - sendemail.suppresscc - sendemail.suppressfrom - sendemail.thread - sendemail.to - sendemail.tocmd - sendemail.validate - sendemail.smtpbatchsize - sendemail.smtprelogindelay - showbranch.default - status.relativePaths - status.showUntrackedFiles - status.submodulesummary - submodule. - tar.umask - transfer.unpackLimit - url. - user.email - user.name - user.signingkey - web.browser - branch. remote. - " } _git_remote () @@ -2672,7 +2413,7 @@ _git_remote () if [ -z "$subcommand" ]; then case "$cur" in --*) - __gitcomp "--verbose" + __gitcomp_builtin remote ;; *) __gitcomp "$subcommands" @@ -2683,33 +2424,33 @@ _git_remote () case "$subcommand,$cur" in add,--*) - __gitcomp "--track --master --fetch --tags --no-tags --mirror=" + __gitcomp_builtin remote_add ;; add,*) ;; set-head,--*) - __gitcomp "--auto --delete" + __gitcomp_builtin remote_set-head ;; set-branches,--*) - __gitcomp "--add" + __gitcomp_builtin remote_set-branches ;; set-head,*|set-branches,*) __git_complete_remote_or_refspec ;; update,--*) - __gitcomp "--prune" + __gitcomp_builtin remote_update ;; update,*) - __gitcomp "$(__git_get_config_variables "remotes")" + __gitcomp "$(__git_remotes) $(__git_get_config_variables "remotes")" ;; set-url,--*) - __gitcomp "--push --add --delete" + __gitcomp_builtin remote_set-url ;; get-url,--*) - __gitcomp "--push --all" + __gitcomp_builtin remote_get-url ;; prune,--*) - __gitcomp "--dry-run" + __gitcomp_builtin remote_prune ;; *) __gitcomp_nl "$(__git_remotes)" @@ -2720,8 +2461,12 @@ _git_remote () _git_replace () { case "$cur" in + --format=*) + __gitcomp "short medium long" "" "${cur##--format=}" + return + ;; --*) - __gitcomp "--edit --graft --format= --list --delete" + __gitcomp_builtin replace return ;; esac @@ -2745,26 +2490,42 @@ _git_reset () case "$cur" in --*) - __gitcomp "--merge --mixed --hard --soft --patch --keep" + __gitcomp_builtin reset return ;; esac __git_complete_refs } +_git_restore () +{ + case "$cur" in + --conflict=*) + __gitcomp "diff3 merge" "" "${cur##--conflict=}" + ;; + --source=*) + __git_complete_refs --cur="${cur##--source=}" + ;; + --*) + __gitcomp_builtin restore + ;; + esac +} + +__git_revert_inprogress_options="--continue --quit --abort" + _git_revert () { __git_find_repo_path if [ -f "$__git_repo_path"/REVERT_HEAD ]; then - __gitcomp "--continue --quit --abort" + __gitcomp "$__git_revert_inprogress_options" return fi + __git_complete_strategy && return case "$cur" in --*) - __gitcomp " - --edit --mainline --no-edit --no-commit --signoff - --strategy= --strategy-option= - " + __gitcomp_builtin revert "" \ + "$__git_revert_inprogress_options" return ;; esac @@ -2775,7 +2536,7 @@ _git_rm () { case "$cur" in --*) - __gitcomp "--cached --dry-run --ignore-unmatch --quiet" + __gitcomp_builtin rm return ;; esac @@ -2833,12 +2594,7 @@ _git_show_branch () { case "$cur" in --*) - __gitcomp " - --all --remotes --topo-order --date-order --current --more= - --list --independent --merge-base --no-name - --color --no-color - --sha1-name --sparse --topics --reflog - " + __gitcomp_builtin show-branch return ;; esac @@ -2848,13 +2604,21 @@ _git_show_branch () _git_stash () { local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked' - local subcommands='push save list show apply clear drop pop create branch' - local subcommand="$(__git_find_on_cmdline "$subcommands")" + local subcommands='push list show apply clear drop pop create branch' + local subcommand="$(__git_find_on_cmdline "$subcommands save")" + if [ -n "$(__git_find_on_cmdline "-p")" ]; then + subcommand="push" + fi if [ -z "$subcommand" ]; then case "$cur" in --*) __gitcomp "$save_opts" ;; + sa*) + if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then + __gitcomp "save" + fi + ;; *) if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then __gitcomp "$subcommands" @@ -2875,6 +2639,9 @@ _git_stash () drop,--*) __gitcomp "--quiet" ;; + list,--*) + __gitcomp "--name-status --oneline --patch-with-stat" + ;; show,--*|branch,--*) ;; branch,*) @@ -2899,7 +2666,7 @@ _git_submodule () { __git_has_doubledash && return - local subcommands="add status init deinit update summary foreach sync" + local subcommands="add status init deinit update set-branch summary foreach sync absorbgitdirs" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then case "$cur" in @@ -2930,6 +2697,9 @@ _git_submodule () --force --rebase --merge --reference --depth --recursive --jobs " ;; + set-branch,--*) + __gitcomp "--default --branch" + ;; summary,--*) __gitcomp "--cached --files --summary-limit" ;; @@ -3045,7 +2815,7 @@ _git_tag () while [ $c -lt $cword ]; do i="${words[c]}" case "$i" in - -d|-v) + -d|--delete|-v|--verify) __gitcomp_direct "$(__git_tags "" "$cur" " ")" return ;; @@ -3071,11 +2841,7 @@ _git_tag () case "$cur" in --*) - __gitcomp " - --list --delete --verify --annotate --message --file - --sign --cleanup --local-user --force --column --sort= - --contains --no-contains --points-at --merged --no-merged --create-reflog - " + __gitcomp_builtin tag ;; esac } @@ -3087,23 +2853,26 @@ _git_whatchanged () _git_worktree () { - local subcommands="add list lock prune unlock" + local subcommands="add list lock move prune remove unlock" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then __gitcomp "$subcommands" else case "$subcommand,$cur" in add,--*) - __gitcomp "--detach" + __gitcomp_builtin worktree_add ;; list,--*) - __gitcomp "--porcelain" + __gitcomp_builtin worktree_list ;; lock,--*) - __gitcomp "--reason" + __gitcomp_builtin worktree_lock ;; prune,--*) - __gitcomp "--dry-run --expire --verbose" + __gitcomp_builtin worktree_prune + ;; + remove,--*) + __gitcomp "--force" ;; *) ;; @@ -3111,6 +2880,52 @@ _git_worktree () fi } +__git_complete_common () { + local command="$1" + + case "$cur" in + --*) + __gitcomp_builtin "$command" + ;; + esac +} + +__git_cmds_with_parseopt_helper= +__git_support_parseopt_helper () { + test -n "$__git_cmds_with_parseopt_helper" || + __git_cmds_with_parseopt_helper="$(__git --list-cmds=parseopt)" + + case " $__git_cmds_with_parseopt_helper " in + *" $1 "*) + return 0 + ;; + *) + return 1 + ;; + esac +} + +__git_complete_command () { + local command="$1" + local completion_func="_git_${command//-/_}" + if ! declare -f $completion_func >/dev/null 2>/dev/null && + declare -f _completion_loader >/dev/null 2>/dev/null + then + _completion_loader "git-$command" + fi + if declare -f $completion_func >/dev/null 2>/dev/null + then + $completion_func + return 0 + elif __git_support_parseopt_helper "$command" + then + __git_complete_common "$command" + return 0 + else + return 1 + fi +} + __git_main () { local i c=1 command __git_dir __git_repo_path @@ -3164,20 +2979,24 @@ __git_main () --help " ;; - *) __git_compute_porcelain_commands - __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;; + *) + if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST" + then + __gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST" + else + __gitcomp "$(__git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)" + fi + ;; esac return fi - local completion_func="_git_${command//-/_}" - declare -f $completion_func >/dev/null 2>/dev/null && $completion_func && return + __git_complete_command "$command" && return local expansion=$(__git_aliased_command "$command") if [ -n "$expansion" ]; then words[1]=$expansion - completion_func="_git_${expansion//-/_}" - declare -f $completion_func >/dev/null 2>/dev/null && $completion_func + __git_complete_command "$expansion" fi } @@ -3205,7 +3024,10 @@ __gitk_main () __git_complete_revlist } -if [[ -n ${ZSH_VERSION-} ]]; then +if [[ -n ${ZSH_VERSION-} ]] && + # Don't define these functions when sourced from 'git-completion.zsh', + # it has its own implementations. + [[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2 autoload -U +X compinit && compinit @@ -3254,13 +3076,22 @@ if [[ -n ${ZSH_VERSION-} ]]; then compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 } + __gitcomp_file_direct () + { + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -f -- ${=1} && _ret=0 + } + __gitcomp_file () { emulate -L zsh local IFS=$'\n' compset -P '*[=:]' - compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 + compadd -p "${2-}" -f -- ${=1} && _ret=0 } _git () @@ -3315,6 +3146,6 @@ __git_complete gitk __gitk_main # when the user has tab-completed the executable name and consequently # included the '.exe' suffix. # -if [[ "$OSTYPE" = cygwin* ]]; then +if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then __git_complete git.exe __git_main fi diff --git a/zsh/.oh-my-zsh/plugins/gitfast/git-prompt.sh b/zsh/.oh-my-zsh/plugins/gitfast/git-prompt.sh index fd2b049..f7009b0 100644 --- a/zsh/.oh-my-zsh/plugins/gitfast/git-prompt.sh +++ b/zsh/.oh-my-zsh/plugins/gitfast/git-prompt.sh @@ -219,7 +219,7 @@ __git_ps1_show_upstream () if [[ -n "$count" && -n "$name" ]]; then __git_ps1_upstream_name=$(git rev-parse \ --abbrev-ref "$upstream" 2>/dev/null) - if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then + if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then p="$p \${__git_ps1_upstream_name}" else p="$p ${__git_ps1_upstream_name}" @@ -237,7 +237,7 @@ __git_ps1_show_upstream () # to build a gitstring. __git_ps1_colorize_gitstring () { - if [[ -n ${ZSH_VERSION-} ]]; then + if [[ -n "${ZSH_VERSION-}" ]]; then local c_red='%F{red}' local c_green='%F{green}' local c_lblue='%F{blue}' @@ -255,7 +255,7 @@ __git_ps1_colorize_gitstring () local flags_color="$c_lblue" local branch_color="" - if [ $detached = no ]; then + if [ "$detached" = no ]; then branch_color="$ok_color" else branch_color="$bad_color" @@ -508,13 +508,13 @@ __git_ps1 () # NO color option unless in PROMPT_COMMAND mode or it's Zsh if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then - if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then + if [ "$pcmode" = yes ] || [ -n "${ZSH_VERSION-}" ]; then __git_ps1_colorize_gitstring fi fi b=${b##refs/heads/} - if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then + if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then __git_ps1_branch_name=$b b="\${__git_ps1_branch_name}" fi @@ -522,7 +522,7 @@ __git_ps1 () local f="$w$i$s$u" local gitstring="$c$b${f:+$z$f}$r$p" - if [ $pcmode = yes ]; then + if [ "$pcmode" = yes ]; then if [ "${__git_printf_supports_v-}" != yes ]; then gitstring=$(printf -- "$printf_format" "$gitstring") else diff --git a/zsh/.oh-my-zsh/plugins/github/README.md b/zsh/.oh-my-zsh/plugins/github/README.md index 70b863f..2b66e39 100644 --- a/zsh/.oh-my-zsh/plugins/github/README.md +++ b/zsh/.oh-my-zsh/plugins/github/README.md @@ -1,4 +1,4 @@ -# github plugin +# github This plugin supports working with GitHub from the command line. It provides a few things: @@ -6,7 +6,7 @@ This plugin supports working with GitHub from the command line. It provides a fe * Completion for the `github` Ruby gem. * Convenience functions for working with repos and URLs. -### Functions +### Functions * `empty_gh` - Creates a new empty repo (with a `README.md`) and pushes it to GitHub * `new_gh` - Initializes an existing directory as a repo and pushes it to GitHub @@ -14,13 +14,13 @@ This plugin supports working with GitHub from the command line. It provides a fe * `git.io` - Shortens a URL using [git.io](https://git.io) -## Installation +## Installation [Hub](https://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ. The [`github` Ruby gem](https://github.com/defunkt/github-gem) needs to be installed if you want to use it. -### Configuration +### Configuration These settings affect `github`'s behavior. @@ -35,7 +35,7 @@ These settings affect `github`'s behavior. See `man hub` for more details. -### Homebrew installation note +### Homebrew installation note If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`. diff --git a/zsh/.oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh b/zsh/.oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh index a687f5c..15e38d3 100644 --- a/zsh/.oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh @@ -1,4 +1,4 @@ -function gi() { curl -fLw '\n' https://www.gitignore.io/api/"${(j:,:)@}" } +function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} } _gitignoreio_get_command_list() { curl -sfL https://www.gitignore.io/api/list | tr "," "\n" diff --git a/zsh/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh b/zsh/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh index 23e00c2..967b8b4 100644 --- a/zsh/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh @@ -36,7 +36,7 @@ __gnu_utils() { gcmds+=('gfind' 'gxargs' 'glocate') # Not part of either coreutils or findutils, installed separately. - gcmds+=('gsed' 'gtar' 'gtime' 'gmake') + gcmds+=('gsed' 'gtar' 'gtime') for gcmd in "${gcmds[@]}"; do # Do nothing if the command isn't found diff --git a/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh b/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh deleted file mode 100644 index da7c87c..0000000 --- a/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh +++ /dev/null @@ -1,3 +0,0 @@ -print -P "%F{yellow}The 'go' plugin is deprecated. Use the '%Ugolang%u' plugin instead.%f" - -source "$ZSH/plugins/golang/golang.plugin.zsh" diff --git a/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh b/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh new file mode 120000 index 0000000..cf943e2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/go/go.plugin.zsh @@ -0,0 +1 @@ +../golang/golang.plugin.zsh \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/gpg-agent/README.md b/zsh/.oh-my-zsh/plugins/gpg-agent/README.md index 9c1e6d2..a9711f9 100644 --- a/zsh/.oh-my-zsh/plugins/gpg-agent/README.md +++ b/zsh/.oh-my-zsh/plugins/gpg-agent/README.md @@ -3,7 +3,6 @@ Enables [GPG's gpg-agent](https://www.gnupg.org/documentation/manuals/gnupg/) if it is not running. To use it, add gpg-agent to the plugins array of your zshrc file: - -```zsh +``` plugins=(... gpg-agent) ``` diff --git a/zsh/.oh-my-zsh/plugins/gradle/README.md b/zsh/.oh-my-zsh/plugins/gradle/README.md index 3756db0..215503c 100644 --- a/zsh/.oh-my-zsh/plugins/gradle/README.md +++ b/zsh/.oh-my-zsh/plugins/gradle/README.md @@ -1,4 +1,4 @@ -# Gradle plugin +## Gradle Plugin This plugin adds completions and aliases for [Gradle](https://gradle.org/). @@ -10,15 +10,9 @@ plugins=(... gradle) ## Usage -This plugin creates a function called `gradle-or-gradlew`, which is aliased -to `gradle`, which is used to determine whether the current project directory -has a gradlew file. If `gradlew` is present it will be used, otherwise `gradle` -is used instead. Gradle tasks can be executed directly without regard for -whether it is `gradle` or `gradlew`. It also supports being called from -any directory inside the root project directory. +This plugin creates an alias `gradle` which is used to determine whether the current working directory has a gradlew file. If gradlew is present it will be used otherwise `gradle` is used directly. Gradle tasks can be executed directly without regard for whether it is `gradle` or `gradlew` Examples: - ```zsh gradle test gradle build @@ -26,5 +20,4 @@ gradle build ## Completion -This plugin uses [the completion from the Gradle project](https://github.com/gradle/gradle-completion), -which is distributed under the MIT license. +The completion provided for this plugin caches the parsed tasks into a file named `.gradletasknamecache` in the current working directory, so you might want to add that to your `.gitignore` file so that it's not accidentally committed. diff --git a/zsh/.oh-my-zsh/plugins/gradle/_gradle b/zsh/.oh-my-zsh/plugins/gradle/_gradle deleted file mode 100644 index 6476266..0000000 --- a/zsh/.oh-my-zsh/plugins/gradle/_gradle +++ /dev/null @@ -1,420 +0,0 @@ -#compdef gradle gradlew gw -# -# Taken from https://github.com/gradle/gradle-completion -# Copyright (c) 2017 Eric Wendelin -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# Terms - -__gradle-set-project-root-dir() { - local dir=`pwd` - project_root_dir=`pwd` - while [[ $dir != '/' ]]; do - if [[ -f "$dir/settings.gradle" || -f "$dir/settings.gradle.kts" || -f "$dir/gradlew" ]]; then - project_root_dir=$dir - return 0 - fi - dir="$(dirname "$dir")" - done - return 1 -} - -__gradle-init-cache-dir() { - cache_dir="$HOME/.gradle/completion" - mkdir -p $cache_dir -} - -__gradle-set-settings-file() { - # In order of precedence: --settings-file=filename, settings.gradle, settings.gradle.kts - - local default_gradle_settings_file="$project_root_dir/settings.gradle" - if [[ ! -f $default_gradle_settings_file ]]; then - default_gradle_settings_file="$project_root_dir/settings.gradle.kts" - fi - gradle_settings_file=${${(v)opt_args[(i)-c|--settings-file]}:-$default_gradle_settings_file} -} - -__gradle-set-build-file() { - __gradle-set-settings-file - # In order of precedence: --build-file=filename, rootProject.buildFileName, build.gradle, build.gradle.kts - - local default_gradle_build_file_name="build.gradle" - if [[ -r $gradle_settings_file ]]; then - default_gradle_build_file_name=${$(grep "^rootProject\.buildFileName" $gradle_settings_file | \ - sed -n -e "s/rootProject\.buildFileName = [\'\"]\(.*\)[\'\"]/\1/p")} - - default_gradle_build_file_name="${default_gradle_build_file:-build.gradle}" - fi - - local default_gradle_build_file="$project_root_dir/$default_gradle_build_file_name" - if [[ ! -f $default_gradle_build_file ]]; then - default_gradle_build_file="$project_root_dir/build.gradle.kts" - fi - - # If a build file is specified after '-b' or '--build-file', use this file. - gradle_build_file=${${(v)opt_args[(i)-b|--build-file]}:-$default_gradle_build_file} -} - -__gradle-set-cache-name() { - # Cache name is constructed from the absolute path of the build file. - cache_name=${${gradle_build_file:a}//[^[:alnum:]]/_} -} - -__gradle-set-files-checksum() { - # Cache MD5 sum of all Gradle scripts and modified timestamps - if builtin command -v md5 > /dev/null; then - gradle_files_checksum=( $(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)") ) - elif builtin command -v md5sum > /dev/null; then - gradle_files_checksum=( $(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}') ) - else - _message 'Cannot generate completions as neither md5 nor md5sum exist on \$PATH' - return 1 - fi -} - -__gradle-generate-script-cache() { - # Invalidate cache after 3 weeks by default - local cache_ttl_mins=${$(echo $GRADLE_CACHE_TTL_MINUTES):-30240} - local script_exclude_pattern=${$(echo $GRADLE_COMPLETION_EXCLUDE_PATTERN):-"/(.git|build|integTest|samples|templates|smokeTest|testFixtures|out)/"} - if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then - zle -R "Generating Gradle build script cache" - # Cache all Gradle scripts - local -a gradle_build_scripts - gradle_build_scripts=( $(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern") ) - printf "%s\n" "${gradle_build_scripts[@]}" >| $cache_dir/$cache_name - fi -} - -__gradle-generate-tasks-cache() { - __gradle-set-files-checksum - - # Use Gradle wrapper when it exists. - local gradle_cmd="gradle" - if [[ -x "$project_root_dir/gradlew" ]]; then - gradle_cmd="$project_root_dir/gradlew" - fi - - zle -R "Generating Gradle task cache from $gradle_build_file" - - # Run gradle to retrieve possible tasks and cache. - # Reuse Gradle Daemon if IDLE but don't start a new one. - local gradle_tasks_output - if [[ ! -z "$($gradle_cmd --status 2>/dev/null | grep IDLE)" ]]; then - gradle_tasks_output="$($gradle_cmd --daemon --build-file $gradle_build_file -q tasks --all 2>/dev/null)" - else - gradle_tasks_output="$($gradle_cmd --no-daemon --build-file $gradle_build_file -q tasks --all 2>/dev/null)" - fi - local gradle_all_tasks="" root_tasks="" subproject_tasks="" output_line - local -a match - for output_line in ${(f)"$(printf "%s\n" "${gradle_tasks_output[@]}")"}; do - if [[ $output_line =~ ^([[:lower:]][[:alnum:][:punct:]]*)([[:space:]]-[[:space:]]([[:print:]]*))? ]]; then - local task_name="${match[1]}" - local task_description="${match[3]}" - # Completion for subproject tasks with ':' prefix - if [[ $task_name =~ ^([[:alnum:][:punct:]]+):([[:alnum:]]+) ]]; then - gradle_all_tasks+="${task_name//:/\\:}:$task_description\n\\:${task_name//:/\\:}:$task_description\n" - subproject_tasks+="${match[2]}\n" - else - gradle_all_tasks+="${task_name//:/\\:}:$task_description\n" - root_tasks+="$task_name\n" - fi - fi - done - - # subproject tasks can be referenced implicitly from root project - if [[ $GRADLE_COMPLETION_UNQUALIFIED_TASKS == "true" ]]; then - local -a implicit_tasks - implicit_tasks=( $(comm -23 <(echo $subproject_tasks | sort) <(echo $root_tasks | sort)) ) - for task in $(printf "%s\n" "${implicit_tasks[@]}"); do - gradle_all_tasks+="$task\n" - done - fi - - echo $gradle_all_tasks >| $cache_dir/$gradle_files_checksum - echo $gradle_files_checksum >| $cache_dir/$cache_name.md5 -} - -__gradle-completion-init() { - local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir - __gradle-init-cache-dir - __gradle-set-project-root-dir - __gradle-set-build-file - if [[ -f $gradle_build_file ]]; then - __gradle-set-cache-name - __gradle-generate-script-cache - __gradle-set-files-checksum - __gradle-generate-tasks-cache - fi - return 0 -} - -__gradle_tasks() { - local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir - - __gradle-init-cache-dir - __gradle-set-project-root-dir - __gradle-set-build-file - if [[ -f $gradle_build_file ]]; then - __gradle-set-cache-name - __gradle-generate-script-cache - __gradle-set-files-checksum - - # The cache key is md5 sum of all gradle scripts, so it's valid if it exists. - if [[ -f $cache_dir/$cache_name.md5 ]]; then - local cached_checksum="$(cat $cache_dir/$cache_name.md5)" - local -a cached_tasks - if [[ -z $cur ]]; then - cached_tasks=(${(f)"$(cat $cache_dir/$cached_checksum)"}) - else - cached_tasks=(${(f)"$(grep "^${cur//:/\\\\:}" $cache_dir/$cached_checksum)"}) - fi - _describe 'all tasks' cached_tasks && ret=0 - else - __gradle-generate-tasks-cache - fi - - # Regenerate tasks cache in the background - if [[ $gradle_files_checksum != "$(cat $cache_dir/$cache_name.md5)" || ! -f $cache_dir/$gradle_files_checksum || $(wc -c < $cache_dir/$gradle_files_checksum) -le 1 ]]; then - $(__gradle-generate-tasks-cache 1>&2 2>/dev/null &) - fi - else - _describe 'built-in tasks' '( - "buildEnvironment:Displays all buildscript dependencies declared in root project." - "components:Displays the components produced by root project." - "dependencies:Displays all dependencies declared in root project." - "dependencyInsight:Displays the insight into a specific dependency in root project." - "dependentComponents:Displays the dependent components of components in root project." - "help:Displays a help message." - "init:Initializes a new Gradle build." - "model:Displays the configuration model of root project." - "projects:Displays the sub-projects of root project." - "properties:Displays the properties of root project." - "tasks:Displays the tasks runnable from root project." - "wrapper:Generates Gradle wrapper files." - )' && ret=0 - fi -} - -__gradle_subcommand() { - integer ret=1 - - case "$words[1]" in - (dependencies) - _arguments \ - '--configuration=[The configuration to generate the report for.]:dependency configuration:_gradle_dependency_configurations' && ret=0 - ;; - (dependencyInsight) - _arguments \ - '--dependency=[Shows the details of given dependency.]' \ - '--configuration=[Looks for the dependency in given configuration.]:dependency configuration:_gradle_dependency_configurations' && ret=0 - ;; - (help) - _arguments \ - '--task[The task to show help for.]' && ret=0 - ;; - (init) - _arguments \ - '--dsl=[DSL to be used in generated scripts.]:dsl:(groovy kotlin)' \ - '--package=[Package for the generated source.]' \ - '--project-name=[Name of the generated project.]' \ - '--test-framework=[Test framework to be used.]:test framework:(junit kotlintest scalatest spock testng)' \ - '--type=[Project type to generate.]:project type:(basic cpp-application cpp-library groovy-application groovy-library java-application java-library kotlin-application kotlin-library pom scala-library)' && ret=0 - ;; - (tasks) - _arguments \ - '--all[List all tasks, including subproject tasks.]' \ - '--group=[Show tasks only from given task group.]' && ret=0 - ;; - (test) - _arguments -C \ - '--debug-jvm[Enable debugging for the test process. The process is started suspended and listening on port 5005. Requires the "java" plugin.]' \ - '--fail-fast[Stops test execution after the first failed test. Requires the "java" plugin.]' \ - '--tests=[Sets test class or method name to be included, * is supported. Requires the "java" plugin.]' \ - '(-)*:: :->task-or-option' && ret=0 - ;; - (wrapper) - _arguments \ - '--distribution-type=[Binary-only or all with docs and sources]:*:distribution type:(bin all)' \ - '--gradle-version=[Set Gradle version for wrapper]' \ - '--gradle-distribution-sha256-sum=[SHA-256 checksum]' \ - '--gradle-distribution-url=[Set Gradle distribution URL]' && ret=0 - ;; - (*) - _arguments -C \ - {-a,--no-rebuild}'[Do not rebuild project dependencies.]' \ - '(--no-build-cache)--build-cache[Enable the Gradle build cache.]' \ - {-b,--build-file}'[Specifies the build file.]:build script:_files -g \*.gradle' \ - {-C,--cache}'[Specifies how compiled build scripts should be cached.]:cache policy:(on rebuild)' \ - {-c,--settings-file}'[Specifies the settings file.]:settings file:_files -g \*.gradle' \ - '(--no-configure-on-demand)--configure-on-demand[Only relevant projects are configured in this build run.]' \ - '--console=[Specifies which type of console output to generate.]:console output type:(plain auto rich verbose)' \ - '--continue[Continues task execution after a task failure.]' \ - '-Dorg.gradle.cache.reserved.mb=[Reserve Gradle Daemon memory for operations.]' \ - '-Dorg.gradle.caching=[Set true to enable Gradle build cache.]:enable build cache:(true false)' \ - '-Dorg.gradle.console=[Set type of console output to generate.]:console output type:(plain auto rich verbose)' \ - '-Dorg.gradle.daemon.debug=[Set true to debug Gradle Daemon.]:enable daemon debug:(true false)' \ - '-Dorg.gradle.daemon.idletimeout=[Kill Gradle Daemon after # idle millis.]' \ - '-Dorg.gradle.debug=[Set true to debug Gradle Client.]' \ - '-Dorg.gradle.jvmargs=[Set JVM arguments.]' \ - '-Dorg.gradle.java.home=[Set JDK home dir.]' \ - '-Dorg.gradle.logging.level=[Set default Gradle log level.]:log level:(quiet warn lifecycle info debug)' \ - '-Dorg.gradle.parallel=[Set true to enable parallel project builds.]:enable parallel build:(true false)' \ - '-Dorg.gradle.priority=[Set priority for Gradle worker processes.]:priority:(low normal)' \ - '-Dorg.gradle.warning.mode=[Set types of warnings to log.]:warning level:(all summary none)' \ - '-Dorg.gradle.workers.max=[Set the number of workers Gradle is allowed to use.]' \ - '(-i --info -w --warn -q --quiet)'{-d,--debug}'[Log in debug mode (includes normal stacktrace).]' \ - '(--no-daemon)--daemon[Uses the Gradle daemon to run the build. Starts the daemon if not running.]' \ - '--foreground[Starts the Gradle daemon in the foreground.]' \ - {-g,--gradle-user-home}'[Specifies the gradle user home directory.]:file:_directories' \ - \*--include-build'[Includes the specified build in the composite.]:file:_directories' \ - \*{-I,--init-script}'[Specifies an initialization script.]:init script:_files -g \*.gradle' \ - '(-d --debug -w --warn -q --quiet)'{-i,--info}'[Set log level to info.]' \ - '--max-workers[Set the maximum number of concurrent workers that Gradle may use.]:number workers' \ - {-m,--dry-run}'[Runs the builds with all task actions disabled.]' \ - '--no-color[Do not use color in the console output. (Removed in Gradle 3.0)]' \ - '(--build-cache)--no-build-cache[Do not use the Gradle build cache.]' \ - '(--configure-on-demand)--no-configure-on-demand[Disables configuration on demand.]' \ - '(--daemon)--no-daemon[Do not use the Gradle daemon to run the build.]' \ - '(--parallel)--no-parallel[Disables parallel execution to build projects.]' \ - '(--scan)--no-scan[Do not create a build scan.]' \ - '--offline[The build should operate without accessing network resources.]' \ - \*{-P+,--project-prop}'[Set project property for the build script (e.g. -Pmyprop=myvalue).]:project property (prop=val):' \ - {-p,--project-dir}'[Specifies the start directory for Gradle.]:start directory:_directories' \ - '(--no-parallel)--parallel[Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use.]' \ - '--profile[Profiles build execution time and generates a report in the /reports/profile directory.]' \ - '--priority[Set priority for Gradle worker processes.]:priority:(low normal)' \ - '--project-cache-dir[Specifies the project-specific cache directory.]:cache directory:_directories' \ - '(-d --debug -w --warn -i --info)'{-q,--quiet}'[Log errors only.]' \ - '--recompile-scripts[Force build script recompiling.]' \ - '--refresh[Refresh the state of resources of the type(s) specified.]:refresh policy:(dependencies)' \ - '--refresh-dependencies[Refresh the state of dependencies.]' \ - '--rerun-tasks[Ignore previously cached task results.]' \ - '(--no-scan)--scan[Create a build scan.]' \ - '(-S --full-stacktrace)'{-s,--stacktrace}'[Print out the stacktrace for all exceptions.]' \ - '(-s --stacktrace)'{-S,--full-stacktrace}'[Print out the full (very verbose) stacktrace for all exceptions.]' \ - '--system-prop[system property (prop=val)]' \ - {-t,--continuous}'[Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change.]' \ - {-u,--no-search-upward}"[Don't search in parent folders for a settings.gradle file.]" \ - '(--write-locks)--update-locks[Perform a partial update of the dependency lock.]' \ - '(-d --debug -q --quiet -i --info)'{-w,--warn}'[Log warnings and errors only.]' \ - '--warning-mode=[Set types of warnings to log.]:warning mode:(all summary none)' \ - '(--update-locks)--write-locks[Persists dependency resolution for locked configurations.]' \ - {-x,--exclude-task}'[Specify a task to be excluded from execution.]' && ret=0 - ;; - esac - - return ret -} - -(( $+functions[_gradle_dependency_configurations] )) || -_gradle_dependency_configurations() { - local configurations - configurations=( - 'compileClasspath' - 'runtimeClasspath' - 'testCompileClasspath' - 'testRuntimeClasspath' - ) - _describe -t 'dependency configurations' "dependency configuration" configurations -} - -_gradle() { - local cur=${words[CURRENT]} - local curcontext="$curcontext" state - integer ret=1 - typeset -A opt_args - - _arguments -C \ - '(-)'{-\?,-h,--help}'[Shows a help message.]' \ - {-a,--no-rebuild}'[Do not rebuild project dependencies.]' \ - '(--no-build-cache)--build-cache[Enable the Gradle build cache.]' \ - {-b,--build-file}'[Specifies the build file.]:build script:_files -g \*.gradle' \ - {-C,--cache}'[Specifies how compiled build scripts should be cached.]:cache policy:(on rebuild)' \ - {-c,--settings-file}'[Specifies the settings file.]:settings file:_files -g \*.gradle:->argument-expected' \ - '(--no-configure-on-demand)--configure-on-demand[Only relevant projects are configured in this build run.]' \ - '--console=[Specifies which type of console output to generate.]:console output type:(plain auto rich verbose)' \ - '--continue[Continues task execution after a task failure.]' \ - '-Dorg.gradle.cache.reserved.mb=[Reserve Gradle Daemon memory for operations.]' \ - '-Dorg.gradle.caching=[Set true to enable Gradle build cache.]' \ - '-Dorg.gradle.console=[Set type of console output to generate.]:console output type:(plain auto rich verbose)' \ - '-Dorg.gradle.daemon.debug=[Set true to debug Gradle Daemon.]' \ - '-Dorg.gradle.daemon.idletimeout=[Kill Gradle Daemon after # idle millis.]' \ - '-Dorg.gradle.debug=[Set true to debug Gradle Client.]' \ - '-Dorg.gradle.jvmargs=[Set JVM arguments.]' \ - '-Dorg.gradle.java.home=[Set JDK home dir.]' \ - '-Dorg.gradle.logging.level=[Set default Gradle log level.]:log level:(quiet warn lifecycle info debug)' \ - '-Dorg.gradle.parallel=[Set true to enable parallel project builds.]:(true false)' \ - '-Dorg.gradle.priority=[Set priority for Gradle worker processes.]:priority:(low normal)' \ - '-Dorg.gradle.warning.mode=[Set types of warnings to log.]:warning level:(all summary none)' \ - '-Dorg.gradle.workers.max=[Set the number of workers Gradle is allowed to use.]' \ - '(-i --info -w --warn -q --quiet)'{-d,--debug}'[Log in debug mode (includes normal stacktrace).]' \ - '(--no-daemon)--daemon[Uses the Gradle daemon to run the build. Starts the daemon if not running.]' \ - '--foreground[Starts the Gradle daemon in the foreground.]' \ - {-g,--gradle-user-home}'[Specifies the gradle user home directory.]:home directory:_directories:->argument-expected' \ - '(-)--gui[Launches the Gradle GUI. (Removed in Gradle 4.0)]' \ - \*--include-build'[Includes the specified build in the composite.]:file:_directories:->argument-expected' \ - \*{-I,--init-script}'[Specifies an initialization script.]:init script:_files -g \*.gradle:->argument-expected' \ - '(-d --debug -w --warn -q --quiet)'{-i,--info}'[Set log level to info.]' \ - '--max-workers[Set the maximum number of concurrent workers that Gradle may use.]:number workers:->argument-expected' \ - {-m,--dry-run}'[Runs the builds with all task actions disabled.]' \ - '--no-color[Do not use color in the console output. (Removed in Gradle 3.0)]' \ - '(--build-cache)--no-build-cache[Do not use the Gradle build cache.]' \ - '(--configure-on-demand)--no-configure-on-demand[Disables configuration on demand.]' \ - '(--daemon)--no-daemon[Do not use the Gradle daemon to run the build.]' \ - '(--parallel)--no-parallel[Disables parallel execution to build projects.]' \ - '(--scan)--no-scan[Do not create a build scan.]' \ - '--offline[The build should operate without accessing network resources.]' \ - \*{-P+,--project-prop}'[Set project property for the build script (e.g. -Pmyprop=myvalue).]:project property (prop=val):->argument-expected' \ - {-p,--project-dir}'[Specifies the start directory for Gradle.]:start directory:_directories:->argument-expected' \ - '(--no-parallel)--parallel[Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use.]' \ - '--priority=[Set priority for Gradle worker processes.]:priority:(low normal)' \ - '--profile[Profiles build execution time and generates a report in the /reports/profile directory.]' \ - '--project-cache-dir=[Specifies the project-specific cache directory.]:cache directory:_directories:->argument-expected' \ - '(-d --debug -w --warn -i --info)'{-q,--quiet}'[Log errors only.]' \ - '--recompile-scripts[Force build script recompiling.]' \ - '--refresh[Refresh the state of resources of the type(s) specified.]:refresh policy:(dependencies)' \ - '--refresh-dependencies[Refresh the state of dependencies.]' \ - '--rerun-tasks[Ignore previously cached task results.]' \ - '(--no-scan)--scan[Create a build scan.]' \ - '(-S --full-stacktrace)'{-s,--stacktrace}'[Print out the stacktrace for all exceptions.]' \ - '(-s --stacktrace)'{-S,--full-stacktrace}'[Print out the full (very verbose) stacktrace for all exceptions.]' \ - '(-)--status[Shows status of running and recently stopped Gradle Daemons.]' \ - '(-)--stop[Stops all Gradle daemons.]' \ - '--system-prop[system property (prop=val)]' \ - {-t,--continuous}'[Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change.]' \ - {-u,--no-search-upward}"[Don't search in parent folders for a settings.gradle file.]" \ - '(--write-locks)--update-locks[Perform a partial update of the dependency lock.]' \ - '(-)'{-v,--version}'[Print version info.]' \ - '(-d --debug -q --quiet -i --info)'{-w,--warn}'[Log warnings and errors only.]' \ - '--warning-mode=[Set types of warnings to log.]:warning mode:(all summary none)' \ - '(--update-locks)--write-locks[Persists dependency resolution for locked configurations.]' \ - {-x,--exclude-task}'[Specify a task to be excluded from execution.]' \ - '(-)*:: :->task-or-option' && ret=0 - - if [[ $words[CURRENT] != -* && $state != "argument-expected" ]]; then - __gradle_tasks && ret=0 - else - curcontext=${curcontext%:*:*}:gradle-$words[1]: - __gradle_subcommand && ret=0 - fi - - return ret -} - -_gradle "$@" diff --git a/zsh/.oh-my-zsh/plugins/gradle/_gradle b/zsh/.oh-my-zsh/plugins/gradle/_gradle new file mode 120000 index 0000000..80723f2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gradle/_gradle @@ -0,0 +1 @@ +gradle.plugin.zsh \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/gradle/_gradlew b/zsh/.oh-my-zsh/plugins/gradle/_gradlew new file mode 120000 index 0000000..80723f2 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/gradle/_gradlew @@ -0,0 +1 @@ +gradle.plugin.zsh \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh b/zsh/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh index 5bca364..6be5831 100644 --- a/zsh/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh @@ -1,26 +1,184 @@ -# Looks for a gradlew file in the current working directory -# or any of its parent directories, and executes it if found. -# Otherwise it will call gradle directly. -function gradle-or-gradlew() { - # find project root - # taken from https://github.com/gradle/gradle-completion - local dir="$PWD" project_root="$PWD" - while [[ "$dir" != / ]]; do - if [[ -f "$dir/settings.gradle" || -f "$dir/settings.gradle.kts" || -f "$dir/gradlew" ]]; then - project_root="$dir" - break - fi - dir="${dir:h}" - done +############################################################################## +# A descriptive listing of core Gradle commands +############################################################################ - # if gradlew found, run it instead of gradle - if [[ -f "$project_root/gradlew" ]]; then - echo "executing gradlew instead of gradle" - "$project_root/gradlew" "$@" - else - command gradle "$@" +gradle-or-gradlew() { + if [ -f ./gradlew ] ; then + echo "executing gradlew instead of gradle"; + ./gradlew "$@"; + else + gradle "$@"; + fi +} + +alias gradle=gradle-or-gradlew; + +function _gradle_core_commands() { + local ret=1 state + _arguments ':subcommand:->subcommand' && ret=0 + + case $state in + subcommand) + subcommands=( + "properties:Display all project properties" + "tasks:Calculate and display all tasks" + "dependencies:Calculate and display all dependencies" + "projects:Discover and display all sub-projects" + "build:Build the project" + "help:Display help" + ) + _describe -t subcommands 'gradle subcommands' subcommands && ret=0 + esac + + return ret +} + +function _gradle_arguments() { + _arguments -C \ + '-a[Do not rebuild project dependencies]' \ + '-b[Specifies the build file]' \ + '-c[Specifies the settings file]' \ + '-d[Log at the debug level]' \ + '-g[Specifies the Gradle user home directory]' \ + '-h[Shows a help message]' \ + '-i[Set log level to INFO]' \ + '-m[Runs the build with all task actions disabled]' \ + '-p[Specifies the start directory for Gradle]' \ + '-q[Log errors only]' \ + '-s[Print out the stacktrace also for user exceptions]' \ + '-t[Continuous mode. Automatically re-run build after changes]' \ + '-u[Don''t search in parent directories for a settings.gradle file]' \ + '-v[Prints Gradle version info]' \ + '-x[Specify a task to be excluded]' \ + '-D[Set a system property]' \ + '-I[Specifies an initialization script]' \ + '-P[Sets a project property of the root project]' \ + '-S[Print out the full (very verbose) stacktrace]' \ + '--build-file[Specifies the build file]' \ + '--configure-on-demand[Only relevant projects are configured]' \ + '--console[Type of console output to generate (plain, auto, or rich)]' \ + '--continue[Continues task execution after a task failure]' \ + '--continuous[Continuous mode. Automatically re-run build after changes]' \ + '--daemon[Use the Gradle Daemon]' \ + '--debug[Log at the debug level]' \ + '--dry-run[Runs the build with all task actions disabled]' \ + '--exclude-task[Specify a task to be excluded]' \ + '--full-stacktrace[Print out the full (very verbose) stacktrace]' \ + '--gradle-user-home[Specifies the Gradle user home directory]' \ + '--gui[Launches the Gradle GUI app (Deprecated)]' \ + '--help[Shows a help message]' \ + '--include-build[Run the build as a composite, including the specified build]' \ + '--info[Set log level to INFO]' \ + '--init-script[Specifies an initialization script]' \ + '--max-workers[Set the maximum number of workers that Gradle may use]' \ + '--no-daemon[Do not use the Gradle Daemon]' \ + '--no-rebuild[Do not rebuild project dependencies]' \ + '--no-search-upwards[Don''t search in parent directories for a settings.gradle file]' \ + '--offline[Build without accessing network resources]' \ + '--parallel[Build projects in parallel]' \ + '--profile[Profile build time and create report]' \ + '--project-cache-dir[Specifies the project-specific cache directory]' \ + '--project-dir[Specifies the start directory for Gradle]' \ + '--project-prop[Sets a project property of the root project]' \ + '--quiet[Log errors only]' \ + '--recompile-scripts[Forces scripts to be recompiled, bypassing caching]' \ + '--refresh-dependencies[Refresh the state of dependencies]' \ + '--rerun-task[Specifies that any task optimization is ignored]' \ + '--settings-file[Specifies the settings file]' \ + '--stacktrace[Print out the stacktrace also for user exceptions]' \ + '--status[Print Gradle Daemon status]' \ + '--stop[Stop all Gradle Daemons]' \ + '--system-prop[Set a system property]' \ + '--version[Prints Gradle version info]' \ + '*::command:->command' \ + && return 0 +} + + +############################################################################## +# Examine the build.gradle file to see if its timestamp has changed; +# and if so, regenerate the .gradle_tasks cache file +############################################################################ +_gradle_does_task_list_need_generating () { + [[ ! -f .gradletasknamecache ]] || [[ build.gradle -nt .gradletasknamecache || build.gradle.kts -nt .gradletasknamecache ]] +} + +############## +# Parse the tasks from `gradle(w) tasks --all` and return them to the calling function. +# All lines in the output from gradle(w) that are between /^-+$/ and /^\s*$/ +# are considered to be tasks. If and when gradle adds support for listing tasks +# for programmatic parsing, this method can be deprecated. +############## +_gradle_parse_tasks () { + lines_might_be_tasks=false + task_name_buffer="" + while read -r line; do + if [[ $line =~ ^-+$ ]]; then + lines_might_be_tasks=true + # Empty buffer, because it contains items that are not tasks + task_name_buffer="" + elif [[ $line =~ ^\s*$ ]]; then + if [[ "$lines_might_be_tasks" = true ]]; then + # If a newline is found, echo the buffer to the calling function + while read -r task; do + echo $task | awk '/[a-zA-Z0-9:-]+/ {print $1}' + done <<< "$task_name_buffer" + # Empty buffer, because we are done with the tasks + task_name_buffer="" + fi + lines_might_be_tasks=false + elif [[ "$lines_might_be_tasks" = true ]]; then + task_name_buffer="${task_name_buffer}\n${line}" + fi + done <<< "$1" +} + + +############## +# Gradle tasks from subprojects are allowed to be executed without specifying +# the subproject; that task will then be called on all subprojects. +# gradle(w) tasks --all only lists tasks per subproject, but when autocompleting +# we often want to be able to run a specific task on all subprojects, e.g. +# "gradle clean". +# This function uses the list of tasks from "gradle tasks --all", and for each +# line grabs everything after the last ":" and combines that output with the original +# output. The combined list is returned as the result of this function. +############## +_gradle_parse_and_extract_tasks () { + # All tasks + tasks=$(_gradle_parse_tasks "$1") + # Task name without sub project(s) prefix + simple_tasks=$(echo $tasks | awk 'BEGIN { FS = ":" } { print $NF }') + echo "$tasks\n$simple_tasks" +} + +############################################################################## +# Discover the gradle tasks by running "gradle tasks --all" +############################################################################ +_gradle_tasks () { + if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then + _gradle_arguments + if _gradle_does_task_list_need_generating; then + _gradle_parse_and_extract_tasks "$(gradle tasks --all)" > .gradletasknamecache + fi + compadd -X "==== Gradle Tasks ====" $(cat .gradletasknamecache) fi } -alias gradle=gradle-or-gradlew -compdef _gradle gradle-or-gradlew +_gradlew_tasks () { + if [[ -f build.gradle || -f build.gradle.kts || -f settings.gradle || -f settings.gradle.kts ]]; then + _gradle_arguments + if _gradle_does_task_list_need_generating; then + _gradle_parse_and_extract_tasks "$(./gradlew tasks --all)" > .gradletasknamecache + fi + compadd -X "==== Gradlew Tasks ====" $(cat .gradletasknamecache) + fi +} + + +############################################################################## +# Register the completions against the gradle and gradlew commands +############################################################################ +compdef _gradle_tasks gradle +compdef _gradlew_tasks gradlew +compdef _gradlew_tasks gw diff --git a/zsh/.oh-my-zsh/plugins/grails/README.md b/zsh/.oh-my-zsh/plugins/grails/README.md index 5d9ebd7..64b4a9f 100644 --- a/zsh/.oh-my-zsh/plugins/grails/README.md +++ b/zsh/.oh-my-zsh/plugins/grails/README.md @@ -14,3 +14,58 @@ It looks for scripts in the following paths: - `~/.grails/scripts` - `./scripts` - `./plugins/*/scripts` + +## Grails Commands +- `add-proxy` +- `alias` +- `bootstrap` +- `bug-report` +- `clean` +- `clean-all` +- `clear-proxy` +- `compile` +- `console` +- `create-app` +- `create-controller` +- `create-domain-class` +- `create-filters` +- `create-integration-test` +- `create-multi-project-build` +- `create-plugin` +- `create-pom` +- `create-script` +- `create-service` +- `create-tag-lib` +- `create-unit-test` +- `dependency-report` +- `doc` +- `help` +- `init` +- `install-app-templates` +- `install-dependency` +- `install-plugin` +- `install-templates` +- `integrate-with` +- `interactive` +- `list-plugin-updates` +- `list-plugins` +- `migrate-docs` +- `package` +- `package-plugin` +- `plugin-info` +- `refresh-dependencies` +- `remove-proxy` +- `run-app` +- `run-script` +- `run-war` +- `set-grails-version` +- `set-proxy` +- `set-version` +- `shell` +- `stats` +- `stop-app` +- `test-app` +- `uninstall-plugin` +- `url-mappings-report` +- `war` +- `wrapper` diff --git a/zsh/.oh-my-zsh/plugins/history-substring-search/README.md b/zsh/.oh-my-zsh/plugins/history-substring-search/README.md index 6d8b564..0ffb213 100644 --- a/zsh/.oh-my-zsh/plugins/history-substring-search/README.md +++ b/zsh/.oh-my-zsh/plugins/history-substring-search/README.md @@ -1,44 +1,25 @@ -# zsh-history-substring-search +zsh-history-substring-search +============================================================================== This is a clean-room implementation of the [Fish shell][1]'s history search -feature, where you can type in any part of any command from history and then -press chosen keys, such as the UP and DOWN arrows, to cycle through matches. +feature, where you can type in any part of any previously entered command +and press the UP and DOWN arrow keys to cycle through the matching commands. +You can also use K and J in VI mode or ^P and ^N in EMACS mode for the same. -[1]: http://fishshell.com -[2]: http://www.zsh.org/mla/users/2009/msg00818.html -[3]: http://sourceforge.net/projects/fizsh/ -[4]: https://github.com/robbyrussell/oh-my-zsh/pull/215 +[1]: https://fishshell.com +[2]: https://www.zsh.org/mla/users/2009/msg00818.html +[3]: https://sourceforge.net/projects/fizsh/ +[4]: https://github.com/ohmyzsh/ohmyzsh/pull/215 [5]: https://github.com/zsh-users/zsh-history-substring-search [6]: https://github.com/zsh-users/zsh-syntax-highlighting - +------------------------------------------------------------------------------ Requirements ------------------------------------------------------------------------------ * [ZSH](http://zsh.sourceforge.net) 4.3 or newer -Install ------------------------------------------------------------------------------ - -Using the [Homebrew]( https://brew.sh ) package manager: - - brew install zsh-history-substring-search - echo 'source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc - -Using [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh): - -1. Clone this repository in oh-my-zsh's plugins directory: - - git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search - -2. Activate the plugin in `~/.zshrc`: - - plugins=( [plugins...] history-substring-search) - -3. Source `~/.zshrc` to take changes into account: - - source ~/.zshrc - Usage ------------------------------------------------------------------------------ @@ -52,147 +33,117 @@ Usage % source zsh-syntax-highlighting.zsh % source zsh-history-substring-search.zsh -2. Bind keyboard shortcuts to this script's functions. +2. Bind keyboard shortcuts to this script's functions: - Users typically bind their UP and DOWN arrow keys to this script, thus: - * Run `cat -v` in your favorite terminal emulator to observe key codes. -      (**NOTE:** In some cases, `cat -v` shows the wrong key codes. If the - key codes shown by `cat -v` don't work for you, press `` and - `` at your ZSH command line prompt for correct key codes.) - * Press the UP arrow key and observe what is printed in your terminal. - * Press the DOWN arrow key and observe what is printed in your terminal. - * Press the Control and C keys simultaneously to terminate the `cat -v`. - * Use your observations from the previous steps to create key bindings. - For example, if you observed `^[[A` for UP and `^[[B` for DOWN, then: + # bind UP and DOWN arrow keys + zmodload zsh/terminfo + bindkey "$terminfo[kcuu1]" history-substring-search-up + bindkey "$terminfo[kcud1]" history-substring-search-down - bindkey '^[[A' history-substring-search-up - bindkey '^[[B' history-substring-search-down + # bind UP and DOWN arrow keys (compatibility fallback + # for Ubuntu 12.04, Fedora 21, and MacOSX 10.9 users) + bindkey '^[[A' history-substring-search-up + bindkey '^[[B' history-substring-search-down - However, if the observed values don't work, you can try using terminfo: + # bind P and N for EMACS mode + bindkey -M emacs '^P' history-substring-search-up + bindkey -M emacs '^N' history-substring-search-down - bindkey "$terminfo[kcuu1]" history-substring-search-up - bindkey "$terminfo[kcud1]" history-substring-search-down - - You might also want to bind the Control-P/N keys for use in EMACS mode: - - bindkey -M emacs '^P' history-substring-search-up - bindkey -M emacs '^N' history-substring-search-down - - You might also want to bind the `k` and `j` keys for use in VI mode: - - bindkey -M vicmd 'k' history-substring-search-up - bindkey -M vicmd 'j' history-substring-search-down + # bind k and j for VI mode + bindkey -M vicmd 'k' history-substring-search-up + bindkey -M vicmd 'j' history-substring-search-down 3. Type any part of any previous command and then: - * Press the `history-substring-search-up` key, which was configured in - step 2 above, to select the nearest command that (1) contains your query - and (2) is also older than the current command in your command history. + * Press the UP arrow key to select the nearest command that (1) contains + your query and (2) is older than the current command in the command + history. - * Press the `history-substring-search-down` key, which was configured in - step 2 above, to select the nearest command that (1) contains your query - and (2) is also newer than the current command in your command history. + * Press the DOWN arrow key to select the nearest command that (1) + contains your query and (2) is newer than the current command in the + command history. - * Press `^U` the Control and U keys simultaneously to abort the search. + * Press ^U (the Control and U keys simultaneously) to abort the search. 4. If a matching command spans more than one line of text, press the LEFT arrow key to move the cursor away from the end of the command, and then: - * Press the `history-substring-search-up` key, which was configured in - step 2 above, to move the cursor to the line above the cursored line. - When the cursor reaches the first line of the command, pressing the - `history-substring-search-up` key again will cause this script to - perform another search. - - * Press the `history-substring-search-down` key, which was configured in - step 2 above, to move the cursor to the line below the cursored line. - When the cursor reaches the last line of the command, pressing the - `history-substring-search-down` key, which was configured in step 2 - above, again will cause this script to perform another search. + * Press the UP arrow key to move the cursor to the line above. When the + cursor reaches the first line of the command, pressing the UP arrow + key again will cause this script to perform another search. + * Press the DOWN arrow key to move the cursor to the line below. When + the cursor reaches the last line of the command, pressing the DOWN + arrow key again will cause this script to perform another search. +------------------------------------------------------------------------------ Configuration ------------------------------------------------------------------------------ This script defines the following global variables. You may override their default values only after having loaded this script into your ZSH session. -* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND` is a global variable that defines +* HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND is a global variable that defines how the query should be highlighted inside a matching command. Its default value causes this script to highlight using bold, white text on a magenta background. See the "Character Highlighting" section in the zshzle(1) man page to learn about the kinds of values you may assign to this variable. -* `HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND` is a global variable that +* HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND is a global variable that defines how the query should be highlighted when no commands in the history match it. Its default value causes this script to highlight using bold, white text on a red background. See the "Character Highlighting" section in the zshzle(1) man page to learn about the kinds of values you may assign to this variable. -* `HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS` is a global variable that defines +* HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS is a global variable that defines how the command history will be searched for your query. Its default value causes this script to perform a case-insensitive search. See the "Globbing Flags" section in the zshexpn(1) man page to learn about the kinds of values you may assign to this variable. -* `HISTORY_SUBSTRING_SEARCH_FUZZY` is a global variable that defines - how the command history will be searched for your query. If set to a non-empty - value, causes this script to perform a fuzzy search by words, matching in - given order e.g. `ab c` will match `*ab*c*` - -* `HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE` is a global variable that defines - whether all search results returned are _unique_. If set to a non-empty - value, then only unique search results are presented. This behaviour is off - by default. An alternative way to ensure that search results are unique is - to use `setopt HIST_IGNORE_ALL_DUPS`. If this configuration variable is off - and `setopt HIST_IGNORE_ALL_DUPS` is unset, then `setopt HIST_FIND_NO_DUPS` - is still respected and it makes this script skip duplicate _adjacent_ search - results as you cycle through them, but this does not guarantee that search - results are unique: if your search results were "Dog", "Dog", "HotDog", - "Dog", then cycling them gives "Dog", "HotDog", "Dog". Notice that the "Dog" - search result appeared twice as you cycled through them. If you wish to - receive globally unique search results only once, then use this - configuration variable, or use `setopt HIST_IGNORE_ALL_DUPS`. - +To always receive _unique_ search results, use `setopt HIST_IGNORE_ALL_DUPS`. +Alternatively, use `setopt HIST_FIND_NO_DUPS` which makes this plugin skip +duplicate _adjacent_ search results as you cycle through them---however, this +does not guarantee that search results are unique: if your search results were +"Dog", "Dog", "HotDog", "Dog", then cycling them gives "Dog", "HotDog", "Dog". +Notice that the "Dog" search result appeared twice as you cycled through them! +If you wish to avoid this limitation, then use `setopt HIST_IGNORE_ALL_DUPS`. +------------------------------------------------------------------------------ History ------------------------------------------------------------------------------ -* September 2009: [Peter Stephenson][2] originally wrote this script and it - published to the zsh-users mailing list. +This script was originally written by [Peter Stephenson][2], who published it +to the ZSH users mailing list (thereby making it public domain) in September +2009. It was later revised by Guido van Steen and released under the BSD +license (see below) as part of [the fizsh project][3] in January 2011. -* January 2011: Guido van Steen (@guidovansteen) revised this script and - released it under the 3-clause BSD license as part of [fizsh][3], the - Friendly Interactive ZSHell. +It was later extracted from fizsh release 1.0.1, refactored heavily, and +repackaged as both an [oh-my-zsh plugin][4] and as an independently loadable +[ZSH script][5] by Suraj N. Kurapati in 2011. -* January 2011: Suraj N. Kurapati (@sunaku) extracted this script from - [fizsh][3] 1.0.1, refactored it heavily, and finally repackaged it as an - [oh-my-zsh plugin][4] and as an independently loadable [ZSH script][5]. - -* July 2011: Guido van Steen, Suraj N. Kurapati, and Sorin Ionescu - (@sorin-ionescu) [further developed it][4] with Vincent Guerci (@vguerci). - -* March 2016: Geza Lore (@gezalore) greatly refactored it in pull request #55. +It was [further developed][4] by Guido van Steen, Suraj N. Kurapati, Sorin +Ionescu, and Vincent Guerci in 2011. ------------------------------------------------------------------------------ Oh My Zsh Distribution Notes ------------------------------------------------------------------------------ -What you are looking at now is Oh My Zsh's repackaging of zsh-history-substring-search +What you are looking at now is Oh My Zsh's repackaging of zsh-history-substring-search as an OMZ module inside the Oh My Zsh distribution. -The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at +The upstream repo, zsh-users/zsh-history-substring-search, can be found on GitHub at https://github.com/zsh-users/zsh-history-substring-search. This downstream copy was last updated from the following upstream commit: - SHA: 0f80b8eb3368b46e5e573c1d91ae69eb095db3fb - Commit date: 2019-05-12 17:35:54 -0700 + SHA: 2c295432175990c1bb4e90bc13f609daa67a25d6 + Commit date: 2015-09-28 10:47:34 -0700 Everything above this section is a copy of the original upstream's README, so things may differ slightly when you're using this inside OMZ. In particular, you do not -need to set up key bindings for the up and down arrows yourself in `~/.zshrc`; the OMZ +need to set up key bindings for the up and down arrows yourself in `~/.zshrc`; the OMZ plugin does that for you. You may still want to set up additional emacs- or vi-specific bindings as mentioned above. diff --git a/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh b/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh index d2c749b..7883a65 100644 --- a/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh @@ -1,9 +1,20 @@ -0=${(%):-%N} -source ${0:A:h}/history-substring-search.zsh +# This file integrates the zsh-history-substring-search script into oh-my-zsh. + +source "${0:r:r}.zsh" + +if test "$CASE_SENSITIVE" = true; then + unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS +fi + +if test "$DISABLE_COLOR" = true; then + unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND +fi # Bind terminal-specific up and down keys - +# Bind in both emacs and vi modes so it works in both, and is not +# sensitive to whether this is loaded before or after the vi-mode plugin if [[ -n "$terminfo[kcuu1]" ]]; then bindkey -M emacs "$terminfo[kcuu1]" history-substring-search-up bindkey -M viins "$terminfo[kcuu1]" history-substring-search-up diff --git a/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh b/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh index a791cc4..3b8afd3 100644 --- a/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh +++ b/zsh/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh @@ -6,8 +6,6 @@ # Copyright (c) 2011 Suraj N. Kurapati # Copyright (c) 2011 Sorin Ionescu # Copyright (c) 2011 Vincent Guerci -# Copyright (c) 2016 Geza Lore -# Copyright (c) 2017 Bengt Brodersen # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,30 +38,12 @@ ############################################################################## #----------------------------------------------------------------------------- -# declare global configuration variables +# configuration variables #----------------------------------------------------------------------------- -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' -typeset -g HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' -typeset -g HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE='' -typeset -g HISTORY_SUBSTRING_SEARCH_FUZZY='' - -#----------------------------------------------------------------------------- -# declare internal global variables -#----------------------------------------------------------------------------- - -typeset -g BUFFER MATCH MBEGIN MEND CURSOR -typeset -g _history_substring_search_refresh_display -typeset -g _history_substring_search_query_highlight -typeset -g _history_substring_search_result -typeset -g _history_substring_search_query -typeset -g -a _history_substring_search_query_parts -typeset -g -a _history_substring_search_raw_matches -typeset -g -i _history_substring_search_raw_match_index -typeset -g -a _history_substring_search_matches -typeset -g -i _history_substring_search_match_index -typeset -g -A _history_substring_search_unique_filter +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=magenta,fg=white,bold' +HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=white,bold' +HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS='i' #----------------------------------------------------------------------------- # the main ZLE widgets @@ -200,104 +180,62 @@ _history-substring-search-begin() { _history_substring_search_query_highlight= # - # If the buffer is the same as the previously displayed history substring - # search result, then just keep stepping through the match list. Otherwise - # start a new search. + # Continue using the previous $_history_substring_search_result by default, + # unless the current query was cleared or a new/different query was entered. # - if [[ -n $BUFFER && $BUFFER == ${_history_substring_search_result:-} ]]; then - return; - fi - - # - # Clear the previous result. - # - _history_substring_search_result='' - - if [[ -z $BUFFER ]]; then + if [[ -z $BUFFER || $BUFFER != $_history_substring_search_result ]]; then # - # If the buffer is empty, we will just act like up-history/down-history - # in ZSH, so we do not need to actually search the history. This should - # speed things up a little. - # - _history_substring_search_query= - _history_substring_search_query_parts=() - _history_substring_search_raw_matches=() - - else - # - # For the purpose of highlighting we keep a copy of the original - # query string. + # For the purpose of highlighting we will also keep + # a version without doubly-escaped meta characters. # _history_substring_search_query=$BUFFER # - # compose search pattern + # $BUFFER contains the text that is in the command-line currently. + # we put an extra "\\" before meta characters such as "\(" and "\)", + # so that they become "\\\(" and "\\\)". # - if [[ -n $HISTORY_SUBSTRING_SEARCH_FUZZY ]]; then - # - # `=` split string in arguments - # - _history_substring_search_query_parts=(${=_history_substring_search_query}) - else - _history_substring_search_query_parts=(${==_history_substring_search_query}) - fi + _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH} # - # Escape and join query parts with wildcard character '*' as seperator - # `(j:CHAR:)` join array to string with CHAR as seperator - # - local search_pattern="*${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*" - - # - # Find all occurrences of the search pattern in the history file. + # Find all occurrences of the search query in the history file. # # (k) returns the "keys" (history index numbers) instead of the values - # (R) returns values in reverse older, so the index of the youngest - # matching history entry is at the head of the list. + # (Oa) reverses the order, because (R) returns results reversed. # - _history_substring_search_raw_matches=(${(k)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${search_pattern}]}) - fi + _history_substring_search_matches=(${(kOa)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)*${_history_substring_search_query_escaped}*]}) - # - # In order to stay as responsive as possible, we will process the raw - # matches lazily (when the user requests the next match) to choose items - # that need to be displayed to the user. - # _history_substring_search_raw_match_index holds the index of the last - # unprocessed entry in _history_substring_search_raw_matches. Any items - # that need to be displayed will be added to - # _history_substring_search_matches. - # - # We use an associative array (_history_substring_search_unique_filter) as - # a 'set' data structure to ensure uniqueness of the results if desired. - # If an entry (key) is in the set (non-empty value), then we have already - # added that entry to _history_substring_search_matches. - # - _history_substring_search_raw_match_index=0 - _history_substring_search_matches=() - _history_substring_search_unique_filter=() + # + # Define the range of values that $_history_substring_search_match_index + # can take: [0, $_history_substring_search_matches_count_plus]. + # + _history_substring_search_matches_count=$#_history_substring_search_matches + _history_substring_search_matches_count_plus=$(( _history_substring_search_matches_count + 1 )) + _history_substring_search_matches_count_sans=$(( _history_substring_search_matches_count - 1 )) - # - # If $_history_substring_search_match_index is equal to - # $#_history_substring_search_matches + 1, this indicates that we - # are beyond the end of $_history_substring_search_matches and that we - # have also processed all entries in - # _history_substring_search_raw_matches. - # - # If $#_history_substring_search_match_index is equal to 0, this indicates - # that we are beyond the beginning of $_history_substring_search_matches. - # - # If we have initially pressed "up" we have to initialize - # $_history_substring_search_match_index to 0 so that it will be - # incremented to 1. - # - # If we have initially pressed "down" we have to initialize - # $_history_substring_search_match_index to 1 so that it will be - # decremented to 0. - # - if [[ $WIDGET == history-substring-search-down ]]; then - _history_substring_search_match_index=1 - else - _history_substring_search_match_index=0 + # + # If $_history_substring_search_match_index is equal to + # $_history_substring_search_matches_count_plus, this indicates that we + # are beyond the beginning of $_history_substring_search_matches. + # + # If $_history_substring_search_match_index is equal to 0, this indicates + # that we are beyond the end of $_history_substring_search_matches. + # + # If we have initially pressed "up" we have to initialize + # $_history_substring_search_match_index to + # $_history_substring_search_matches_count_plus so that it will be + # decreased to $_history_substring_search_matches_count. + # + # If we have initially pressed "down" we have to initialize + # $_history_substring_search_match_index to + # $_history_substring_search_matches_count so that it will be increased to + # $_history_substring_search_matches_count_plus. + # + if [[ $WIDGET == history-substring-search-down ]]; then + _history_substring_search_match_index=$_history_substring_search_matches_count + else + _history_substring_search_match_index=$_history_substring_search_matches_count_plus + fi fi } @@ -317,21 +255,16 @@ _history-substring-search-end() { _zsh_highlight # highlight the search query inside the command line - if [[ -n $_history_substring_search_query_highlight ]]; then - # highlight first matching query parts - local highlight_start_index=0 - local highlight_end_index=0 - local query_part - for query_part in $_history_substring_search_query_parts; do - local escaped_query_part=${query_part//(#m)[\][()|\\*?#<>~^]/\\$MATCH} - # (i) get index of pattern - local query_part_match_index="${${BUFFER:$highlight_start_index}[(i)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)${escaped_query_part}]}" - if [[ $query_part_match_index -le ${#BUFFER:$highlight_start_index} ]]; then - highlight_start_index=$(( $highlight_start_index + $query_part_match_index )) - highlight_end_index=$(( $highlight_start_index + ${#query_part} )) - region_highlight+=("$(($highlight_start_index - 1)) $(($highlight_end_index - 1)) $_history_substring_search_query_highlight") - fi - done + if [[ -n $_history_substring_search_query_highlight && -n $_history_substring_search_query ]]; then + # + # The following expression yields a variable $MBEGIN, which + # indicates the begin position + 1 of the first occurrence + # of _history_substring_search_query_escaped in $BUFFER. + # + : ${(S)BUFFER##(#m$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)($_history_substring_search_query##)} + local begin=$(( MBEGIN - 1 )) + local end=$(( begin + $#_history_substring_search_query )) + region_highlight+=("$begin $end $_history_substring_search_query_highlight") fi # For debugging purposes: @@ -445,143 +378,12 @@ _history-substring-search-down-history() { return 1 } -_history_substring_search_process_raw_matches() { - # - # Process more outstanding raw matches and append any matches that need to - # be displayed to the user to _history_substring_search_matches. - # Return whether there were any more results appended. - # - - # - # While we have more raw matches. Process them to see if there are any more - # matches that need to be displayed to the user. - # - while [[ $_history_substring_search_raw_match_index -lt $#_history_substring_search_raw_matches ]]; do - # - # Move on to the next raw entry and get its history index. - # - _history_substring_search_raw_match_index+=1 - local index=${_history_substring_search_raw_matches[$_history_substring_search_raw_match_index]} - - # - # If HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set to a non-empty value, - # then ensure that only unique matches are presented to the user. - # When HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history, - # so in this case we do not need to do anything. - # - if [[ ! -o HIST_IGNORE_ALL_DUPS && -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - # - # Get the actual history entry at the new index, and check if we have - # already added it to _history_substring_search_matches. - # - local entry=${history[$index]} - - if [[ -z ${_history_substring_search_unique_filter[$entry]} ]]; then - # - # This is a new unique entry. Add it to the filter and append the - # index to _history_substring_search_matches. - # - _history_substring_search_unique_filter[$entry]=1 - _history_substring_search_matches+=($index) - - # - # Indicate that we did find a match. - # - return 0 - fi - - else - # - # Just append the new history index to the processed matches. - # - _history_substring_search_matches+=($index) - - # - # Indicate that we did find a match. - # - return 0 - fi - - done - - # - # We are beyond the end of the list of raw matches. Indicate that no - # more matches are available. - # - return 1 -} - -_history-substring-search-has-next() { - # - # Predicate function that returns whether any more older matches are - # available. - # - - if [[ $_history_substring_search_match_index -lt $#_history_substring_search_matches ]]; then - # - # We did not reach the end of the processed list, so we do have further - # matches. - # - return 0 - - else - # - # We are at the end of the processed list. Try to process further - # unprocessed matches. _history_substring_search_process_raw_matches - # returns whether any more matches were available, so just return - # that result. - # - _history_substring_search_process_raw_matches - return $? - fi -} - -_history-substring-search-has-prev() { - # - # Predicate function that returns whether any more younger matches are - # available. - # - - if [[ $_history_substring_search_match_index -gt 1 ]]; then - # - # We did not reach the beginning of the processed list, so we do have - # further matches. - # - return 0 - - else - # - # We are at the beginning of the processed list. We do not have any more - # matches. - # - return 1 - fi -} - -_history-substring-search-found() { - # - # A match is available. The index of the match is held in - # $_history_substring_search_match_index - # - # 1. Make $BUFFER equal to the matching history entry. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - # to highlight the current buffer. - # - BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] - _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND -} - _history-substring-search-not-found() { # - # No more matches are available. - # - # 1. Make $BUFFER equal to $_history_substring_search_query so the user can - # revise it and search again. - # - # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND - # to highlight the current buffer. + # Nothing matched the search query, so put it back into the $BUFFER while + # highlighting it accordingly so the user can revise it and search again. # + _history_substring_search_old_buffer=$BUFFER BUFFER=$_history_substring_search_query _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND } @@ -590,84 +392,91 @@ _history-substring-search-up-search() { _history_substring_search_refresh_display=1 # - # Select history entry during history-substring-down-search: + # Highlight matches during history-substring-up-search: # - # The following variables have been initialized in + # The following constants have been initialized in # _history-substring-search-up/down-search(): # - # $_history_substring_search_matches is the current list of matches that - # need to be displayed to the user. + # $_history_substring_search_matches is the current list of matches + # $_history_substring_search_matches_count is the current number of matches + # $_history_substring_search_matches_count_plus is the current number of matches + 1 + # $_history_substring_search_matches_count_sans is the current number of matches - 1 # $_history_substring_search_match_index is the index of the current match - # that is being displayed to the user. # # The range of values that $_history_substring_search_match_index can take - # is: [0, $#_history_substring_search_matches + 1]. A value of 0 - # indicates that we are beyond the beginning of + # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 + # indicates that we are beyond the end of # $_history_substring_search_matches. A value of - # $#_history_substring_search_matches + 1 indicates that we are beyond - # the end of $_history_substring_search_matches and that we have also - # processed all entries in _history_substring_search_raw_matches. - # - # If $_history_substring_search_match_index equals - # $#_history_substring_search_matches and - # $_history_substring_search_raw_match_index is not greater than - # $#_history_substring_search_raw_matches, then we need to further process - # $_history_substring_search_raw_matches to see if there are any more - # entries that need to be displayed to the user. + # $_history_substring_search_matches_count_plus indicates that we are beyond + # the beginning of $_history_substring_search_matches. # # In _history-substring-search-up-search() the initial value of - # $_history_substring_search_match_index is 0. This value is set in - # _history-substring-search-begin(). _history-substring-search-up-search() - # will initially increment it to 1. + # $_history_substring_search_match_index is + # $_history_substring_search_matches_count_plus. This value is set in + # _history-substring-search-begin(). _history-substring-search-up-search() + # will initially decrease it to $_history_substring_search_matches_count. # + if [[ $_history_substring_search_match_index -ge 2 ]]; then + # + # Highlight the next match: + # + # 1. Decrease the value of $_history_substring_search_match_index. + # + # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) + BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - if [[ $_history_substring_search_match_index -gt $#_history_substring_search_matches ]]; then + elif [[ $_history_substring_search_match_index -eq 1 ]]; then # - # We are beyond the end of $_history_substring_search_matches. This - # can only happen if we have also exhausted the unprocessed matches in - # _history_substring_search_raw_matches. + # We will move beyond the end of $_history_substring_search_matches: # - # 1. Update display to indicate search not found. + # 1. Decrease the value of $_history_substring_search_match_index. # + # 2. Save the current buffer in $_history_substring_search_old_buffer, + # so that it can be retrieved by + # _history-substring-search-down-search() later. + # + # 3. Make $BUFFER equal to $_history_substring_search_query. + # + # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) _history-substring-search-not-found - return - fi - if _history-substring-search-has-next; then + elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count_plus ]]; then # - # We do have older matches. + # We were beyond the beginning of $_history_substring_search_matches but + # UP makes us move back to $_history_substring_search_matches: # - # 1. Move index to point to the next match. - # 2. Update display to indicate search found. + # 1. Decrease the value of $_history_substring_search_match_index. # - _history_substring_search_match_index+=1 - _history-substring-search-found + # 2. Restore $BUFFER from $_history_substring_search_old_buffer. + # + # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index-- )) + BUFFER=$_history_substring_search_old_buffer + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND else # - # We do not have older matches. + # We are at the beginning of history and there are no further matches. # - # 1. Move the index beyond the end of - # _history_substring_search_matches. - # 2. Update display to indicate search not found. - # - _history_substring_search_match_index+=1 _history-substring-search-not-found + return fi # # When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from # history should be matched, make sure the new and old results are different. + # But when HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history. # - # However, if the HIST_IGNORE_ALL_DUPS shell option, or - # HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a - # unique history, so in this case we do not need to do anything. - # - if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - return - fi - - if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then + if [[ ! -o HIST_IGNORE_ALL_DUPS && -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then # # Repeat the current search so that a different (unique) match is found. # @@ -679,75 +488,92 @@ _history-substring-search-down-search() { _history_substring_search_refresh_display=1 # - # Select history entry during history-substring-down-search: + # Highlight matches during history-substring-up-search: # - # The following variables have been initialized in + # The following constants have been initialized in # _history-substring-search-up/down-search(): # - # $_history_substring_search_matches is the current list of matches that - # need to be displayed to the user. + # $_history_substring_search_matches is the current list of matches + # $_history_substring_search_matches_count is the current number of matches + # $_history_substring_search_matches_count_plus is the current number of matches + 1 + # $_history_substring_search_matches_count_sans is the current number of matches - 1 # $_history_substring_search_match_index is the index of the current match - # that is being displayed to the user. # # The range of values that $_history_substring_search_match_index can take - # is: [0, $#_history_substring_search_matches + 1]. A value of 0 - # indicates that we are beyond the beginning of + # is: [0, $_history_substring_search_matches_count_plus]. A value of 0 + # indicates that we are beyond the end of # $_history_substring_search_matches. A value of - # $#_history_substring_search_matches + 1 indicates that we are beyond - # the end of $_history_substring_search_matches and that we have also - # processed all entries in _history_substring_search_raw_matches. + # $_history_substring_search_matches_count_plus indicates that we are beyond + # the beginning of $_history_substring_search_matches. # # In _history-substring-search-down-search() the initial value of - # $_history_substring_search_match_index is 1. This value is set in - # _history-substring-search-begin(). _history-substring-search-down-search() - # will initially decrement it to 0. + # $_history_substring_search_match_index is + # $_history_substring_search_matches_count. This value is set in + # _history-substring-search-begin(). + # _history-substring-search-down-search() will initially increase it to + # $_history_substring_search_matches_count_plus. # + if [[ $_history_substring_search_match_index -le $_history_substring_search_matches_count_sans ]]; then + # + # Highlight the next match: + # + # 1. Increase $_history_substring_search_match_index by 1. + # + # 2. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) + BUFFER=$history[$_history_substring_search_matches[$_history_substring_search_match_index]] + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND - if [[ $_history_substring_search_match_index -lt 1 ]]; then + elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count ]]; then # - # We are beyond the beginning of $_history_substring_search_matches. + # We will move beyond the beginning of $_history_substring_search_matches: # - # 1. Update display to indicate search not found. + # 1. Increase $_history_substring_search_match_index by 1. # + # 2. Save the current buffer in $_history_substring_search_old_buffer, so + # that it can be retrieved by _history-substring-search-up-search() + # later. + # + # 3. Make $BUFFER equal to $_history_substring_search_query. + # + # 4. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) _history-substring-search-not-found - return - fi - if _history-substring-search-has-prev; then + elif [[ $_history_substring_search_match_index -eq 0 ]]; then # - # We do have younger matches. + # We were beyond the end of $_history_substring_search_matches but DOWN + # makes us move back to the $_history_substring_search_matches: # - # 1. Move index to point to the previous match. - # 2. Update display to indicate search found. + # 1. Increase $_history_substring_search_match_index by 1. # - _history_substring_search_match_index+=-1 - _history-substring-search-found + # 2. Restore $BUFFER from $_history_substring_search_old_buffer. + # + # 3. Use $HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND + # to highlight the current buffer. + # + (( _history_substring_search_match_index++ )) + BUFFER=$_history_substring_search_old_buffer + _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND else # - # We do not have younger matches. + # We are at the end of history and there are no further matches. # - # 1. Move the index beyond the beginning of - # _history_substring_search_matches. - # 2. Update display to indicate search not found. - # - _history_substring_search_match_index+=-1 _history-substring-search-not-found + return fi # # When HIST_FIND_NO_DUPS is set, meaning that only unique command lines from # history should be matched, make sure the new and old results are different. + # But when HIST_IGNORE_ALL_DUPS is set, ZSH already ensures a unique history. # - # However, if the HIST_IGNORE_ALL_DUPS shell option, or - # HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE is set, then we already have a - # unique history, so in this case we do not need to do anything. - # - if [[ -o HIST_IGNORE_ALL_DUPS || -n $HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE ]]; then - return - fi - - if [[ -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then + if [[ ! -o HIST_IGNORE_ALL_DUPS && -o HIST_FIND_NO_DUPS && $BUFFER == $_history_substring_search_result ]]; then # # Repeat the current search so that a different (unique) match is found. # diff --git a/zsh/.oh-my-zsh/plugins/history/README.md b/zsh/.oh-my-zsh/plugins/history/README.md index a9d480f..dd92868 100644 --- a/zsh/.oh-my-zsh/plugins/history/README.md +++ b/zsh/.oh-my-zsh/plugins/history/README.md @@ -1,17 +1,15 @@ -# history plugin +## history Provides a couple of convenient aliases for using the `history` command to examine your command line history. -To use it, add `history` to the plugins array in your zshrc file: +### Requirements -```zsh -plugins=(... history) -``` +* None. -## Aliases +### Usage -| Alias | Command | Description | -|-------|----------------------|------------------------------------------------------------------| -| `h` | `history` | Prints your command history | -| `hs` | `history \| grep` | Use grep to search your command history | -| `hsi` | `history \| grep -i` | Use grep to do a case-insensitive search of your command history | +* If `h` is called, your command history is listed. Equivalent to using `history` + +* If `hsi` is called with an argument, a **case insensitive** `grep` search is performed on your command history, looking for commands that match the argument provided + +* If `hsi` is called without an argument you will help on `grep` arguments \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/history/history.plugin.zsh b/zsh/.oh-my-zsh/plugins/history/history.plugin.zsh index 9cee48f..0f4aa4b 100644 --- a/zsh/.oh-my-zsh/plugins/history/history.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/history/history.plugin.zsh @@ -1,3 +1,8 @@ alias h='history' -alias hs='history | grep' -alias hsi='history | grep -i' + +function hs +{ + history | grep $* +} + +alias hsi='hs -i' diff --git a/zsh/.oh-my-zsh/plugins/httpie/README.md b/zsh/.oh-my-zsh/plugins/httpie/README.md index 25bdd0c..f22d3a6 100644 --- a/zsh/.oh-my-zsh/plugins/httpie/README.md +++ b/zsh/.oh-my-zsh/plugins/httpie/README.md @@ -11,4 +11,5 @@ plugins=(... httpie) It uses completion from [zsh-completions](https://github.com/zsh-users/zsh-completions). + **Maintainer:** [lululau](https://github.com/lululau) diff --git a/zsh/.oh-my-zsh/plugins/jenv/jenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/jenv/jenv.plugin.zsh index 946ce18..b85906a 100644 --- a/zsh/.oh-my-zsh/plugins/jenv/jenv.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/jenv/jenv.plugin.zsh @@ -1,4 +1,4 @@ -jenvdirs=("$HOME/.jenv" "/usr/local/bin/jenv" "/usr/local/jenv" "/opt/jenv") +jenvdirs=("$HOME/.jenv" "/usr/local" "/usr/local/jenv" "/opt/jenv") FOUND_JENV=0 for jenvdir in $jenvdirs; do diff --git a/zsh/.oh-my-zsh/plugins/jhbuild/README.md b/zsh/.oh-my-zsh/plugins/jhbuild/README.md index 3220e0d..9105269 100644 --- a/zsh/.oh-my-zsh/plugins/jhbuild/README.md +++ b/zsh/.oh-my-zsh/plugins/jhbuild/README.md @@ -1,34 +1,4 @@ -# JHBuild - -This plugin adds some [JHBuild](https://developer.gnome.org/jhbuild/) aliases. - -To use it, add `jhbuild` to the plugins array of your zshrc file: - -```zsh -plugins=(... jhbuild) -``` - +## JHBuild **Maintainer:** [Miguel Vaello](https://github.com/miguxbe) -## Aliases - -| Alias | Command | -|---------|---------------------------| -| `jh` | `jhbuild` | -| `jhb` | `jhbuild build` | -| `jhbo` | `jhbuild buildone` | -| `jhckb` | `jhbuild checkbranches` | -| `jhckm` | `jhbuild checkmodulesets` | -| `jhi` | `jhbuild info` | -| `jhl` | `jhbuild list` | -| `jhc` | `jhbuild clean` | -| `jhco` | `jhbuild cleanone` | -| `jhm` | `jhbuild make` | -| `jhr` | `jhbuild run` | -| `jhrd` | `jhbuild rdepends` | -| `jhsd` | `jhbuild sysdeps` | -| `jhu` | `jhbuild update` | -| `jhuo` | `jhbuild updateone` | -| `jhun` | `jhbuild uninstall` | -| `jhsh` | `jhbuild shell` | -| `jht` | `jhbuild tinderbox` | +This plugin adds some jhbuild aliases and increase the completion function provided by zsh. diff --git a/zsh/.oh-my-zsh/plugins/jhbuild/jhbuild.plugin.zsh b/zsh/.oh-my-zsh/plugins/jhbuild/jhbuild.plugin.zsh index 416745d..fed1bc9 100644 --- a/zsh/.oh-my-zsh/plugins/jhbuild/jhbuild.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/jhbuild/jhbuild.plugin.zsh @@ -1,6 +1,5 @@ -# JHBuild Aliases - -# Base +# Aliases +# alias jh='jhbuild' # Build alias jhb='jhbuild build' @@ -8,14 +7,12 @@ alias jhbo='jhbuild buildone' # Checks alias jhckb='jhbuild checkbranches' alias jhckm='jhbuild checkmodulesets' -# Info & List +# Info & list alias jhi='jhbuild info' alias jhl='jhbuild list' # Clean alias jhc='jhbuild clean' alias jhco='jhbuild cleanone' -# Make -alias jhm='jhbuild make' # Run alias jhr='jhbuild run' # Depends @@ -26,7 +23,6 @@ alias jhu='jhbuild update' alias jhuo='jhbuild updateone' # Uninstall alias jhun='jhbuild uninstall' -# Shell -alias jhsh='jhbuild shell' -# Tinderbox -alias jht='jhbuild tinderbox' + + + diff --git a/zsh/.oh-my-zsh/plugins/jira/README.md b/zsh/.oh-my-zsh/plugins/jira/README.md index a5633af..091dccb 100644 --- a/zsh/.oh-my-zsh/plugins/jira/README.md +++ b/zsh/.oh-my-zsh/plugins/jira/README.md @@ -19,14 +19,10 @@ jira # performs the default action jira new # opens a new issue jira dashboard # opens your JIRA dashboard -jira tempo # opens your JIRA Tempo jira reported [username] # queries for issues reported by a user jira assigned [username] # queries for issues assigned to a user jira myissues # queries for you own issues jira branch # opens an existing issue matching the current branch name - # The branch name may have prefixes ending in "/": "feature/MP-1234", - # and also suffixes starting with "_": "MP-1234_fix_dashboard" - # In both these cases, the issue opened will be "MP-1234" jira ABC-123 # opens an existing issue jira ABC-123 m # opens an existing issue for adding a comment ``` diff --git a/zsh/.oh-my-zsh/plugins/jira/_jira b/zsh/.oh-my-zsh/plugins/jira/_jira index 1ac3eed..d646142 100644 --- a/zsh/.oh-my-zsh/plugins/jira/_jira +++ b/zsh/.oh-my-zsh/plugins/jira/_jira @@ -5,7 +5,6 @@ local -a _1st_arguments _1st_arguments=( 'new:create a new issue' 'dashboard:open the dashboard' - 'tempo:open the tempo' 'reported:search for issues reported by a user' 'assigned:search for issues assigned to a user' 'branch:open the issue named after the git branch of the current directory' diff --git a/zsh/.oh-my-zsh/plugins/jira/jira.plugin.zsh b/zsh/.oh-my-zsh/plugins/jira/jira.plugin.zsh index 22807e0..e706948 100644 --- a/zsh/.oh-my-zsh/plugins/jira/jira.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/jira/jira.plugin.zsh @@ -54,9 +54,6 @@ function jira() { else open_command "${jira_url}/secure/Dashboard.jspa" fi - elif [[ "$action" == "tempo" ]]; then - echo "Opening tempo" - open_command "${jira_url}/secure/Tempo.jspa" elif [[ "$action" == "dumpconfig" ]]; then echo "JIRA_URL=$jira_url" echo "JIRA_PREFIX=$jira_prefix" @@ -66,33 +63,25 @@ function jira() { else # Anything that doesn't match a special action is considered an issue name # but `branch` is a special case that will parse the current git branch - local issue_arg issue if [[ "$action" == "branch" ]]; then - # Get name of the branch - issue_arg=$(git rev-parse --abbrev-ref HEAD) - # Strip prefixes like feature/ or bugfix/ - issue_arg=${issue_arg##*/} - # Strip suffixes starting with _ - issue_arg=(${(s:_:)issue_arg}) - issue_arg=${issue_arg[1]} - if [[ "$issue_arg" = ${jira_prefix}* ]]; then - issue="${issue_arg}" - else - issue="${jira_prefix}${issue_arg}" - fi + local issue_arg=$(git rev-parse --abbrev-ref HEAD) + local issue="${jira_prefix}${issue_arg}" else - issue_arg=${(U)action} - issue="${jira_prefix}${issue_arg}" + local issue_arg=$action + local issue="${jira_prefix}${issue_arg}" fi - - local url_fragment + local url_fragment='' if [[ "$2" == "m" ]]; then url_fragment="#add-comment" echo "Add comment to issue #$issue" else echo "Opening issue #$issue" fi - open_command "${jira_url}/browse/${issue}${url_fragment}" + if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then + open_command "${jira_url}/issues/${issue}${url_fragment}" + else + open_command "${jira_url}/browse/${issue}${url_fragment}" + fi fi } diff --git a/zsh/.oh-my-zsh/plugins/jsontools/README.md b/zsh/.oh-my-zsh/plugins/jsontools/README.md index 1fa2b8e..4faf58b 100644 --- a/zsh/.oh-my-zsh/plugins/jsontools/README.md +++ b/zsh/.oh-my-zsh/plugins/jsontools/README.md @@ -2,47 +2,41 @@ Handy command line tools for dealing with json data. -To use it, add `jsontools` to the plugins array in your zshrc file: +## Tools -```zsh -plugins=(... jsontools) -``` +- **pp_json** - pretty prints json +- **is_json** - returns true if valid json; false otherwise +- **urlencode_json** - returns a url encoded string for the given json +- **urldecode_json** - returns decoded json for the given url encoded string ## Usage +Usage is simple...just take your json data and pipe it into the appropriate jsontool. +```sh + | +``` +## Examples -Usage is simple... just take your json data and pipe it into the appropriate jsontool: - -- `pp_json`: pretty prints json. -- `is_json`: returns true if valid json; false otherwise. -- `urlencode_json`: returns a url encoded string for the given json. -- `urldecode_json`: returns decoded json for the given url encoded string. - -### Examples - -- **pp_json**: +##### pp_json ```sh # curl json data and pretty print the results curl https://coderwall.com/bobwilliams.json | pp_json ``` -- **is_json**: - +##### is_json ```sh -# Validate if file's content conforms to a valid JSON schema +# pretty print the contents of an existing json file less data.json | is_json ``` -- **urlencode_json**: - +##### urlencode_json ```sh # json data directly from the command line echo '{"b":2, "a":1}' | urlencode_json ``` -- **urldecode_json**: - +##### urldecode_json ```sh # url encoded string to decode echo '%7B%22b%22:2,%20%22a%22:1%7D%0A' | urldecode_json -``` +``` \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/jump/README.md b/zsh/.oh-my-zsh/plugins/jump/README.md index 1b0ce68..ed64152 100644 --- a/zsh/.oh-my-zsh/plugins/jump/README.md +++ b/zsh/.oh-my-zsh/plugins/jump/README.md @@ -17,15 +17,3 @@ plugins=(... jump) | `mark [mark-name]` | Create a mark with the given name or with the name of the current directory if none is provided | | `unmark ` | Remove the given mark | | `marks` | List the existing marks and the directories they point to | - -## Key bindings - -Pressing `CTRL`+`G` substitutes the written mark name for the full path of the mark. -For example, with a mark named `mymark` pointing to `/path/to/my/mark`: -```zsh -$ cp /tmp/file mymark -``` -will become: -```zsh -$ cp /tmp/file /path/to/my/mark -``` diff --git a/zsh/.oh-my-zsh/plugins/jump/jump.plugin.zsh b/zsh/.oh-my-zsh/plugins/jump/jump.plugin.zsh index c2da114..d161a6d 100644 --- a/zsh/.oh-my-zsh/plugins/jump/jump.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/jump/jump.plugin.zsh @@ -9,34 +9,33 @@ export MARKPATH=$HOME/.marks jump() { - builtin cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1} + cd -P "$MARKPATH/$1" 2>/dev/null || {echo "No such mark: $1"; return 1} } mark() { - if [[ $# -eq 0 || "$1" = "." ]]; then - MARK=${PWD:t} + if [[ ( $# == 0 ) || ( "$1" == "." ) ]]; then + MARK=$(basename "$PWD") else MARK="$1" fi - if read -q "?Mark $PWD as ${MARK}? (y/n) "; then - command mkdir -p "$MARKPATH" - command ln -sfn "$PWD" "$MARKPATH/$MARK" + if read -q \?"Mark $PWD as ${MARK}? (y/n) "; then + mkdir -p "$MARKPATH"; ln -sfn "$PWD" "$MARKPATH/$MARK" fi } unmark() { - LANG= command rm -i "$MARKPATH/$1" + rm -i "$MARKPATH/$1" } marks() { - local link max=0 - for link in $MARKPATH/{,.}*(@N); do + local max=0 + for link in $MARKPATH/*(@); do if [[ ${#link:t} -gt $max ]]; then max=${#link:t} fi done local printf_markname_template="$(printf -- "%%%us " "$max")" - for link in $MARKPATH/{,.}*(@N); do + for link in $MARKPATH/*(@); do local markname="$fg[cyan]${link:t}$reset_color" local markpath="$fg[blue]$(readlink $link)$reset_color" printf -- "$printf_markname_template" "$markname" @@ -45,15 +44,21 @@ marks() { } _completemarks() { - reply=("${MARKPATH}"/{,.}*(@N:t)) + if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then + reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_a-zA-Z0-9\.\-]*):$/\2/g')) + else + if readlink -e "${MARKPATH}"/* &>/dev/null; then + reply=($(ls "${MARKPATH}")) + fi + fi } compctl -K _completemarks jump compctl -K _completemarks unmark _mark_expansion() { - setopt localoptions extendedglob + setopt extendedglob autoload -U modify-current-argument - modify-current-argument '$(readlink "$MARKPATH/$ARG" || echo "$ARG")' + modify-current-argument '$(readlink "$MARKPATH/$ARG")' } zle -N _mark_expansion bindkey "^g" _mark_expansion diff --git a/zsh/.oh-my-zsh/plugins/keychain/keychain.plugin.zsh b/zsh/.oh-my-zsh/plugins/keychain/keychain.plugin.zsh index f122f79..def97d8 100644 --- a/zsh/.oh-my-zsh/plugins/keychain/keychain.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/keychain/keychain.plugin.zsh @@ -1,9 +1,4 @@ -(( $+commands[keychain] )) || return - -# Define SHORT_HOST if not defined (%m = host name up to first .) -SHORT_HOST=${SHORT_HOST:-${(%):-%m}} - -function { +function _start_agent() { local agents local -a identities local -a options @@ -30,3 +25,8 @@ function { [ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh" [ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg" } + +_start_agent + +# tidy up after ourselves +unfunction _start_agent diff --git a/zsh/.oh-my-zsh/plugins/kitchen/_kitchen b/zsh/.oh-my-zsh/plugins/kitchen/_kitchen index d93d93d..29a3125 100644 --- a/zsh/.oh-my-zsh/plugins/kitchen/_kitchen +++ b/zsh/.oh-my-zsh/plugins/kitchen/_kitchen @@ -67,7 +67,7 @@ _kitchen() { _kitchen_commands() { local commands - commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ A-Z[].*# \(.*\)$/\1:\2/p')}") + commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}") _describe -t commands 'kitchen commands' commands } diff --git a/zsh/.oh-my-zsh/plugins/knife/_knife b/zsh/.oh-my-zsh/plugins/knife/_knife index 09757eb..06b12a3 100644 --- a/zsh/.oh-my-zsh/plugins/knife/_knife +++ b/zsh/.oh-my-zsh/plugins/knife/_knife @@ -34,7 +34,7 @@ _knife() { case $state in knifecmd) - compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search solo ssh status upload vault windows $cloudproviders + compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload vault windows $cloudproviders ;; knifesubcmd) case $words[2] in @@ -65,9 +65,6 @@ _knife() { role) compadd -Q "$@" "bulk delete" create delete edit "from file" list show ;; - solo) - compadd "$@" bootstrap clean cook init prepare - ;; upload) _arguments '*:file or directory:_files -g "*"' ;; @@ -105,12 +102,6 @@ _knife() { bag) compadd -Q "$@" show edit list "from file" create delete ;; - bootstrap|clean|cook|prepare) - compadd "$@" nodes/*.json(N:t:r) - ;; - init) - compadd "$@" ./*(/N:t) - ;; *) _arguments '3:Subsubcommands:($(_knife_options2))' ;; diff --git a/zsh/.oh-my-zsh/plugins/kube-ps1/README.md b/zsh/.oh-my-zsh/plugins/kube-ps1/README.md index a143372..82c0a77 100644 --- a/zsh/.oh-my-zsh/plugins/kube-ps1/README.md +++ b/zsh/.oh-my-zsh/plugins/kube-ps1/README.md @@ -1,246 +1,104 @@ -kube-ps1: Kubernetes prompt for bash and zsh -============================================ +# Kubernetes prompt for zsh -A script that lets you add the current Kubernetes context and namespace -configured on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`). +A Kubernetes zsh prompt that displays the current cluster cluster +and the namespace. -Inspired by several tools used to simplify usage of `kubectl`. +Inspired by several tools used to simplify usage of kubectl -![prompt](img/screenshot2.png) - -![prompt_sol_light](img/screenshot-sol-light.png) - -![prompt_img](img/screenshot-img.png) - -![prompt demo](img/kube-ps1.gif) - -## Installing - -### MacOS - -Homebrew package manager: - -``` -$ brew update -$ brew install kube-ps1 -``` -### From Source - -1. Clone this repository -2. Source the kube-ps1.sh in your `~/.zshrc` or your `~/.bashrc` - -### Arch Linux -AUR Package available at [https://aur.archlinux.org/packages/kube-ps1/](https://aur.archlinux.org/packages/kube-ps1/). - -#### Zsh -```sh -source /path/to/kube-ps1.sh -PROMPT='$(kube_ps1)'$PROMPT -``` -#### Bash -```sh -source /path/to/kube-ps1.sh -PS1='[\u@\h \W $(kube_ps1)]\$ ' -``` - -### Zsh Plugin Managers - -#### Using [zplugin](https://github.com/zdharma/zplugin) - -Update `.zshrc` with: -```sh -zplugin light jonmosco/kube-ps1 -PROMPT='$(kube_ps1)'$PROMPT -``` +NOTE: If you are not using zsh, check out [kube-ps1](https://github.com/jonmosco/kube-ps1) +designed for bash as well as zsh. ## Requirements -The default prompt assumes you have the `kubectl` command line utility installed. -Official installation instructions and binaries are available: +The default prompt assumes you have the kubectl command line utility installed. It +can be obtained here: [Install and Set up kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -If using this with OpenShift, the `oc` tool needs installed. It can be obtained -from brew ports: - -``` -brew install openshift-cli -``` -or the source can be downloaded: +If using this with OpenShift, the oc tool needs installed. It can be obtained from here: [OC Client Tools](https://www.openshift.org/download.html) -Set the binary to `oc` with the following environment variable: - -``` -KUBE_PS1_BINARY=oc -``` - -If neither binary is available, the prompt will print the following: - -``` -(|BINARY-N/A:N/A) -``` - ## Helper utilities -There are several great tools that make using kubectl very enjoyable: +There are several great tools that make using kubectl very enjoyable. -- [`kubectx` and `kubens`](https://github.com/ahmetb/kubectx) are great for +[kubectx and kubenx](https://github.com/ahmetb/kubectx) are great for fast switching between clusters and namespaces. -## Tmux port - -I have begun porting kube-ps1 to tmux as a status line plugin. If you prefer -tmux, and like the functionality provided by kube-ps1, checkout the -[kube-tmux](https://github.com/jonmosco/kube-tmux) project - ## Prompt Structure -The default prompt layout is: +The prompt layout is: ``` -(|:) +(|:) ``` -If the current-context is not set, kube-ps1 will return the following: +## Enabling -``` -(|N/A:N/A) +In order to use kube-ps1 with Oh My Zsh, you'll need to enable them in the +.zshrc file. You'll find the zshrc file in your $HOME directory. Open it with +your favorite text editor and you'll see a spot to list all the plugins you +want to load. + +```shell +vim $HOME/.zshrc ``` -## Enabling/Disabling +Add kube-ps1 to the list of enabled plugins and enable it on the prompt: -If you want to stop showing Kubernetes status on your prompt string temporarily -run `kubeoff`. To disable the prompt for all shell sessions, run `kubeoff -g`. -You can enable it again in the current shell by running `kubeon`, and globally -with `kubeon -g`. +```shell +plugins=( + git + kube-ps1 +) -``` -kubeon : turn on kube-ps1 status for this shell. Takes precedence over - global setting for current session -kubeon -g : turn on kube-ps1 status globally -kubeoff : turn off kube-ps1 status for this shell. Takes precedence over - global setting for current session -kubeoff -g : turn off kube-ps1 status globally +# After the "source Oh My Zsh" line +PROMPT=$PROMPT'$(kube_ps1) ' ``` -## Customization +Note: The `PROMPT` example above was tested with the theme `robbyrussell`. -The default settings can be overridden in `~/.bashrc` or `~/.zshrc` by setting -the following environment variables: +## Enabling / Disabling on the current shell -| Variable | Default | Meaning | -| :------- | :-----: | ------- | -| `KUBE_PS1_BINARY` | `kubectl` | Default Kubernetes binary | -| `KUBE_PS1_NS_ENABLE` | `true` | Display the namespace. If set to `false`, this will also disable `KUBE_PS1_DIVIDER` | -| `KUBE_PS1_PREFIX` | `(` | Prompt opening character | -| `KUBE_PS1_SYMBOL_ENABLE` | `true ` | Display the prompt Symbol. If set to `false`, this will also disable `KUBE_PS1_SEPARATOR` | -| `KUBE_PS1_SYMBOL_DEFAULT` | `⎈ ` | Default prompt symbol. Unicode `\u2388` | -| `KUBE_PS1_SYMBOL_USE_IMG` | `false` | ☸️ , Unicode `\u2638` as the prompt symbol | -| `KUBE_PS1_SEPARATOR` | | | Separator between symbol and context name | -| `KUBE_PS1_DIVIDER` | `:` | Separator between context and namespace | -| `KUBE_PS1_SUFFIX` | `)` | Prompt closing character | -| `KUBE_PS1_CLUSTER_FUNCTION` | No default, must be user supplied | Function to customize how cluster is displayed | -| `KUBE_PS1_NAMESPACE_FUNCTION` | No default, must be user supplied | Function to customize how namespace is displayed | - -For terminals that do not support UTF-8, the symbol will be replaced with the -string `k8s`. - -To disable a feature, set it to an empty string: +Sometimes the kubernetes information can be anoying, you can easily +switch it on and off with the following commands: +```shell +kubeon ``` -KUBE_PS1_SEPARATOR='' + +```shell +kubeoff ``` ## Colors -The default colors are set with the following environment variables: +Blue was used as the prefix to match the Kubernetes color as closely as +possible. Red was chosen as the cluster name to stand out, and cyan +for the namespace. Check the customization section for changing them. + +## Customization + +The default settings can be overridden in ~/.zshrc | Variable | Default | Meaning | | :------- | :-----: | ------- | -| `KUBE_PS1_SYMBOL_COLOR` | `blue` | Set default color of the Kubernetes symbol | -| `KUBE_PS1_CTX_COLOR` | `red` | Set default color of the context | -| `KUBE_PS1_NS_COLOR` | `cyan` | Set default color of the namespace | -| `KUBE_PS1_BG_COLOR` | `null` | Set default color of the prompt background | - -Blue was used for the default symbol to match the Kubernetes color as closely -as possible. Red was chosen as the context name to stand out, and cyan for the -namespace. - -Set the variable to an empty string if you do not want color for each -prompt section: - -``` -KUBE_PS1_CTX_COLOR='' -``` - -Names are usable for the following colors: - -``` -black, red, green, yellow, blue, magenta, cyan -``` - -256 colors are available by specifying the numerical value as the variable -argument. - -## Customize display of cluster name and namespace - -You can change how the cluster name and namespace are displayed using the -`KUBE_PS1_CLUSTER_FUNCTION` and `KUBE_PS1_NAMESPACE_FUNCTION` variables -respectively. - -For the following examples let's assume the following: - -cluster name: `sandbox.k8s.example.com` -namespace: `alpha` - -If you're using domain style cluster names, your prompt will get quite long -very quickly. Let's say you only want to display the first portion of the -cluster name (`sandbox`), you could do that by adding the following: - -```sh -function get_cluster_short() { - echo "$1" | cut -d . -f1 -} - -KUBE_PS1_CLUSTER_FUNCTION=get_cluster_short -``` - -The same pattern can be followed to customize the display of the namespace. -Let's say you would prefer the namespace to be displayed in all uppercase -(`ALPHA`), here's one way you could do that: - -```sh -function get_namespace_upper() { - echo "$1" | tr '[:lower:]' '[:upper:]' -} - -export KUBE_PS1_NAMESPACE_FUNCTION=get_namespace_upper -``` - -In both cases, the variable is set to the name of the function, and you must have defined the function in your shell configuration before kube_ps1 is called. The function must accept a single parameter and echo out the final value. - -### Bug Reports and shell configuration - -Due to the vast ways of customizing the shell, please try the prompt with a -minimal configuration before submitting a bug report. - -This can be done as follows for each shell before loading kube-ps1: - -Bash: -```bash -bash --norc -``` - -Zsh: -```bash -zsh -f -or -zsh --no-rcs -``` +| `KUBE_PS1_BINARY` | `kubectl` | Default Kubernetes binary | +| `KUBE_PS1_PREFIX` | `(` | Prompt opening character | +| `KUBE_PS1_SYMBOL_ENABLE` | `true ` | Display the prompt Symbol. If set to `false`, this will also disable `KUBE_PS1_SEPARATOR` | +| `KUBE_PS1_SYMBOL_DEFAULT` | `⎈ ` | Default prompt symbol. Unicode `\u2388` | +| `KUBE_PS1_SYMBOL_USE_IMG` | `false` | ☸️ , Unicode `\u2638` as the prompt symbol | +| `KUBE_PS1_NS_ENABLE` | `true` | Display the namespace. If set to `false`, this will also disable `KUBE_PS1_DIVIDER` | +| `KUBE_PS1_SEPERATOR` | `\|` | Separator between symbol and cluster name | +| `KUBE_PS1_DIVIDER` | `:` | Separator between cluster and namespace | +| `KUBE_PS1_SUFFIX` | `)` | Prompt closing character | +| `KUBE_PS1_COLOR_SYMBOL` | `"%F{blue}"` | Custom color for the symbol | +| `KUBE_PS1_COLOR_CONTEXT` | `"%F{red}"` | Custom color for the context | +| `KUBE_PS1_COLOR_NS` | `"%F{cyan}"` | Custom color for the namespace | +| `KUBE_PS1_ENABLED` | `true` | Set to false to start disabled on any new shell, `kubeon`/`kubeoff` will flip this value on the current shell | ## Contributors -* [Ahmet Alp Balkan](https://github.com/ahmetb) -* Jared Yanovich +- Jared Yanovich +- Pedro Moranga diff --git a/zsh/.oh-my-zsh/plugins/kube-ps1/kube-ps1.plugin.zsh b/zsh/.oh-my-zsh/plugins/kube-ps1/kube-ps1.plugin.zsh index 9e77cbc..3cb2128 100644 --- a/zsh/.oh-my-zsh/plugins/kube-ps1/kube-ps1.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/kube-ps1/kube-ps1.plugin.zsh @@ -1,15 +1,16 @@ -#!/bin/bash +#!/bin/zsh # Kubernetes prompt helper for bash/zsh +# ported to oh-my-zsh # Displays current context and namespace -# Copyright 2019 Jon Mosco +# Copyright 2018 Jon Mosco # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -20,150 +21,39 @@ # Debug [[ -n $DEBUG ]] && set -x +setopt PROMPT_SUBST +autoload -U add-zsh-hook +add-zsh-hook precmd _kube_ps1_update_cache +zmodload zsh/stat +zmodload zsh/datetime + # Default values for the prompt -# Override these values in ~/.zshrc or ~/.bashrc +# Override these values in ~/.zshrc KUBE_PS1_BINARY="${KUBE_PS1_BINARY:-kubectl}" KUBE_PS1_SYMBOL_ENABLE="${KUBE_PS1_SYMBOL_ENABLE:-true}" -KUBE_PS1_SYMBOL_DEFAULT=${KUBE_PS1_SYMBOL_DEFAULT:-$'\u2388 '} +KUBE_PS1_SYMBOL_DEFAULT="${KUBE_PS1_SYMBOL_DEFAULT:-\u2388 }" KUBE_PS1_SYMBOL_USE_IMG="${KUBE_PS1_SYMBOL_USE_IMG:-false}" KUBE_PS1_NS_ENABLE="${KUBE_PS1_NS_ENABLE:-true}" -KUBE_PS1_CONTEXT_ENABLE="${KUBE_PS1_CONTEXT_ENABLE:-true}" -KUBE_PS1_PREFIX="${KUBE_PS1_PREFIX-(}" KUBE_PS1_SEPARATOR="${KUBE_PS1_SEPARATOR-|}" KUBE_PS1_DIVIDER="${KUBE_PS1_DIVIDER-:}" +KUBE_PS1_PREFIX="${KUBE_PS1_PREFIX-(}" KUBE_PS1_SUFFIX="${KUBE_PS1_SUFFIX-)}" -KUBE_PS1_SYMBOL_COLOR="${KUBE_PS1_SYMBOL_COLOR-blue}" -KUBE_PS1_CTX_COLOR="${KUBE_PS1_CTX_COLOR-red}" -KUBE_PS1_NS_COLOR="${KUBE_PS1_NS_COLOR-cyan}" -KUBE_PS1_BG_COLOR="${KUBE_PS1_BG_COLOR}" -KUBE_PS1_KUBECONFIG_CACHE="${KUBECONFIG}" -KUBE_PS1_DISABLE_PATH="${HOME}/.kube/kube-ps1/disabled" KUBE_PS1_LAST_TIME=0 -KUBE_PS1_CLUSTER_FUNCTION="${KUBE_PS1_CLUSTER_FUNCTION}" -KUBE_PS1_NAMESPACE_FUNCTION="${KUBE_PS1_NAMESPACE_FUNCTION}" +KUBE_PS1_ENABLED=true -# Determine our shell -if [ "${ZSH_VERSION-}" ]; then - KUBE_PS1_SHELL="zsh" -elif [ "${BASH_VERSION-}" ]; then - KUBE_PS1_SHELL="bash" -fi - -_kube_ps1_init() { - [[ -f "${KUBE_PS1_DISABLE_PATH}" ]] && KUBE_PS1_ENABLED=off - - case "${KUBE_PS1_SHELL}" in - "zsh") - _KUBE_PS1_OPEN_ESC="%{" - _KUBE_PS1_CLOSE_ESC="%}" - _KUBE_PS1_DEFAULT_BG="%k" - _KUBE_PS1_DEFAULT_FG="%f" - setopt PROMPT_SUBST - autoload -U add-zsh-hook - add-zsh-hook precmd _kube_ps1_update_cache - zmodload -F zsh/stat b:zstat - zmodload zsh/datetime - ;; - "bash") - _KUBE_PS1_OPEN_ESC=$'\001' - _KUBE_PS1_CLOSE_ESC=$'\002' - _KUBE_PS1_DEFAULT_BG=$'\033[49m' - _KUBE_PS1_DEFAULT_FG=$'\033[39m' - [[ $PROMPT_COMMAND =~ _kube_ps1_update_cache ]] || PROMPT_COMMAND="_kube_ps1_update_cache;${PROMPT_COMMAND:-:}" - ;; - esac -} - -_kube_ps1_color_fg() { - local KUBE_PS1_FG_CODE - case "${1}" in - black) KUBE_PS1_FG_CODE=0;; - red) KUBE_PS1_FG_CODE=1;; - green) KUBE_PS1_FG_CODE=2;; - yellow) KUBE_PS1_FG_CODE=3;; - blue) KUBE_PS1_FG_CODE=4;; - magenta) KUBE_PS1_FG_CODE=5;; - cyan) KUBE_PS1_FG_CODE=6;; - white) KUBE_PS1_FG_CODE=7;; - # 256 - [0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-6]) KUBE_PS1_FG_CODE="${1}";; - *) KUBE_PS1_FG_CODE=default - esac - - if [[ "${KUBE_PS1_FG_CODE}" == "default" ]]; then - KUBE_PS1_FG_CODE="${_KUBE_PS1_DEFAULT_FG}" - return - elif [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then - KUBE_PS1_FG_CODE="%F{$KUBE_PS1_FG_CODE}" - elif [[ "${KUBE_PS1_SHELL}" == "bash" ]]; then - if tput setaf 1 &> /dev/null; then - KUBE_PS1_FG_CODE="$(tput setaf ${KUBE_PS1_FG_CODE})" - elif [[ $KUBE_PS1_FG_CODE -ge 0 ]] && [[ $KUBE_PS1_FG_CODE -le 256 ]]; then - KUBE_PS1_FG_CODE="\033[38;5;${KUBE_PS1_FG_CODE}m" - else - KUBE_PS1_FG_CODE="${_KUBE_PS1_DEFAULT_FG}" - fi - fi - echo ${_KUBE_PS1_OPEN_ESC}${KUBE_PS1_FG_CODE}${_KUBE_PS1_CLOSE_ESC} -} - -_kube_ps1_color_bg() { - local KUBE_PS1_BG_CODE - case "${1}" in - black) KUBE_PS1_BG_CODE=0;; - red) KUBE_PS1_BG_CODE=1;; - green) KUBE_PS1_BG_CODE=2;; - yellow) KUBE_PS1_BG_CODE=3;; - blue) KUBE_PS1_BG_CODE=4;; - magenta) KUBE_PS1_BG_CODE=5;; - cyan) KUBE_PS1_BG_CODE=6;; - white) KUBE_PS1_BG_CODE=7;; - # 256 - [0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-6]) KUBE_PS1_BG_CODE="${1}";; - *) KUBE_PS1_BG_CODE=$'\033[0m';; - esac - - if [[ "${KUBE_PS1_BG_CODE}" == "default" ]]; then - KUBE_PS1_FG_CODE="${_KUBE_PS1_DEFAULT_BG}" - return - elif [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then - KUBE_PS1_BG_CODE="%K{$KUBE_PS1_BG_CODE}" - elif [[ "${KUBE_PS1_SHELL}" == "bash" ]]; then - if tput setaf 1 &> /dev/null; then - KUBE_PS1_BG_CODE="$(tput setab ${KUBE_PS1_BG_CODE})" - elif [[ $KUBE_PS1_BG_CODE -ge 0 ]] && [[ $KUBE_PS1_BG_CODE -le 256 ]]; then - KUBE_PS1_BG_CODE="\033[48;5;${KUBE_PS1_BG_CODE}m" - else - KUBE_PS1_BG_CODE="${DEFAULT_BG}" - fi - fi - echo ${OPEN_ESC}${KUBE_PS1_BG_CODE}${CLOSE_ESC} -} +KUBE_PS1_COLOR_SYMBOL="%{$fg[blue]%}" +KUBE_PS1_COLOR_CONTEXT="%{$fg[red]%}" +KUBE_PS1_COLOR_NS="%{$fg[cyan]%}" _kube_ps1_binary_check() { - command -v $1 >/dev/null + command -v "$1" >/dev/null } _kube_ps1_symbol() { [[ "${KUBE_PS1_SYMBOL_ENABLE}" == false ]] && return - case "${KUBE_PS1_SHELL}" in - bash) - if ((BASH_VERSINFO[0] >= 4)) && [[ $'\u2388 ' != "\\u2388 " ]]; then - KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_DEFAULT}" - # KUBE_PS1_SYMBOL=$'\u2388 ' - KUBE_PS1_SYMBOL_IMG=$'\u2638 ' - else - KUBE_PS1_SYMBOL=$'\xE2\x8E\x88 ' - KUBE_PS1_SYMBOL_IMG=$'\xE2\x98\xB8 ' - fi - ;; - zsh) - KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_DEFAULT}" - KUBE_PS1_SYMBOL_IMG="\u2638 ";; - *) - KUBE_PS1_SYMBOL="k8s" - esac + KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_DEFAULT}" + KUBE_PS1_SYMBOL_IMG="\u2638 " if [[ "${KUBE_PS1_SYMBOL_USE_IMG}" == true ]]; then KUBE_PS1_SYMBOL="${KUBE_PS1_SYMBOL_IMG}" @@ -183,24 +73,22 @@ _kube_ps1_file_newer_than() { local file=$1 local check_time=$2 - if [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then - mtime=$(zstat +mtime "${file}") + zmodload -e "zsh/stat" + if [[ "$?" -eq 0 ]]; then + mtime=$(stat +mtime "${file}") elif stat -c "%s" /dev/null &> /dev/null; then # GNU stat - mtime=$(stat -L -c %Y "${file}") + mtime=$(stat -c %Y "${file}") else # BSD stat - mtime=$(stat -L -f %m "$file") + mtime=$(stat -f %m "$file") fi [[ "${mtime}" -gt "${check_time}" ]] } _kube_ps1_update_cache() { - local return_code=$? - - [[ "${KUBE_PS1_ENABLED}" == "off" ]] && return $return_code - + KUBECONFIG="${KUBECONFIG:=$HOME/.kube/config}" if ! _kube_ps1_binary_check "${KUBE_PS1_BINARY}"; then # No ability to fetch context/namespace; display N/A. KUBE_PS1_CONTEXT="BINARY-N/A" @@ -225,147 +113,47 @@ _kube_ps1_update_cache() { return fi done - - return $return_code -} - -_kube_ps1_get_context() { - if [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]]; then - KUBE_PS1_CONTEXT="$(${KUBE_PS1_BINARY} config current-context 2>/dev/null)" - # Set namespace to 'N/A' if it is not defined - KUBE_PS1_CONTEXT="${KUBE_PS1_CONTEXT:-N/A}" - - if [[ ! -z "${KUBE_PS1_CLUSTER_FUNCTION}" ]]; then - KUBE_PS1_CONTEXT=$($KUBE_PS1_CLUSTER_FUNCTION $KUBE_PS1_CONTEXT) - fi - fi -} - -_kube_ps1_get_ns() { - if [[ "${KUBE_PS1_NS_ENABLE}" == true ]]; then - KUBE_PS1_NAMESPACE="$(${KUBE_PS1_BINARY} config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)" - # Set namespace to 'default' if it is not defined - KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-default}" - - if [[ ! -z "${KUBE_PS1_NAMESPACE_FUNCTION}" ]]; then - KUBE_PS1_NAMESPACE=$($KUBE_PS1_NAMESPACE_FUNCTION $KUBE_PS1_NAMESPACE) - fi - fi } _kube_ps1_get_context_ns() { + # Set the command time - if [[ "${KUBE_PS1_SHELL}" == "bash" ]]; then - if ((BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 2)); then - KUBE_PS1_LAST_TIME=$(printf '%(%s)T') - else - KUBE_PS1_LAST_TIME=$(date +%s) - fi - elif [[ "${KUBE_PS1_SHELL}" == "zsh" ]]; then - KUBE_PS1_LAST_TIME=$EPOCHSECONDS - fi + KUBE_PS1_LAST_TIME=$EPOCHSECONDS - _kube_ps1_get_context - _kube_ps1_get_ns -} - -# Set kube-ps1 shell defaults -_kube_ps1_init - -_kubeon_usage() { - cat <<"EOF" -Toggle kube-ps1 prompt on - -Usage: kubeon [-g | --global] [-h | --help] - -With no arguments, turn off kube-ps1 status for this shell instance (default). - - -g --global turn on kube-ps1 status globally - -h --help print this message -EOF -} - -_kubeoff_usage() { - cat <<"EOF" -Toggle kube-ps1 prompt off - -Usage: kubeoff [-g | --global] [-h | --help] - -With no arguments, turn off kube-ps1 status for this shell instance (default). - - -g --global turn off kube-ps1 status globally - -h --help print this message -EOF -} - -kubeon() { - if [[ "${1}" == '-h' || "${1}" == '--help' ]]; then - _kubeon_usage - elif [[ "${1}" == '-g' || "${1}" == '--global' ]]; then - rm -f -- "${KUBE_PS1_DISABLE_PATH}" - elif [[ "$#" -ne 0 ]]; then - echo -e "error: unrecognized flag ${1}\\n" - _kubeon_usage + KUBE_PS1_CONTEXT="$(${KUBE_PS1_BINARY} config current-context 2>/dev/null)" + if [[ -z "${KUBE_PS1_CONTEXT}" ]]; then + KUBE_PS1_CONTEXT="N/A" + KUBE_PS1_NAMESPACE="N/A" return + elif [[ "${KUBE_PS1_NS_ENABLE}" == true ]]; then + KUBE_PS1_NAMESPACE="$(${KUBE_PS1_BINARY} config view --minify --output 'jsonpath={..namespace}' 2>/dev/null)" + # Set namespace to 'default' if it is not defined + KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-default}" fi - - KUBE_PS1_ENABLED=on } -kubeoff() { - if [[ "${1}" == '-h' || "${1}" == '--help' ]]; then - _kubeoff_usage - elif [[ "${1}" == '-g' || "${1}" == '--global' ]]; then - mkdir -p -- "$(dirname "${KUBE_PS1_DISABLE_PATH}")" - touch -- "${KUBE_PS1_DISABLE_PATH}" - elif [[ $# -ne 0 ]]; then - echo "error: unrecognized flag ${1}" >&2 - _kubeoff_usage - return - fi +# function to disable the prompt on the current shell +kubeon(){ + KUBE_PS1_ENABLED=true +} - KUBE_PS1_ENABLED=off +# function to disable the prompt on the current shell +kubeoff(){ + KUBE_PS1_ENABLED=false } # Build our prompt -kube_ps1() { - [[ "${KUBE_PS1_ENABLED}" == "off" ]] && return - [[ -z "${KUBE_PS1_CONTEXT}" ]] && [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]] && return +kube_ps1 () { + local reset_color="%{$reset_color%}" + [[ ${KUBE_PS1_ENABLED} != 'true' ]] && return - local KUBE_PS1 - local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}" - - # Background Color - [[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="$(_kube_ps1_color_bg ${KUBE_PS1_BG_COLOR})" - - # Prefix - [[ -n "${KUBE_PS1_PREFIX}" ]] && KUBE_PS1+="${KUBE_PS1_PREFIX}" - - # Symbol - KUBE_PS1+="$(_kube_ps1_color_fg $KUBE_PS1_SYMBOL_COLOR)$(_kube_ps1_symbol)${KUBE_PS1_RESET_COLOR}" - - if [[ -n "${KUBE_PS1_SEPARATOR}" ]] && [[ "${KUBE_PS1_SYMBOL_ENABLE}" == true ]]; then - KUBE_PS1+="${KUBE_PS1_SEPARATOR}" - fi - - # Context - if [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]]; then - KUBE_PS1+="$(_kube_ps1_color_fg $KUBE_PS1_CTX_COLOR)${KUBE_PS1_CONTEXT}${KUBE_PS1_RESET_COLOR}" - fi - - # Namespace - if [[ "${KUBE_PS1_NS_ENABLE}" == true ]]; then - if [[ -n "${KUBE_PS1_DIVIDER}" ]] && [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]]; then - KUBE_PS1+="${KUBE_PS1_DIVIDER}" - fi - KUBE_PS1+="$(_kube_ps1_color_fg ${KUBE_PS1_NS_COLOR})${KUBE_PS1_NAMESPACE}${KUBE_PS1_RESET_COLOR}" - fi - - # Suffix - [[ -n "${KUBE_PS1_SUFFIX}" ]] && KUBE_PS1+="${KUBE_PS1_SUFFIX}" - - # Close Background color if defined - [[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}" + KUBE_PS1="${reset_color}$KUBE_PS1_PREFIX" + KUBE_PS1+="${KUBE_PS1_COLOR_SYMBOL}$(_kube_ps1_symbol)" + KUBE_PS1+="${reset_color}$KUBE_PS1_SEPERATOR" + KUBE_PS1+="${KUBE_PS1_COLOR_CONTEXT}$KUBE_PS1_CONTEXT${reset_color}" + KUBE_PS1+="$KUBE_PS1_DIVIDER" + KUBE_PS1+="${KUBE_PS1_COLOR_NS}$KUBE_PS1_NAMESPACE${reset_color}" + KUBE_PS1+="$KUBE_PS1_SUFFIX" echo "${KUBE_PS1}" } diff --git a/zsh/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh b/zsh/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh index 92688c5..cc447b8 100644 --- a/zsh/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/kubectl/kubectl.plugin.zsh @@ -14,7 +14,7 @@ fi alias k=kubectl # Execute a kubectl command against all namespaces -alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca' +alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f' # Apply a YML file alias kaf='kubectl apply -f' diff --git a/zsh/.oh-my-zsh/plugins/laravel4/README.md b/zsh/.oh-my-zsh/plugins/laravel4/README.md index 97a6a78..c945601 100644 --- a/zsh/.oh-my-zsh/plugins/laravel4/README.md +++ b/zsh/.oh-my-zsh/plugins/laravel4/README.md @@ -10,9 +10,9 @@ plugins=(... laravel4) ## Aliases -| Alias | Command | Description | -|-----------|-----------------------------|-------------------------------------| -| la4 | `php artisan` | Main Artisan command | -| la4dump | `php artisan dump-autoload` | Regenerate framework autoload files | -| la4cache | `php artisan cache:clear` | Flush the application cache | -| la4routes | `php artisan routes` | List all registered routes | +| Alias | Command | Description | +|-----------|-------------------------------------------|-------------------------------------------------------------| +| la4 | `php artisan` | Main Artisan command | +| la4dump | `php artisan dump-autoload` | Regenerate framework autoload files | +| la4cache | `php artisan cache:clear` | Flush the application cache | +| la4routes | `php artisan routes` | List all registered routes | diff --git a/zsh/.oh-my-zsh/plugins/last-working-dir/README.md b/zsh/.oh-my-zsh/plugins/last-working-dir/README.md index ced9e03..4cc4aca 100644 --- a/zsh/.oh-my-zsh/plugins/last-working-dir/README.md +++ b/zsh/.oh-my-zsh/plugins/last-working-dir/README.md @@ -6,10 +6,4 @@ for new shells, unless: - The plugin is already loaded. - The current `$PWD` is not `$HOME`. -Also adds `lwd` function to jump to the last working directory. - -To use it, add `last-working-dir` to the plugins array in your zshrc file: - -```zsh -plugins=(... last-working-dir) -``` +Adds `lwd` function to jump to the last working directory. diff --git a/zsh/.oh-my-zsh/plugins/lighthouse/README.md b/zsh/.oh-my-zsh/plugins/lighthouse/README.md index 55587b2..0db29b4 100644 --- a/zsh/.oh-my-zsh/plugins/lighthouse/README.md +++ b/zsh/.oh-my-zsh/plugins/lighthouse/README.md @@ -16,8 +16,7 @@ plugins=(... lighthouse) file in your directory with the URL to the individual project. Example: - - ```console + ```zsh $ cat .lighthouse-url https://rails.lighthouseapp.com/projects/8994 @@ -25,5 +24,3 @@ plugins=(... lighthouse) Opening ticket #23 # The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23 ``` - -See a demo: http://screencast.com/t/ZDgwNDUwNT diff --git a/zsh/.oh-my-zsh/plugins/lol/README.md b/zsh/.oh-my-zsh/plugins/lol/README.md index ea6b0c3..1791de4 100644 --- a/zsh/.oh-my-zsh/plugins/lol/README.md +++ b/zsh/.oh-my-zsh/plugins/lol/README.md @@ -1,55 +1,67 @@ # lol -Plugin for adding catspeak aliases, because why not. +Plugin for adding catspeak aliases, because why not -To use it, add `lol` to the plugins array in your zshrc file: +## Enabling the plugin -```zsh -plugins=(... lol) -``` +1. Open your `.zshrc` file and add `lol` in the plugins section: + + ```zsh + plugins=( + # all your enabled plugins + lol + ) + ``` + +2. Restart your terminal session or restart the shell: + + ```console + $ exec zsh + $ + ``` ## Aliases -| Alias | Command | -| ------------ | --------------------------------------------------------------- | -| `:3` | `echo` | -| `alwayz` | `tail -f` | -| `bringz` | `git pull` | -| `btw` | `nice` | -| `byes` | `exit` | -| `chicken` | `git add` | -| `cya` | `reboot` | -| `donotwant` | `rm` | -| `dowant` | `cp` | -| `gimmeh` | `touch` | -| `gtfo` | `mv` | -| `hackzor` | `git init` | -| `hai` | `cd` | -| `icanhas` | `mkdir` | -| `ihasbucket` | `df -h` | -| `iminurbase` | `finger` | -| `inur` | `locate` | -| `invisible` | `cat` | -| `iz` | `ls` | -| `kthxbai` | `halt` | -| `letcat` | `git checkout` | -| `moar` | `more` | -| `nomnom` | `killall` | -| `nomz` | `ps aux` | -| `nowai` | `chmod` | -| `oanward` | `git commit -m` | -| `obtw` | `nohup` | -| `onoz` | `cat /var/log/errors.log` | -| `ooanward` | `git commit -am` | -| `plz` | `pwd` | -| `pwned` | `ssh` | -| `rtfm` | `man` | -| `rulz` | `git push` | -| `tldr` | `less` | -| `violenz` | `git rebase` | -| `visible` | `echo` | -| `wtf` | `dmesg` | -| `yolo` | `git commit -m "$(curl -s http://whatthecommit.com/index.txt)"` | +| Alias | Command | +| ------------ | ---------------------------------------------------------------- | +| `:3` | `echo` | +| `alwayz` | `tail -f` | +| `bringz` | `git pull` | +| `btw` | `nice` | +| `byes` | `exit` | +| `chicken` | `git add` | +| `cya` | `reboot` | +| `donotwant` | `rm` | +| `dowant` | `cp` | +| `gimmeh` | `touch` | +| `gtfo` | `mv` | +| `hackzor` | `git init` | +| `hai` | `cd` | +| `icanhas` | `mkdir` | +| `ihasbucket` | `df -h` | +| `iminurbase` | `finger` | +| `inur` | `locate` | +| `invisible` | `cat` | +| `iz` | `ls` | +| `kthxbai` | `halt` | +| `letcat` | `git checkout` | +| `moar` | `more` | +| `nomnom` | `killall` | +| `nomz` | `ps aux` | +| `nowai` | `chmod` | +| `oanward` | `git commit -m` | +| `obtw` | `nohup` | +| `onoz` | `cat /var/log/errors.log` | +| `ooanward` | `git commit -am` | +| `plz` | `pwd` | +| `pwned` | `ssh` | +| `rtfm` | `man` | +| `rulz` | `git push` | +| `tldr` | `less` | +| `violenz` | `git rebase` | +| `visible` | `echo` | +| `wtf` | `dmesg` | +| `yolo` | `git commit -m "$(curl -s http://whatthecommit.com/index.txt)"` | ## Usage Examples diff --git a/zsh/.oh-my-zsh/plugins/macports/_port b/zsh/.oh-my-zsh/plugins/macports/_port index 6a9ebe0..06d7fb4 100644 --- a/zsh/.oh-my-zsh/plugins/macports/_port +++ b/zsh/.oh-my-zsh/plugins/macports/_port @@ -41,8 +41,6 @@ subcmds=( 'patch' 'pkg' 'provides' -'rdependents' -'rdeps' 'rpmpackage' 'search' 'selfupdate' diff --git a/zsh/.oh-my-zsh/plugins/magic-enter/magic-enter.plugin.zsh b/zsh/.oh-my-zsh/plugins/magic-enter/magic-enter.plugin.zsh index 2d4d578..8e18596 100644 --- a/zsh/.oh-my-zsh/plugins/magic-enter/magic-enter.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/magic-enter/magic-enter.plugin.zsh @@ -3,6 +3,7 @@ # Pressing enter in a git directory runs `git status` # in other directories `ls` magic-enter () { + # If commands are not already set, use the defaults [ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ." [ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ." @@ -19,9 +20,5 @@ magic-enter () { zle accept-line fi } - zle -N magic-enter - -bindkey -M emacs "^M" magic-enter -bindkey -M vicmd "^M" magic-enter -bindkey -M viins "^M" magic-enter +bindkey "^M" magic-enter diff --git a/zsh/.oh-my-zsh/plugins/man/man.plugin.zsh b/zsh/.oh-my-zsh/plugins/man/man.plugin.zsh index dcba613..94aa491 100644 --- a/zsh/.oh-my-zsh/plugins/man/man.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/man/man.plugin.zsh @@ -13,25 +13,15 @@ # ------------------------------------------------------------------------------ man-command-line() { - # if there is no command typed, use the last command - [[ -z "$BUFFER" ]] && zle up-history - - # if typed command begins with man, do nothing - [[ "$BUFFER" = man\ * ]] && return - - # get command and possible subcommand - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags - local -a args - args=(${${(Az)BUFFER}[1]} ${${(Az)BUFFER}[2]}) - - # check if man page exists for command and first argument - if man "${args[1]}-${args[2]}" >/dev/null 2>&1; then - BUFFER="man $args" - else - BUFFER="man ${args[1]}" - fi + [[ -z $BUFFER ]] && zle up-history + [[ $BUFFER != man\ * ]] && LBUFFER="man $LBUFFER" } - zle -N man-command-line # Defined shortcut keys: [Esc]man bindkey "\e"man man-command-line + + +# ------------------------------------------------------------------------------ +# Also, you might want to use man-preview included in 'osx' plugin +# just substitute "man" in the function with "man-preview" after you included OS X in +# the .zshrc diff --git a/zsh/.oh-my-zsh/plugins/mercurial/README.md b/zsh/.oh-my-zsh/plugins/mercurial/README.md index 80ea2de..f42212d 100644 --- a/zsh/.oh-my-zsh/plugins/mercurial/README.md +++ b/zsh/.oh-my-zsh/plugins/mercurial/README.md @@ -1,66 +1,60 @@ # Mercurial plugin +### Usage +Update .zshrc: -This plugin adds some handy aliases for using Mercurial as well as a few -utility and prompt functions that can be used in a theme. +1. Add name to the list of plugins, e.g. `plugins=(... mercurial ...)` + (that is pretty obvious). +2. Switch to a theme which uses `hg_prompt_info`. -To use it, add `mercurial` to the plugins array in your zshrc file: + Or, customize the `$PROMPT` variable of your current theme to contain current folder mercurial repo info. This can be done by putting a custom version of the theme in `$ZSH_CUSTOM` or by changing `$PROMPT` in `.zshrc` after loading the theme. -```zsh -plugins=(... mercurial) -``` + The `robbyrussell` theme is used by default, so you need to modify `$PROMPT` var by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so it looks like this: -## Aliases + ```zsh + PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + ``` -| Alias | Command | -|--------|-------------------------------------------------------------------------------------------------------------| -| `hga` | `hg add` | -| `hgc` | `hg commit` | -| `hgca` | `hg commit --amend` | -| `hgb` | `hg branch` | -| `hgba` | `hg branches` | -| `hgbk` | `hg bookmarks` | -| `hgco` | `hg checkout` | -| `hgd` | `hg diff` | -| `hged` | `hg diffmerge` | -| `hgp` | `hg push` | -| `hgs` | `hg status` | -| `hgsl` | `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"` | -| `hgun` | `hg resolve --list` | -| `hgi` | `hg incoming` | -| `hgl` | `hg pull -u` | -| `hglr` | `hg pull --rebase` | -| `hgo` | `hg outgoing` | +3. Initialize additional vars used in plugin. So in short put next in **.zshrc**: -## Prompt usage + ``` + ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}" + ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}" + ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}" + ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})" + ``` -- Switch to a theme which uses `hg_prompt_info` +### What's inside? +#### Adds handy aliases: +###### general +* `hgc` - `hg commit` +* `hgb` - `hg branch` +* `hgba` - `hg branches` +* `hgbk` - `hg bookmarks` +* `hgco` - `hg checkout` +* `hgd` - `hg diff` +* `hged` - `hg diffmerge` -- Or customize the `$PROMPT` variable of your current theme to contain current folder mercurial repo info. - This can be done by putting a custom version of the theme in `$ZSH_CUSTOM` or by changing `$PROMPT` in - `.zshrc` after loading the theme. +###### pull and update +* `hgi` - `hg incoming` +* `hgl` - `hg pull -u` +* `hglr` - `hg pull --rebase` +* `hgo` - `hg outgoing` +* `hgp` - `hg push` +* `hgs` - `hg status` +* `hgsl` - `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"` - For example, for the `robbyrussell` theme you need to modify `$PROMPT` var by adding `$(hg_prompt_info)` - after `$(git_prompt_info)`, so it looks like this: +###### this is the 'git commit --amend' equivalent +* `hgca` - `hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip` - ```zsh - PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' - ``` +###### list unresolved files (since hg does not list unmerged files in the status command) +* `hgun` - `hg resolve --list` -You can also redefine additional vars used in the plugin (after Oh My Zsh is sourced): +#### Displays repo branch and directory status in prompt +This is the same as git plugin does. -```zsh -ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}" -ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}" -ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}" -ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})" -``` +**Note**: Additional changes to **.zshrc**, or using a theme designed to use `hg_prompt_info`, are required in order for this to work. -### Display repo branch and directory status in prompt +### Mantainers +[ptrv](https://github.com/ptrv) - original creator -This is the same as git plugin does. **Note**: additional changes to `.zshrc`, or using a theme designed -to use `hg_prompt_info`, are required in order for this to work. - -## Mantainers - -- [ptrv](https://github.com/ptrv): original creator -- [oshybystyi](https://github.com/oshybystyi) +[oshybystyi](https://github.com/oshybystyi) - created this README and know how most of code works diff --git a/zsh/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh b/zsh/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh index f134304..58bc571 100644 --- a/zsh/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/mercurial/mercurial.plugin.zsh @@ -1,22 +1,23 @@ -# aliases +# Mercurial alias hga='hg add' alias hgc='hg commit' -alias hgca='hg commit --amend' alias hgb='hg branch' alias hgba='hg branches' alias hgbk='hg bookmarks' alias hgco='hg checkout' alias hgd='hg diff' alias hged='hg diffmerge' -alias hgp='hg push' -alias hgs='hg status' -alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"' -alias hgun='hg resolve --list' # pull and update alias hgi='hg incoming' alias hgl='hg pull -u' alias hglr='hg pull --rebase' alias hgo='hg outgoing' +alias hgp='hg push' +alias hgs='hg status' +alias hgsl='hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n" ' +alias hgca='hg commit --amend' +# list unresolved files (since hg does not list unmerged files in the status command) +alias hgun='hg resolve --list' function in_hg() { if [[ -d .hg ]] || $(hg summary > /dev/null 2>&1); then diff --git a/zsh/.oh-my-zsh/plugins/meteor/README.md b/zsh/.oh-my-zsh/plugins/meteor/README.md index f7c43b7..187a45a 100644 --- a/zsh/.oh-my-zsh/plugins/meteor/README.md +++ b/zsh/.oh-my-zsh/plugins/meteor/README.md @@ -1,10 +1,9 @@ -# meteor plugin +## Introduction The [meteor plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/meteor) provides many [useful aliases](#aliases) as well as completion for the `meteor` command. Enable it by adding `meteor` to the plugins array in your zshrc file: - ```zsh plugins=(... meteor) ``` diff --git a/zsh/.oh-my-zsh/plugins/minikube/minikube.plugin.zsh b/zsh/.oh-my-zsh/plugins/minikube/minikube.plugin.zsh index f7b365c..d8ebe79 100644 --- a/zsh/.oh-my-zsh/plugins/minikube/minikube.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/minikube/minikube.plugin.zsh @@ -1,13 +1,6 @@ # Autocompletion for Minikube. # -if (( $+commands[minikube] )); then - __MINICUBE_COMPLETION_FILE="${ZSH_CACHE_DIR}/minicube_completion" - if [[ ! -f $__MINICUBE_COMPLETION_FILE ]]; then - minikube completion zsh >! $__MINICUBE_COMPLETION_FILE - fi - - [[ -f $__MINICUBE_COMPLETION_FILE ]] && source $__MINICUBE_COMPLETION_FILE - - unset __MINICUBE_COMPLETION_FILE +if [ $commands[minikube] ]; then + source <(minikube completion zsh) fi diff --git a/zsh/.oh-my-zsh/plugins/mix/_mix b/zsh/.oh-my-zsh/plugins/mix/_mix index c0fe68c..61fa1cf 100644 --- a/zsh/.oh-my-zsh/plugins/mix/_mix +++ b/zsh/.oh-my-zsh/plugins/mix/_mix @@ -34,7 +34,6 @@ _1st_arguments=( 'firmware:Nerves - Build a firmware image for the selected target platform' 'firmware.burn:Nerves - Writes the generated firmware image to an attached SDCard or file' 'firmware.image:Nerves - Create a firmware image file that can be copied byte-for-byte' - 'format:Formats the given files and patterns' 'help:Print help information for tasks' 'hex:Print hex help information' 'hex.config:Read or update hex config' @@ -93,7 +92,7 @@ __task_list () local expl declare -a tasks - tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build format help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test) + tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.presence phx.gen.schema phx.gen.secret phx.new phx.new.ecto phx.new.web phx.routes phx.server run test) _wanted tasks expl 'help' compadd $tasks } diff --git a/zsh/.oh-my-zsh/plugins/mvn/README.md b/zsh/.oh-my-zsh/plugins/mvn/README.md index 72cea9c..3bbba5b 100644 --- a/zsh/.oh-my-zsh/plugins/mvn/README.md +++ b/zsh/.oh-my-zsh/plugins/mvn/README.md @@ -4,7 +4,6 @@ The mvn plugin provides many [useful aliases](#aliases) as well as completion fo the [Apache Maven](https://maven.apache.org/) command (`mvn`). Enable it by adding `mvn` to the plugins array in your zshrc file: - ```zsh plugins=(... mvn) ``` diff --git a/zsh/.oh-my-zsh/plugins/mysql-macports/README.md b/zsh/.oh-my-zsh/plugins/mysql-macports/README.md index ff4fb3a..a4224d9 100644 --- a/zsh/.oh-my-zsh/plugins/mysql-macports/README.md +++ b/zsh/.oh-my-zsh/plugins/mysql-macports/README.md @@ -12,9 +12,9 @@ For instructions on how to install MySQL using MacPorts, read the [MacPorts wiki ## Aliases -| Alias | Command | Description | -| ------------ | ------------------------------------ | ------------------------------------------ | -| mysqlstart | `sudo /path/to/mysql.server start` | Start the MySQL server. | -| mysqlstop | `sudo /path/to/mysql.server stop` | Stop the MySQL server. | -| mysqlrestart | `sudo /path/to/mysql.server restart` | Restart the MySQL server. | -| mysqlstatus | `mysqladmin5 -u root -p ping` | Check whether the MySQL server is running. | +| Alias | Command | Description | +| ------------ | --------------------------------------------------------- | ------------------------------------------ | +| mysqlstart | `sudo /opt/local/share/mysql5/mysql/mysql.server start` | Start the MySQL server. | +| mysqlstop | `sudo /opt/local/share/mysql5/mysql/mysql.server stop` | Stop the MySQL server. | +| mysqlrestart | `sudo /opt/local/share/mysql5/mysql/mysql.server restart` | Restart the MySQL server. | +| mysqlstatus | `mysqladmin5 -u root -p ping` | Check whether the MySQL server is running. | diff --git a/zsh/.oh-my-zsh/plugins/ng/README.md b/zsh/.oh-my-zsh/plugins/ng/README.md index 29ac15a..94a450c 100644 --- a/zsh/.oh-my-zsh/plugins/ng/README.md +++ b/zsh/.oh-my-zsh/plugins/ng/README.md @@ -1,10 +1,37 @@ -# ng plugin +## NG Plugin -This plugin adds autocompletion support for [Angular's CLI](https://github.com/angular/angular-cli) -(named `ng`). +This [ng plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ng) + adds completion support for Angular's CLI (named ng). -To use it, add `ng` to the plugins array of your zshrc file: +Ng is hosted on [ng home](https://github.com/catull/angular-cli) + +It is used to generate Angular 2 app "stubs", build those apps, configure them, +test them, lint them etc. + +Ahem, "stubs" is not what Angular engineers refer to the items ng can generate +for you. + +"Stubs" can be any one of: +- class +- component +- directive +- enum +- module +- pipe +- route +- service + +At the moment, `ng completion` creates a very rough completion for Zsh and +Bash. + +It is missing most of the options and a few arguments. +In future, this plugin may be shortened to simply being ```zsh -plugins=(... ng) +eval `ng completion` ``` + +There is hope this materialises in the 21st century. + +### CONTRIBUTOR + - Carlo Dapor ([catull](https://github.com/catull)) diff --git a/zsh/.oh-my-zsh/plugins/nmap/README.md b/zsh/.oh-my-zsh/plugins/nmap/README.md index 0a60068..5cd6462 100644 --- a/zsh/.oh-my-zsh/plugins/nmap/README.md +++ b/zsh/.oh-my-zsh/plugins/nmap/README.md @@ -1,27 +1,37 @@ -# Nmap plugin +# Nmap aliases plugin -Adds some useful aliases for [Nmap](https://nmap.org/) similar to the profiles in zenmap. +Adds some useful aliases for nmap similar to the profiles in zenmap. -To use it, add `nmap` to the plugins array in your zshrc file: +Nmap options are: + * -sS - TCP SYN scan + * -v - verbose + * -T1 - timing of scan. Options are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5) + * -sF - FIN scan (can sneak through non-stateful firewalls) + * -PE - ICMP echo discovery probe + * -PP - timestamp discovery probe + * -PY - SCTP init ping + * -g - use given number as source port + * -A - enable OS detection, version detection, script scanning, and traceroute (aggressive) + * -O - enable OS detection + * -sA - TCP ACK scan + * -F - fast scan + * --script=vulscan - also access vulnerabilities in target -```zsh -plugins=(... nmap) -``` +## Aliases explained -## Aliases + * nmap_open_ports - Scan for open ports on target + * nmap_list_interfaces - List all network interfaces on host where the command runs + * nmap_slow - Slow scan that avoids to spam the targets logs + * nmap_fin - Scan to see if hosts are up with TCP FIN scan + * nmap_full - Aggressive full scan that scans all ports, tries to determine OS and service versions + * nmap_check_for_firewall - TCP ACK scan to check for firewall existence + * nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall + restrictions + * nmap_fast - Fast scan of the top 300 popular ports + * nmap_detect_versions - Detects versions of services and OS, runs on all ports + * nmap_check_for_vulns - Uses vulscan script to check target services for vulnerabilities + * nmap_full_udp - Same as full but via UDP + * nmap_traceroute - Try to traceroute using the most common ports + * nmap_full_with_scripts - Same as nmap_full but also runs all the scripts + * nmap_web_safe_osscan - Little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking. -- `nmap_open_ports`: scan for open ports on target. -- `nmap_list_interfaces`: list all network interfaces on host where the command runs. -- `nmap_slow`: slow scan that avoids to spam the targets logs. -- `nmap_fin`: scan to see if hosts are up with TCP FIN scan. -- `nmap_full`: aggressive full scan that scans all ports, tries to determine OS and service versions. -- `nmap_check_for_firewall`: TCP ACK scan to check for firewall existence. -- `nmap_ping_through_firewall`: host discovery with SYN and ACK probes instead of just pings to avoid firewall restrictions. -- `nmap_fast`: fast scan of the top 300 popular ports. -- `nmap_detect_versions`: detects versions of services and OS, runs on all ports. -- `nmap_check_for_vulns`: uses vulscan script to check target services for vulnerabilities. -- `nmap_full_udp`: same as full but via UDP. -- `nmap_traceroute`: try to traceroute using the most common ports. -- `nmap_full_with_scripts`: same as nmap_full but also runs all the scripts. -- `nmap_web_safe_osscan`: little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking. -- `nmap_ping_scan`: ICMP scan for active hosts. diff --git a/zsh/.oh-my-zsh/plugins/nmap/nmap.plugin.zsh b/zsh/.oh-my-zsh/plugins/nmap/nmap.plugin.zsh index 406870f..8c691bd 100644 --- a/zsh/.oh-my-zsh/plugins/nmap/nmap.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/nmap/nmap.plugin.zsh @@ -29,4 +29,4 @@ alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443 alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy " -alias nmap_ping_scan="nmap -n -sP" + diff --git a/zsh/.oh-my-zsh/plugins/node/README.md b/zsh/.oh-my-zsh/plugins/node/README.md index 911b669..c392dc0 100644 --- a/zsh/.oh-my-zsh/plugins/node/README.md +++ b/zsh/.oh-my-zsh/plugins/node/README.md @@ -1,19 +1,16 @@ # node plugin -This plugin adds `node-docs` function that opens specific section in [Node.js](https://nodejs.org) -documentation (depending on the installed version). - To use it, add `node` to the plugins array of your zshrc file: - ```zsh plugins=(... node) ``` -## Usage +This plugin adds `node-docs` function that open specific section in [Node.js](https://nodejs.org) documentation (depending on the installed version). +For example: ```zsh # Opens https://nodejs.org/docs/latest-v10.x/api/fs.html $ node-docs fs # Opens https://nodejs.org/docs/latest-v10.x/api/path.html -$ node-docs path +$ node-docs path ``` diff --git a/zsh/.oh-my-zsh/plugins/npm/README.md b/zsh/.oh-my-zsh/plugins/npm/README.md index 0b1a228..202e2b0 100644 --- a/zsh/.oh-my-zsh/plugins/npm/README.md +++ b/zsh/.oh-my-zsh/plugins/npm/README.md @@ -1,10 +1,9 @@ -# npm plugin +## npm plugin The npm plugin provides completion as well as adding many useful aliases. To use it, add npm to the plugins array of your zshrc file: - -```zsh +``` plugins=(... npm) ``` diff --git a/zsh/.oh-my-zsh/plugins/npm/npm.plugin.zsh b/zsh/.oh-my-zsh/plugins/npm/npm.plugin.zsh index 87c68f3..f62174a 100644 --- a/zsh/.oh-my-zsh/plugins/npm/npm.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/npm/npm.plugin.zsh @@ -1,16 +1,14 @@ (( $+commands[npm] )) && { - rm -f "${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion" + __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion" - _npm_completion() { - local si=$IFS - compadd -- $(COMP_CWORD=$((CURRENT-1)) \ - COMP_LINE=$BUFFER \ - COMP_POINT=0 \ - npm completion -- "${words[@]}" \ - 2>/dev/null) - IFS=$si - } - compdef _npm_completion npm + if [[ ! -f $__NPM_COMPLETION_FILE ]]; then + npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null + [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE + fi + + [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE + + unset __NPM_COMPLETION_FILE } # Install dependencies globally diff --git a/zsh/.oh-my-zsh/plugins/nvm/_nvm b/zsh/.oh-my-zsh/plugins/nvm/_nvm index e292a8d..1eec48b 100644 --- a/zsh/.oh-my-zsh/plugins/nvm/_nvm +++ b/zsh/.oh-my-zsh/plugins/nvm/_nvm @@ -8,7 +8,6 @@ _1st_arguments=( 'help:show help' '--version:print out the latest released version of nvm' 'install:download and install a version in ' - 'install-latest-npm:download and install the latest npm version' 'uninstall:uninstall a version' 'use:modify PATH to use . Uses .nvmrc if available' 'exec:run on . Uses .nvmrc if available' diff --git a/zsh/.oh-my-zsh/plugins/nyan/README.md b/zsh/.oh-my-zsh/plugins/nyan/README.md new file mode 100644 index 0000000..5929418 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/nyan/README.md @@ -0,0 +1,5 @@ +# Nyan plugin + +This plugin adds a command to display [Nyan Cat](https://en.wikipedia.org/wiki/Nyan_Cat) right inside your terminal. + +**Plugin is deprecated**. Check [official repo](https://github.com/klange/nyancat) for more information. \ No newline at end of file diff --git a/zsh/.oh-my-zsh/plugins/nyan/nyan.plugin.zsh b/zsh/.oh-my-zsh/plugins/nyan/nyan.plugin.zsh new file mode 100644 index 0000000..c21c784 --- /dev/null +++ b/zsh/.oh-my-zsh/plugins/nyan/nyan.plugin.zsh @@ -0,0 +1,10 @@ +print -Pn '%F{yellow}' +cat >&2 <<-EOD + nyan plugin: + The nyancat server used by this plugin was shut down due to increased + bandwidth costs, so the nyan plugin no longer works. You can get the + same functionality in some distributions by installing the nyancat package, + or you can compile it yourself. + See https://github.com/klange/nyancat for more information. +EOD +print -Pn '%f' diff --git a/zsh/.oh-my-zsh/plugins/osx/README.md b/zsh/.oh-my-zsh/plugins/osx/README.md index 50e9e7f..f3881ec 100644 --- a/zsh/.oh-my-zsh/plugins/osx/README.md +++ b/zsh/.oh-my-zsh/plugins/osx/README.md @@ -1,6 +1,8 @@ # OSX plugin -This plugin provides a few utilities to make it more enjoyable on macOS (previously named OSX). +## Description + +This plugin provides a few utilities to make it more enjoyable on OSX. To start using it, add the `osx` plugin to your plugins array in `~/.zshrc`: @@ -10,27 +12,6 @@ plugins=(... osx) Original author: [Sorin Ionescu](https://github.com/sorin-ionescu) -## Commands - -| Command | Description | -| :-------------- | :---------------------------------------------------- | -| `tab` | Open the current directory in a new tab | -| `split_tab` | Split the current terminal tab horizontally | -| `vsplit_tab` | Split the current terminal tab vertically | -| `ofd` | Open the current directory in a Finder window | -| `pfd` | Return the path of the frontmost Finder window | -| `pfs` | Return the current Finder selection | -| `cdf` | `cd` to the current Finder directory | -| `pushdf` | `pushd` to the current Finder directory | -| `quick-look` | Quick-Look a specified file | -| `man-preview` | Open a specified man page in Preview app | -| `showfiles` | Show hidden files | -| `hidefiles` | Hide the hidden files | -| `itunes` | DEPRECATED. Use `music` from macOS Catalina on | -| `music` | Control Apple Music. Use `music -h` for usage details | -| `spotify` | Control Spotify and search by artist, album, track… | -| `rmdsstore` | Remove .DS\_Store files recursively in a directory | - ## Acknowledgements This application makes use of the following third party scripts: @@ -57,3 +38,25 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +## Commands + +| Command | Description | +| :-------------- | :---------------------------------------------------- | +| `tab` | Open the current directory in a new tab | +| `split_tab` | Split the current terminal tab horizontally | +| `vsplit_tab` | Split the current terminal tab vertically | +| `ofd` | Open the current directory in a Finder window | +| `pfd` | Return the path of the frontmost Finder window | +| `pfs` | Return the current Finder selection | +| `cdf` | `cd` to the current Finder directory | +| `pushdf` | `pushd` to the current Finder directory | +| `quick-look` | Quick-Look a specified file | +| `man-preview` | Open a specified man page in Preview app | +| `showfiles` | Show hidden files | +| `hidefiles` | Hide the hidden files | +| `itunes` | DEPRECATED. Use `music` from macOS Catalina on | +| `music` | Control Apple Music. Use `music -h` for usage details | +| `spotify` | Control Spotify and search by artist, album, track… | +| `rmdsstore` | Remove .DS\_Store files recursively in a directory | diff --git a/zsh/.oh-my-zsh/plugins/pass/_pass b/zsh/.oh-my-zsh/plugins/pass/_pass index 75f3feb..5f3b8f5 100644 --- a/zsh/.oh-my-zsh/plugins/pass/_pass +++ b/zsh/.oh-my-zsh/plugins/pass/_pass @@ -10,14 +10,6 @@ # Please visit https://git.zx2c4.com/password-store/tree/COPYING for more information. -# If you use multiple repositories, you can configure completion like this: -# -# compdef _pass workpass -# zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass" -# workpass() { -# PASSWORD_STORE_DIR=$HOME/work/pass pass $@ -# } - # If you use multiple repositories, you can configure completion like this: # # compdef _pass workpass diff --git a/zsh/.oh-my-zsh/plugins/perms/README.md b/zsh/.oh-my-zsh/plugins/perms/README.md index ae7a36b..324b3f3 100644 --- a/zsh/.oh-my-zsh/plugins/perms/README.md +++ b/zsh/.oh-my-zsh/plugins/perms/README.md @@ -1,15 +1,9 @@ -# Perms plugin +## Perms -Plugin to handle some unix filesystem permissions quickly. +Plugin to handle some unix filesystem permissions quickly -To use it, add `perms` to the plugins array in your zshrc file: - -```zsh -plugins=(... perms) -``` - -## Usage +### Usage * `set755` recursively sets all given directories (default to .) to octal 755. * `set644` recursively sets all given files (default to .) to octal 644. -* `fixperms` is a wrapper around `set755` and `set644` applied to a specified directory or the current directory otherwise. It also prompts prior to execution unlike the other two aliases. +* `fixperms` is a wrapper around `set755` and `set644` applied to a specified directory or the current directory otherwise. It also prompts prior to execution unlike the other two aliases. diff --git a/zsh/.oh-my-zsh/plugins/phing/README.md b/zsh/.oh-my-zsh/plugins/phing/README.md index 84d1d18..e2ac0bd 100644 --- a/zsh/.oh-my-zsh/plugins/phing/README.md +++ b/zsh/.oh-my-zsh/plugins/phing/README.md @@ -3,7 +3,6 @@ This plugin adds autocompletion for [`phing`](https://github.com/phingofficial/phing) targets. To use it, add `phing` to the plugins array of your `.zshrc` file: - -```zsh -plugins=(... phing) +``` +plugins=(... eecms) ``` diff --git a/zsh/.oh-my-zsh/plugins/pip/_pip b/zsh/.oh-my-zsh/plugins/pip/_pip index a5adead..607f68e 100644 --- a/zsh/.oh-my-zsh/plugins/pip/_pip +++ b/zsh/.oh-my-zsh/plugins/pip/_pip @@ -89,7 +89,6 @@ case "$words[1]" in if [[ "$state" == packages ]]; then _pip_all _wanted piplist expl 'packages' compadd -a piplist - _files -g "*.(tar.gz|whl)" fi ;; uninstall) _pip_installed diff --git a/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh index e7a9e6b..ec41c3e 100644 --- a/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh @@ -7,7 +7,7 @@ compdef _pipenv pipenv # Automatic pipenv shell activation/deactivation _togglePipenvShell() { # deactivate shell if Pipfile doesn't exist and not in a subdir - if [[ ! -f "$PWD/Pipfile" ]]; then + if [[ ! -a "$PWD/Pipfile" ]]; then if [[ "$PIPENV_ACTIVE" == 1 ]]; then if [[ "$PWD" != "$pipfile_dir"* ]]; then exit @@ -17,7 +17,7 @@ _togglePipenvShell() { # activate the shell if Pipfile exists if [[ "$PIPENV_ACTIVE" != 1 ]]; then - if [[ -f "$PWD/Pipfile" ]]; then + if [[ -a "$PWD/Pipfile" ]]; then export pipfile_dir="$PWD" pipenv shell fi diff --git a/zsh/.oh-my-zsh/plugins/pylint/README.md b/zsh/.oh-my-zsh/plugins/pylint/README.md index 31710d8..8c1de88 100644 --- a/zsh/.oh-my-zsh/plugins/pylint/README.md +++ b/zsh/.oh-my-zsh/plugins/pylint/README.md @@ -1,7 +1,6 @@ -# pylint +# pylint -This plugin adds aliases and autocompletion for [Pylint](https://www.pylint.org/), -the Python code style checking tool. +This plugin adds code analysis for python through [Pylint](https://www.pylint.org/). To use it, add `pylint` to the plugins array in your zshrc file: @@ -13,4 +12,4 @@ plugins=(... pylint) | Alias | Command | Description | | -------------| -------------------- | -------------------------------------------------------------------------------------------------------------------------| -| pylint-quick | `pylint --reports=n` | Displays a set of reports each one focusing on a particular aspect of the project, default set `no` for multiple reports | +| pylint-quick | `pylint --reports=n` | Displays a set of reports each one focusing on a particular aspect of the project, default set `no` for multiple reports | | diff --git a/zsh/.oh-my-zsh/plugins/pylint/pylint.plugin.zsh b/zsh/.oh-my-zsh/plugins/pylint/pylint.plugin.zsh index 14cea5b..57c7c0a 100644 --- a/zsh/.oh-my-zsh/plugins/pylint/pylint.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/pylint/pylint.plugin.zsh @@ -1 +1,3 @@ +# Aliases alias pylint-quick='pylint --reports=n' +compdef _pylint-quick pylint-quick='pylint --reports=n' diff --git a/zsh/.oh-my-zsh/plugins/python/README.md b/zsh/.oh-my-zsh/plugins/python/README.md index 0180218..2d955c5 100644 --- a/zsh/.oh-my-zsh/plugins/python/README.md +++ b/zsh/.oh-my-zsh/plugins/python/README.md @@ -11,8 +11,6 @@ plugins=(... python) | Command | Description | |------------------|---------------------------------------------------------------------------------| -| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv | | `pyfind` | Finds .py files recursively in the current directory | | `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one | | `pygrep ` | Looks for `text` in .py files | -| `pyuserpaths` | Add --user site-packages to PYTHONPATH, for all installed python versions. | diff --git a/zsh/.oh-my-zsh/plugins/python/python.plugin.zsh b/zsh/.oh-my-zsh/plugins/python/python.plugin.zsh index c3c1474..f39cd80 100644 --- a/zsh/.oh-my-zsh/plugins/python/python.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/python/python.plugin.zsh @@ -11,37 +11,6 @@ function pyclean() { find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".pytest_cache" -exec rm -r "{}" + } -# Add the user installed site-packages paths to PYTHONPATH, only if the -# directory exists. Also preserve the current PYTHONPATH value. -# Feel free to autorun this when .zshrc loads. -function pyuserpaths() { - local targets=("python2" "python3") # bins - - # Get existing interpreters. - local interps=() - for target in $targets; do - [ `command -v $target` ] && interps+=($target) - done - - # Check for a non-standard install directory. - local user_base="${HOME}/.local" - [ $PYTHONUSERBASE ] && user_base=$PYTHONUSERBASE - - # Add version specific paths, if: - # it exists in the filesystem; - # it isn't in PYTHONPATH already. - for interp in $interps; do - # Get minor release version. - local ver=`$interp -V 2>&1` - ver=`echo ${ver:7} | cut -d '.' -f 1,2` # The patch version is variable length, truncate it. - - local site_pkgs="${user_base}/lib/python${ver}/site-packages" - [[ -d $site_pkgs && ! $PYTHONPATH =~ $site_pkgs ]] && export PYTHONPATH=${site_pkgs}:$PYTHONPATH - done -} - # Grep among .py files -alias pygrep='grep -nr --include="*.py"' +alias pygrep='grep -r --include="*.py"' -# Run proper IPython regarding current virtualenv (if any) -alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'" diff --git a/zsh/.oh-my-zsh/plugins/rails/README.md b/zsh/.oh-my-zsh/plugins/rails/README.md index 9fb1cec..ad83fff 100644 --- a/zsh/.oh-my-zsh/plugins/rails/README.md +++ b/zsh/.oh-my-zsh/plugins/rails/README.md @@ -80,3 +80,4 @@ separately. For example: `REP rake db:migrate` will migrate the production db. | `ssp` | `ruby script/spec` | | `sc` | `ruby script/console` | | `sd` | `ruby script/server --debugger` | + diff --git a/zsh/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh b/zsh/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh index 3c96432..ed46d35 100644 --- a/zsh/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh @@ -34,7 +34,7 @@ if [[ $FOUND_RBENV -eq 1 ]]; then } function current_gemset() { - echo "$(rbenv gemset active 2>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" + echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)" } function gems() { @@ -47,10 +47,11 @@ if [[ $FOUND_RBENV -eq 1 ]]; then } function rbenv_prompt_info() { - local ruby=$(current_ruby) gemset=$(current_gemset) - echo -n "${ZSH_THEME_RUBY_PROMPT_PREFIX}" - [[ -n "$gemset" ]] && echo -n "${ruby}@${gemset}" || echo -n "${ruby}" - echo "${ZSH_THEME_RUBY_PROMPT_SUFFIX}" + if [[ -n $(current_gemset) ]] ; then + echo "$(current_ruby)@$(current_gemset)" + else + echo "$(current_ruby)" + fi } else alias rubies="ruby -v" @@ -58,11 +59,7 @@ else function current_ruby() { echo "not supported" } function current_gemset() { echo "not supported" } function gems() { echo "not supported" } - function rbenv_prompt_info() { - echo -n "${ZSH_THEME_RUBY_PROMPT_PREFIX}" - echo -n "system: $(ruby -v | cut -f-2 -d ' ')" - echo "${ZSH_THEME_RUBY_PROMPT_SUFFIX}" - } + function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } fi unset FOUND_RBENV rbenvdirs dir diff --git a/zsh/.oh-my-zsh/plugins/repo/README.md b/zsh/.oh-my-zsh/plugins/repo/README.md index 6abd233..4d9366a 100644 --- a/zsh/.oh-my-zsh/plugins/repo/README.md +++ b/zsh/.oh-my-zsh/plugins/repo/README.md @@ -1,25 +1,7 @@ -# repo plugin +## repo +**Maintainer:** [Stibbons](https://github.com/Stibbons) -This plugin mainly adds some aliases and support for automatic completion for -the [repo command line tool](https://code.google.com/p/git-repo/). +This plugin mainly add support automatic completion for the repo command line tool: +https://code.google.com/p/git-repo/ -To use it, add `repo` to the plugins array in your zshrc file: - -```zsh -plugins=(... repo) -``` - -## Aliases - -| Alias | Command | -|---------|----------------------------------------| -| `r` | `repo` | -| `rra` | `repo rebase --auto-stash` | -| `rs` | `repo sync` | -| `rsrra` | `repo sync ; repo rebase --auto-stash` | -| `ru` | `repo upload` | -| `rst` | `repo status` | -| `rsto` | `repo status -o` | -| `rfa` | `repo forall -c` | -| `rfap` | `repo forall -p -c` | -| `rinf` | `repo info` | +* `r` aliases `repo` diff --git a/zsh/.oh-my-zsh/plugins/repo/_repo b/zsh/.oh-my-zsh/plugins/repo/_repo index db0ecd1..59e39c9 100644 --- a/zsh/.oh-my-zsh/plugins/repo/_repo +++ b/zsh/.oh-my-zsh/plugins/repo/_repo @@ -1,5 +1,6 @@ #compdef repo + __git_apply_whitespace_strategies () { declare -a strategies @@ -268,3 +269,4 @@ __repo_projects_or_all() _repo "$@" return $? + diff --git a/zsh/.oh-my-zsh/plugins/repo/repo.plugin.zsh b/zsh/.oh-my-zsh/plugins/repo/repo.plugin.zsh index f098993..51cd32f 100644 --- a/zsh/.oh-my-zsh/plugins/repo/repo.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/repo/repo.plugin.zsh @@ -1,10 +1,30 @@ +# Aliases alias r='repo' +compdef _repo r=repo + alias rra='repo rebase --auto-stash' +compdef _repo rra='repo rebase --auto-stash' + alias rs='repo sync' +compdef _repo rs='repo sync' + alias rsrra='repo sync ; repo rebase --auto-stash' +compdef _repo rsrra='repo sync ; repo rebase --auto-stash' + alias ru='repo upload' +compdef _repo ru='repo upload' + alias rst='repo status' +compdef _repo rst='repo status' + alias rsto='repo status -o' +compdef _repo rsto='repo status -o' + alias rfa='repo forall -c' +compdef _repo rfa='repo forall -c' + alias rfap='repo forall -p -c' +compdef _repo rfap='repo forall -p -c' + alias rinf='repo info' +compdef _repo rinf='repo info' diff --git a/zsh/.oh-my-zsh/plugins/rvm/README.md b/zsh/.oh-my-zsh/plugins/rvm/README.md index 1ed8d46..9d6fd8f 100644 --- a/zsh/.oh-my-zsh/plugins/rvm/README.md +++ b/zsh/.oh-my-zsh/plugins/rvm/README.md @@ -8,8 +8,7 @@ To use it, add `rvm` to the plugins array in your zshrc file: plugins=(... rvm) ``` -## Aliases - +## Functions | Alias | Command | |----------------|----------------------| | `rb18` | `rvm use ruby-1.8.7` | diff --git a/zsh/.oh-my-zsh/plugins/scala/README.md b/zsh/.oh-my-zsh/plugins/scala/README.md index 91a3221..957261d 100644 --- a/zsh/.oh-my-zsh/plugins/scala/README.md +++ b/zsh/.oh-my-zsh/plugins/scala/README.md @@ -1,16 +1,15 @@ -# Scala plugin +## Scala plugin Completion script for [scala and scalac](https://www.scala-lang.org/) commands. To use it, add `scala` to the plugins array of your zshrc file: - -```zsh +``` plugins=(... scala) ``` ## Aliases -| Command | Description | -|----------|---------------------------------| -| `scala` | Run code in the Scala language | -| `scalac` | Compiler for the Scala language | +| Command | Description | +|------------------|---------------------------------------------------------------------------------| +| `scala` | Run code in the Scala language | +| `scalac` | Compiler for the Scala language | diff --git a/zsh/.oh-my-zsh/plugins/sdk/README.md b/zsh/.oh-my-zsh/plugins/sdk/README.md index 1eda5d3..b237f3b 100644 --- a/zsh/.oh-my-zsh/plugins/sdk/README.md +++ b/zsh/.oh-my-zsh/plugins/sdk/README.md @@ -3,12 +3,6 @@ Plugin for SDKMAN, a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. Provides autocompletion for all known commands. -To use it, add `sdk` to your plugins array in your zshrc file: - -```zsh -plugins=(... sdk) -``` - ## Requirements -* [SDKMAN](http://sdkman.io/) + * [SDKMAN](http://sdkman.io/) diff --git a/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh b/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh index 441bd6f..d00459b 100644 --- a/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh @@ -1,58 +1,82 @@ -#!/usr/bin/env zsh - ### SDKMAN Autocomplete for Oh My Zsh -_sdk() { - case "${CURRENT}" in - 2) - compadd -X $'Commands:\n' -- "${${(Mk)functions[@]:#__sdk_*}[@]#__sdk_}" - compadd -n rm - ;; - 3) - case "${words[2]}" in - l|ls|list|i|install) - compadd -X $'Candidates:\n' -- "${SDKMAN_CANDIDATES[@]}" - ;; - ug|upgrade|h|home|c|current|u|use|d|default|rm|uninstall) - compadd -X $'Installed Candidates:\n' -- "${${(u)${(f)$(find -L -- "${SDKMAN_CANDIDATES_DIR}" -mindepth 2 -maxdepth 2 -type d)}[@]:h}[@]:t}" - ;; - e|env) - compadd init - ;; - offline) - compadd enable disable - ;; - selfupdate) - compadd force - ;; - flush) - compadd archives broadcast temp version - ;; - esac - ;; - 4) - case "${words[2]}" in - i|install) - setopt localoptions kshglob - if [[ "${words[3]}" == 'java' ]]; then - compadd -X $'Installable Versions of java:\n' -- "${${${${${(f)$(__sdkman_list_versions "${words[3]}")}[@]:5:-4}[@]:#* | (local only|installed ) | *}[@]##* | | }[@]%%+( )}" - else - compadd -X "Installable Versions of ${words[3]}:"$'\n' -- "${${(z)${(M)${(f)${$(__sdkman_list_versions "${words[3]}")//[*+>]+( )/-}}[@]:# *}[@]}[@]:#-*}" - fi - ;; - h|home|u|use|d|default|rm|uninstall) - compadd -X "Installed Versions of ${words[3]}:"$'\n' -- "${${(f)$(find -L -- "${SDKMAN_CANDIDATES_DIR}/${words[3]}" -mindepth 1 -maxdepth 1 -type d -not -name 'current')}[@]:t}" - ;; - esac - ;; - 5) - case "${words[2]}" in - i|install) - _files -X "Path to Local Installation of ${words[3]} ${words[4]}:"$'\n' -/ - ;; - esac - ;; - esac +# This is the output from sdkman. All the these options are supported at the +# moment. + +# Usage: sdk [candidate] [version] +# sdk offline +# +# commands: +# install or i [version] +# uninstall or rm +# list or ls [candidate] +# use or u [version] +# default or d [version] +# current or c [candidate] +# upgrade or ug [candidate] +# version or v +# broadcast or b +# help or h +# offline [enable|disable] +# selfupdate [force] +# update +# flush +# +# candidate : the SDK to install: groovy, scala, grails, gradle, kotlin, etc. +# use list command for comprehensive list of candidates +# eg: $ sdk list +# +# version : where optional, defaults to latest stable if not provided +# eg: $ sdk install groovy + +local _sdk_commands=( + install i + uninstall rm + list ls + use u + default d + current c + upgrade ug + version v + broadcast b + help h + offline + selfupdate + update + flush +) + +_listInstalledVersions() { + __sdkman_build_version_csv $1 | sed -e "s/,/ /g" +} + +_listInstallableVersions() { + __sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \ + sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*" +} + +_listAllVersion() { + __sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g" +} + +_sdk () { + case $CURRENT in + 2) compadd -- $_sdk_commands ;; + 3) case "$words[2]" in + i|install|rm|uninstall|ls|list|u|use|d|default|c|current|ug|upgrade) + compadd -- $SDKMAN_CANDIDATES ;; + offline) compadd -- enable disable ;; + selfupdate) compadd -- force ;; + flush) compadd -- candidates broadcast archives temp ;; + esac + ;; + 4) case "$words[2]" in + rm|uninstall|d|default) compadd -- $(_listInstalledVersions $words[3]) ;; + i|install) compadd -- $(_listInstallableVersions $words[3]) ;; + u|use) compadd -- $(_listAllVersion $words[3]) ;; + esac + ;; + esac } compdef _sdk sdk diff --git a/zsh/.oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh b/zsh/.oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh index 177e5fa..a0f0349 100644 --- a/zsh/.oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh +++ b/zsh/.oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh @@ -6,9 +6,9 @@ # REQUIRE: ack # ------------------------------------------------------------------------------ -if (( ! $+commands[ack] )); then - echo "'ack' is not installed!" - return +if [ ! -x $(which ack) ]; then + echo \'ack\' is not installed! + exit -1 fi ajs() { diff --git a/zsh/.oh-my-zsh/plugins/shrink-path/README.md b/zsh/.oh-my-zsh/plugins/shrink-path/README.md index 33dc3f8..b990aea 100644 --- a/zsh/.oh-my-zsh/plugins/shrink-path/README.md +++ b/zsh/.oh-my-zsh/plugins/shrink-path/README.md @@ -7,26 +7,19 @@ For this directory tree: ``` /home/ me/ - f o o/ # The prefix f is ambiguous between "f o o" and "f i g". + foo/ bar/ quux/ biz/ # The prefix b is ambiguous between bar and biz. - f i g/ - baz/ ``` here are the results of calling `shrink_path