db90589c8a02e98e657af17bb0b460b752d9ed61

Author
Tristan Carel <tcarel@exalead.com>
Committer
Tristan Carel <tcarel@exalead.com>
Date

Message

Merge remote-tracking branch 'upstream/master' into emacs

Conflicts:
	plugins/emacs/emacs.plugin.zsh
	plugins/emacs/emacsclient.sh

Diff

This diff is truncated to protect this page.

   1diff --git a/.gitignore b/.gitignore
   2index 8d19d100c593afe9d4524f55b84c4b6c45eafbbd..2e8db7341894fdf0940c0c37995e93e1b3b0d9fa 100644
   3--- a/.gitignore
   4+++ b/.gitignore
   5@@ -2,4 +2,7 @@ locals.zsh
   6 log/.zsh_history
   7 projects.zsh
   8 custom/*
   9-!custom/example.zsh
  10+!custom/example
  11+!custom/example.zsh
  12+cache
  13+*.swp
  14diff --git a/README.textile b/README.textile
  15index 86d2652bbc42a9bf45cc99da55f556516f0d197a..2dbfbe5a658d8bba2d387bbab272e189ab9e8fca 100644
  16--- a/README.textile
  17+++ b/README.textile
  18@@ -48,18 +48,14 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
  19 h3. Customization
  20 
  21 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
  22-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @plugin/@ directory and then enable this plugin.
  23+If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
  24+If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
  25+
  26 
  27 h3. Uninstalling
  28 
  29 If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
  30 
  31-h2. Thanks
  32-
  33-* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
  34-* Marcel (noradio) provided Rick the original zsh configuration.
  35-* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh.
  36-
  37 h2. Help out!
  38 
  39 I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests!
  40@@ -67,3 +63,11 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y
  41 h3. Send us your theme!
  42 
  43 I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.
  44+
  45+h2. Contributors
  46+
  47+This project wouldn't exist without all of our awesome users and contributors.
  48+
  49+* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
  50+
  51+Thank you so much!
  52diff --git a/custom/example/example.plugin.zsh b/custom/example/example.plugin.zsh
  53new file mode 100644
  54index 0000000000000000000000000000000000000000..406f27445b76feced2ff33e2d09b079f6739eca3
  55--- /dev/null
  56+++ b/custom/example/example.plugin.zsh
  57@@ -0,0 +1,2 @@
  58+# Add your own custom plugins in the custom/plugins directory. Plugins placed
  59+# here will override ones with the same name in the main plugins directory.
  60diff --git a/lib/aliases.zsh b/lib/aliases.zsh
  61index b47de5bde5a573e4c9465048111c133b3213edc3..0555be2642fcd73e6d4ced8bc44e7eee75e13607 100644
  62--- a/lib/aliases.zsh
  63+++ b/lib/aliases.zsh
  64@@ -22,4 +22,3 @@ alias sl=ls # often screw this up
  65 
  66 alias afind='ack-grep -il'
  67 
  68-alias x=extract
  69diff --git a/lib/completion.zsh b/lib/completion.zsh
  70index e8e9776a5b9f7e70e51bc8421d8080c9d637d793..b3cc918229ce3cdf60f6434cda1ecf1e7a385a77 100644
  71--- a/lib/completion.zsh
  72+++ b/lib/completion.zsh
  73@@ -4,14 +4,10 @@ unsetopt menu_complete   # do not autoselect the first completion entry
  74 unsetopt flowcontrol
  75 setopt auto_menu         # show completion menu on succesive tab press
  76 setopt complete_in_word
  77-setopt complete_aliases
  78 setopt always_to_end
  79 
  80 WORDCHARS=''
  81 
  82-autoload -U compinit
  83-compinit -i
  84-
  85 zmodload -i zsh/complist
  86 
  87 ## case-insensitive (all),partial-word and then substring completion
  88@@ -63,3 +59,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
  89 # ... unless we really want to.
  90 zstyle '*' single-ignored show
  91 
  92+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
  93+  expand-or-complete-with-dots() {
  94+    echo -n "\e[31m......\e[0m"
  95+    zle expand-or-complete
  96+    zle redisplay
  97+  }
  98+  zle -N expand-or-complete-with-dots
  99+  bindkey "^I" expand-or-complete-with-dots
 100+fi
 101diff --git a/lib/edit-command-line.zsh b/lib/edit-command-line.zsh
 102new file mode 100644
 103index 0000000000000000000000000000000000000000..db2000325c82691b5eef2b664c27b00caab1ec58
 104--- /dev/null
 105+++ b/lib/edit-command-line.zsh
 106@@ -0,0 +1,3 @@
 107+autoload -U edit-command-line
 108+zle -N edit-command-line
 109+bindkey '\C-x\C-e' edit-command-line
 110diff --git a/lib/functions.zsh b/lib/functions.zsh
 111index 6f5d015f7a598739ddc3de8e5fbf451817a8e125..ef7cc6383038b7e6f9a02c857f13ea498ba5a8fe 100644
 112--- a/lib/functions.zsh
 113+++ b/lib/functions.zsh
 114@@ -15,38 +15,3 @@ function take() {
 115   cd $1
 116 }
 117 
 118-function extract() {
 119-    unset REMOVE_ARCHIVE
 120-    
 121-    if test "$1" = "-r"; then
 122-        REMOVE=1
 123-        shift
 124-    fi
 125-  if [[ -f $1 ]]; then
 126-    case $1 in
 127-      *.tar.bz2) tar xvjf $1;;
 128-      *.tar.gz) tar xvzf $1;;
 129-      *.tar.xz) tar xvJf $1;;
 130-      *.tar.lzma) tar --lzma -xvf $1;;
 131-      *.bz2) bunzip $1;;
 132-      *.rar) unrar $1;;
 133-      *.gz) gunzip $1;;
 134-      *.tar) tar xvf $1;;
 135-      *.tbz2) tar xvjf $1;;
 136-      *.tgz) tar xvzf $1;;
 137-      *.zip) unzip $1;;
 138-      *.Z) uncompress $1;;
 139-      *.7z) 7z x $1;;
 140-      *) echo "'$1' cannot be extracted via >extract<";;
 141-    esac
 142-
 143-    if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
 144-        echo removing "$1";
 145-        /bin/rm "$1";
 146-    fi
 147-
 148-  else
 149-    echo "'$1' is not a valid file"
 150-  fi
 151-}
 152-
 153diff --git a/lib/git.zsh b/lib/git.zsh
 154index 8512de8a40ba542e24d86be6e5c83c7245623875..f04343650f65ddaaa6f9eba34b718d5f5d1bfd9c 100644
 155--- a/lib/git.zsh
 156+++ b/lib/git.zsh
 157@@ -4,7 +4,8 @@ function git_prompt_info() {
 158   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
 159 }
 160 
 161-parse_git_dirty () {
 162+# Checks if working tree is dirty
 163+parse_git_dirty() {
 164   if [[ -n $(git status -s 2> /dev/null) ]]; then
 165     echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
 166   else
 167@@ -12,7 +13,24 @@ parse_git_dirty () {
 168   fi
 169 }
 170 
 171-# get the status of the working tree
 172+# Checks if there are commits ahead from remote
 173+function git_prompt_ahead() {
 174+  if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
 175+    echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
 176+  fi
 177+}
 178+
 179+# Formats prompt string for current git commit short SHA
 180+function git_prompt_short_sha() {
 181+  SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
 182+}
 183+
 184+# Formats prompt string for current git commit long SHA
 185+function git_prompt_long_sha() {
 186+  SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
 187+}
 188+
 189+# Get the status of the working tree
 190 git_prompt_status() {
 191   INDEX=$(git status --porcelain 2> /dev/null)
 192   STATUS=""
 193@@ -36,6 +54,8 @@ git_prompt_status() {
 194   fi
 195   if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
 196     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 197+  elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
 198+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 199   fi
 200   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
 201     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
 202diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh
 203index 7196a88ffe3de7e8b1f4e8327ed58f050f8898b8..5c1b90bfa94d4a3e9497383e0c6eac9f7a4ed07f 100644
 204--- a/lib/key-bindings.zsh
 205+++ b/lib/key-bindings.zsh
 206@@ -1,6 +1,4 @@
 207 # TODO: Explain what some of this does..
 208-autoload -U compinit
 209-compinit -i
 210 
 211 bindkey -e
 212 bindkey '\ew' kill-region
 213@@ -16,12 +14,23 @@ bindkey '^[[B' down-line-or-search
 214 
 215 bindkey "^[[H" beginning-of-line
 216 bindkey "^[[1~" beginning-of-line
 217+bindkey "^[OH" beginning-of-line
 218 bindkey "^[[F"  end-of-line
 219 bindkey "^[[4~" end-of-line
 220+bindkey "^[OF" end-of-line
 221 bindkey ' ' magic-space    # also do history expansion on space
 222 
 223+bindkey "^[[1;5C" forward-word
 224+bindkey "^[[1;5D" backward-word
 225+
 226 bindkey '^[[Z' reverse-menu-complete
 227 
 228+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
 229+bindkey '^?' backward-delete-char
 230+bindkey "^[[3~" delete-char
 231+bindkey "^[3;5~" delete-char
 232+bindkey "\e[3~" delete-char
 233+
 234 # consider emacs keybindings:
 235 
 236 #bindkey -e  ## emacs key bindings
 237diff --git a/lib/misc.zsh b/lib/misc.zsh
 238index 4c1743657fc1f70a3de0b2ca37fa7c0df7b05843..88732e664e1fc4ec3c5cb8e8e04ccc2ba9761dba 100644
 239--- a/lib/misc.zsh
 240+++ b/lib/misc.zsh
 241@@ -10,4 +10,4 @@ setopt long_list_jobs
 242 
 243 ## pager
 244 export PAGER=less
 245-export LC_CTYPE=en_US.UTF-8
 246+export LC_CTYPE=$LANG
 247diff --git a/lib/spectrum.zsh b/lib/spectrum.zsh
 248index 4006a7fe105dd0b7fddadf8b265186b57f596cc6..2fdf537ef5e2ea10e1494f4668c01231ba58e1e2 100644
 249--- a/lib/spectrum.zsh
 250+++ b/lib/spectrum.zsh
 251@@ -18,3 +18,11 @@ for color in {000..255}; do
 252     FG[$color]="%{[38;5;${color}m%}"
 253     BG[$color]="%{[48;5;${color}m%}"
 254 done
 255+
 256+# Show all 256 colors with color number
 257+function spectrum_ls() {
 258+  for code in {000..255}; do
 259+    print -P -- "$code: %F{$code}Test%f"
 260+  done
 261+}
 262+
 263diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 264index b250833ed66c7d886cf68e1a26ab9ea0e1004b7e..22e7f372fffdb1da78ffd3852130340a5d9aa448 100644
 265--- a/lib/termsupport.zsh
 266+++ b/lib/termsupport.zsh
 267@@ -3,11 +3,12 @@
 268 #Fully support screen, iterm, and probably most modern xterm and rxvt
 269 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
 270 function title {
 271-  if [[ "$TERM" == "screen" ]]; then 
 272-    print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars
 273-  elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
 274-    print -Pn "\e]2;$2\a" #set window name
 275-    print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal)
 276+  [ "$DISABLE_AUTO_TITLE" != "true" ] || return
 277+  if [[ "$TERM" == screen* ]]; then 
 278+    print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
 279+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
 280+    print -Pn "\e]2;$2:q\a" #set window name
 281+    print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
 282   fi
 283 }
 284 
 285@@ -16,15 +17,13 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
 286 
 287 #Appears when you have the prompt
 288 function precmd {
 289-  if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
 290-    title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
 291-  fi
 292+  title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
 293 }
 294 
 295 #Appears at the beginning of (and during) of command execution
 296 function preexec {
 297-  if [ "$DISABLE_AUTO_TITLE" != "true" ]; then
 298-    local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 299-    title "$CMD" "%100>...>$2%<<"
 300-  fi
 301+  emulate -L zsh
 302+  setopt extended_glob
 303+  local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
 304+  title "$CMD" "%100>...>$2%<<"
 305 }
 306diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
 307index 291772dfe0b8bc5345717ef2b185eb7b52fa3194..3865abe17e964354c78c432ae5531fdf9ef693ca 100644
 308--- a/oh-my-zsh.sh
 309+++ b/oh-my-zsh.sh
 310@@ -1,26 +1,58 @@
 311+# Check for updates on initial load...
 312+if [ "$DISABLE_AUTO_UPDATE" != "true" ]
 313+then
 314+  /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
 315+fi
 316+
 317 # Initializes Oh My Zsh
 318 
 319 # add a function path
 320-fpath=($ZSH/functions $fpath)
 321+fpath=($ZSH/functions $ZSH/completions $fpath)
 322 
 323 # Load all of the config files in ~/oh-my-zsh that end in .zsh
 324 # TIP: Add files you don't want in git to .gitignore
 325 for config_file ($ZSH/lib/*.zsh) source $config_file
 326 
 327-# Load all of your custom configurations from custom/
 328-for config_file ($ZSH/custom/*.zsh) source $config_file
 329+# Add all defined plugins to fpath
 330+plugin=${plugin:=()}
 331+for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
 332+
 333+# Load and run compinit
 334+autoload -U compinit
 335+compinit -i
 336+
 337+# Set ZSH_CUSTOM to the path where your custom config files
 338+# and plugins exists, or else we will use the default custom/
 339+if [ "$ZSH_CUSTOM" = ""  ]
 340+then
 341+    ZSH_CUSTOM="$ZSH/custom"
 342+fi
 343 
 344 # Load all of the plugins that were defined in ~/.zshrc
 345-plugin=${plugin:=()}
 346-for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
 347+for plugin ($plugins); do
 348+  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
 349+    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
 350+  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
 351+    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
 352+  fi
 353+done
 354 
 355-# Load the theme
 356-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
 357+# Load all of your custom configurations from custom/
 358+for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
 359 
 360-# Check for updates on initial load...
 361-if [ "$DISABLE_AUTO_UPDATE" = "true" ]
 362+# Load the theme
 363+if [ "$ZSH_THEME" = "random" ]
 364 then
 365-  return
 366+  themes=($ZSH/themes/*zsh-theme)
 367+  N=${#themes[@]}
 368+  ((N=(RANDOM%N)+1))
 369+  RANDOM_THEME=${themes[$N]}
 370+  source "$RANDOM_THEME"
 371+  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
 372 else
 373-  /usr/bin/env zsh $ZSH/tools/check_for_upgrade.sh
 374+  if [ ! "$ZSH_THEME" = ""  ]
 375+  then
 376+    source "$ZSH/themes/$ZSH_THEME.zsh-theme"
 377+  fi
 378 fi
 379+
 380diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
 381new file mode 100644
 382index 0000000000000000000000000000000000000000..691d4d2db51a09b5ce69c83d621f8e2cce008e28
 383--- /dev/null
 384+++ b/plugins/ant/ant.plugin.zsh
 385@@ -0,0 +1,26 @@
 386+stat -f%m . > /dev/null 2>&1
 387+if [ "$?" = 0 ]; then
 388+	stat_cmd=(stat -f%m)
 389+else
 390+	stat_cmd=(stat -L --format=%Y)
 391+fi
 392+
 393+_ant_does_target_list_need_generating () {
 394+  if [ ! -f .ant_targets ]; then return 0;
 395+  else
 396+    accurate=$($stat_cmd .ant_targets)
 397+    changed=$($stat_cmd build.xml)
 398+    return $(expr $accurate '>=' $changed)
 399+  fi
 400+}
 401+
 402+_ant () {
 403+  if [ -f build.xml ]; then
 404+    if _ant_does_target_list_need_generating; then
 405+     sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
 406+    fi
 407+    compadd `cat .ant_targets`
 408+  fi
 409+}
 410+
 411+compdef _ant ant
 412diff --git a/plugins/apache2-macports/apache2-macports.plugin.zsh b/plugins/apache2-macports/apache2-macports.plugin.zsh
 413new file mode 100644
 414index 0000000000000000000000000000000000000000..1caa4cf9d11b318a59a7c5473c975c5c5833d103
 415--- /dev/null
 416+++ b/plugins/apache2-macports/apache2-macports.plugin.zsh
 417@@ -0,0 +1,6 @@
 418+# commands to control local apache2 server installation
 419+# paths are for osx installation via macports
 420+
 421+alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
 422+alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
 423+alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'
 424diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
 425new file mode 100644
 426index 0000000000000000000000000000000000000000..b5e519036229b856c7a92854130d7fccaf848957
 427--- /dev/null
 428+++ b/plugins/archlinux/archlinux.plugin.zsh
 429@@ -0,0 +1,76 @@
 430+# Archlinux zsh aliases and functions
 431+# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
 432+
 433+# Look for yaourt, and add some useful functions if we have it.
 434+if [[ -x `which yaourt` ]]; then
 435+  upgrade () {
 436+    yaourt -Syu
 437+  }
 438+  alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
 439+  # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
 440+  alias yaupg='yaourt -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 441+  alias yain='yaourt -S'           # Install specific package(s) from the repositories
 442+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file 
 443+  alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
 444+  alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
 445+  alias yarep='yaourt -Si'         # Display information about a given package in the repositories
 446+  alias yareps='yaourt -Ss'        # Search for package(s) in the repositories
 447+  alias yaloc='yaourt -Qi'         # Display information about a given package in the local database
 448+  alias yalocs='yaourt -Qs'        # Search for package(s) in the local database
 449+  # Additional yaourt alias examples
 450+  if [[ -x `which abs` ]]; then
 451+    alias yaupd='yaourt -Sy && sudo abs'   # Update and refresh the local package and ABS databases against repositories
 452+  else
 453+    alias yaupd='yaourt -Sy'               # Update and refresh the local package and ABS databases against repositories
 454+  fi
 455+  alias yainsd='yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
 456+  alias yamir='yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
 457+else
 458+ upgrade() {
 459+   sudo pacman -Syu
 460+ }
 461+fi
 462+
 463+# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
 464+alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
 465+alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
 466+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file 
 467+alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
 468+alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
 469+alias pacrep='pacman -Si'              # Display information about a given package in the repositories
 470+alias pacreps='pacman -Ss'             # Search for package(s) in the repositories
 471+alias pacloc='pacman -Qi'              # Display information about a given package in the local database
 472+alias paclocs='pacman -Qs'             # Search for package(s) in the local database
 473+# Additional pacman alias examples
 474+if [[ -x `which abs` ]]; then
 475+  alias pacupd='sudo pacman -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
 476+else
 477+  alias pacupd='sudo pacman -Sy'     # Update and refresh the local package and ABS databases against repositories
 478+fi
 479+alias pacinsd='sudo pacman -S --asdeps'        # Install given package(s) as dependencies of another package
 480+alias pacmir='sudo pacman -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
 481+
 482+# https://bbs.archlinux.org/viewtopic.php?id=93683
 483+paclist() {
 484+  sudo pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
 485+}
 486+
 487+alias paclsorphans='sudo pacman -Qdt'
 488+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
 489+
 490+pacdisowned() {
 491+  tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
 492+  db=$tmp/db
 493+  fs=$tmp/fs
 494+
 495+  mkdir "$tmp"
 496+  trap  'rm -rf "$tmp"' EXIT
 497+
 498+  pacman -Qlq | sort -u > "$db"
 499+
 500+  find /bin /etc /lib /sbin /usr \
 501+      ! -name lost+found \
 502+        \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
 503+
 504+  comm -23 "$fs" "$db"
 505+}
 506diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
 507new file mode 100644
 508index 0000000000000000000000000000000000000000..da0a1276572dc655cc82eedc762e2996dac8b0b6
 509--- /dev/null
 510+++ b/plugins/autojump/autojump.plugin.zsh
 511@@ -0,0 +1,3 @@
 512+if [ -f `brew --prefix`/etc/autojump ]; then
 513+  . `brew --prefix`/etc/autojump
 514+fi
 515diff --git a/plugins/brew/_brew b/plugins/brew/_brew
 516index 4e590ac6302d0196a9b269798ea9f4ded913a05c..1dcf0a4bff26c50eec9a8023695cfe409db6053d 100644
 517--- a/plugins/brew/_brew
 518+++ b/plugins/brew/_brew
 519@@ -25,20 +25,27 @@ _1st_arguments=(
 520   'link:link a formula'
 521   'list:list files in a formula or not-installed formulae'
 522   'log:git commit log for a formula'
 523+  'missing:check all installed formuale for missing dependencies.'
 524   'outdated:list formulas for which a newer version is available'
 525   'prune:remove dead links'
 526   'remove:remove a formula'
 527   'search:search for a formula (/regex/ or string)'
 528+  'server:start a local web app that lets you browse formulae (requires Sinatra)'
 529   'unlink:unlink a formula'
 530   'update:freshen up links'
 531+  'upgrade:upgrade outdated formulae'
 532   'uses:show formulas which depend on a formula'
 533 )
 534 
 535 local expl
 536-local -a formula installed_formulae
 537+local -a formulae installed_formulae
 538 
 539 _arguments \
 540-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
 541+  '(-v)-v[verbose]' \
 542+  '(--cellar)--cellar[brew cellar]' \
 543+  '(--config)--config[brew configuration]' \
 544+  '(--env)--env[brew environment]' \
 545+  '(--repository)--repository[brew repository]' \
 546   '(--version)--version[version information]' \
 547   '(--prefix)--prefix[where brew lives on this system]' \
 548   '(--cache)--cache[brew cache]' \
 549@@ -50,20 +57,24 @@ if (( CURRENT == 1 )); then
 550 fi
 551 
 552 case "$words[1]" in
 553-  list)
 554+  search|-S)
 555+    _arguments \
 556+      '(--macports)--macports[search the macports repository]' \
 557+      '(--fink)--fink[search the fink repository]' ;;
 558+  list|ls)
 559     _arguments \
 560       '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
 561+      '(--versions)--versions[list all installed versions of a formula]' \
 562       '1: :->forms' &&  return 0
 563 
 564       if [[ "$state" == forms ]]; then
 565         _brew_installed_formulae
 566-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
 567+        _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
 568       fi ;;
 569-  install|home|log|info|uses|cat|deps)
 570+  install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
 571     _brew_all_formulae
 572     _wanted formulae expl 'all formulae' compadd -a formulae ;;
 573-  remove|edit|xo)
 574+  remove|rm|uninstall|unlink|cleanup|link|ln)
 575     _brew_installed_formulae
 576     _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
 577 esac
 578-
 579diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh
 580index 353a18942ac594122f5bfc634fcef3f834d1c665..c2e95884e96fd6bb5faba415ebdbe6e9b11153f0 100644
 581--- a/plugins/brew/brew.plugin.zsh
 582+++ b/plugins/brew/brew.plugin.zsh
 583@@ -1,4 +1 @@
 584-# add brew completion function to path
 585-fpath=($ZSH/plugins/brew $fpath)
 586-autoload -U compinit
 587-compinit -i
 588+alias brews='brew list -1'
 589diff --git a/plugins/bundler/_bundler b/plugins/bundler/_bundler
 590new file mode 100644
 591index 0000000000000000000000000000000000000000..5d22cac9a3f1985cf6174e6b1e2b4c23c055828f
 592--- /dev/null
 593+++ b/plugins/bundler/_bundler
 594@@ -0,0 +1,82 @@
 595+#compdef bundle
 596+
 597+local curcontext="$curcontext" state line _gems _opts ret=1
 598+
 599+_arguments -C -A "-v" -A "--version" \
 600+	'(- 1 *)'{-v,--version}'[display version information]' \
 601+	'1: :->cmds' \
 602+	'*:: :->args' && ret=0
 603+
 604+case $state in
 605+	cmds)
 606+		_values "bundle command" \
 607+			"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
 608+			"update[Update dependencies to their latest versions]" \
 609+			"package[Package the .gem files required by your application]" \
 610+			"exec[Execute a script in the context of the current bundle]" \
 611+			"config[Specify and read configuration options for bundler]" \
 612+			"check[Determine whether the requirements for your application are installed]" \
 613+			"list[Show all of the gems in the current bundle]" \
 614+			"show[Show the source location of a particular gem in the bundle]" \
 615+			"console[Start an IRB session in the context of the current bundle]" \
 616+			"open[Open an installed gem in the editor]" \
 617+			"viz[Generate a visual representation of your dependencies]" \
 618+			"init[Generate a simple Gemfile, placed in the current directory]" \
 619+			"gem[Create a simple gem, suitable for development with bundler]" \
 620+			"help[Describe available tasks or one specific task]"
 621+		ret=0
 622+		;;
 623+	args)
 624+		case $line[1] in
 625+			help)
 626+				_values 'commands' \
 627+                    'install' \
 628+                    'update' \
 629+                    'package' \
 630+                    'exec' \
 631+                    'config' \
 632+                    'check' \
 633+                    'list' \
 634+                    'show' \
 635+                    'console' \
 636+                    'open' \
 637+                    'viz' \
 638+                    'init' \
 639+                    'gem' \
 640+                    'help' && ret=0
 641+				;;
 642+			install)
 643+				_arguments \
 644+					'(--no-color)--no-color[disable colorization in output]' \
 645+					'(--local)--local[do not attempt to connect to rubygems.org]' \
 646+					'(--quiet)--quiet[only output warnings and errors]' \
 647+					'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
 648+					'(--system)--system[install to the system location]' \
 649+					'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
 650+					'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
 651+					'(--path)--path=-[specify a different path than the system default]:path:_files' \
 652+					'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
 653+					'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
 654+				ret=0
 655+				;;
 656+			exec)
 657+				_normal && ret=0
 658+				;;
 659+			(open|show)
 660+				_gems=( $(bundle show 2> /dev/null | sed -e '/^  \*/!d; s/^  \* \([^ ]*\) .*/\1/') )
 661+				if [[ $_gems != "" ]]; then
 662+					_values 'gems' $_gems && ret=0
 663+				fi
 664+				;;
 665+			*)
 666+				_opts=(  $(bundle help $line[1] | sed -e '/^  \[-/!d; s/^  \[\(-[^=]*\)=.*/\1/') )
 667+				_opts+=( $(bundle help $line[1] | sed -e '/^  -/!d; s/^  \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
 668+				if [[ $_opts != "" ]]; then
 669+					_values 'options' $_opts && ret=0
 670+				fi
 671+				;;
 672+		esac
 673+		;;
 674+esac
 675+
 676+return ret
 677diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 678index fb40e2cec10dc79da5875c660d18d70d4ee9ac10..dd69f68b1e9393af42d341677fe8b89b2748b0b5 100644
 679--- a/plugins/bundler/bundler.plugin.zsh
 680+++ b/plugins/bundler/bundler.plugin.zsh
 681@@ -1,3 +1,41 @@
 682+fpath=($ZSH/plugins/bundler $fpath)
 683+autoload -U compinit
 684+compinit -i
 685+
 686 alias be="bundle exec"
 687 alias bi="bundle install"
 688+alias bl="bundle list"
 689 alias bu="bundle update"
 690+alias bp="bundle package"
 691+
 692+# The following is based on https://github.com/gma/bundler-exec
 693+
 694+bundled_commands=(cap capify cucumber guard heroku rackup rails rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
 695+
 696+## Functions
 697+
 698+_bundler-installed() {
 699+  which bundle > /dev/null 2>&1
 700+}
 701+
 702+_within-bundled-project() {
 703+  local check_dir=$PWD
 704+  while [ "$(dirname $check_dir)" != "/" ]; do
 705+    [ -f "$check_dir/Gemfile" ] && return
 706+    check_dir="$(dirname $check_dir)"
 707+  done
 708+  false
 709+}
 710+
 711+_run-with-bundler() {
 712+  if _bundler-installed && _within-bundled-project; then
 713+    bundle exec $@
 714+  else
 715+    $@
 716+  fi
 717+}
 718+
 719+## Main program
 720+for cmd in $bundled_commands; do
 721+  alias $cmd="_run-with-bundler $cmd"
 722+done
 723diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
 724new file mode 100644
 725index 0000000000000000000000000000000000000000..f968c71d582a35a9e175f0fc3a55d220f71d85fe
 726--- /dev/null
 727+++ b/plugins/cake/cake.plugin.zsh
 728@@ -0,0 +1,32 @@
 729+# Set this to 1 if you want to cache the tasks
 730+cache_task_list=1
 731+
 732+# Cache filename
 733+cache_file='.cake_task_cache'
 734+
 735+_cake_does_target_list_need_generating () {
 736+
 737+	if [ $cache_task_list -eq 0 ]; then
 738+		return 1;
 739+	fi
 740+
 741+	if [ ! -f $cache_file ]; then return 0;
 742+	else
 743+		accurate=$(stat -f%m $cache_file)
 744+		changed=$(stat -f%m Cakefile)
 745+		return $(expr $accurate '>=' $changed)
 746+	fi
 747+}
 748+
 749+_cake () {
 750+	if [ -f Cakefile ]; then
 751+		if _cake_does_target_list_need_generating; then
 752+			cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$' > $cache_file
 753+			compadd `cat $cache_file`
 754+		else
 755+			compadd `cake | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'`
 756+		fi
 757+	fi
 758+}
 759+
 760+compdef _cake cake
 761diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh
 762index a0fa21d005e628888cf73c9f3e4abc56d1a090b1..8336182d5d8692f609b04d0c9c9c385fc6de5367 100644
 763--- a/plugins/cap/cap.plugin.zsh
 764+++ b/plugins/cap/cap.plugin.zsh
 765@@ -18,4 +18,4 @@ function _cap () {
 766   fi
 767 }
 768 
 769-compctl -K _cap cap
 770+compctl -K _cap cap
 771diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh
 772new file mode 100644
 773index 0000000000000000000000000000000000000000..99252f690b13c0d247024187858c759898d9474f
 774--- /dev/null
 775+++ b/plugins/cloudapp/cloudapp.plugin.zsh
 776@@ -0,0 +1,2 @@
 777+#!/bin/zsh
 778+alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb
 779diff --git a/plugins/cloudapp/cloudapp.rb b/plugins/cloudapp/cloudapp.rb
 780new file mode 100755
 781index 0000000000000000000000000000000000000000..a11cfdb32be06a1fb1ea00933f306e2ff1e95715
 782--- /dev/null
 783+++ b/plugins/cloudapp/cloudapp.rb
 784@@ -0,0 +1,60 @@
 785+#!/usr/bin/env ruby
 786+#
 787+# cloudapp
 788+# Zach Holman / @holman
 789+#
 790+# Uploads a file from the command line to CloudApp, drops it into your 
 791+# clipboard (on a Mac, at least).
 792+#
 793+# Example:
 794+#
 795+#   cloudapp drunk-blake.png
 796+#
 797+# This requires Aaron Russell's cloudapp_api gem:
 798+#
 799+#   gem install cloudapp_api
 800+#
 801+# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
 802+#
 803+#   email
 804+#   password
 805+
 806+require 'rubygems'
 807+begin
 808+  require 'cloudapp_api'
 809+rescue LoadError
 810+  puts "You need to install cloudapp_api: gem install cloudapp_api"
 811+  exit!(1)
 812+end
 813+
 814+config_file = "#{ENV['HOME']}/.cloudapp"
 815+unless File.exist?(config_file)
 816+  puts "You need to type your email and password (one per line) into "+
 817+       "`~/.cloudapp`"
 818+  exit!(1)
 819+end
 820+
 821+email,password = File.read(config_file).split("\n")
 822+
 823+class HTTParty::Response
 824+  # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
 825+  # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
 826+  def ok? ; true end
 827+end
 828+
 829+if ARGV[0].nil?
 830+   puts "You need to specify a file to upload."
 831+   exit!(1)
 832+end
 833+
 834+CloudApp.authenticate(email,password)
 835+url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
 836+
 837+# Say it for good measure.
 838+puts "Uploaded to #{url}."
 839+
 840+# Get the embed link.
 841+url = "#{url}/#{ARGV[0].split('/').last}"
 842+
 843+# Copy it to your (Mac's) clipboard.
 844+`echo '#{url}' | tr -d "\n" | pbcopy`
 845diff --git a/plugins/compleat/compleat.plugin.zsh b/plugins/compleat/compleat.plugin.zsh
 846new file mode 100644
 847index 0000000000000000000000000000000000000000..38f1b396aabf16926d6f0aff06e6f20b2840ab40
 848--- /dev/null
 849+++ b/plugins/compleat/compleat.plugin.zsh
 850@@ -0,0 +1,20 @@
 851+# ------------------------------------------------------------------------------
 852+#          FILE:  compleat.plugin.zsh
 853+#   DESCRIPTION:  oh-my-zsh plugin file.
 854+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
 855+#       VERSION:  1.0.0
 856+# ------------------------------------------------------------------------------
 857+
 858+if (( ${+commands[compleat]} )); then
 859+  local prefix="${commands[compleat]:h:h}"
 860+  local setup="${prefix}/share/compleat-1.0/compleat_setup" 
 861+
 862+  if [[ -f "$setup" ]]; then
 863+    if ! bashcompinit >/dev/null 2>&1; then
 864+      autoload -U bashcompinit
 865+      bashcompinit -i
 866+    fi
 867+
 868+    source "$setup" 
 869+  fi
 870+fi
 871diff --git a/plugins/cpanm/cpanm.plugin.zsh b/plugins/cpanm/cpanm.plugin.zsh
 872deleted file mode 100644
 873index af52d3e8b2567a2a61f9f41cae8f3b15e0d4b933..0000000000000000000000000000000000000000
 874--- a/plugins/cpanm/cpanm.plugin.zsh
 875+++ /dev/null
 876@@ -1,4 +0,0 @@
 877-# add cpanm completion function to path
 878-fpath=($ZSH/plugins/cpanm $fpath)
 879-autoload -U compinit
 880-compinit -i
 881diff --git a/plugins/deb/deb.plugin.zsh b/plugins/deb/deb.plugin.zsh
 882index 732294a87d08858a8abb05248d19a27256680eca..1b35a064628625497cd67c2163c00d02a4c35cff 100644
 883--- a/plugins/deb/deb.plugin.zsh
 884+++ b/plugins/deb/deb.plugin.zsh
 885@@ -9,4 +9,5 @@ alias ar="sudo apt-get remove --purge && \
 886 		sudo apt-get autoremove --purge"	# remove package
 887 alias ap="apt-cache policy"				# apt policy
 888 alias av="apt-cache show"				# show package info
 889+alias acs="apt-cache search"                            # search package
 890 alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache
 891diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
 892new file mode 100644
 893index 0000000000000000000000000000000000000000..1d72a2f2c13f20d33ee63f5ec9918621bdb6827a
 894--- /dev/null
 895+++ b/plugins/django/django.plugin.zsh
 896@@ -0,0 +1,222 @@
 897+#compdef manage.py
 898+
 899+typeset -ga nul_args
 900+nul_args=(
 901+  '--settings=-[the Python path to a settings module.]:file:_files'
 902+  '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
 903+  '--traceback[print traceback on exception.]'
 904+  "--version[show program's version number and exit.]"
 905+  {-h,--help}'[show this help message and exit.]'
 906+)
 907+
 908+_managepy-adminindex(){
 909+  _arguments -s : \
 910+    $nul_args \
 911+    '*::directory:_directories' && ret=0
 912+}
 913+
 914+_managepy-createcachetable(){
 915+  _arguments -s : \
 916+    $nul_args && ret=0
 917+}
 918+
 919+_managepy-dbshell(){
 920+  _arguments -s : \
 921+    $nul_args && ret=0
 922+}
 923+
 924+_managepy-diffsettings(){
 925+  _arguments -s : \
 926+    $nul_args && ret=0
 927+}
 928+
 929+_managepy-dumpdata(){
 930+  _arguments -s : \
 931+    '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
 932+    '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
 933+    $nul_args \
 934+    '*::appname:_applist' && ret=0
 935+}
 936+
 937+_managepy-flush(){
 938+  _arguments -s : \
 939+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
 940+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
 941+    $nul_args && ret=0
 942+}
 943+
 944+_managepy-help(){
 945+  _arguments -s : \
 946+    '*:command:_managepy_cmds' \
 947+    $nul_args && ret=0
 948+}
 949+
 950+_managepy_cmds(){
 951+    local line
 952+    local -a cmd
 953+    _call_program help-command ./manage.py help \
 954+      |& sed -n '/^ /s/[(), ]/ /gp' \
 955+      | while read -A line; do cmd=($line $cmd) done
 956+    _describe -t managepy-command 'manage.py command' cmd
 957+}
 958+
 959+_managepy-inspectdb(){
 960+  _arguments -s : \
 961+    $nul_args && ret=0
 962+}
 963+
 964+_managepy-loaddata(){
 965+  _arguments -s : \
 966+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
 967+    '*::file:_files' \
 968+    $nul_args && ret=0
 969+}
 970+
 971+_managepy-reset(){
 972+  _arguments -s : \
 973+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
 974+    '*::appname:_applist' \
 975+    $nul_args && ret=0
 976+}
 977+
 978+_managepy-runfcgi(){
 979+  local state
 980+  
 981+  local fcgi_opts
 982+  fcgi_opts=(
 983+    'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
 984+    'host[hostname to listen on..]:'
 985+    'port[port to listen on.]:'
 986+    'socket[UNIX socket to listen on.]::file:_files'
 987+    'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
 988+    'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
 989+    'maxspare[max number of spare processes / threads.]:'
 990+    'minspare[min number of spare processes / threads.]:'
 991+    'maxchildren[hard limit number of processes / threads.]:'
 992+    'daemonize[whether to detach from terminal.]:boolean:(False True)'
 993+    'pidfile[write the spawned process-id to this file.]:file:_files'
 994+    'workdir[change to this directory when daemonizing.]:directory:_files'
 995+    'outlog[write stdout to this file.]:file:_files'
 996diff --git a/plugins/extract/_extract b/plugins/extract/_extract
 997new file mode 100644
 998index 0000000000000000000000000000000000000000..dca890954aaad3e36543d18b6fc8b04c090cfc7d
 999--- /dev/null
1000+++ b/plugins/extract/_extract
1001@@ -0,0 +1,8 @@
1002+#compdef extract
1003+#autoload
1004+
1005+_arguments \
1006+  '(-r --remove)'{-r,--remove}'[Remove archive.]' \
1007+  "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
1008+
1009+
1010diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
1011new file mode 100644
1012index 0000000000000000000000000000000000000000..8cc17f7d4be725da84afaf018cb8343e3048ad5d
1013--- /dev/null
1014+++ b/plugins/extract/extract.plugin.zsh
1015@@ -0,0 +1,85 @@
1016+# ------------------------------------------------------------------------------
1017+#          FILE:  extract.plugin.zsh
1018+#   DESCRIPTION:  oh-my-zsh plugin file.
1019+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
1020+#       VERSION:  1.0.1
1021+# ------------------------------------------------------------------------------
1022+
1023+
1024+function extract() {
1025+  local remove_archive
1026+  local success
1027+  local file_name
1028+  local extract_dir
1029+
1030+  if (( $# == 0 )); then
1031+    echo "Usage: extract [-option] [file ...]"
1032+    echo
1033+    echo Options:
1034+    echo "    -r, --remove    Remove archive."
1035+    echo
1036+    echo "Report bugs to <sorin.ionescu@gmail.com>."
1037+  fi
1038+
1039+  remove_archive=1
1040+  if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
1041+    remove_archive=0 
1042+    shift
1043+  fi
1044+
1045+  while (( $# > 0 )); do
1046+    if [[ ! -f "$1" ]]; then
1047+      echo "extract: '$1' is not a valid file" 1>&2
1048+      shift
1049+      continue
1050+    fi
1051+
1052+    success=0
1053+    file_name="$( basename "$1" )"
1054+    extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
1055+    case "$1" in
1056+      (*.tar.gz|*.tgz) tar xvzf "$1" ;;
1057+      (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
1058+      (*.tar.xz|*.txz) tar --xz --help &> /dev/null \
1059+        && tar --xz -xvf "$1" \
1060+        || xzcat "$1" | tar xvf - ;;
1061+      (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
1062+        && tar --lzma -xvf "$1" \
1063+        || lzcat "$1" | tar xvf - ;;
1064+      (*.tar) tar xvf "$1" ;;
1065+      (*.gz) gunzip "$1" ;;
1066+      (*.bz2) bunzip2 "$1" ;;
1067+      (*.xz) unxz "$1" ;;
1068+      (*.lzma) unlzma "$1" ;;
1069+      (*.Z) uncompress "$1" ;;
1070+      (*.zip) unzip "$1" -d $extract_dir ;;
1071+      (*.rar) unrar e -ad "$1" ;;
1072+      (*.7z) 7za x "$1" ;;
1073+      (*.deb)
1074+        mkdir -p "$extract_dir/control"
1075+        mkdir -p "$extract_dir/data"
1076+        cd "$extract_dir"; ar vx "../${1}" > /dev/null
1077+        cd control; tar xzvf ../control.tar.gz
1078+        cd ../data; tar xzvf ../data.tar.gz
1079+        cd ..; rm *.tar.gz debian-binary
1080+        cd ..
1081+      ;;
1082+      (*) 
1083+        echo "extract: '$1' cannot be extracted" 1>&2
1084+        success=1 
1085+      ;; 
1086+    esac
1087+
1088+    (( success = $success > 0 ? $success : $? ))
1089+    (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
1090+    shift
1091+  done
1092+}
1093+
1094+alias x=extract
1095+
1096+# add extract completion function to path
1097+fpath=($ZSH/plugins/extract $fpath)
1098+autoload -U compinit
1099+compinit -i
1100+
1101diff --git a/plugins/gas/_gas b/plugins/gas/_gas
1102new file mode 100644
1103index 0000000000000000000000000000000000000000..befdc94598df69bba47201e6933829b4fb39fbce
1104--- /dev/null
1105+++ b/plugins/gas/_gas
1106@@ -0,0 +1,34 @@
1107+#compdef gas
1108+
1109+local curcontext="$curcontext" state line cmds ret=1
1110+
1111+_arguments -C \
1112+	'(- 1 *)'{-v,--version}'[display version information]' \
1113+	'(-h|--help)'{-h,--help}'[show help information]' \
1114+	'1: :->cmds' \
1115+	'*: :->args' && ret=0
1116+
1117+case $state in
1118+	cmds)
1119+		cmds=(
1120+            "version:Prints Gas's version"
1121+            "use:Uses author"
1122+            "show:Shows your current user"
1123+            "list:Lists your authors"
1124+            "import:Imports current user to gasconfig"
1125+            "help:Describe available tasks or one specific task"
1126+            "delete:Deletes author"
1127+            "add:Adds author to gasconfig"
1128+        )
1129+		_describe -t commands 'gas command' cmds && ret=0
1130+		;;
1131+	args)
1132+		case $line[1] in
1133+			(use|delete)
1134+				_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
1135+				;;
1136+		esac
1137+		;;
1138+esac
1139+
1140+return ret
1141diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh
1142deleted file mode 100644
1143index d4e5c6584a8289c6d4097cd2090fb71a48ef69c6..0000000000000000000000000000000000000000
1144--- a/plugins/gem/gem.plugin.zsh
1145+++ /dev/null
1146@@ -1,4 +0,0 @@
1147-# add gem completion function to path
1148-fpath=($ZSH/plugins/gem $fpath)
1149-autoload -U compinit
1150-compinit -i
1151diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
1152new file mode 100644
1153index 0000000000000000000000000000000000000000..270bcbe389b79224d4725e45be39abb4c3823829
1154--- /dev/null
1155+++ b/plugins/git-flow/git-flow.plugin.zsh
1156@@ -0,0 +1,332 @@
1157+#!zsh
1158+#
1159+# Installation
1160+# ------------
1161+#
1162+# To achieve git-flow completion nirvana:
1163+#
1164+#  0. Update your zsh's git-completion module to the newest verion.
1165+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
1166+#
1167+#  1. Install this file. Either:
1168+#
1169+#     a. Place it in your .zshrc:
1170+#
1171+#     b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
1172+#        your .zshrc:
1173+#
1174+#            source ~/.git-flow-completion.zsh
1175+#
1176+#     c. Or, use this file as a oh-my-zsh plugin.
1177+#
1178+
1179+_git-flow ()
1180+{
1181+	local curcontext="$curcontext" state line
1182+	typeset -A opt_args
1183+
1184+	_arguments -C \
1185+		':command:->command' \
1186+		'*::options:->options'
1187+
1188+	case $state in
1189+		(command)
1190+
1191+			local -a subcommands
1192+			subcommands=(
1193+				'init:Initialize a new git repo with support for the branching model.'
1194+				'feature:Manage your feature branches.'
1195+				'release:Manage your release branches.'
1196+				'hotfix:Manage your hotfix branches.'
1197+				'support:Manage your support branches.'
1198+				'version:Shows version information.'
1199+			)
1200+			_describe -t commands 'git flow' subcommands
1201+		;;
1202+
1203+		(options)
1204+			case $line[1] in
1205+
1206+				(init)
1207+					_arguments \
1208+						-f'[Force setting of gitflow branches, even if already configured]'
1209+					;;
1210+
1211+					(version)
1212+					;;
1213+
1214+					(hotfix)
1215+						__git-flow-hotfix
1216+					;;
1217+
1218+					(release)
1219+						__git-flow-release
1220+					;;
1221+
1222+					(feature)
1223+						__git-flow-feature
1224+					;;
1225+			esac
1226+		;;
1227+	esac
1228+}
1229+
1230+__git-flow-release ()
1231+{
1232+	local curcontext="$curcontext" state line
1233+	typeset -A opt_args
1234+
1235+	_arguments -C \
1236+		':command:->command' \
1237+		'*::options:->options'
1238+
1239+	case $state in
1240+		(command)
1241+
1242+			local -a subcommands
1243+			subcommands=(
1244+				'start:Start a new release branch.'
1245+				'finish:Finish a release branch.'
1246+				'list:List all your release branches. (Alias to `git flow release`)'
1247+			)
1248+			_describe -t commands 'git flow release' subcommands
1249+			_arguments \
1250+				-v'[Verbose (more) output]'
1251+		;;
1252+
1253+		(options)
1254+			case $line[1] in
1255+
1256diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
1257index 8470c28a44e08558531791518739a6bc2a92fa2d..4fcf9425d408a7a40996f8ff8d5e189a155044af 100644
1258--- a/plugins/git/git.plugin.zsh
1259+++ b/plugins/git/git.plugin.zsh
1260@@ -6,35 +6,40 @@ compdef _git gst=git-status
1261 alias gl='git pull'
1262 compdef _git gl=git-pull
1263 alias gup='git fetch && git rebase'
1264-compdef gup=git
1265+compdef _git gup=git-fetch
1266 alias gp='git push'
1267 compdef _git gp=git-push
1268-alias gd='git diff | mate'
1269-# WTF is mate??
1270-compdef _git gd=git-diff
1271-alias gdv='git diff -w "$@" | vim -R -'
1272-compdef gdv=git
1273+gdv() { git-diff -w "$@" | view - }
1274+compdef _git gdv=git-diff
1275 alias gc='git commit -v'
1276-compdef gc=git
1277+compdef _git gc=git-commit
1278 alias gca='git commit -v -a'
1279-compdef gca=git
1280+compdef _git gca=git-commit
1281 alias gco='git checkout'
1282 compdef _git gco=git-checkout
1283 alias gb='git branch'
1284 compdef _git gb=git-branch
1285 alias gba='git branch -a'
1286-compdef gba=git
1287+compdef _git gba=git-branch
1288 alias gcount='git shortlog -sn'
1289 compdef gcount=git
1290 alias gcp='git cherry-pick'
1291 compdef _git gcp=git-cherry-pick
1292 alias glg='git log --stat --max-count=5'
1293 compdef _git glg=git-log
1294+alias glgg='git log --graph --max-count=5'
1295+compdef _git glgg=git-log
1296+alias gss='git status -s'
1297+compdef _git gss=git-status
1298+alias ga='git add'
1299+compdef _git ga=git-add
1300 
1301 # Git and svn mix
1302 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
1303 compdef git-svn-dcommit-push=git
1304 
1305+alias gsr='git svn rebase'
1306+alias gsd='git svn dcommit'
1307 #
1308 # Will return the current branch name
1309 # Usage example: git pull origin $(current_branch)
1310diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
1311index c23504b85b464b411c14abcbe9301e9348ebf5f6..b50ac4d850da1c202d07a190b93ccc90949dd3fa 100644
1312--- a/plugins/github/github.plugin.zsh
1313+++ b/plugins/github/github.plugin.zsh
1314@@ -1,4 +1,5 @@
1315-# add github completion function to path
1316-fpath=($ZSH/plugins/github $fpath)
1317-autoload -U compinit
1318-compinit -i
1319+# Setup hub function for git, if it is available; http://github.com/defunkt/hub
1320+if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
1321+    # eval `hub alias -s zsh`
1322+    function git(){hub "$@"}
1323+fi
1324diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
1325new file mode 100644
1326index 0000000000000000000000000000000000000000..e59265d664fa6f0022c52d2791bcf78a84d2b793
1327--- /dev/null
1328+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
1329@@ -0,0 +1,80 @@
1330+# ------------------------------------------------------------------------------
1331+#          FILE:  gnu-utils.plugin.zsh
1332+#   DESCRIPTION:  oh-my-zsh plugin file.
1333+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
1334+#       VERSION:  1.0.0
1335+# ------------------------------------------------------------------------------
1336+
1337+
1338+if [[ -x "${commands[gwhoami]}" ]]; then 
1339+  __gnu_utils() {
1340+    emulate -L zsh
1341+    local gcmds
1342+    local gcmd
1343+    local cmd
1344+    local prefix
1345+
1346+    # coreutils 
1347+    gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
1348+    'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
1349+    'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
1350+    'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
1351+    'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
1352+    'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
1353+    'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
1354+    'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
1355+    'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
1356+    'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
1357+    'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
1358+    'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
1359+    'gwhoami' 'gyes')
1360+
1361+    # Not part of coreutils, installed separately.
1362+    gcmds+=('gsed' 'gtar' 'gtime')
1363+
1364+    for gcmd in "${gcmds[@]}"; do
1365+      #
1366+      # This method allows for builtin commands to be primary but it's
1367+      # lost if hash -r or rehash -f is executed. Thus, those two 
1368+      # functions have to be wrapped.
1369+      #
1370+      (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
1371+
1372+      #
1373+      # This method generates wrapper functions.
1374+      # It will override shell builtins.
1375+      #
1376+      # (( ${+commands[$gcmd]} )) && \
1377+      # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
1378+
1379+      #
1380+      # This method is inflexible since the aliases are at risk of being
1381+      # overriden resulting in the BSD coreutils being called.
1382+      #
1383+      # (( ${+commands[$gcmd]} )) && \
1384+      # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
1385+    done
1386+
1387+    return 0
1388+  }
1389+  __gnu_utils;
1390+
1391+  function hash() {
1392+    if [[ "$*" =~ "-(r|f)" ]]; then
1393+      builtin hash "$@"
1394+      __gnu_utils
1395+    else
1396+      builtin hash "$@"
1397+    fi
1398+  }
1399+
1400+  function rehash() {
1401+    if [[ "$*" =~ "-f" ]]; then
1402+      builtin rehash "$@"
1403+      __gnu_utils
1404+    else
1405+      builtin rehash "$@"
1406+    fi
1407+  }
1408+fi
1409+
1410diff --git a/plugins/gpg-agent/gpg-agent.plugin.zsh b/plugins/gpg-agent/gpg-agent.plugin.zsh
1411new file mode 100644
1412index 0000000000000000000000000000000000000000..8cc71fd57692de243e8a497786d1e1f8eb0b2bba
1413--- /dev/null
1414+++ b/plugins/gpg-agent/gpg-agent.plugin.zsh
1415@@ -0,0 +1,26 @@
1416+# Based on ssh-agent code
1417+
1418+local GPG_ENV=$HOME/.gnupg/gpg-agent.env
1419+
1420+function start_agent {
1421+  /usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null
1422+  chmod 600 ${GPG_ENV}
1423+  . ${GPG_ENV} > /dev/null
1424+}
1425+
1426+# Source GPG agent settings, if applicable
1427+if [ -f "${GPG_ENV}" ]; then
1428+  . ${GPG_ENV} > /dev/null
1429+  ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || {
1430+    start_agent;
1431+  }
1432+else
1433+  start_agent;
1434+fi
1435+
1436+export GPG_AGENT_INFO
1437+export SSH_AUTH_SOCK
1438+export SSH_AGENT_PID
1439+
1440+GPG_TTY=$(tty)
1441+export GPG_TTY
1442diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
1443new file mode 100644
1444index 0000000000000000000000000000000000000000..fc4c78c503c26ef2762cb1f84df3476670b1a84d
1445--- /dev/null
1446+++ b/plugins/gradle/gradle.plugin.zsh
1447@@ -0,0 +1,119 @@
1448+#!zsh
1449+##############################################################################
1450+# A descriptive listing of core Gradle commands 
1451+############################################################################
1452+function _gradle_core_commands() {
1453+    local ret=1 state
1454+    _arguments ':subcommand:->subcommand' && ret=0
1455+
1456+    case $state in
1457+      subcommand)
1458+        subcommands=(
1459+          "properties:Display all project properties"
1460+          "tasks:Calculate and display all tasks"
1461+          "dependencies:Calculate and display all dependencies"
1462+          "projects:Discover and display all sub-projects"
1463+          "build:Build the project"
1464+          "help:Display help"
1465+        )
1466+        _describe -t subcommands 'gradle subcommands' subcommands && ret=0
1467+    esac
1468+
1469+    return ret
1470+}
1471+
1472+function _gradle_arguments() {
1473+    _arguments -C \
1474+    '-a[Do not rebuild project dependencies]' \
1475+    '-h[Help]' \
1476+    '-D[System property]' \
1477+    '-d[Log at the debug level]' \
1478+    '--gui[Launches the Gradle GUI app]' \
1479+    '--stop[Stop the Gradle daemon]' \
1480+    '--daemon[Use the Gradle daemon]' \
1481+    '--no-daemon[Do not use the Gradle daemon]' \
1482+    '--no-opt[Do not perform any task optimization]' \
1483+    '-i[Log at the info level]' \
1484+    '-m[Dry run]' \
1485+    '-P[Set a project property]' \
1486+    '--profile[Profile the build time]' \
1487+    '-q[Log at the quiet level (only show errors)]' \
1488+    '-v[Print the Gradle version info]' \
1489+    '-x[Specify a task to be excluded]' \
1490+    '*::command:->command' \
1491+    && return 0
1492+}
1493+
1494+
1495+##############################################################################
1496+# Are we in a directory containing a build.gradle file?
1497+############################################################################
1498+function in_gradle() {
1499+    if [[ -f build.gradle ]]; then
1500+        echo 1
1501+    fi
1502+}
1503+
1504+############################################################################
1505+# Define the stat_cmd command based on platform behavior
1506+##########################################################################
1507+stat -f%m . > /dev/null 2>&1
1508+if [ "$?" = 0 ]; then
1509+	stat_cmd=(stat -f%m)
1510+else
1511+	stat_cmd=(stat -L --format=%Y)
1512+fi
1513+
1514+############################################################################## Examine the build.gradle file to see if its
1515+# timestamp has changed, and if so, regen
1516+# the .gradle_tasks cache file
1517+############################################################################
1518+_gradle_does_task_list_need_generating () {
1519+  if [ ! -f .gradletasknamecache ]; then return 0;
1520+  else
1521+    accurate=$($stat_cmd .gradletasknamecache)
1522+    changed=$($stat_cmd build.gradle)
1523+    return $(expr $accurate '>=' $changed)
1524+  fi
1525+}
1526+
1527+
1528+##############################################################################
1529+# Discover the gradle tasks by running "gradle tasks --all"
1530+############################################################################
1531+_gradle_tasks () {
1532+  if [ in_gradle ]; then
1533+    _gradle_arguments
1534+    if _gradle_does_task_list_need_generating; then
1535+     gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1536+    fi
1537+    compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache`
1538+  fi
1539+}
1540+
1541+_gradlew_tasks () {
1542+  if [ in_gradle ]; then
1543+    _gradle_arguments
1544+    if _gradle_does_task_list_need_generating; then
1545+     gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
1546+    fi
1547diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku
1548new file mode 100644
1549index 0000000000000000000000000000000000000000..dc899e2b2a3e07b6d36501b4b1b6f4f6211302db
1550--- /dev/null
1551+++ b/plugins/heroku/_heroku
1552@@ -0,0 +1,158 @@
1553+#compdef heroku
1554+
1555+# Heroku Autocomplete plugin for Oh-My-Zsh
1556+# Requires: The Heroku client gem (https://github.com/heroku/heroku)
1557+# Author: Ali B. (http://awhitebox.com)
1558+
1559+local -a _1st_arguments
1560+_1st_arguments=(
1561+  "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
1562+  "addons":"list installed addons"
1563+  "addons\:list":"list all available addons"
1564+  "addons\:add":"install an addon"
1565+  "addons\:upgrade":"upgrade an existing addon"
1566+  "addons\:downgrade":"downgrade an existing addon"
1567+  "addons\:remove":"uninstall an addon"
1568+  "addons\:open":"open an addon's dashboard in your browser"
1569+  "apps":"list your apps"
1570+  "apps\:info":"show detailed app information"
1571+  "apps\:create":"create a new app"
1572+  "apps\:rename":"rename the app"
1573+  "apps\:open":"open the app in a web browser"
1574+  "apps\:destroy":"permanently destroy an app"
1575+  "auth\:login":"log in with your heroku credentials"
1576+  "auth\:logout":"clear local authentication credentials"
1577+  "config":"display the config vars for an app"
1578+  "config\:add":"add one or more config vars"
1579+  "config\:remove":"remove a config var"
1580+  "db\:push":"push local data up to your app"
1581+  "db\:pull":"pull heroku data down into your local database"
1582+  "domains":"list custom domains for an app"
1583+  "domains\:add":"add a custom domain to an app"
1584+  "domains\:remove":"remove a custom domain from an app"
1585+  "domains\:clear":"remove all custom domains from an app"
1586+  "help":"list available commands or display help for a specific command"
1587+  "keys":"display keys for the current user"
1588+  "keys\:add":"add a key for the current user"
1589+  "keys\:remove":"remove a key from the current user"
1590+  "keys\:clear":"remove all authentication keys from the current user"
1591+  "logs":"display recent log output"
1592+  "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
1593+  "logs\:drains":"manage syslog drains"
1594+  "maintenance\:on":"put the app into maintenance mode"
1595+  "maintenance\:off":"take the app out of maintenance mode"
1596+  "pg\:info":"display database information"
1597+  "pg\:ingress":"allow direct connections to the database from this IP for one minute"
1598+  "pg\:promote":"sets DATABASE as your DATABASE_URL"
1599+  "pg\:psql":"open a psql shell to the database"
1600+  "pg\:reset":"delete all data in DATABASE"
1601+  "pg\:unfollow":"stop a replica from following and make it a read/write database"
1602+  "pg\:wait":"monitor database creation, exit when complete"
1603+  "pgbackups":"list captured backups"
1604+  "pgbackups\:url":"get a temporary URL for a backup"
1605+  "pgbackups\:capture":"capture a backup from a database id"
1606+  "pgbackups\:restore":"restore a backup to a database"
1607+  "pgbackups\:destroy":"destroys a backup"
1608+  "plugins":"list installed plugins"
1609+  "plugins\:install":"install a plugin"
1610+  "plugins\:uninstall":"uninstall a plugin"
1611+  "ps\:dynos":"scale to QTY web processes"
1612+  "ps\:workers":"scale to QTY background processes"
1613+  "ps":"list processes for an app"
1614+  "ps\:restart":"restart an app process"
1615+  "ps\:scale":"scale processes by the given amount"
1616+  "releases":"list releases"
1617+  "releases\:info":"view detailed information for a release"
1618+  "rollback":"roll back to an older release"
1619+  "run":"run an attached process"
1620+  "run\:rake":"remotely execute a rake command"
1621+  "run\:console":"open a remote console session"
1622+  "sharing":"list collaborators on an app"
1623+  "sharing\:add":"add a collaborator to an app"
1624+  "sharing\:remove":"remove a collaborator from an app"
1625+  "sharing\:transfer":"transfer an app to a new owner"
1626+  "ssl":"list certificates for an app"
1627+  "ssl\:add":"add an ssl certificate to an app"
1628+  "ssl\:remove":"remove an ssl certificate from an app"
1629+  "ssl\:clear":"remove all ssl certificates from an app"
1630+  "stack":"show the list of available stacks"
1631+  "stack\:migrate":"prepare migration of this app to a new stack"
1632+  "version":"show heroku client version"
1633+)
1634+
1635+_arguments '*:: :->command'
1636+
1637+if (( CURRENT == 1 )); then
1638+  _describe -t commands "heroku command" _1st_arguments
1639+  return
1640+fi
1641+
1642+local -a _command_args
1643+case "$words[1]" in
1644+  apps:info)
1645+    _command_args=(
1646+      '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
1647+    )
1648+    ;;
1649+  apps:create)
1650+    _command_args=(
1651+      '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
1652diff --git a/plugins/history-substring-search/README b/plugins/history-substring-search/README
1653new file mode 100644
1654index 0000000000000000000000000000000000000000..be11adf76b54ce2e7f8dc4ad14c61c1c3a62ad28
1655--- /dev/null
1656+++ b/plugins/history-substring-search/README
1657@@ -0,0 +1,7 @@
1658+To activate this script, load it into an interactive ZSH session:
1659+
1660+  % source history-substring-search.zsh
1661+
1662+See the "history-substring-search.zsh" file for more information:
1663+
1664+  % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more
1665diff --git a/plugins/history-substring-search/history-substring-search.plugin.zsh b/plugins/history-substring-search/history-substring-search.plugin.zsh
1666new file mode 100644
1667index 0000000000000000000000000000000000000000..99a5922c5faa3d3130578e119e18a4d7ad6eac55
1668--- /dev/null
1669+++ b/plugins/history-substring-search/history-substring-search.plugin.zsh
1670@@ -0,0 +1,12 @@
1671+# This file integrates the history-substring-search script into oh-my-zsh.
1672+
1673+source "$ZSH/plugins/history-substring-search/history-substring-search.zsh"
1674+
1675+if test "$CASE_SENSITIVE" = true; then
1676+  unset HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS
1677+fi
1678+
1679+if test "$DISABLE_COLOR" = true; then
1680+  unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
1681+  unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
1682+fi
1683diff --git a/plugins/history-substring-search/history-substring-search.zsh b/plugins/history-substring-search/history-substring-search.zsh
1684new file mode 100644
1685index 0000000000000000000000000000000000000000..53f707c79c11c72931fcae67eeb6931b29cbade0
1686--- /dev/null
1687+++ b/plugins/history-substring-search/history-substring-search.zsh
1688@@ -0,0 +1,642 @@
1689+#!/usr/bin/env zsh
1690+#
1691+# This is a clean-room implementation of the Fish[1] shell's history search
1692+# feature, where you can type in any part of any previously entered command
1693+# and press the UP and DOWN arrow keys to cycle through the matching commands.
1694+#
1695+#-----------------------------------------------------------------------------
1696+# Usage
1697+#-----------------------------------------------------------------------------
1698+#
1699+# 1. Load this script into your interactive ZSH session:
1700+#
1701+#       % source history-substring-search.zsh
1702+#
1703+#    If you want to use the zsh-syntax-highlighting[6] script along with this
1704+#    script, then make sure that you load it *before* you load this script:
1705+#
1706+#       % source zsh-syntax-highlighting.zsh
1707+#       % source history-substring-search.zsh
1708+#
1709+# 2. Type any part of any previous command and then:
1710+#
1711+#     * Press the UP arrow key to select the nearest command that (1) contains
1712+#       your query and (2) is older than the current command in the command
1713+#       history.
1714+#
1715+#     * Press the DOWN arrow key to select the nearest command that (1)
1716+#       contains your query and (2) is newer than the current command in the
1717+#       command history.
1718+#
1719+#     * Press ^U (the Control and U keys simultaneously) to abort the search.
1720+#
1721+# 3. If a matching command spans more than one line of text, press the LEFT
1722+#    arrow key to move the cursor away from the end of the command, and then:
1723+#
1724+#     * Press the UP arrow key to move the cursor to the line above.  When the
1725+#       cursor reaches the first line of the command, pressing the UP arrow
1726+#       key again will cause this script to perform another search.
1727+#
1728+#     * Press the DOWN arrow key to move the cursor to the line below.  When
1729+#       the cursor reaches the last line of the command, pressing the DOWN
1730+#       arrow key again will cause this script to perform another search.
1731+#
1732+#-----------------------------------------------------------------------------
1733+# Configuration
1734+#-----------------------------------------------------------------------------
1735+#
1736+# This script defines the following global variables. You may override their
1737+# default values only after having loaded this script into your ZSH session.
1738+#
1739+# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND is a global variable that defines
1740+#   how the query should be highlighted inside a matching command. Its default
1741+#   value causes this script to highlight using bold, white text on a magenta
1742+#   background. See the "Character Highlighting" section in the zshzle(1) man
1743+#   page to learn about the kinds of values you may assign to this variable.
1744+#
1745+# * HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND is a global variable that
1746+#   defines how the query should be highlighted when no commands in the
1747+#   history match it. Its default value causes this script to highlight using
1748+#   bold, white text on a red background. See the "Character Highlighting"
1749+#   section in the zshzle(1) man page to learn about the kinds of values you
1750+#   may assign to this variable.
1751+#
1752+# * HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS is a global variable that defines
1753+#   how the command history will be searched for your query. Its default value
1754+#   causes this script to perform a case-insensitive search. See the "Globbing
1755+#   Flags" section in the zshexpn(1) man page to learn about the kinds of
1756+#   values you may assign to this variable.
1757+#
1758+#-----------------------------------------------------------------------------
1759+# History
1760+#-----------------------------------------------------------------------------
1761+#
1762+# This script was originally written by Peter Stephenson[2], who published it
1763+# to the ZSH users mailing list (thereby making it public domain) in September
1764+# 2009. It was later revised by Guido van Steen and released under the BSD
1765+# license (see below) as part of the fizsh[3] project in January 2011.
1766+#
1767+# It was later extracted from fizsh[3] release 1.0.1, refactored heavily, and
1768+# repackaged as both an oh-my-zsh plugin[4] and as an independently loadable
1769+# ZSH script[5] by Suraj N. Kurapati in 2011.
1770+#
1771+# It was further developed[4] by Guido van Steen, Suraj N. Kurapati, Sorin
1772+# Ionescu, and Vincent Guerci in 2011.
1773+#
1774+# [1]: http://fishshell.com
1775+# [2]: http://www.zsh.org/mla/users/2009/msg00818.html
1776+# [3]: http://sourceforge.net/projects/fizsh/
1777+# [4]: https://github.com/robbyrussell/oh-my-zsh/pull/215
1778+# [5]: https://github.com/sunaku/zsh-history-substring-search
1779+# [6]: https://github.com/nicoulaj/zsh-syntax-highlighting
1780+#
1781+##############################################################################
1782+#
1783+# Copyright (c) 2009 Peter Stephenson
1784+# Copyright (c) 2011 Guido van Steen
1785+# Copyright (c) 2011 Suraj N. Kurapati
1786+# Copyright (c) 2011 Sorin Ionescu
1787+# Copyright (c) 2011 Vincent Guerci
1788diff --git a/plugins/kate/kate.plugin.zsh b/plugins/kate/kate.plugin.zsh
1789new file mode 100644
1790index 0000000000000000000000000000000000000000..eb16522acafa12576aa2bcddac5d7b6b5448443c
1791--- /dev/null
1792+++ b/plugins/kate/kate.plugin.zsh
1793@@ -0,0 +1,9 @@
1794+
1795+# Kate
1796+# Start kate always silent
1797+alias kate='kate >/dev/null 2>&1'
1798+
1799+function kt () {
1800+  cd $1
1801+  kate $1
1802+}
1803diff --git a/plugins/knife/_knife b/plugins/knife/_knife
1804new file mode 100644
1805index 0000000000000000000000000000000000000000..7f8c95ee5a470810785cb719828371a5e7463e6c
1806--- /dev/null
1807+++ b/plugins/knife/_knife
1808@@ -0,0 +1,174 @@
1809+#compdef knife
1810+
1811+# These flags should be available everywhere according to man knife
1812+knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
1813+
1814+# knife has a very special syntax, some example calls are:
1815+# knife status
1816+# knife cookbook list
1817+# knife role show ROLENAME
1818+# knife data bag show DATABAGNAME
1819+# knife role show ROLENAME --attribute ATTRIBUTENAME
1820+# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
1821+
1822+# The -Q switch in compadd allow for completions of things like "data bag" without having to go through two rounds of completion and avoids zsh inserting a \ for escaping spaces
1823+_knife() {
1824+  local curcontext="$curcontext" state line
1825+  typeset -A opt_args
1826+  cloudproviders=(bluebox ec2 rackspace slicehost terremark)
1827+  _arguments \
1828+    '1: :->knifecmd'\
1829+    '2: :->knifesubcmd'\
1830+    '3: :->knifesubcmd2' \
1831+    '4: :->knifesubcmd3' \
1832+    '5: :->knifesubcmd4' \
1833+    '6: :->knifesubcmd5'
1834+  
1835+  case $state in
1836+  knifecmd)
1837+    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
1838+  ;;
1839+  knifesubcmd)
1840+    case $words[2] in
1841+    (bluebox|ec2|rackspace|slicehost|terremark)
1842+      compadd "$@" server images
1843+    ;;
1844+    client)
1845+      compadd -Q "$@" "bulk delete" list create show delete edit reregister
1846+    ;;
1847+    configure)
1848+      compadd "$@" client
1849+    ;;
1850+    cookbook)
1851+      compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
1852+    ;;
1853+    node)
1854+     compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
1855+    ;;
1856+    recipe)
1857+     compadd "$@" list
1858+    ;;
1859+    role)
1860+      compadd -Q "$@" "bulk delete" create delete edit "from file" list show
1861+    ;; 
1862+    windows)
1863+      compadd "$@" bootstrap
1864+    ;;
1865+    *)
1866+    _arguments '2:Subsubcommands:($(_knife_options1))'
1867+    esac
1868+   ;;
1869+   knifesubcmd2)
1870+    case $words[3] in
1871+     server)
1872+      compadd "$@" list create delete
1873+    ;;
1874+     images)
1875+      compadd "$@" list
1876+    ;;
1877+     site)
1878+      compadd "$@" vendor show share search download list unshare
1879+    ;;
1880+     (show|delete|edit)
1881+     _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
1882+    ;;
1883+    (upload|test)
1884+     _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
1885+    ;;
1886+    list)
1887+     compadd -a "$@" knife_general_flags
1888+    ;;
1889+    bag)
1890+      compadd -Q "$@" show edit list "from file" create delete
1891+    ;;
1892+    *)
1893+      _arguments '3:Subsubcommands:($(_knife_options2))'
1894+    esac
1895+   ;;
1896+   knifesubcmd3)
1897+     case $words[3] in
1898+      show)
1899+       case $words[2] in
1900+       cookbook)
1901+          versioncomp=1
1902+          _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
1903+       ;;
1904+       (node|client|role)
1905+         compadd "$@" --attribute
1906+       esac
1907+     esac
1908diff --git a/plugins/lein/lein.plugin.zsh b/plugins/lein/lein.plugin.zsh
1909new file mode 100644
1910index 0000000000000000000000000000000000000000..19af3556a662b89a55a6b00e022a8018953cddd3
1911--- /dev/null
1912+++ b/plugins/lein/lein.plugin.zsh
1913@@ -0,0 +1,27 @@
1914+function _lein_commands() {
1915+    local ret=1 state
1916+    _arguments ':subcommand:->subcommand' && ret=0
1917+
1918+    case $state in
1919+      subcommand)
1920+        subcommands=(
1921+          "clean:remove compiled files and dependencies from project"
1922+          "compile:ahead-of-time compile the project"
1923+          "deps:download and install all dependencies"
1924+          "help:display a list of tasks or help for a given task"
1925+          "install:install the project and its dependencies in your local repository"
1926+          "jar:create a jar file containing the compiled .class files"
1927+          "new:create a new project skeleton"
1928+          "pom:write a pom.xml file to disk for maven interop"
1929+          "test:run the project's tests"
1930+          "uberjar:Create a jar including the contents of each of deps"
1931+          "upgrade:upgrade leiningen to the latest stable release"
1932+          "version:print leiningen's version"
1933+        )
1934+        _describe -t subcommands 'leiningen subcommands' subcommands && ret=0
1935+    esac
1936+
1937+    return ret
1938+}
1939+
1940+compdef _lein_commands lein
1941diff --git a/plugins/lol/lol.plugin.zsh b/plugins/lol/lol.plugin.zsh
1942index a7153bb570d559fc4cdabb7f88c9aba2db2d94a4..e455527e7617fb356c9e73dc5271f7c75bb71ff6 100644
1943--- a/plugins/lol/lol.plugin.zsh
1944+++ b/plugins/lol/lol.plugin.zsh
1945@@ -8,19 +8,30 @@ alias rtfm='man'
1946 alias visible='echo'
1947 alias invisible='cat'
1948 alias moar='more'
1949+alias tldr='less'
1950+alias alwayz='tail -f'
1951 
1952 alias icanhas='mkdir'
1953+alias gimmeh='touch'
1954 alias donotwant='rm'
1955 alias dowant='cp'
1956 alias gtfo='mv'
1957+alias nowai='chmod'
1958 
1959 alias hai='cd'
1960+alias iz='ls'
1961 alias plz='pwd'
1962+alias ihasbucket='df -h'
1963 
1964 alias inur='locate'
1965+alias iminurbase='finger'
1966+
1967+alias btw='nice'
1968+alias obtw='nohup'
1969 
1970 alias nomz='ps -aux'
1971 alias nomnom='killall'
1972 
1973+alias byes='exit'
1974 alias cya='reboot'
1975 alias kthxbai='halt'
1976diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh
1977index cbbc4926596480a1567ae5b36e812412c3c901d3..277352e321afd49b954cb91223cf59f9eaf399a3 100644
1978--- a/plugins/macports/macports.plugin.zsh
1979+++ b/plugins/macports/macports.plugin.zsh
1980@@ -6,7 +6,3 @@ alias puni="sudo port uninstall inactive"
1981 alias puo="sudo port upgrade outdated"
1982 alias pup="psu && puo"
1983 
1984-# add macports completion function to path
1985-fpath=($ZSH/plugins/macports $fpath)
1986-autoload -U compinit
1987-compinit -i
1988diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
1989new file mode 100644
1990index 0000000000000000000000000000000000000000..2988f0a4678b3a337312e8ee80bce20ce34889cc
1991--- /dev/null
1992+++ b/plugins/mercurial/mercurial.plugin.zsh
1993@@ -0,0 +1,14 @@
1994+
1995+# Mercurial
1996+alias hgc='hg commit -v'
1997+alias hgb='hg branch -v'
1998+alias hgba='hg branches'
1999+alias hgco='hg checkout'
2000+alias hgd='hg diff'
2001+alias hged='hg diffmerge'
2002+# pull and update
2003+alias hgl='hg pull -u -v'
2004+alias hgp='hg push -v'
2005+alias hgs='hg status -v'
2006+# this is the 'git commit --amend' equivalent
2007+alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
2008diff --git a/plugins/mysql-macports/mysql-macports.plugin.zsh b/plugins/mysql-macports/mysql-macports.plugin.zsh
2009new file mode 100644
2010index 0000000000000000000000000000000000000000..c39563fe49c0cbc81dd7eb9ca8feeb5bc54a3da0
2011--- /dev/null
2012+++ b/plugins/mysql-macports/mysql-macports.plugin.zsh
2013@@ -0,0 +1,8 @@
2014+# commands to control local mysql-server installation
2015+# paths are for osx installation via macports
2016+
2017+alias mysqlstart='sudo /opt/local/share/mysql5/mysql/mysql.server start'
2018+alias mysqlstop='sudo /opt/local/share/mysql5/mysql/mysql.server stop'
2019+alias mysqlrestart='sudo /opt/local/share/mysql5/mysql/mysql.server restart'
2020+
2021+alias mysqlstatus='mysqladmin5 -u root -p ping'