Browse Source

sync zsh config on lucid.remote

windhamdavid 11 years ago
parent
commit
9b17118fa5
100 changed files with 9205 additions and 0 deletions
  1. 9 0
      lucid.remote/.oh-my-zsh/.gitignore
  2. 21 0
      lucid.remote/.oh-my-zsh/MIT-LICENSE.txt
  3. 95 0
      lucid.remote/.oh-my-zsh/README.textile
  4. 5 0
      lucid.remote/.oh-my-zsh/custom/example.zsh
  5. 2 0
      lucid.remote/.oh-my-zsh/custom/example/example.plugin.zsh
  6. 26 0
      lucid.remote/.oh-my-zsh/lib/aliases.zsh
  7. 75 0
      lucid.remote/.oh-my-zsh/lib/completion.zsh
  8. 14 0
      lucid.remote/.oh-my-zsh/lib/correction.zsh
  9. 43 0
      lucid.remote/.oh-my-zsh/lib/directories.zsh
  10. 3 0
      lucid.remote/.oh-my-zsh/lib/edit-command-line.zsh
  11. 17 0
      lucid.remote/.oh-my-zsh/lib/functions.zsh
  12. 141 0
      lucid.remote/.oh-my-zsh/lib/git.zsh
  13. 6 0
      lucid.remote/.oh-my-zsh/lib/grep.zsh
  14. 15 0
      lucid.remote/.oh-my-zsh/lib/history.zsh
  15. 50 0
      lucid.remote/.oh-my-zsh/lib/key-bindings.zsh
  16. 15 0
      lucid.remote/.oh-my-zsh/lib/misc.zsh
  17. 2 0
      lucid.remote/.oh-my-zsh/lib/rbenv.zsh
  18. 8 0
      lucid.remote/.oh-my-zsh/lib/rvm.zsh
  19. 28 0
      lucid.remote/.oh-my-zsh/lib/spectrum.zsh
  20. 35 0
      lucid.remote/.oh-my-zsh/lib/termsupport.zsh
  21. 42 0
      lucid.remote/.oh-my-zsh/lib/theme-and-appearance.zsh
  22. 4 0
      lucid.remote/.oh-my-zsh/log/.easter-egg
  23. 83 0
      lucid.remote/.oh-my-zsh/oh-my-zsh.sh
  24. 16 0
      lucid.remote/.oh-my-zsh/plugins/ant/ant.plugin.zsh
  25. 6 0
      lucid.remote/.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh
  26. 95 0
      lucid.remote/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh
  27. 18 0
      lucid.remote/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh
  28. 13 0
      lucid.remote/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh
  29. 82 0
      lucid.remote/.oh-my-zsh/plugins/battery/battery.plugin.zsh
  30. 58 0
      lucid.remote/.oh-my-zsh/plugins/bower/_bower
  31. 38 0
      lucid.remote/.oh-my-zsh/plugins/bower/bower.plugin.zsh
  32. 81 0
      lucid.remote/.oh-my-zsh/plugins/brew/_brew
  33. 1 0
      lucid.remote/.oh-my-zsh/plugins/brew/brew.plugin.zsh
  34. 91 0
      lucid.remote/.oh-my-zsh/plugins/bundler/_bundler
  35. 44 0
      lucid.remote/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh
  36. 13 0
      lucid.remote/.oh-my-zsh/plugins/bwana/bwana.plugin.zsh
  37. 33 0
      lucid.remote/.oh-my-zsh/plugins/cake/cake.plugin.zsh
  38. 10 0
      lucid.remote/.oh-my-zsh/plugins/capistrano/_capistrano
  39. 2 0
      lucid.remote/.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh
  40. 60 0
      lucid.remote/.oh-my-zsh/plugins/cloudapp/cloudapp.rb
  41. 71 0
      lucid.remote/.oh-my-zsh/plugins/coffee/_coffee
  42. 6 0
      lucid.remote/.oh-my-zsh/plugins/colemak/colemak-less
  43. 22 0
      lucid.remote/.oh-my-zsh/plugins/colemak/colemak.plugin.zsh
  44. 11 0
      lucid.remote/.oh-my-zsh/plugins/colored-man/colored-man.plugin.zsh
  45. 28 0
      lucid.remote/.oh-my-zsh/plugins/colorize/colorize.plugin.zsh
  46. 9 0
      lucid.remote/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh
  47. 20 0
      lucid.remote/.oh-my-zsh/plugins/compleat/compleat.plugin.zsh
  48. 32 0
      lucid.remote/.oh-my-zsh/plugins/composer/composer.plugin.zsh
  49. 3 0
      lucid.remote/.oh-my-zsh/plugins/copydir/copydir.plugin.zsh
  50. 5 0
      lucid.remote/.oh-my-zsh/plugins/copyfile/copyfile.plugin.zsh
  51. 14 0
      lucid.remote/.oh-my-zsh/plugins/cp/cp.plugin.zsh
  52. 67 0
      lucid.remote/.oh-my-zsh/plugins/cpanm/_cpanm
  53. 186 0
      lucid.remote/.oh-my-zsh/plugins/debian/debian.plugin.zsh
  54. 10 0
      lucid.remote/.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh
  55. 39 0
      lucid.remote/.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh
  56. 238 0
      lucid.remote/.oh-my-zsh/plugins/django/django.plugin.zsh
  57. 29 0
      lucid.remote/.oh-my-zsh/plugins/emoji-clock/emoji-clock.plugin.zsh
  58. 4 0
      lucid.remote/.oh-my-zsh/plugins/encode64/encode64.plugin.zsh
  59. 8 0
      lucid.remote/.oh-my-zsh/plugins/extract/_extract
  60. 80 0
      lucid.remote/.oh-my-zsh/plugins/extract/extract.plugin.zsh
  61. 60 0
      lucid.remote/.oh-my-zsh/plugins/fabric/_fab
  62. 1 0
      lucid.remote/.oh-my-zsh/plugins/fabric/fabric.plugin.zsh
  63. 6 0
      lucid.remote/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh
  64. 6 0
      lucid.remote/.oh-my-zsh/plugins/fbterm/fbterm.plugin.zsh
  65. 44 0
      lucid.remote/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh
  66. 34 0
      lucid.remote/.oh-my-zsh/plugins/gas/_gas
  67. 64 0
      lucid.remote/.oh-my-zsh/plugins/gem/_gem
  68. 285 0
      lucid.remote/.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh
  69. 416 0
      lucid.remote/.oh-my-zsh/plugins/git-flow-avh/git-flow-avh.plugin.zsh
  70. 349 0
      lucid.remote/.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh
  71. 348 0
      lucid.remote/.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh
  72. 19 0
      lucid.remote/.oh-my-zsh/plugins/git-remote-branch/git-remote-branch.plugin.zsh
  73. 110 0
      lucid.remote/.oh-my-zsh/plugins/git/git.plugin.zsh
  74. 87 0
      lucid.remote/.oh-my-zsh/plugins/gitfast/_git
  75. 2766 0
      lucid.remote/.oh-my-zsh/plugins/gitfast/git-completion.bash
  76. 399 0
      lucid.remote/.oh-my-zsh/plugins/gitfast/git-prompt.sh
  77. 8 0
      lucid.remote/.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh
  78. 40 0
      lucid.remote/.oh-my-zsh/plugins/github/_github
  79. 88 0
      lucid.remote/.oh-my-zsh/plugins/github/github.plugin.zsh
  80. 80 0
      lucid.remote/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh
  81. 151 0
      lucid.remote/.oh-my-zsh/plugins/go/go.plugin.zsh
  82. 150 0
      lucid.remote/.oh-my-zsh/plugins/golang/golang.plugin.zsh
  83. 30 0
      lucid.remote/.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh
  84. 106 0
      lucid.remote/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh
  85. 60 0
      lucid.remote/.oh-my-zsh/plugins/grails/grails.plugin.zsh
  86. 159 0
      lucid.remote/.oh-my-zsh/plugins/heroku/_heroku
  87. 7 0
      lucid.remote/.oh-my-zsh/plugins/history-substring-search/README
  88. 12 0
      lucid.remote/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh
  89. 642 0
      lucid.remote/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh
  90. 8 0
      lucid.remote/.oh-my-zsh/plugins/history/history.plugin.zsh
  91. 14 0
      lucid.remote/.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh
  92. 38 0
      lucid.remote/.oh-my-zsh/plugins/jira/jira.plugin.zsh
  93. 4 0
      lucid.remote/.oh-my-zsh/plugins/jruby/jruby.plugin.zsh
  94. 9 0
      lucid.remote/.oh-my-zsh/plugins/kate/kate.plugin.zsh
  95. 198 0
      lucid.remote/.oh-my-zsh/plugins/knife/_knife
  96. 40 0
      lucid.remote/.oh-my-zsh/plugins/laravel/_artisan
  97. 3 0
      lucid.remote/.oh-my-zsh/plugins/laravel/laravel.plugin.zsh
  98. 25 0
      lucid.remote/.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh
  99. 41 0
      lucid.remote/.oh-my-zsh/plugins/lein/lein.plugin.zsh
  100. 16 0
      lucid.remote/.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh

+ 9 - 0
lucid.remote/.oh-my-zsh/.gitignore

@@ -0,0 +1,9 @@
+locals.zsh
+log/.zsh_history
+projects.zsh
+custom/*
+!custom/example
+!custom/example.zsh
+*.swp
+!custom/example.zshcache
+cache/

+ 21 - 0
lucid.remote/.oh-my-zsh/MIT-LICENSE.txt

@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
+
+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.

+ 95 - 0
lucid.remote/.oh-my-zsh/README.textile

@@ -0,0 +1,95 @@
+oh-my-zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and few things that make you shout...
+
+bq. "OH MY ZSHELL!"
+
+h2. Setup
+
+@oh-my-zsh@ should work with any recent release of "zsh":http://www.zsh.org/, the minimum recommended version is 4.3.9.
+
+h3. The automatic installer... (do you trust me?)
+
+You can install this via the command line with either `curl` or `wget`.
+
+h4. via `curl`
+
+@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
+
+h4. via `wget`
+
+@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
+
+h3. The manual way
+
+
+1. Clone the repository
+
+  @git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
+
+2. *OPTIONAL* Backup your existing ~/.zshrc file
+
+  @cp ~/.zshrc ~/.zshrc.orig@
+
+3. Create a new zsh config by copying the zsh template we've provided.
+
+  @cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
+
+
+4. Set zsh as your default shell:
+
+  @chsh -s /bin/zsh@
+
+5. Start / restart zsh (open a new terminal is easy enough...)
+
+h3. Problems?
+
+You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
+
+h2. Usage
+
+* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
+** example: @plugins=(git osx ruby)@
+* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
+** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.
+* much much more...  take a look at @lib/@ what _Oh My Zsh_ offers...
+
+h2. Useful
+
+the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty for tips.
+
+h3. Customization
+
+If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
+If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
+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/@.
+
+h3. Updates
+
+By default you will be prompted to check for updates. If you would like oh-my-zsh to automatically update itself without prompting you, set the following in your ~/.zshrc
+
+@DISABLE_UPDATE_PROMPT=true@
+
+To disable updates entirely, put this in your ~/.zshrc
+
+@DISABLE_AUTO_UPDATE=true@
+
+h3. Uninstalling
+
+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).
+
+h2. Help out!
+
+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!
+
+h3. (Don't) Send us your theme! (for now)
+
+-I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory.-
+
+We have enough themes for the time being. Please fork the project and add on in there, you can let people know how to grab it from there.
+
+h2. Contributors
+
+This project wouldn't exist without all of our awesome users and contributors.
+
+* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors
+
+Thank you so much!

+ 5 - 0
lucid.remote/.oh-my-zsh/custom/example.zsh

@@ -0,0 +1,5 @@
+# Add yourself some shortcuts to projects you often work on
+# Example:
+#
+# brainstormr=/Users/robbyrussell/Projects/development/planetargon/brainstormr
+#

+ 2 - 0
lucid.remote/.oh-my-zsh/custom/example/example.plugin.zsh

@@ -0,0 +1,2 @@
+# Add your own custom plugins in the custom/plugins directory. Plugins placed
+# here will override ones with the same name in the main plugins directory.

+ 26 - 0
lucid.remote/.oh-my-zsh/lib/aliases.zsh

@@ -0,0 +1,26 @@
+# Push and pop directories on directory stack
+alias pu='pushd'
+alias po='popd'
+
+# Basic directory operations
+alias ...='cd ../..'
+alias -- -='cd -'
+
+# Super user
+alias _='sudo'
+alias please='sudo'
+
+#alias g='grep -in'
+
+# Show history
+alias history='fc -l 1'
+
+# List direcory contents
+alias lsa='ls -lah'
+#alias l='ls -la'
+alias ll='ls -l'
+alias la='ls -lA'
+alias sl=ls # often screw this up
+
+alias afind='ack-grep -il'
+

+ 75 - 0
lucid.remote/.oh-my-zsh/lib/completion.zsh

@@ -0,0 +1,75 @@
+# fixme - the load process here seems a bit bizarre
+
+unsetopt menu_complete   # do not autoselect the first completion entry
+unsetopt flowcontrol
+setopt auto_menu         # show completion menu on succesive tab press
+setopt complete_in_word
+setopt always_to_end
+
+WORDCHARS=''
+
+zmodload -i zsh/complist
+
+## case-insensitive (all),partial-word and then substring completion
+if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
+  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+  unset CASE_SENSITIVE
+else
+  zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+fi
+
+zstyle ':completion:*' list-colors ''
+
+# should this be in keybindings?
+bindkey -M menuselect '^o' accept-and-infer-next-history
+
+zstyle ':completion:*:*:*:*:*' menu select
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
+zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
+
+# disable named-directories autocompletion
+zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
+cdpath=(.)
+
+# use /etc/hosts and known_hosts for hostname completion
+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
+[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
+[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
+[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+hosts=(
+  "$_ssh_config[@]"
+  "$_global_ssh_hosts[@]"
+  "$_ssh_hosts[@]"
+  "$_etc_hosts[@]"
+  "$HOST"
+  localhost
+)
+zstyle ':completion:*:hosts' hosts $hosts
+zstyle ':completion:*' users off
+
+# Use caching so that commands like apt and dpkg complete are useable
+zstyle ':completion::complete:*' use-cache 1
+zstyle ':completion::complete:*' cache-path $ZSH/cache/
+
+# Don't complete uninteresting users
+zstyle ':completion:*:*:*:users' ignored-patterns \
+        adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
+        dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
+        hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
+        mailman mailnull mldonkey mysql nagios \
+        named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
+        operator pcap postfix postgres privoxy pulse pvm quagga radvd \
+        rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
+
+# ... unless we really want to.
+zstyle '*' single-ignored show
+
+if [ "x$COMPLETION_WAITING_DOTS" = "xtrue" ]; then
+  expand-or-complete-with-dots() {
+    echo -n "\e[31m......\e[0m"
+    zle expand-or-complete
+    zle redisplay
+  }
+  zle -N expand-or-complete-with-dots
+  bindkey "^I" expand-or-complete-with-dots
+fi

+ 14 - 0
lucid.remote/.oh-my-zsh/lib/correction.zsh

@@ -0,0 +1,14 @@
+if [[ "$DISABLE_CORRECTION" == "true" ]]; then
+  return
+else
+  setopt correct_all
+  alias man='nocorrect man'
+  alias mv='nocorrect mv'
+  alias mysql='nocorrect mysql'
+  alias mkdir='nocorrect mkdir'
+  alias gist='nocorrect gist'
+  alias heroku='nocorrect heroku'
+  alias ebuild='nocorrect ebuild'
+  alias hpodder='nocorrect hpodder'
+  alias sudo='nocorrect sudo'
+fi

+ 43 - 0
lucid.remote/.oh-my-zsh/lib/directories.zsh

@@ -0,0 +1,43 @@
+# Changing/making/removing directory
+setopt auto_name_dirs
+setopt auto_pushd
+setopt pushd_ignore_dups
+setopt pushdminus
+
+alias ..='cd ..'
+alias cd..='cd ..'
+alias cd...='cd ../..'
+alias cd....='cd ../../..'
+alias cd.....='cd ../../../..'
+alias cd/='cd /'
+
+alias 1='cd -'
+alias 2='cd -2'
+alias 3='cd -3'
+alias 4='cd -4'
+alias 5='cd -5'
+alias 6='cd -6'
+alias 7='cd -7'
+alias 8='cd -8'
+alias 9='cd -9'
+
+cd () {
+  if   [[ "x$*" == "x..." ]]; then
+    cd ../..
+  elif [[ "x$*" == "x...." ]]; then
+    cd ../../..
+  elif [[ "x$*" == "x....." ]]; then
+    cd ../../../..
+  elif [[ "x$*" == "x......" ]]; then
+    cd ../../../../..
+  elif [ -d ~/.autoenv ]; then
+    source ~/.autoenv/activate.sh
+    autoenv_cd "$@"
+  else
+    builtin cd "$@"
+  fi
+}
+
+alias md='mkdir -p'
+alias rd=rmdir
+alias d='dirs -v | head -10'

+ 3 - 0
lucid.remote/.oh-my-zsh/lib/edit-command-line.zsh

@@ -0,0 +1,3 @@
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\C-x\C-e' edit-command-line

+ 17 - 0
lucid.remote/.oh-my-zsh/lib/functions.zsh

@@ -0,0 +1,17 @@
+function zsh_stats() {
+  history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n20
+}
+
+function uninstall_oh_my_zsh() {
+  /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
+}
+
+function upgrade_oh_my_zsh() {
+  /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
+}
+
+function take() {
+  mkdir -p $1
+  cd $1
+}
+

+ 141 - 0
lucid.remote/.oh-my-zsh/lib/git.zsh

@@ -0,0 +1,141 @@
+# get the name of the branch we are on
+function git_prompt_info() {
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
+  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+}
+
+
+# Checks if working tree is dirty
+parse_git_dirty() {
+  local SUBMODULE_SYNTAX=''
+  local GIT_STATUS=''
+  local CLEAN_MESSAGE='nothing to commit (working directory clean)'
+  if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
+    if [[ $POST_1_7_2_GIT -gt 0 ]]; then
+          SUBMODULE_SYNTAX="--ignore-submodules=dirty"
+    fi
+    if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" != "true" ]]; then
+        GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null | tail -n1)
+    else
+        GIT_STATUS=$(git status -s ${SUBMODULE_SYNTAX} -uno 2> /dev/null | tail -n1)
+    fi
+    if [[ -n $(git status -s ${SUBMODULE_SYNTAX} -uno  2> /dev/null) ]]; then
+      echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
+    else
+      echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+    fi
+  else
+    echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
+  fi
+}
+
+# get the difference between the local and remote branches
+git_remote_status() {
+    remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
+    if [[ -n ${remote} ]] ; then
+        ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
+        behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
+
+        if [ $ahead -eq 0 ] && [ $behind -gt 0 ]
+        then
+            echo "$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
+        elif [ $ahead -gt 0 ] && [ $behind -eq 0 ]
+        then
+            echo "$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
+        elif [ $ahead -gt 0 ] && [ $behind -gt 0 ]
+        then
+            echo "$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
+        fi
+    fi
+}
+
+# Checks if there are commits ahead from remote
+function git_prompt_ahead() {
+  if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+    echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
+  fi
+}
+
+# Formats prompt string for current git commit short SHA
+function git_prompt_short_sha() {
+  SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Formats prompt string for current git commit long SHA
+function git_prompt_long_sha() {
+  SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
+}
+
+# Get the status of the working tree
+git_prompt_status() {
+  INDEX=$(git status --porcelain -b 2> /dev/null)
+  STATUS=""
+  if $(echo "$INDEX" | grep -E '^\?\? ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^A  ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+  elif $(echo "$INDEX" | grep '^M  ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+  elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+  elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^R  ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+  elif $(echo "$INDEX" | grep '^D  ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+  elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
+  fi
+  if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
+  fi
+  if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then
+    STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
+  fi
+  echo $STATUS
+}
+
+#compare the provided version of git to the version installed and on path
+#prints 1 if input version <= installed version
+#prints -1 otherwise
+function git_compare_version() {
+  local INPUT_GIT_VERSION=$1;
+  local INSTALLED_GIT_VERSION
+  INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
+  INSTALLED_GIT_VERSION=($(git --version 2>/dev/null));
+  INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
+
+  for i in {1..3}; do
+    if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
+      echo -1
+      return 0
+    fi
+  done
+  echo 1
+}
+
+#this is unlikely to change so make it all statically assigned
+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
+#clean up the namespace slightly by removing the checker function
+unset -f git_compare_version
+
+

+ 6 - 0
lucid.remote/.oh-my-zsh/lib/grep.zsh

@@ -0,0 +1,6 @@
+#
+# Color grep results
+# Examples: http://rubyurl.com/ZXv
+#
+export GREP_OPTIONS='--color=auto'
+export GREP_COLOR='1;32'

+ 15 - 0
lucid.remote/.oh-my-zsh/lib/history.zsh

@@ -0,0 +1,15 @@
+## Command history configuration
+if [ -z $HISTFILE ]; then
+    HISTFILE=$HOME/.zsh_history
+fi
+HISTSIZE=10000
+SAVEHIST=10000
+
+setopt append_history
+setopt extended_history
+setopt hist_expire_dups_first
+setopt hist_ignore_dups # ignore duplication command history list
+setopt hist_ignore_space
+setopt hist_verify
+setopt inc_append_history
+setopt share_history # share command history data

+ 50 - 0
lucid.remote/.oh-my-zsh/lib/key-bindings.zsh

@@ -0,0 +1,50 @@
+# TODO: Explain what some of this does..
+
+bindkey -e
+bindkey '\ew' kill-region
+bindkey -s '\el' "ls\n"
+bindkey '^r' history-incremental-search-backward
+bindkey "^[[5~" up-line-or-history
+bindkey "^[[6~" down-line-or-history
+
+# make search up and down work, so partially type and hit up/down to find relevant stuff
+bindkey '^[[A' up-line-or-search
+bindkey '^[[B' down-line-or-search
+
+bindkey "^[[H" beginning-of-line
+bindkey "^[[1~" beginning-of-line
+bindkey "^[OH" beginning-of-line
+bindkey "^[[F"  end-of-line
+bindkey "^[[4~" end-of-line
+bindkey "^[OF" end-of-line
+bindkey ' ' magic-space    # also do history expansion on space
+
+bindkey "^[[1;5C" forward-word
+bindkey "^[[1;5D" backward-word
+
+bindkey '^[[Z' reverse-menu-complete
+
+# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
+bindkey '^?' backward-delete-char
+bindkey "^[[3~" delete-char
+bindkey "^[3;5~" delete-char
+bindkey "\e[3~" delete-char
+
+# consider emacs keybindings:
+
+#bindkey -e  ## emacs key bindings
+#
+#bindkey '^[[A' up-line-or-search
+#bindkey '^[[B' down-line-or-search
+#bindkey '^[^[[C' emacs-forward-word
+#bindkey '^[^[[D' emacs-backward-word
+#
+#bindkey -s '^X^Z' '%-^M'
+#bindkey '^[e' expand-cmd-path
+#bindkey '^[^I' reverse-menu-complete
+#bindkey '^X^N' accept-and-infer-next-history
+#bindkey '^W' kill-region
+#bindkey '^I' complete-word
+## Fix weird sequence that rxvt produces
+#bindkey -s '^[[Z' '\t'
+#

+ 15 - 0
lucid.remote/.oh-my-zsh/lib/misc.zsh

@@ -0,0 +1,15 @@
+## smart urls
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+## file rename magick
+bindkey "^[m" copy-prev-shell-word
+
+## jobs
+setopt long_list_jobs
+
+## pager
+export PAGER="less"
+export LESS="-R"
+
+export LC_CTYPE=$LANG

+ 2 - 0
lucid.remote/.oh-my-zsh/lib/rbenv.zsh

@@ -0,0 +1,2 @@
+# using the rbenv plugin will override this with a real implementation
+function rbenv_prompt_info() {}

+ 8 - 0
lucid.remote/.oh-my-zsh/lib/rvm.zsh

@@ -0,0 +1,8 @@
+# get the name of the ruby version
+function rvm_prompt_info() {
+  [ -f $HOME/.rvm/bin/rvm-prompt ] || return
+  local rvm_prompt
+  rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
+  [[ "${rvm_prompt}x" == "x" ]] && return
+  echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
+}

+ 28 - 0
lucid.remote/.oh-my-zsh/lib/spectrum.zsh

@@ -0,0 +1,28 @@
+#! /bin/zsh
+# A script to make using 256 colors in zsh less painful.
+# P.C. Shyamshankar <sykora@lucentbeing.com>
+# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
+
+typeset -Ag FX FG BG
+
+FX=(
+    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%}"
+done
+
+# Show all 256 colors with color number
+function spectrum_ls() {
+  for code in {000..255}; do
+    print -P -- "$code: %F{$code}Test%f"
+  done
+}
+

+ 35 - 0
lucid.remote/.oh-my-zsh/lib/termsupport.zsh

@@ -0,0 +1,35 @@
+#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
+#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
+#Fully support screen, iterm, and probably most modern xterm and rxvt
+#Limited support for Apple Terminal (Terminal can't set window or tab separately)
+function title {
+  if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
+    return
+  fi
+  if [[ "$TERM" == screen* ]]; then
+    print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
+  elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
+    print -Pn "\e]2;$2:q\a" #set window name
+    print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
+  fi
+}
+
+ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
+ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
+
+#Appears when you have the prompt
+function omz_termsupport_precmd {
+  title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
+}
+
+#Appears at the beginning of (and during) of command execution
+function omz_termsupport_preexec {
+  emulate -L zsh
+  setopt extended_glob
+  local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
+  title "$CMD" "%100>...>${2:gs/%/%%}%<<"
+}
+
+autoload -U add-zsh-hook
+add-zsh-hook precmd  omz_termsupport_precmd
+add-zsh-hook preexec omz_termsupport_preexec

+ 42 - 0
lucid.remote/.oh-my-zsh/lib/theme-and-appearance.zsh

@@ -0,0 +1,42 @@
+# ls colors
+autoload colors; colors;
+export LSCOLORS="Gxfxcxdxbxegedabagacad"
+#export LS_COLORS
+
+# Enable ls colors
+if [ "$DISABLE_LS_COLORS" != "true" ]
+then
+  # Find the option for using colors in ls, depending on the version: Linux or BSD
+  if [[ "$(uname -s)" == "NetBSD" ]]; then
+    # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors); 
+    # otherwise, leave ls as is, because NetBSD's ls doesn't support -G
+    gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
+  else
+    ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
+  fi
+fi
+
+#setopt no_beep
+setopt auto_cd
+setopt multios
+setopt cdablevarS
+
+if [[ x$WINDOW != x ]]
+then
+    SCREEN_NO="%B$WINDOW%b "
+else
+    SCREEN_NO=""
+fi
+
+# Apply theming defaults
+PS1="%n@%m:%~%# "
+
+# git theming default: Variables for theming the git info prompt
+ZSH_THEME_GIT_PROMPT_PREFIX="git:("         # Prefix at the very beginning of the prompt, before the branch name
+ZSH_THEME_GIT_PROMPT_SUFFIX=")"             # At the very end of the prompt
+ZSH_THEME_GIT_PROMPT_DIRTY="*"              # Text to display if the branch is dirty
+ZSH_THEME_GIT_PROMPT_CLEAN=""               # Text to display if the branch is clean
+
+# Setup the prompt with pretty colors
+setopt prompt_subst
+

+ 4 - 0
lucid.remote/.oh-my-zsh/log/.easter-egg

@@ -0,0 +1,4 @@
+This file is only here so that Git will keep a log directory as .gitignore is ignoring all the log files within it.
+
+feel free to add love notes for people here.
+

+ 83 - 0
lucid.remote/.oh-my-zsh/oh-my-zsh.sh

@@ -0,0 +1,83 @@
+# Check for updates on initial load...
+if [ "$DISABLE_AUTO_UPDATE" != "true" ]
+then
+  /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
+fi
+
+# Initializes Oh My Zsh
+
+# add a function path
+fpath=($ZSH/functions $ZSH/completions $fpath)
+
+# Load all of the config files in ~/oh-my-zsh that end in .zsh
+# TIP: Add files you don't want in git to .gitignore
+for config_file ($ZSH/lib/*.zsh); do
+  source $config_file
+done
+
+# Set ZSH_CUSTOM to the path where your custom config files
+# and plugins exists, or else we will use the default custom/
+if [[ -z "$ZSH_CUSTOM" ]]; then
+    ZSH_CUSTOM="$ZSH/custom"
+fi
+
+
+is_plugin() {
+  local base_dir=$1
+  local name=$2
+  test -f $base_dir/plugins/$name/$name.plugin.zsh \
+    || test -f $base_dir/plugins/$name/_$name
+}
+# Add all defined plugins to fpath. This must be done
+# before running compinit.
+for plugin ($plugins); do
+  if is_plugin $ZSH_CUSTOM $plugin; then
+    fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
+  elif is_plugin $ZSH $plugin; then
+    fpath=($ZSH/plugins/$plugin $fpath)
+  fi
+done
+
+# Load and run compinit
+autoload -U compinit
+compinit -i
+
+
+# Load all of the plugins that were defined in ~/.zshrc
+for plugin ($plugins); do
+  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
+    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
+  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
+    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+  fi
+done
+
+# Load all of your custom configurations from custom/
+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
+  source $config_file
+done
+unset config_file
+
+# Load the theme
+if [ "$ZSH_THEME" = "random" ]
+then
+  themes=($ZSH/themes/*zsh-theme)
+  N=${#themes[@]}
+  ((N=(RANDOM%N)+1))
+  RANDOM_THEME=${themes[$N]}
+  source "$RANDOM_THEME"
+  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
+else
+  if [ ! "$ZSH_THEME" = ""  ]
+  then
+    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]
+    then
+      source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
+    elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]
+    then
+      source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
+    else
+      source "$ZSH/themes/$ZSH_THEME.zsh-theme"
+    fi
+  fi
+fi

+ 16 - 0
lucid.remote/.oh-my-zsh/plugins/ant/ant.plugin.zsh

@@ -0,0 +1,16 @@
+_ant_does_target_list_need_generating () {
+  [ ! -f .ant_targets ] && return 0;
+  [ .ant_targets -nt build.xml ] && return 0;
+  return 1;
+}
+
+_ant () {
+  if [ -f build.xml ]; then
+    if _ant_does_target_list_need_generating; then
+     sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
+    fi
+    compadd `cat .ant_targets`
+  fi
+}
+
+compdef _ant ant

+ 6 - 0
lucid.remote/.oh-my-zsh/plugins/apache2-macports/apache2-macports.plugin.zsh

@@ -0,0 +1,6 @@
+# commands to control local apache2 server installation
+# paths are for osx installation via macports
+
+alias apache2start='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start'
+alias apache2stop='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop'
+alias apache2restart='sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart'

+ 95 - 0
lucid.remote/.oh-my-zsh/plugins/archlinux/archlinux.plugin.zsh

@@ -0,0 +1,95 @@
+# Archlinux zsh aliases and functions
+# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
+
+# Look for yaourt, and add some useful functions if we have it.
+if [[ -x `which yaourt` ]]; then
+  upgrade () {
+    yaourt -Syu
+  }
+  alias yaconf='yaourt -C'        # Fix all configuration files with vimdiff
+  # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
+  alias yaupg='yaourt -Syua'        # Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system.
+  alias yasu='yaourt --sucre'      # Same as yaupg, but without confirmation
+  alias yain='yaourt -S'           # Install specific package(s) from the repositories
+  alias yains='yaourt -U'          # Install specific package not from the repositories but from a file
+  alias yare='yaourt -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
+  alias yarem='yaourt -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
+  alias yarep='yaourt -Si'         # Display information about a given package in the repositories
+  alias yareps='yaourt -Ss'        # Search for package(s) in the repositories
+  alias yaloc='yaourt -Qi'         # Display information about a given package in the local database
+  alias yalocs='yaourt -Qs'        # Search for package(s) in the local database
+  alias yalst='yaourt -Qe'         # List installed packages, even those installed from AUR (they're tagged as "local")
+  alias yaorph='yaourt -Qtd'       # Remove orphans using yaourt
+  # Additional yaourt alias examples
+  if [[ -x `which abs` ]]; then
+    alias yaupd='yaourt -Sy && sudo abs'   # Update and refresh the local package and ABS databases against repositories
+  else
+    alias yaupd='yaourt -Sy'               # Update and refresh the local package and ABS databases against repositories
+  fi
+  alias yainsd='yaourt -S --asdeps'        # Install given package(s) as dependencies of another package
+  alias yamir='yaourt -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
+else
+ upgrade() {
+   sudo pacman -Syu
+ }
+fi
+
+# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
+alias pacupg='sudo pacman -Syu'        # Synchronize with repositories before upgrading packages that are out of date on the local system.
+alias pacin='sudo pacman -S'           # Install specific package(s) from the repositories
+alias pacins='sudo pacman -U'          # Install specific package not from the repositories but from a file
+alias pacre='sudo pacman -R'           # Remove the specified package(s), retaining its configuration(s) and required dependencies
+alias pacrem='sudo pacman -Rns'        # Remove the specified package(s), its configuration(s) and unneeded dependencies
+alias pacrep='pacman -Si'              # Display information about a given package in the repositories
+alias pacreps='pacman -Ss'             # Search for package(s) in the repositories
+alias pacloc='pacman -Qi'              # Display information about a given package in the local database
+alias paclocs='pacman -Qs'             # Search for package(s) in the local database
+# Additional pacman alias examples
+if [[ -x `which abs` ]]; then
+  alias pacupd='sudo pacman -Sy && sudo abs'     # Update and refresh the local package and ABS databases against repositories
+else
+  alias pacupd='sudo pacman -Sy'     # Update and refresh the local package and ABS databases against repositories
+fi
+alias pacinsd='sudo pacman -S --asdeps'        # Install given package(s) as dependencies of another package
+alias pacmir='sudo pacman -Syy'                # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
+
+# https://bbs.archlinux.org/viewtopic.php?id=93683
+paclist() {
+  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}'
+}
+
+alias paclsorphans='sudo pacman -Qdt'
+alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
+
+pacdisowned() {
+  tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
+  db=$tmp/db
+  fs=$tmp/fs
+
+  mkdir "$tmp"
+  trap  'rm -rf "$tmp"' EXIT
+
+  pacman -Qlq | sort -u > "$db"
+
+  find /bin /etc /lib /sbin /usr \
+      ! -name lost+found \
+        \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
+
+  comm -23 "$fs" "$db"
+}
+
+pacmanallkeys() {
+  # Get all keys for developers and trusted users
+  curl https://www.archlinux.org/{developers,trustedusers}/ |
+  awk -F\" '(/pgp.mit.edu/) {sub(/.*search=0x/,"");print $1}' |
+  xargs sudo pacman-key --recv-keys
+}
+
+pacmansignkeys() {
+  for key in $*; do
+    sudo pacman-key --recv-keys $key
+    sudo pacman-key --lsign-key $key
+    printf 'trust\n3\n' | sudo gpg --homedir /etc/pacman.d/gnupg \
+      --no-permission-warning --command-fd 0 --edit-key $key
+  done
+}

+ 18 - 0
lucid.remote/.oh-my-zsh/plugins/autoenv/autoenv.plugin.zsh

@@ -0,0 +1,18 @@
+# The use_env call below is a reusable command to activate/create a new Python
+# virtualenv, requiring only a single declarative line of code in your .env files.
+# It only performs an action if the requested virtualenv is not the current one.
+use_env() {
+    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
+}

+ 13 - 0
lucid.remote/.oh-my-zsh/plugins/autojump/autojump.plugin.zsh

@@ -0,0 +1,13 @@
+if [ $commands[autojump] ]; then # check if autojump is installed
+  if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
+    . /usr/share/autojump/autojump.zsh
+  elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
+    . /etc/profile.d/autojump.zsh
+  elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
+    . $HOME/.autojump/etc/profile.d/autojump.zsh
+  elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
+    . /opt/local/etc/profile.d/autojump.zsh
+  elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
+    . `brew --prefix`/etc/autojump.zsh
+  fi
+fi

+ 82 - 0
lucid.remote/.oh-my-zsh/plugins/battery/battery.plugin.zsh

@@ -0,0 +1,82 @@
+###########################################
+# Battery plugin for oh-my-zsh            #
+# Original Author: Peter hoeg (peterhoeg) #
+# Email: peter@speartail.com              #
+###########################################
+# Author: Sean Jones (neuralsandwich)     #
+# Email: neuralsandwich@gmail.com         #
+# Modified to add support for Apple Mac   #
+###########################################
+
+if [[ $(uname) == "Darwin" ]] ; then
+
+  function battery_pct() {
+    typeset -F maxcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
+    typeset -F currentcapacity=$(ioreg -rc "AppleSmartBattery"| grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
+    integer i=$(((currentcapacity/maxcapacity) * 100))
+    echo $i
+  }
+  
+  function battery_pct_remaining() {
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+      battery_pct
+    else
+      echo "External Power"
+    fi
+  }
+
+  function battery_time_remaining() {
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+      timeremaining=$(ioreg -rc "AppleSmartBattery"| grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
+      echo "~$((timeremaining / 60)):$((timeremaining % 60))"
+    else
+      echo "โˆž"
+    fi
+  }
+
+  function battery_pct_prompt () {
+    if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
+      b=$(battery_pct_remaining)
+      if [ $b -gt 50 ] ; then
+        color='green'
+      elif [ $b -gt 20 ] ; then
+        color='yellow'
+      else
+        color='red'
+      fi
+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+    else
+      echo "โˆž"
+    fi
+  }
+
+elif [[ $(uname) == "Linux"  ]] ; then
+
+  function battery_pct_remaining() {
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+      echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" 
+    fi
+  }
+
+  function battery_time_remaining() {
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+      echo $(acpi | cut -f3 -d ',')
+    fi
+  }
+
+  function battery_pct_prompt() {
+    b=$(battery_pct_remaining) 
+    if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
+      if [ $b -gt 50 ] ; then
+        color='green'
+      elif [ $b -gt 20 ] ; then
+        color='yellow'
+      else
+        color='red'
+      fi
+      echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
+    else
+      echo "โˆž"
+    fi
+  }
+fi

+ 58 - 0
lucid.remote/.oh-my-zsh/plugins/bower/_bower

@@ -0,0 +1,58 @@
+
+
+# Credits to npm's awesome completion utility.
+#
+# Bower completion script, based on npm completion script.
+
+###-begin-bower-completion-###
+#
+# Installation: bower completion >> ~/.bashrc  (or ~/.zshrc)
+# Or, maybe: bower completion > /usr/local/etc/bash_completion.d/bower
+#
+
+COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
+COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
+export COMP_WORDBREAKS
+
+if type complete &>/dev/null; then
+  _bower_completion () {
+    local si="$IFS"
+    IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
+                           COMP_LINE="$COMP_LINE" \
+                           COMP_POINT="$COMP_POINT" \
+                           bower completion -- "${COMP_WORDS[@]}" \
+                           2>/dev/null)) || return $?
+    IFS="$si"
+  }
+  complete -F _bower_completion bower
+elif type compdef &>/dev/null; then
+  _bower_completion() {
+    si=$IFS
+    compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+                 COMP_LINE=$BUFFER \
+                 COMP_POINT=0 \
+                 bower completion -- "${words[@]}" \
+                 2>/dev/null)
+    IFS=$si
+  }
+  compdef _bower_completion bower
+elif type compctl &>/dev/null; then
+  _bower_completion () {
+    local cword line point words si
+    read -Ac words
+    read -cn cword
+    let cword-=1
+    read -l line
+    read -ln point
+    si="$IFS"
+    IFS=$'\n' reply=($(COMP_CWORD="$cword" \
+                       COMP_LINE="$line" \
+                       COMP_POINT="$point" \
+                       bower completion -- "${words[@]}" \
+                       2>/dev/null)) || return $?
+    IFS="$si"
+  }
+  compctl -K _bower_completion bower
+fi
+###-end-bower-completion-###
+

+ 38 - 0
lucid.remote/.oh-my-zsh/plugins/bower/bower.plugin.zsh

@@ -0,0 +1,38 @@
+alias bi="bower install"
+alias bl="bower list"
+alias bs="bower search"
+
+bower_package_list=''
+
+_bower ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(${=$(bower help | grep help | sed -e 's/,//g')})
+			_describe -t commands 'bower' subcommands
+		;;
+
+		(options)
+			case $line[1] in
+
+				(install)
+				    if [ -z "$bower_package_list" ];then
+                    bower_package_list=$(bower search | awk 'NR > 2' | cut -d '-' -f 2 | cut -d ' ' -f 2 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
+                fi
+				    compadd "$@" $(echo $bower_package_list)
+                ;;
+			esac
+		;;
+	esac
+}
+
+compdef _bower bower

+ 81 - 0
lucid.remote/.oh-my-zsh/plugins/brew/_brew

@@ -0,0 +1,81 @@
+#compdef brew
+#autoload
+
+# imported from the latest homebrew contributions
+
+_brew_all_formulae() {
+  formulae=(`brew search`)
+}
+
+_brew_installed_formulae() {
+  installed_formulae=(`brew list`)
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+  'cat:display formula file for a formula'
+  'cleanup:uninstall unused and old versions of packages'
+  'create:create a new formula'
+  'deps:list dependencies and dependants of a formula'
+  'doctor:audits your installation for common issues'
+  'edit:edit a formula'
+  'home:visit the homepage of a formula or the brew project'
+  'info:information about a formula'
+  'install:install a formula'
+  'link:link a formula'
+  'list:list files in a formula or not-installed formulae'
+  'log:git commit log for a formula'
+  'missing:check all installed formuale for missing dependencies.'
+  'outdated:list formulas for which a newer version is available'
+  'prune:remove dead links'
+  'remove:remove a formula'
+  'search:search for a formula (/regex/ or string)'
+  'server:start a local web app that lets you browse formulae (requires Sinatra)'
+  'unlink:unlink a formula'
+  'update:freshen up links'
+  'upgrade:upgrade outdated formulae'
+  'uses:show formulas which depend on a formula'
+  'versions:show all available formula versions'
+)
+
+local expl
+local -a formulae installed_formulae
+
+_arguments \
+  '(-v)-v[verbose]' \
+  '(--cellar)--cellar[brew cellar]' \
+  '(--config)--config[brew configuration]' \
+  '(--env)--env[brew environment]' \
+  '(--repository)--repository[brew repository]' \
+  '(--version)--version[version information]' \
+  '(--prefix)--prefix[where brew lives on this system]' \
+  '(--cache)--cache[brew cache]' \
+  '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+  _describe -t commands "brew subcommand" _1st_arguments
+  return
+fi
+
+case "$words[1]" in
+  search|-S)
+    _arguments \
+      '(--macports)--macports[search the macports repository]' \
+      '(--fink)--fink[search the fink repository]' ;;
+  list|ls)
+    _arguments \
+      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
+      '(--versions)--versions[list all installed versions of a formula]' \
+      '1: :->forms' &&  return 0
+
+      if [[ "$state" == forms ]]; then
+        _brew_installed_formulae
+        _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae
+      fi ;;
+  install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
+    _brew_all_formulae
+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
+  remove|rm|uninstall|unlink|cleanup|link|ln)
+    _brew_installed_formulae
+    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+esac

+ 1 - 0
lucid.remote/.oh-my-zsh/plugins/brew/brew.plugin.zsh

@@ -0,0 +1 @@
+alias brews='brew list -1'

+ 91 - 0
lucid.remote/.oh-my-zsh/plugins/bundler/_bundler

@@ -0,0 +1,91 @@
+#compdef bundle
+
+local curcontext="$curcontext" state line _gems _opts ret=1
+
+_arguments -C -A "-v" -A "--version" \
+	'(- 1 *)'{-v,--version}'[display version information]' \
+	'1: :->cmds' \
+	'*:: :->args' && ret=0
+
+case $state in
+	cmds)
+		_values "bundle command" \
+			"install[Install the gems specified by the Gemfile or Gemfile.lock]" \
+			"update[Update dependencies to their latest versions]" \
+			"package[Package the .gem files required by your application]" \
+			"exec[Execute a script in the context of the current bundle]" \
+			"config[Specify and read configuration options for bundler]" \
+			"check[Determine whether the requirements for your application are installed]" \
+			"list[Show all of the gems in the current bundle]" \
+			"show[Show the source location of a particular gem in the bundle]" \
+			"console[Start an IRB session in the context of the current bundle]" \
+			"open[Open an installed gem in the editor]" \
+			"viz[Generate a visual representation of your dependencies]" \
+			"init[Generate a simple Gemfile, placed in the current directory]" \
+			"gem[Create a simple gem, suitable for development with bundler]" \
+			"clean[Cleans up unused gems in your bundler directory]" \
+			"help[Describe available tasks or one specific task]"
+		ret=0
+		;;
+	args)
+		case $line[1] in
+			help)
+				_values 'commands' \
+                    'install' \
+                    'update' \
+                    'package' \
+                    'exec' \
+                    'config' \
+                    'check' \
+                    'list' \
+                    'show' \
+                    'console' \
+                    'open' \
+                    'viz' \
+                    'init' \
+                    'gem' \
+                    'help' && ret=0
+				;;
+			install)
+				_arguments \
+					'(--no-color)--no-color[disable colorization in output]' \
+					'(--local)--local[do not attempt to connect to rubygems.org]' \
+					'(--quiet)--quiet[only output warnings and errors]' \
+					'(--gemfile)--gemfile=-[use the specified gemfile instead of Gemfile]:gemfile' \
+					'(--system)--system[install to the system location]' \
+					'(--deployment)--deployment[install using defaults tuned for deployment environments]' \
+					'(--frozen)--frozen[do not allow the Gemfile.lock to be updated after this install]' \
+					'(--path)--path=-[specify a different path than the system default]:path:_files' \
+					'(--binstubs)--binstubs=-[generate bin stubs for bundled gems to ./bin]:directory:_files' \
+					'(--without)--without=-[exclude gems that are part of the specified named group]:groups'
+				ret=0
+				;;
+			exec)
+				_normal && ret=0
+				;;
+			clean)
+				_arguments \
+					'(--force)--force[forces clean even if --path is not set]' \
+					'(--dry-run)--dry-run[only print out changes, do not actually clean gems]' \
+					'(--no-color)--no-color[Disable colorization in output]' \
+					'(--verbose)--verbose[Enable verbose output mode]'
+				ret=0
+				;;
+			(open|show)
+				_gems=( $(bundle show 2> /dev/null | sed -e '/^  \*/!d; s/^  \* \([^ ]*\) .*/\1/') )
+				if [[ $_gems != "" ]]; then
+					_values 'gems' $_gems && ret=0
+				fi
+				;;
+			*)
+				_opts=(  $(bundle help $line[1] | sed -e '/^  \[-/!d; s/^  \[\(-[^=]*\)=.*/\1/') )
+				_opts+=( $(bundle help $line[1] | sed -e '/^  -/!d; s/^  \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
+				if [[ $_opts != "" ]]; then
+					_values 'options' $_opts && ret=0
+				fi
+				;;
+		esac
+		;;
+esac
+
+return ret

+ 44 - 0
lucid.remote/.oh-my-zsh/plugins/bundler/bundler.plugin.zsh

@@ -0,0 +1,44 @@
+alias be="bundle exec"
+alias bi="bundle install"
+alias bl="bundle list"
+alias bp="bundle package"
+alias bo="bundle open"
+alias bu="bundle update"
+
+# The following is based on https://github.com/gma/bundler-exec
+
+bundled_commands=(annotate cap capify cucumber foreman guard jekyll middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork thin thor unicorn unicorn_rails puma)
+
+## Functions
+
+_bundler-installed() {
+  which bundle > /dev/null 2>&1
+}
+
+_within-bundled-project() {
+  local check_dir=$PWD
+  while [ $check_dir != "/" ]; do
+    [ -f "$check_dir/Gemfile" ] && return
+    check_dir="$(dirname $check_dir)"
+  done
+  false
+}
+
+_run-with-bundler() {
+  if _bundler-installed && _within-bundled-project; then
+    bundle exec $@
+  else
+    $@
+  fi
+}
+
+## Main program
+for cmd in $bundled_commands; do
+  eval "function unbundled_$cmd () { $cmd \$@ }"
+  eval "function bundled_$cmd () { _run-with-bundler $cmd \$@}"
+  alias $cmd=bundled_$cmd
+
+  if which _$cmd > /dev/null 2>&1; then
+        compdef _$cmd bundled_$cmd=$cmd
+  fi
+done

+ 13 - 0
lucid.remote/.oh-my-zsh/plugins/bwana/bwana.plugin.zsh

@@ -0,0 +1,13 @@
+#
+# Requires http://www.bruji.com/bwana/
+#
+if [[ -e /Applications/Bwana.app ]] ||
+    ( system_profiler -detailLevel mini SPApplicationsDataType | grep -q Bwana )
+then
+  function man() {
+    open "man:$1"
+  }
+else
+  echo "Bwana lets you read man files in Safari through a man: URI scheme" 
+  echo "To use it within Zsh, install it from http://www.bruji.com/bwana/"
+fi

+ 33 - 0
lucid.remote/.oh-my-zsh/plugins/cake/cake.plugin.zsh

@@ -0,0 +1,33 @@
+# Set this to 1 if you want to cache the tasks
+_cake_cache_task_list=1
+
+# Cache filename
+_cake_task_cache_file='.cake_task_cache'
+
+_cake_get_target_list () {
+	cake | grep '^cake ' | sed -e "s/cake \([^ ]*\) .*/\1/" | grep -v '^$'
+}
+
+_cake_does_target_list_need_generating () {
+
+	if [ ${_cake_cache_task_list} -eq 0 ]; then
+		return 1;
+	fi
+
+	[ ! -f ${_cake_task_cache_file} ] && return 0;
+	[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
+	return 1;
+}
+
+_cake () {
+	if [ -f Cakefile ]; then
+		if _cake_does_target_list_need_generating; then
+			_cake_get_target_list > ${_cake_task_cache_file}
+			compadd `cat ${_cake_task_cache_file}`
+		else
+			compadd `_cake_get_target_list`
+		fi
+	fi
+}
+
+compdef _cake cake

+ 10 - 0
lucid.remote/.oh-my-zsh/plugins/capistrano/_capistrano

@@ -0,0 +1,10 @@
+#compdef cap
+#autoload
+
+if [[ -f config/deploy.rb || -f Capfile ]]; then
+  if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
+    echo "\nGenerating .cap_tasks~..." > /dev/stderr
+    cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
+  fi
+  compadd `cat .cap_tasks~`
+fi

+ 2 - 0
lucid.remote/.oh-my-zsh/plugins/cloudapp/cloudapp.plugin.zsh

@@ -0,0 +1,2 @@
+#!/bin/zsh
+alias cloudapp=$ZSH/plugins/cloudapp/cloudapp.rb

+ 60 - 0
lucid.remote/.oh-my-zsh/plugins/cloudapp/cloudapp.rb

@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+#
+# cloudapp
+# Zach Holman / @holman
+#
+# Uploads a file from the command line to CloudApp, drops it into your 
+# clipboard (on a Mac, at least).
+#
+# Example:
+#
+#   cloudapp drunk-blake.png
+#
+# This requires Aaron Russell's cloudapp_api gem:
+#
+#   gem install cloudapp_api
+#
+# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
+#
+#   email
+#   password
+
+require 'rubygems'
+begin
+  require 'cloudapp_api'
+rescue LoadError
+  puts "You need to install cloudapp_api: gem install cloudapp_api"
+  exit!(1)
+end
+
+config_file = "#{ENV['HOME']}/.cloudapp"
+unless File.exist?(config_file)
+  puts "You need to type your email and password (one per line) into "+
+       "`~/.cloudapp`"
+  exit!(1)
+end
+
+email,password = File.read(config_file).split("\n")
+
+class HTTParty::Response
+  # Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
+  # LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
+  def ok? ; true end
+end
+
+if ARGV[0].nil?
+   puts "You need to specify a file to upload."
+   exit!(1)
+end
+
+CloudApp.authenticate(email,password)
+url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
+
+# Say it for good measure.
+puts "Uploaded to #{url}."
+
+# Get the embed link.
+url = "#{url}/#{ARGV[0].split('/').last}"
+
+# Copy it to your (Mac's) clipboard.
+`echo '#{url}' | tr -d "\n" | pbcopy`

+ 71 - 0
lucid.remote/.oh-my-zsh/plugins/coffee/_coffee

@@ -0,0 +1,71 @@
+#compdef coffee
+# ------------------------------------------------------------------------------
+# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in the
+#       documentation and/or other materials provided with the distribution.
+#     * Neither the name of the zsh-users nor the
+#       names of its contributors may be used to endorse or promote products
+#       derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+#  Completion script for Coffee.js v0.6.11 (http://coffeejs.org)
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+#  * Mario Fernandez (https://github.com/sirech)
+#
+# ------------------------------------------------------------------------------
+
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
+
+_arguments -C \
+  '(- *)'{-h,--help}'[display this help message]' \
+  '(- *)'{-v,--version}'[display the version number]' \
+  '(-b --bare)'{-b,--bare}'[compile without a top-level function wrapper]' \
+  '(-e --eval)'{-e,--eval}'[pass a string from the command line as input]:Inline Script' \
+  '(-i --interactive)'{-i,--interactive}'[run an interactive CoffeeScript REPL]' \
+  '(-j --join)'{-j,--join}'[concatenate the source CoffeeScript before compiling]:Destination JS file:_files -g "*.js"' \
+  '(-l --lint)'{-l,--lint}'[pipe the compiled JavaScript through JavaScript Lint]' \
+  '(--nodejs)--nodejs[pass options directly to the "node" binary]' \
+  '(-c --compile)'{-c,--compile}'[compile to JavaScript and save as .js files]' \
+  '(-o --output)'{-o,--output}'[set the output directory for compiled JavaScript]:Output Directory:_files -/' \
+  '(-n -t -p)'{-n,--nodes}'[print out the parse tree that the parser produces]' \
+  '(-n -t -p)'{-p,--print}'[print out the compiled JavaScript]' \
+  '(-n -t -p)'{-t,--tokens}'[print out the tokens that the lexer/rewriter produce]' \
+  '(-r --require)'{-r,--require}'[require a library before executing your script]:library' \
+  '(-s --stdio)'{-s,--stdio}'[listen for and compile scripts over stdio]' \
+  '(-w --watch)'{-w,--watch}'[watch scripts for changes and rerun commands]' \
+  '*:script or directory:_files' && ret=0
+
+return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et

+ 6 - 0
lucid.remote/.oh-my-zsh/plugins/colemak/colemak-less

@@ -0,0 +1,6 @@
+n    forw-line
+e    back-line
+k    repeat-search
+\ek  repeat-search-all
+K    reverse-search
+\eK  reverse-search-all

+ 22 - 0
lucid.remote/.oh-my-zsh/plugins/colemak/colemak.plugin.zsh

@@ -0,0 +1,22 @@
+# ctrl-j newline
+bindkey '^n' accept-line
+bindkey -a '^n' accept-line
+
+# another rotation to match qwerty
+bindkey -a 'n' down-line-or-history
+bindkey -a 'e' up-line-or-history
+bindkey -a 'i' vi-forward-char
+
+# make qwerty
+bindkey -a 'k' vi-repeat-search
+bindkey -a 'K' vi-rev-repeat-search
+bindkey -a 'u' vi-insert
+bindkey -a 'U' vi-insert-bol
+bindkey -a 'l' vi-undo-change
+bindkey -a 'N' vi-join
+
+# spare
+bindkey -a 'j' vi-forward-word-end
+bindkey -a 'J' vi-forward-blank-word-end
+
+lesskey $ZSH_CUSTOM/plugins/colemak/colemak-less

+ 11 - 0
lucid.remote/.oh-my-zsh/plugins/colored-man/colored-man.plugin.zsh

@@ -0,0 +1,11 @@
+man() {
+      env \
+      	  LESS_TERMCAP_mb=$(printf "\e[1;31m") \
+	  LESS_TERMCAP_md=$(printf "\e[1;31m") \
+	  LESS_TERMCAP_me=$(printf "\e[0m") \
+	  LESS_TERMCAP_se=$(printf "\e[0m") \
+	  LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
+	  LESS_TERMCAP_ue=$(printf "\e[0m") \
+	  LESS_TERMCAP_us=$(printf "\e[1;32m") \
+	  			   man "$@"
+}

+ 28 - 0
lucid.remote/.oh-my-zsh/plugins/colorize/colorize.plugin.zsh

@@ -0,0 +1,28 @@
+# Plugin for highligthing file content
+# Plugin highlights file content based on the filename extension.
+# If no highlighting method supported for given extension then it tries 
+# guess it by looking for file content.
+
+alias colorize='colorize_via_pygmentize'
+
+colorize_via_pygmentize() {
+    if [ ! -x $(which pygmentize) ]; then
+        echo package \'pygmentize\' is not installed!
+        exit -1
+    fi
+
+    if [ $# -eq 0 ]; then
+        pygmentize -g $@
+    fi
+
+    for FNAME in $@
+    do
+        filename=$(basename "$FNAME")
+        lexer=`pygmentize -N \"$filename\"`
+        if [ "Z$lexer" != "Ztext" ]; then
+            pygmentize -l $lexer "$FNAME"
+        else
+            pygmentize -g "$FNAME"
+        fi
+    done
+}

+ 9 - 0
lucid.remote/.oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh

@@ -0,0 +1,9 @@
+# Uses the command-not-found package zsh support
+# as seen in http://www.porcheron.info/command-not-found-for-zsh/
+# this is installed in Ubuntu
+
+[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
+
+# Arch Linux command-not-found support, you must have package pkgfile installed
+# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
+[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh

+ 20 - 0
lucid.remote/.oh-my-zsh/plugins/compleat/compleat.plugin.zsh

@@ -0,0 +1,20 @@
+# ------------------------------------------------------------------------------
+#          FILE:  compleat.plugin.zsh
+#   DESCRIPTION:  oh-my-zsh plugin file.
+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
+#       VERSION:  1.0.0
+# ------------------------------------------------------------------------------
+
+if (( ${+commands[compleat]} )); then
+  local prefix="${commands[compleat]:h:h}"
+  local setup="${prefix}/share/compleat-1.0/compleat_setup" 
+
+  if [[ -f "$setup" ]]; then
+    if ! bashcompinit >/dev/null 2>&1; then
+      autoload -U bashcompinit
+      bashcompinit -i
+    fi
+
+    source "$setup" 
+  fi
+fi

+ 32 - 0
lucid.remote/.oh-my-zsh/plugins/composer/composer.plugin.zsh

@@ -0,0 +1,32 @@
+# ------------------------------------------------------------------------------
+#          FILE:  composer.plugin.zsh
+#   DESCRIPTION:  oh-my-zsh composer plugin file.
+#        AUTHOR:  Daniel Gomes (me@danielcsgomes.com)
+#       VERSION:  1.0.0
+# ------------------------------------------------------------------------------
+
+# Composer basic command completion
+_composer_get_command_list () {
+	composer --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'
+}
+
+_composer () {
+  if [ -f composer.json ]; then
+    compadd `_composer_get_command_list`
+  else
+    compadd create-project init search selfupdate show
+  fi
+}
+
+compdef _composer composer
+
+# Aliases
+alias c='composer'
+alias csu='composer self-update'
+alias cu='composer update'
+alias ci='composer install'
+alias ccp='composer create-project'
+alias cdu='composer dump-autoload'
+
+# install composer in the current directory
+alias cget='curl -s https://getcomposer.org/installer | php'

+ 3 - 0
lucid.remote/.oh-my-zsh/plugins/copydir/copydir.plugin.zsh

@@ -0,0 +1,3 @@
+function copydir {
+  pwd | tr -d "\r\n" | pbcopy
+}

+ 5 - 0
lucid.remote/.oh-my-zsh/plugins/copyfile/copyfile.plugin.zsh

@@ -0,0 +1,5 @@
+function copyfile {
+  [[ "$#" != 1 ]] && return 1
+  local file_to_copy=$1
+  cat $file_to_copy | pbcopy
+}

+ 14 - 0
lucid.remote/.oh-my-zsh/plugins/cp/cp.plugin.zsh

@@ -0,0 +1,14 @@
+#Show progress while file is copying
+
+# Rsync options are:
+#  -p - preserve permissions
+#  -o - preserve owner
+#  -g - preserve group
+#  -h - output in human-readable format
+#  --progress - display progress
+#  -b - instead of just overwriting an existing file, save the original
+#  --backup-dir=/tmp/rsync - move backup copies to "/tmp/rsync"
+#  -e /dev/null - only work on local files
+#  -- - everything after this is an argument, even if it looks like an option
+
+alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"

+ 67 - 0
lucid.remote/.oh-my-zsh/plugins/cpanm/_cpanm

@@ -0,0 +1,67 @@
+#compdef cpanm
+
+##
+# cpanminus Z Shell completion script
+##
+#
+# Current supported cpanm version: 1.4000 (Tue Mar  8 01:00:49 PST 2011)
+#
+# The latest code is always located at:
+#   https://github.com/rshhh/cpanminus/blob/master/etc/_cpanm
+#
+
+local arguments curcontext="$curcontext"
+typeset -A opt_args
+
+
+arguments=(
+
+# Commands
+#  '(--install -i)'{--install,-i}'[Installs the modules]'
+  '(- :)--self-upgrade[Upgrades itself]'
+  '(- :)--info[Displays distribution info on CPAN]'
+  '(--installdeps)--installdeps[Only install dependencies]'
+  '(--look)--look[Download/unpack the distribution and then open the directory with your shell]'
+  '(- :)'{--help,-h}'[Displays help information]'
+  '(- :)'{--version,-V}'[Displays software version]'
+
+# Options
+  {--force,-f}'[Force install]'
+  {--notest,-n}'[Do not run unit tests]'
+  {--sudo,-S}'[sudo to run install commands]'
+  '(-v --verbose --quiet -q)'{--verbose,-v}'[Turns on chatty output]'
+  '(-q --quiet --verbose -v)'{--quiet,-q}'[Turns off all output]'
+  {--local-lib,-l}'[Specify the install base to install modules]'
+  {--local-lib-contained,-L}'[Specify the install base to install all non-core modules]'
+  '--mirror[Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)]:URLs:_urls'
+  '--mirror-only[Use the mirror\''s index file instead of the CPAN Meta DB]'
+  '--prompt[Prompt when configure/build/test fails]'
+  '--reinstall[Reinstall the distribution even if you already have the latest version installed]'
+  '--interactive[Turn on interactive configure]'
+
+  '--scandeps[Scan the depencencies of given modules and output the tree in a text format]'
+  '--format[Specify what format to display the scanned dependency tree]:scandeps format:(tree json yaml dists)'
+
+  '--save-dists[Specify the optional directory path to copy downloaded tarballs]'
+#  '--uninst-shadows[Uninstalls the shadow files of the distribution that you\''re installing]'
+
+  '--auto-cleanup[Number of days that cpanm\''s work directories expire in. Defaults to 7]'
+  '(--no-man-pages)--man-pages[Generates man pages for executables (man1) and libraries (man3)]'
+  '(--man-pages)--no-man-pages[Do not generate man pages]'
+
+
+  # Note: Normally with "--lwp", "--wget" and "--curl" options set to true (which is the default) cpanm tries LWP,
+  #            Wget, cURL and HTTP::Tiny (in that order) and uses the first one available.
+  # (So that the exclusions are not enabled here for the completion)
+  '(--lwp)--lwp[Use LWP module to download stuff]'
+  '(--wget)--wget[Use GNU Wget (if available) to download stuff]'
+  '(--curl)--curl[Use cURL (if available) to download stuff]'
+
+# Other completions
+  '*:Local directory or archive:_files -/ -g "*.(tar.gz|tgz|tar.bz2|zip)(-.)"'
+  #  '*::args: _normal' # this looks for default files (any files)
+)
+_arguments -s $arguments \
+  && return 0
+
+return 1

+ 186 - 0
lucid.remote/.oh-my-zsh/plugins/debian/debian.plugin.zsh

@@ -0,0 +1,186 @@
+# Authors:
+# https://github.com/AlexBio
+# https://github.com/dbb
+#
+# Debian-related zsh aliases and functions for zsh
+
+# Use aptitude if installed, or apt-get if not.
+# You can just set apt_pref='apt-get' to override it.
+if [[ -e $( which aptitude 2>&1 ) ]]; then
+    apt_pref='aptitude'
+else
+    apt_pref='apt-get'
+fi
+
+# Use sudo by default if it's installed
+if [[ -e $( which sudo 2>&1 ) ]]; then
+    use_sudo=1
+fi
+
+# Aliases ###################################################################
+# These are for more obscure uses of apt-get and aptitude that aren't covered
+# below.
+alias ag='apt-get'
+alias ap='aptitude'
+
+# Some self-explanatory aliases
+alias acs="apt-cache search"
+alias aps='aptitude search'
+alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
+		--no-gui --disable-columns search"	# search package
+
+# apt-file
+alias afs='apt-file search --regexp'
+
+
+# These are apt-get only
+alias asrc='apt-get source'
+alias app='apt-cache policy'
+
+# superuser operations ######################################################
+if [[ $use_sudo -eq 1 ]]; then
+# commands using sudo #######
+    alias aac='sudo $apt_pref autoclean'
+    alias abd='sudo $apt_pref build-dep'
+    alias ac='sudo $apt_pref clean'
+    alias ad='sudo $apt_pref update'
+    alias adg='sudo $apt_pref update && sudo $apt_pref upgrade'
+    alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
+    alias afu='sudo apt-file update'
+    alias ag='sudo $apt_pref upgrade'
+    alias ai='sudo $apt_pref install'
+    # Install all packages given on the command line while using only the first word of each line:
+    # acs ... | ail
+    alias ail="sed -e 's/  */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | "' xargs sudo $apt_pref install'
+    alias ap='sudo $apt_pref purge'
+    alias ar='sudo $apt_pref remove'
+
+    # apt-get only
+    alias ads='sudo $apt_pref dselect-upgrade'
+
+    # Install all .deb files in the current directory.
+    # Warning: you will need to put the glob in single quotes if you use:
+    # glob_subst
+    alias dia='sudo dpkg -i ./*.deb'
+    alias di='sudo dpkg -i'
+
+    # Remove ALL kernel images and headers EXCEPT the one in use
+    alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
+        ?not(~n`uname -r`))'
+
+
+# commands using su #########
+else
+    alias aac='su -ls \'$apt_pref autoclean\' root'
+    abd() {
+        cmd="su -lc '$apt_pref build-dep $@' root"
+        print "$cmd"
+        eval "$cmd"
+    }
+    alias ac='su -ls \'$apt_pref clean\' root'
+    alias ad='su -lc \'$apt_pref update\' root'
+    alias adg='su -lc \'$apt_pref update && aptitude safe-upgrade\' root'
+    alias adu='su -lc \'$apt_pref update && aptitude dist-upgrade\' root'
+    alias afu='su -lc "apt-file update"'
+    alias ag='su -lc \'$apt_pref safe-upgrade\' root'
+    ai() {
+        cmd="su -lc 'aptitude -P install $@' root"
+        print "$cmd"
+        eval "$cmd"
+    }
+    ap() {
+        cmd="su -lc '$apt_pref -P purge $@' root"
+        print "$cmd"
+        eval "$cmd"
+    }
+    ar() {
+        cmd="su -lc '$apt_pref -P remove $@' root"
+        print "$cmd"
+        eval "$cmd"
+    }
+
+    # Install all .deb files in the current directory
+    # Assumes glob_subst is off
+    alias dia='su -lc "dpkg -i ./*.deb" root'
+    alias di='su -lc "dpkg -i" root'
+
+    # Remove ALL kernel images and headers EXCEPT the one in use
+    alias kclean='su -lc '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) \
+        ?not(~n`uname -r`))'\'' root'
+fi
+
+
+# Misc. #####################################################################
+# print all installed packages
+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
+
+# Create a basic .deb package
+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
+
+
+# Functions #################################################################
+# create a simple script that can be used to 'duplicate' a system
+apt-copy() {
+    print '#!/bin/sh'"\n" > apt-copy.sh
+
+    cmd='$apt_pref install'
+
+    for p in ${(f)"$(aptitude search -F "%p" --disable-columns \~i)"}; {
+        cmd="${cmd} ${p}"
+    }
+
+    print $cmd "\n" >> apt-copy.sh
+
+    chmod +x apt-copy.sh
+}
+
+# Prints apt history
+# Usage:
+#   apt-history install
+#   apt-history upgrade
+#   apt-history remove
+#   apt-history rollback
+#   apt-history list
+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
+apt-history () {
+  case "$1" in
+    install)
+      zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
+      ;;
+    upgrade|remove)
+      zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
+      ;;
+    rollback)
+      zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
+        grep "$2" -A10000000 | \
+        grep "$3" -B10000000 | \
+        awk '{print $4"="$5}'
+      ;;
+    list)
+      zcat $(ls -rt /var/log/dpkg*)
+      ;;
+    *)
+      echo "Parameters:"
+      echo " install - Lists all packages that have been installed."
+      echo " upgrade - Lists all packages that have been upgraded."
+      echo " remove - Lists all packages that have been removed."
+      echo " rollback - Lists rollback information."
+      echo " list - Lists all contains of dpkg logs."
+      ;;
+  esac
+}
+
+# Kernel-package building shortcut
+kerndeb () {
+    # temporarily unset MAKEFLAGS ( '-j3' will fail )
+    MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
+    print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
+	appendage='-custom' # this shows up in $ (uname -r )
+    revision=$(date +"%Y%m%d") # this shows up in the .deb file name
+
+    make-kpkg clean
+
+    time fakeroot make-kpkg --append-to-version "$appendage" --revision \
+        "$revision" kernel_image kernel_headers
+}
+

+ 10 - 0
lucid.remote/.oh-my-zsh/plugins/dircycle/dircycle.plugin.zsh

@@ -0,0 +1,10 @@
+##
+# dircycle plugin: enables cycling through the directory
+# stack using Ctrl+Shift+Left/Right
+
+eval "insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
+zle -N insert-cycledleft
+bindkey "\e[1;6D" insert-cycledleft
+eval "insert-cycledright () { zle push-line; LBUFFER='pushd -q -0'; zle accept-line }"
+zle -N insert-cycledright
+bindkey "\e[1;6C" insert-cycledright

+ 39 - 0
lucid.remote/.oh-my-zsh/plugins/dirpersist/dirpersist.plugin.zsh

@@ -0,0 +1,39 @@
+#!/bin/zsh
+# 
+# Make the dirstack more persistant
+# 
+# Add dirpersist to $plugins in ~/.zshrc to load
+# 
+
+# $zdirstore is the file used to persist the stack
+zdirstore=~/.zdirstore
+
+dirpersistinstall () {
+    if grep 'dirpersiststore' ~/.zlogout > /dev/null; then
+    else
+        if read -q \?"Would you like to set up your .zlogout file for use with dirspersist? (y/n) "; then
+            echo "# Store dirs stack\n# See $ZSH/plugins/dirspersist.plugin.zsh\ndirpersiststore" >> ~/.zlogout
+        else
+            echo "If you don't want this message to appear, remove dirspersist from \$plugins"
+        fi
+    fi
+}
+
+dirpersiststore () {
+    dirs -p | perl -e 'foreach (reverse <STDIN>) {chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"}' > $zdirstore
+}
+
+dirpersistrestore () {
+    if [ -f $zdirstore ]; then
+        source $zdirstore
+    fi
+}
+
+DIRSTACKSIZE=10
+setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
+
+dirpersistinstall
+dirpersistrestore
+
+# Make popd changes permanent without having to wait for logout
+alias popd="popd;dirpersiststore"

+ 238 - 0
lucid.remote/.oh-my-zsh/plugins/django/django.plugin.zsh

@@ -0,0 +1,238 @@
+#compdef manage.py
+
+typeset -ga nul_args
+nul_args=(
+  '--settings=-[the Python path to a settings module.]:file:_files'
+  '--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
+  '--traceback[print traceback on exception.]'
+  "--version[show program's version number and exit.]"
+  {-h,--help}'[show this help message and exit.]'
+)
+
+_managepy-adminindex(){
+  _arguments -s : \
+    $nul_args \
+    '*::directory:_directories' && ret=0
+}
+
+_managepy-createcachetable(){
+  _arguments -s : \
+    $nul_args && ret=0
+}
+
+_managepy-collectstatic(){
+  _arguments -s : \
+    '--link=-[Create a symbolic link to each file instead of copying.]:' \
+    '--noinput=-[Do NOT prompt the user for input of any kind.]:' \
+    '--no-post-process=-[Do NOT post process collected files.]:' \
+    '--ignore=-[Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more.]:' \
+    '--dry-run=-[Do everything except modify the filesystem.]:' \
+    '--clear=-[Clear the existing files using the storage before trying to copy or link the original file.]:' \
+    '--link=-[Create a symbolic link to each file instead of copying.]:' \
+    '--no-default-ignore=-[Do not ignore the common private glob-style patterns "CVS", ".*" and "*~".]:' \
+    $nul_args && ret=0
+}
+
+_managepy-dbshell(){
+  _arguments -s : \
+    $nul_args && ret=0
+}
+
+_managepy-diffsettings(){
+  _arguments -s : \
+    $nul_args && ret=0
+}
+
+_managepy-dumpdata(){
+  _arguments -s : \
+    '--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
+    '--indent=-[specifies the indent level to use when pretty-printing output.]:' \
+    $nul_args \
+    '*::appname:_applist' && ret=0
+}
+
+_managepy-flush(){
+  _arguments -s : \
+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+    $nul_args && ret=0
+}
+
+_managepy-help(){
+  _arguments -s : \
+    '*:command:_managepy_cmds' \
+    $nul_args && ret=0
+}
+
+_managepy_cmds(){
+    local line
+    local -a cmd
+    _call_program help-command ./manage.py help \
+      |& sed -n '/^ /s/[(), ]/ /gp' \
+      | while read -A line; do cmd=($line $cmd) done
+    _describe -t managepy-command 'manage.py command' cmd
+}
+
+_managepy-inspectdb(){
+  _arguments -s : \
+    $nul_args && ret=0
+}
+
+_managepy-loaddata(){
+  _arguments -s : \
+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+    '*::file:_files' \
+    $nul_args && ret=0
+}
+
+_managepy-reset(){
+  _arguments -s : \
+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+    '*::appname:_applist' \
+    $nul_args && ret=0
+}
+
+_managepy-runfcgi(){
+  local state
+  
+  local fcgi_opts
+  fcgi_opts=(
+    'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
+    'host[hostname to listen on..]:'
+    'port[port to listen on.]:'
+    'socket[UNIX socket to listen on.]::file:_files'
+    'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
+    'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
+    'maxspare[max number of spare processes / threads.]:'
+    'minspare[min number of spare processes / threads.]:'
+    'maxchildren[hard limit number of processes / threads.]:'
+    'daemonize[whether to detach from terminal.]:boolean:(False True)'
+    'pidfile[write the spawned process-id to this file.]:file:_files'
+    'workdir[change to this directory when daemonizing.]:directory:_files'
+    'outlog[write stdout to this file.]:file:_files'
+    'errlog[write stderr to this file.]:file:_files'
+  )
+  
+  _arguments -s : \
+    $nul_args \
+    '*: :_values "FCGI Setting" $fcgi_opts' && ret=0
+}
+
+_managepy-runserver(){
+  _arguments -s : \
+    '--noreload[tells Django to NOT use the auto-reloader.]' \
+    '--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
+    $nul_args && ret=0
+}
+
+_managepy-shell(){
+  _arguments -s : \
+    '--plain[tells Django to use plain Python, not IPython.]' \
+    $nul_args && ret=0
+}
+
+_managepy-sql(){}
+_managepy-sqlall(){}
+_managepy-sqlclear(){}
+_managepy-sqlcustom(){}
+_managepy-sqlflush(){}
+_managepy-sqlindexes(){}
+_managepy-sqlinitialdata(){}
+_managepy-sqlreset(){}
+_managepy-sqlsequencereset(){}
+_managepy-startapp(){}
+
+_managepy-syncdb() {
+  _arguments -s : \
+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+    $nul_args && ret=0
+}
+
+_managepy-test() {
+  _arguments -s : \
+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+    '--noinput[tells Django to NOT prompt the user for input of any kind.]' \
+    '*::appname:_applist' \
+    $nul_args && ret=0
+}
+
+_managepy-testserver() {
+  _arguments -s : \
+    '--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
+    '--addrport=-[port number or ipaddr:port to run the server on.]' \
+    '*::fixture:_files' \
+    $nul_args && ret=0
+}
+
+_managepy-validate() {
+  _arguments -s : \
+    $nul_args && ret=0
+}
+
+_managepy-commands() {
+  local -a commands
+  
+  commands=(
+    'adminindex:prints the admin-index template snippet for the given app name(s).'
+    'createcachetable:creates the table needed to use the SQL cache backend.'
+    'collectstatic:Collect static files in a single location.'
+    'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
+    "diffsettings:displays differences between the current settings.py and Django's default settings."
+    'dumpdata:Output the contents of the database as a fixture of the given format.'
+    'flush:Executes ``sqlflush`` on the current database.'
+    'help:manage.py help.'
+    'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
+    'loaddata:Installs the named fixture(s) in the database.'
+    'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
+    'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
+    'runserver:Starts a lightweight Web server for development.'
+    'shell:Runs a Python interactive interpreter.'
+    'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
+    'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
+    'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
+    'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
+    'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
+    'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
+    "sqlinitialdata:RENAMED: see 'sqlcustom'"
+    'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
+    'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
+    "startapp:Creates a Django app directory structure for the given app name in this project's directory."
+    "syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
+    'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
+    'testserver:Runs a development server with data from the given fixture(s).'
+    'validate:Validates all installed models.'
+  )
+  
+  _describe -t commands 'manage.py command' commands && ret=0
+}
+
+_applist() {
+  local line
+  local -a apps
+  _call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
+                                          bn=op.basename(op.abspath(op.curdir));[sys\\
+                                          .stdout.write(str(re.sub(r'^%s\.(.*?)$' %
+                                          bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
+                                          INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
+                             | while read -A line; do apps=($line $apps) done
+  _values 'Application' $apps && ret=0
+}
+
+_managepy() {
+  local curcontext=$curcontext ret=1
+  
+  if ((CURRENT == 2)); then
+    _managepy-commands
+  else
+    shift words
+    (( CURRENT -- ))
+    curcontext="${curcontext%:*:*}:managepy-$words[1]:"
+    _call_function ret _managepy-$words[1]
+  fi
+}
+
+compdef _managepy manage.py
+compdef _managepy django
+compdef _managepy django-admin.py
+compdef _managepy django-manage

+ 29 - 0
lucid.remote/.oh-my-zsh/plugins/emoji-clock/emoji-clock.plugin.zsh

@@ -0,0 +1,29 @@
+# ------------------------------------------------------------------------------
+#          FILE: emoji-clock.plugin.zsh
+#   DESCRIPTION: The current time with half hour accuracy as an emoji symbol.
+#                Inspired by Andre Torrez' "Put A Burger In Your Shell"
+#                http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
+#        AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
+#       VERSION: 1.0.0
+# -----------------------------------------------------------------------------
+
+function emoji-clock() {
+  hour=$(date '+%I')
+  minutes=$(date '+%M')
+  case $hour in
+    01) clock="๐Ÿ•"; [ $minutes -ge 30 ] && clock="๐Ÿ•œ";;
+    02) clock="๐Ÿ•‘"; [ $minutes -ge 30 ] && clock="๐Ÿ•";;
+    03) clock="๐Ÿ•’"; [ $minutes -ge 30 ] && clock="๐Ÿ•ž";;
+    04) clock="๐Ÿ•“"; [ $minutes -ge 30 ] && clock="๐Ÿ•Ÿ";;
+    05) clock="๐Ÿ•”"; [ $minutes -ge 30 ] && clock="๐Ÿ• ";;
+    06) clock="๐Ÿ••"; [ $minutes -ge 30 ] && clock="๐Ÿ•ก";;
+    07) clock="๐Ÿ•–"; [ $minutes -ge 30 ] && clock="๐Ÿ•ข";;
+    08) clock="๐Ÿ•—"; [ $minutes -ge 30 ] && clock="๐Ÿ•ฃ";;
+    09) clock="๐Ÿ•˜"; [ $minutes -ge 30 ] && clock="๐Ÿ•ค";;
+    10) clock="๐Ÿ•™"; [ $minutes -ge 30 ] && clock="๐Ÿ•ฅ";;
+    11) clock="๐Ÿ•š"; [ $minutes -ge 30 ] && clock="๐Ÿ•ฆ";;
+    12) clock="๐Ÿ•›"; [ $minutes -ge 30 ] && clock="๐Ÿ•ง";;
+     *) clock="โŒ›";;
+  esac
+  echo $clock
+}

+ 4 - 0
lucid.remote/.oh-my-zsh/plugins/encode64/encode64.plugin.zsh

@@ -0,0 +1,4 @@
+encode64(){ echo -n $1 | base64 }
+decode64(){ echo -n $1 | base64 --decode }
+alias e64=encode64
+alias d64=decode64

+ 8 - 0
lucid.remote/.oh-my-zsh/plugins/extract/_extract

@@ -0,0 +1,8 @@
+#compdef extract
+#autoload
+
+_arguments \
+  '(-r --remove)'{-r,--remove}'[Remove archive.]' \
+  "*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
+
+

+ 80 - 0
lucid.remote/.oh-my-zsh/plugins/extract/extract.plugin.zsh

@@ -0,0 +1,80 @@
+# ------------------------------------------------------------------------------
+#          FILE:  extract.plugin.zsh
+#   DESCRIPTION:  oh-my-zsh plugin file.
+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
+#       VERSION:  1.0.1
+# ------------------------------------------------------------------------------
+
+
+function extract() {
+  local remove_archive
+  local success
+  local file_name
+  local extract_dir
+
+  if (( $# == 0 )); then
+    echo "Usage: extract [-option] [file ...]"
+    echo
+    echo Options:
+    echo "    -r, --remove    Remove archive."
+    echo
+    echo "Report bugs to <sorin.ionescu@gmail.com>."
+  fi
+
+  remove_archive=1
+  if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
+    remove_archive=0 
+    shift
+  fi
+
+  while (( $# > 0 )); do
+    if [[ ! -f "$1" ]]; then
+      echo "extract: '$1' is not a valid file" 1>&2
+      shift
+      continue
+    fi
+
+    success=0
+    file_name="$( basename "$1" )"
+    extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
+    case "$1" in
+      (*.tar.gz|*.tgz) tar xvzf "$1" ;;
+      (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
+      (*.tar.xz|*.txz) tar --xz --help &> /dev/null \
+        && tar --xz -xvf "$1" \
+        || xzcat "$1" | tar xvf - ;;
+      (*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
+        && tar --lzma -xvf "$1" \
+        || lzcat "$1" | tar xvf - ;;
+      (*.tar) tar xvf "$1" ;;
+      (*.gz) gunzip "$1" ;;
+      (*.bz2) bunzip2 "$1" ;;
+      (*.xz) unxz "$1" ;;
+      (*.lzma) unlzma "$1" ;;
+      (*.Z) uncompress "$1" ;;
+      (*.zip) unzip "$1" -d $extract_dir ;;
+      (*.rar) unrar x -ad "$1" ;;
+      (*.7z) 7za x "$1" ;;
+      (*.deb)
+        mkdir -p "$extract_dir/control"
+        mkdir -p "$extract_dir/data"
+        cd "$extract_dir"; ar vx "../${1}" > /dev/null
+        cd control; tar xzvf ../control.tar.gz
+        cd ../data; tar xzvf ../data.tar.gz
+        cd ..; rm *.tar.gz debian-binary
+        cd ..
+      ;;
+      (*) 
+        echo "extract: '$1' cannot be extracted" 1>&2
+        success=1 
+      ;; 
+    esac
+
+    (( success = $success > 0 ? $success : $? ))
+    (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
+    shift
+  done
+}
+
+alias x=extract
+

+ 60 - 0
lucid.remote/.oh-my-zsh/plugins/fabric/_fab

@@ -0,0 +1,60 @@
+#compdef fab
+#autoload
+
+local curcontext=$curcontext state line
+declare -A opt_args
+
+declare target_list
+target_list=(`fab --shortlist 2>/dev/null`)
+
+_targets() {
+    _describe -t commands "fabric targets" target_list
+}
+
+output_levels=(
+    'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
+    'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur โ€“ there just wonโ€™t be any output about why Fabric aborted!'
+    'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
+    'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
+    'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
+    'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
+    'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
+)
+
+_arguments -w -S -C \
+  '(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
+  '(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \
+  '(-)--list[print list of possible commands and exit]: :->noargs' \
+  '(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
+  '(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
+  '(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
+  "(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
+  '(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
+  '(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
+  '(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
+  '(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
+  '(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
+  '(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
+  '(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
+  '(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
+  '(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
+  '-i+[path to SSH private key file. May be repeated]: :_files' \
+  "(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
+  '(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
+  '(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
+  '(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
+  '(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
+  '*::: :->subcmds' && return 0
+
+if [[ CURRENT -ge 1 ]]; then
+    case $state in
+        noargs)
+             _message "nothing to complete";;
+        levels)
+            _describe -t commands "output levels" output_levels;;
+        *)
+            _targets;;
+    esac
+
+    return
+fi

+ 1 - 0
lucid.remote/.oh-my-zsh/plugins/fabric/fabric.plugin.zsh

@@ -0,0 +1 @@
+# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete.

+ 6 - 0
lucid.remote/.oh-my-zsh/plugins/fasd/fasd.plugin.zsh

@@ -0,0 +1,6 @@
+if [ $commands[fasd] ]; then # check if fasd is installed
+  eval "$(fasd --init auto)"
+  alias v='f -e vim'
+  alias o='a -e open'
+fi
+

+ 6 - 0
lucid.remote/.oh-my-zsh/plugins/fbterm/fbterm.plugin.zsh

@@ -0,0 +1,6 @@
+# start fbterm automatically in /dev/tty*
+
+if [[ $(tty|grep -o '/dev/tty') = /dev/tty ]] ; then
+	fbterm
+	exit
+fi

+ 44 - 0
lucid.remote/.oh-my-zsh/plugins/forklift/forklift.plugin.zsh

@@ -0,0 +1,44 @@
+# Open folder in ForkLift.app from console
+# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
+#
+# Usage:
+#   fl [<folder>]
+#
+# Opens specified directory or current working directory in ForkLift.app
+#
+# Notes:
+# It assumes Shift+Cmd+G launches go to folder panel and Cmd+N opens new
+# app window.
+#
+# https://gist.github.com/3313481
+function fl {
+  if [ ! -z "$1" ]; then
+    DIR=$1
+    if [ ! -d "$DIR" ]; then
+      DIR=$(dirname $DIR)
+    fi
+    if [ "$DIR" != "." ]; then
+      PWD=`cd "$DIR";pwd`
+    fi
+  fi
+  osascript 2>&1 1>/dev/null <<END
+    tell application "ForkLift"
+      activate
+    end tell
+    tell application "System Events"
+      tell application process "ForkLift"
+        try
+          set topWindow to window 1
+        on error
+          keystroke "n" using command down
+          set topWindow to window 1
+        end try
+        keystroke "g" using {command down, shift down}
+        tell sheet 1 of topWindow
+          set value of text field 1 to "$PWD"
+        	keystroke return
+        end tell
+      end tell
+    end tell
+END
+}

+ 34 - 0
lucid.remote/.oh-my-zsh/plugins/gas/_gas

@@ -0,0 +1,34 @@
+#compdef gas
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+	'(- 1 *)'{-v,--version}'[display version information]' \
+	'(-h|--help)'{-h,--help}'[show help information]' \
+	'1: :->cmds' \
+	'*: :->args' && ret=0
+
+case $state in
+	cmds)
+		cmds=(
+            "version:Prints Gas's version"
+            "use:Uses author"
+            "show:Shows your current user"
+            "list:Lists your authors"
+            "import:Imports current user to gasconfig"
+            "help:Describe available tasks or one specific task"
+            "delete:Deletes author"
+            "add:Adds author to gasconfig"
+        )
+		_describe -t commands 'gas command' cmds && ret=0
+		;;
+	args)
+		case $line[1] in
+			(use|delete)
+				_values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
+				;;
+		esac
+		;;
+esac
+
+return ret

+ 64 - 0
lucid.remote/.oh-my-zsh/plugins/gem/_gem

@@ -0,0 +1,64 @@
+#compdef gem
+#autoload
+
+# gem zsh completion, based on homebrew completion
+
+_gem_installed() {
+  installed_gems=(`gem list --local --no-versions`)
+}
+
+local -a _1st_arguments
+_1st_arguments=(
+  'cert:Manage RubyGems certificates and signing settings'
+  'check:Check installed gems'
+  'cleanup:Clean up old versions of installed gems in the local repository'
+  'contents:Display the contents of the installed gems'
+  'dependency:Show the dependencies of an installed gem'
+  'environment:Display information about the RubyGems environment'
+  'fetch:Download a gem and place it in the current directory'
+  'generate_index:Generates the index files for a gem server directory'
+  'help:Provide help on the `gem` command'
+  'install:Install a gem into the local repository'
+  'list:Display gems whose name starts with STRING'
+  'lock:Generate a lockdown list of gems'
+  'mirror:Mirror a gem repository'
+  'outdated:Display all gems that need updates'
+  'owner:Manage gem owners on RubyGems.org.'
+  'pristine:Restores installed gems to pristine condition from files located in the gem cache'
+  'push:Push a gem up to RubyGems.org'
+  'query:Query gem information in local or remote repositories'
+  'rdoc:Generates RDoc for pre-installed gems'
+  'search:Display all gems whose name contains STRING'
+  'server:Documentation and gem repository HTTP server'
+  'sources:Manage the sources and cache file RubyGems uses to search for gems'
+  'specification:Display gem specification (in yaml)'
+  'stale:List gems along with access times'
+  'uninstall:Uninstall gems from the local repository'
+  'unpack:Unpack an installed gem to the current directory'
+  'update:Update the named gems (or all installed gems) in the local repository'
+  'which:Find the location of a library file you can require'
+)
+
+local expl
+local -a gems installed_gems
+
+_arguments \
+  '(-v --version)'{-v,--version}'[show version]' \
+  '(-h --help)'{-h,--help}'[show help]' \
+  '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+  _describe -t commands "gem subcommand" _1st_arguments
+  return
+fi
+
+case "$words[1]" in
+  list)
+      if [[ "$state" == forms ]]; then
+        _gem_installed
+        _requested installed_gems expl 'installed gems' compadd -a installed_gems
+      fi ;;
+  uninstall|update)
+    _gem_installed
+    _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
+esac

+ 285 - 0
lucid.remote/.oh-my-zsh/plugins/git-extras/git-extras.plugin.zsh

@@ -0,0 +1,285 @@
+#compdef git
+# ------------------------------------------------------------------------------
+# Description
+# -----------
+#
+#  Completion script for git-extras (http://github.com/visionmedia/git-extras).
+#
+# ------------------------------------------------------------------------------
+# Authors
+# -------
+#
+#  * Alexis GRIMALDI (https://github.com/agrimaldi)
+#
+# ------------------------------------------------------------------------------
+# Inspirations
+# -----------
+#
+#  * git-extras (http://github.com/visionmedia/git-extras)
+#  * git-flow-completion (http://github.com/bobthecow/git-flow-completion)
+#
+# ------------------------------------------------------------------------------
+
+
+__git_command_successful () {
+    if (( ${#pipestatus:#0} > 0 )); then
+        _message 'not a git repository'
+        return 1
+    fi
+    return 0
+}
+
+
+__git_tag_names() {
+    local expl
+    declare -a tag_names
+    tag_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
+    __git_command_successful || return
+    _wanted tag-names expl tag-name compadd $* - $tag_names
+}
+
+
+__git_branch_names() {
+    local expl
+    declare -a branch_names
+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+    __git_command_successful || return
+    _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+
+__git_feature_branch_names() {
+    local expl
+    declare -a branch_names
+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/feature 2>/dev/null)"}#refs/heads/feature/})
+    __git_command_successful || return
+    _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+
+__git_refactor_branch_names() {
+    local expl
+    declare -a branch_names
+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/refactor 2>/dev/null)"}#refs/heads/refactor/})
+    __git_command_successful || return
+    _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+
+__git_bug_branch_names() {
+    local expl
+    declare -a branch_names
+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/bug 2>/dev/null)"}#refs/heads/bug/})
+    __git_command_successful || return
+    _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+
+__git_submodule_names() {
+    local expl
+    declare -a submodule_names
+    submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
+    __git_command_successful || return
+    _wanted submodule-names expl submodule-name compadd $* - $submodule_names
+}
+
+
+__git_author_names() {
+    local expl
+    declare -a author_names
+    author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
+    __git_command_successful || return
+    _wanted author-names expl author-name compadd $* - $author_names
+}
+
+
+_git-changelog() {
+    _arguments \
+        '(-l --list)'{-l,--list}'[list commits]' \
+}
+
+
+_git-effort() {
+    _arguments \
+        '--above[ignore file with less than x commits]' \
+}
+
+
+_git-contrib() {
+    _arguments \
+        ':author:__git_author_names'
+}
+
+
+_git-count() {
+    _arguments \
+        '--all[detailed commit count]'
+}
+
+
+_git-delete-branch() {
+    _arguments \
+        ':branch-name:__git_branch_names'
+}
+
+
+_git-delete-submodule() {
+    _arguments \
+        ':submodule-name:__git_submodule_names'
+}
+
+
+_git-delete-tag() {
+    _arguments \
+        ':tag-name:__git_tag_names'
+}
+
+
+_git-extras() {
+    local curcontext=$curcontext state line ret=1
+    declare -A opt_args
+
+    _arguments -C \
+        ': :->command' \
+        '*:: :->option-or-argument' && ret=0
+
+    case $state in
+        (command)
+            declare -a commands
+            commands=(
+                'update:update git-extras'
+            )
+            _describe -t commands command commands && ret=0
+            ;;
+    esac
+
+    _arguments \
+        '(-v --version)'{-v,--version}'[show current version]' \
+}
+
+
+_git-graft() {
+    _arguments \
+        ':src-branch-name:__git_branch_names' \
+        ':dest-branch-name:__git_branch_names'
+}
+
+
+_git-squash() {
+    _arguments \
+        ':branch-name:__git_branch_names'
+}
+
+
+_git-feature() {
+    local curcontext=$curcontext state line ret=1
+    declare -A opt_args
+
+    _arguments -C \
+        ': :->command' \
+        '*:: :->option-or-argument' && ret=0
+
+    case $state in
+        (command)
+            declare -a commands
+            commands=(
+                'finish:merge feature into the current branch'
+            )
+            _describe -t commands command commands && ret=0
+            ;;
+        (option-or-argument)
+            curcontext=${curcontext%:*}-$line[1]:
+            case $line[1] in
+                (finish)
+                    _arguments -C \
+                        ':branch-name:__git_feature_branch_names'
+                    ;;
+            esac
+    esac
+}
+
+
+_git-refactor() {
+    local curcontext=$curcontext state line ret=1
+    declare -A opt_args
+
+    _arguments -C \
+        ': :->command' \
+        '*:: :->option-or-argument' && ret=0
+
+    case $state in
+        (command)
+            declare -a commands
+            commands=(
+                'finish:merge refactor into the current branch'
+            )
+            _describe -t commands command commands && ret=0
+            ;;
+        (option-or-argument)
+            curcontext=${curcontext%:*}-$line[1]:
+            case $line[1] in
+                (finish)
+                    _arguments -C \
+                        ':branch-name:__git_refactor_branch_names'
+                    ;;
+            esac
+    esac
+}
+
+
+_git-bug() {
+    local curcontext=$curcontext state line ret=1
+    declare -A opt_args
+
+    _arguments -C \
+        ': :->command' \
+        '*:: :->option-or-argument' && ret=0
+
+    case $state in
+        (command)
+            declare -a commands
+            commands=(
+                'finish:merge bug into the current branch'
+            )
+            _describe -t commands command commands && ret=0
+            ;;
+        (option-or-argument)
+            curcontext=${curcontext%:*}-$line[1]:
+            case $line[1] in
+                (finish)
+                    _arguments -C \
+                        ':branch-name:__git_bug_branch_names'
+                    ;;
+            esac
+    esac
+}
+
+
+zstyle ':completion:*:*:git:*' user-commands \
+    changelog:'populate changelog file with commits since the previous tag' \
+    contrib:'display author contributions' \
+    count:'count commits' \
+    delete-branch:'delete local and remote branch' \
+    delete-submodule:'delete submodule' \
+    delete-tag:'delete local and remote tag' \
+    extras:'git-extras' \
+    graft:'merge commits from source branch to destination branch' \
+    squash:'merge commits from source branch into the current one as a single commit' \
+    feature:'create a feature branch' \
+    refactor:'create a refactor branch' \
+    bug:'create a bug branch' \
+    summary:'repository summary' \
+    effort:'display effort statistics' \
+    repl:'read-eval-print-loop' \
+    commits-since:'list commits since a given date' \
+    release:'release commit with the given tag' \
+    alias:'define, search and show aliases' \
+    ignore:'add patterns to .gitignore' \
+    info:'show info about the repository' \
+    create-branch:'create local and remote branch' \
+    fresh-branch:'create empty local branch' \
+    undo:'remove the latest commit' \
+    setup:'setup a git repository' \
+    touch:'one step creation of new files' \
+    obliterate:'Completely remove a file from the repository, including past commits and tags' \
+    local-commits:'list unpushed commits on the local branch' \

+ 416 - 0
lucid.remote/.oh-my-zsh/plugins/git-flow-avh/git-flow-avh.plugin.zsh

@@ -0,0 +1,416 @@
+#!zsh
+#
+# Installation
+# ------------
+#
+# To achieve git-flow completion nirvana:
+#
+#  0. Update your zsh's git-completion module to the newest verion.
+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
+#
+#  1. Install this file. Either:
+#
+#     a. Place it in your .zshrc:
+#
+#     b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
+#        your .zshrc:
+#
+#            source ~/.git-flow-completion.zsh
+#
+#     c. Or, use this file as a oh-my-zsh plugin.
+#
+
+_git-flow ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'init:Initialize a new git repo with support for the branching model.'
+				'feature:Manage your feature branches.'
+				'config:Manage your configuration.'
+				'release:Manage your release branches.'
+				'hotfix:Manage your hotfix branches.'
+				'support:Manage your support branches.'
+				'version:Shows version information.'
+			)
+			_describe -t commands 'git flow' subcommands
+		;;
+
+		(options)
+			case $line[1] in
+
+				(init)
+					_arguments \
+						-f'[Force setting of gitflow branches, even if already configured]'
+					;;
+
+					(version)
+					;;
+
+					(hotfix)
+						__git-flow-hotfix
+					;;
+
+					(release)
+						__git-flow-release
+					;;
+
+					(feature)
+						__git-flow-feature
+					;;
+					(config)
+					__git-flow-config
+					;;
+
+			esac
+		;;
+	esac
+}
+
+__git-flow-release ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new release branch.'
+				'finish:Finish a release branch.'
+				'list:List all your release branches. (Alias to `git flow release`)'
+				'publish:Publish release branch to remote.'
+				'track:Checkout remote release branch.'
+				'delet:Delete a release branch.'
+			)
+			_describe -t commands 'git flow release' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':version:__git_flow_version_list'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-s'[Sign the release tag cryptographically]'\
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
+						-m'[Use the given tag message]'\
+						-p'[Push to $ORIGIN after performing finish]'\
+						':version:__git_flow_version_list'
+				;;
+
+				(delete)
+					_arguments \
+						-f'[Force deletion]' \
+						-r'[Delete remote branch]' \
+						':version:__git_flow_version_list'
+				;;
+
+				(publish)
+					_arguments \
+						':version:__git_flow_version_list'
+				;;
+
+				(track)
+					_arguments \
+						':version:__git_flow_version_list'
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-hotfix ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new hotfix branch.'
+				'finish:Finish a hotfix branch.'
+				'delete:Delete a hotfix branch.'
+				'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
+			)
+			_describe -t commands 'git flow hotfix' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':hotfix:__git_flow_version_list'\
+						':branch-name:__git_branch_names'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-s'[Sign the release tag cryptographically]'\
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
+						-m'[Use the given tag message]'\
+						-p'[Push to $ORIGIN after performing finish]'\
+						':hotfix:__git_flow_hotfix_list'
+				;;
+
+				(delete)
+					_arguments \
+						-f'[Force deletion]' \
+						-r'[Delete remote branch]' \
+						':hotfix:__git_flow_hotfix_list'
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-feature ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new feature branch.'
+				'finish:Finish a feature branch.'
+				'delete:Delete a feature branch.'
+				'list:List all your feature branches. (Alias to `git flow feature`)'
+				'publish:Publish feature branch to remote.'
+				'track:Checkout remote feature branch.'
+				'diff:Show all changes.'
+				'rebase:Rebase from integration branch.'
+				'checkout:Checkout local feature branch.'
+				'pull:Pull changes from remote.'
+			)
+			_describe -t commands 'git flow feature' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':feature:__git_flow_feature_list'\
+						':branch-name:__git_branch_names'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-r'[Rebase instead of merge]'\
+						':feature:__git_flow_feature_list'
+				;;
+
+				(delete)
+					_arguments \
+						-f'[Force deletion]' \
+						-r'[Delete remote branch]' \
+						':feature:__git_flow_feature_list'
+				;;
+
+				(publish)
+					_arguments \
+						':feature:__git_flow_feature_list'\
+				;;
+
+				(track)
+					_arguments \
+						':feature:__git_flow_feature_list'\
+				;;
+
+				(diff)
+					_arguments \
+						':branch:__git_branch_names'\
+				;;
+
+				(rebase)
+					_arguments \
+						-i'[Do an interactive rebase]' \
+						':branch:__git_branch_names'
+				;;
+
+				(checkout)
+					_arguments \
+						':branch:__git_flow_feature_list'\
+				;;
+
+				(pull)
+					_arguments \
+						':remote:__git_remotes'\
+						':branch:__git_branch_names'
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-config ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'list:List the configuration. (Alias to `git flow config`)'
+				'set:Set the configuration option'
+			)
+			_describe -t commands 'git flow config' subcommands
+		;;
+
+		(options)
+			case $line[1] in
+
+				(set)
+					_arguments \
+						--local'[Use repository config file]' \
+						--global'[Use global config file]'\
+						--system'[Use system config file]'\
+						--file'[Use given config file]'\
+						':option:(master develop feature hotfix release support	versiontagprefix)'
+				;;
+
+				*)
+					_arguments \
+						--local'[Use repository config file]' \
+						--global'[Use global config file]'\
+						--system'[Use system config file]'\
+						--file'[Use given config file]'
+				;;
+			esac
+		;;
+	esac
+}
+__git_flow_version_list ()
+{
+	local expl
+	declare -a versions
+
+	versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted versions expl 'version' compadd $versions
+}
+
+__git_flow_feature_list ()
+{
+	local expl
+	declare -a features
+
+	features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted features expl 'feature' compadd $features
+}
+
+__git_remotes () {
+	local expl gitdir remotes
+
+	gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
+	__git_command_successful || return
+
+	remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
+	__git_command_successful || return
+
+	# TODO: Should combine the two instead of either or.
+	if (( $#remotes > 0 )); then
+		_wanted remotes expl remote compadd $* - $remotes
+	else
+		_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
+	fi
+}
+
+__git_flow_hotfix_list ()
+{
+	local expl
+	declare -a hotfixes
+
+	hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted hotfixes expl 'hotfix' compadd $hotfixes
+}
+
+__git_branch_names () {
+	local expl
+	declare -a branch_names
+
+	branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+	__git_command_successful || return
+
+	_wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+__git_command_successful () {
+	if (( ${#pipestatus:#0} > 0 )); then
+		_message 'not a git repository'
+		return 1
+	fi
+	return 0
+}
+
+zstyle ':completion:*:*:git:*' user-commands flow:'provide high-level repository operations'

+ 349 - 0
lucid.remote/.oh-my-zsh/plugins/git-flow/git-flow.plugin.zsh

@@ -0,0 +1,349 @@
+#!zsh
+#
+# Installation
+# ------------
+#
+# To achieve git-flow completion nirvana:
+#
+#  0. Update your zsh's git-completion module to the newest verion.
+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
+#
+#  1. Install this file. Either:
+#
+#     a. Place it in your .zshrc:
+#
+#     b. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in
+#        your .zshrc:
+#
+#            source ~/.git-flow-completion.zsh
+#
+#     c. Or, use this file as a oh-my-zsh plugin.
+#
+
+_git-flow ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'init:Initialize a new git repo with support for the branching model.'
+				'feature:Manage your feature branches.'
+				'release:Manage your release branches.'
+				'hotfix:Manage your hotfix branches.'
+				'support:Manage your support branches.'
+				'version:Shows version information.'
+			)
+			_describe -t commands 'git flow' subcommands
+		;;
+
+		(options)
+			case $line[1] in
+
+				(init)
+					_arguments \
+						-f'[Force setting of gitflow branches, even if already configured]'
+					;;
+
+					(version)
+					;;
+
+					(hotfix)
+						__git-flow-hotfix
+					;;
+
+					(release)
+						__git-flow-release
+					;;
+
+					(feature)
+						__git-flow-feature
+					;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-release ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new release branch.'
+				'finish:Finish a release branch.'
+				'list:List all your release branches. (Alias to `git flow release`)'
+				'publish: public'
+				'track: track'
+			)
+			_describe -t commands 'git flow release' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':version:__git_flow_version_list'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-s'[Sign the release tag cryptographically]'\
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
+						-m'[Use the given tag message]'\
+						-p'[Push to $ORIGIN after performing finish]'\
+						-k'[Keep branch after performing finish]'\
+						-n"[Don't tag this release]"\
+						':version:__git_flow_version_list'
+				;;
+
+				(publish)
+					_arguments \
+						':version:__git_flow_version_list'\
+				;;
+
+				(track)
+					_arguments \
+						':version:__git_flow_version_list'\
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-hotfix ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new hotfix branch.'
+				'finish:Finish a hotfix branch.'
+				'list:List all your hotfix branches. (Alias to `git flow hotfix`)'
+			)
+			_describe -t commands 'git flow hotfix' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':hotfix:__git_flow_version_list'\
+						':branch-name:__git_branch_names'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-s'[Sign the release tag cryptographically]'\
+						-u'[Use the given GPG-key for the digital signature (implies -s)]'\
+						-m'[Use the given tag message]'\
+						-p'[Push to $ORIGIN after performing finish]'\
+						-k'[Keep branch after performing finish]'\
+						-n"[Don't tag this release]"\
+						':hotfix:__git_flow_hotfix_list'
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git-flow-feature ()
+{
+	local curcontext="$curcontext" state line
+	typeset -A opt_args
+
+	_arguments -C \
+		':command:->command' \
+		'*::options:->options'
+
+	case $state in
+		(command)
+
+			local -a subcommands
+			subcommands=(
+				'start:Start a new feature branch.'
+				'finish:Finish a feature branch.'
+				'list:List all your feature branches. (Alias to `git flow feature`)'
+				'publish: publish'
+				'track: track'
+				'diff: diff'
+				'rebase: rebase'
+				'checkout: checkout'
+				'pull: pull'
+			)
+			_describe -t commands 'git flow feature' subcommands
+			_arguments \
+				-v'[Verbose (more) output]'
+		;;
+
+		(options)
+			case $line[1] in
+
+				(start)
+					_arguments \
+						-F'[Fetch from origin before performing finish]'\
+						':feature:__git_flow_feature_list'\
+						':branch-name:__git_branch_names'
+				;;
+
+				(finish)
+					_arguments \
+						-F'[Fetch from origin before performing finish]' \
+						-r'[Rebase instead of merge]'\
+						-k'[Keep branch after performing finish]'\
+						':feature:__git_flow_feature_list'
+				;;
+
+				(publish)
+					_arguments \
+						':feature:__git_flow_feature_list'\
+				;;
+
+				(track)
+					_arguments \
+						':feature:__git_flow_feature_list'\
+				;;
+
+				(diff)
+					_arguments \
+						':branch:__git_flow_feature_list'\
+				;;
+
+				(rebase)
+					_arguments \
+						-i'[Do an interactive rebase]' \
+						':branch:__git_flow_feature_list'
+				;;
+
+				(checkout)
+					_arguments \
+						':branch:__git_flow_feature_list'\
+				;;
+
+				(pull)
+					_arguments \
+						':remote:__git_remotes'\
+						':branch:__git_flow_feature_list'
+				;;
+
+				*)
+					_arguments \
+						-v'[Verbose (more) output]'
+				;;
+			esac
+		;;
+	esac
+}
+
+__git_flow_version_list ()
+{
+	local expl
+	declare -a versions
+
+	versions=(${${(f)"$(_call_program versions git flow release list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted versions expl 'version' compadd $versions
+}
+
+__git_flow_feature_list ()
+{
+	local expl
+	declare -a features
+
+	features=(${${(f)"$(_call_program features git flow feature list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted features expl 'feature' compadd $features
+}
+
+__git_remotes () {
+	local expl gitdir remotes
+
+	gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
+	__git_command_successful || return
+
+	remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
+	__git_command_successful || return
+
+	# TODO: Should combine the two instead of either or.
+	if (( $#remotes > 0 )); then
+		_wanted remotes expl remote compadd $* - $remotes
+	else
+		_wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
+	fi
+}
+
+__git_flow_hotfix_list ()
+{
+	local expl
+	declare -a hotfixes
+
+	hotfixes=(${${(f)"$(_call_program hotfixes git flow hotfix list 2> /dev/null | tr -d ' |*')"}})
+	__git_command_successful || return
+
+	_wanted hotfixes expl 'hotfix' compadd $hotfixes
+}
+
+__git_branch_names () {
+	local expl
+	declare -a branch_names
+
+	branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+	__git_command_successful || return
+
+	_wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+__git_command_successful () {
+	if (( ${#pipestatus:#0} > 0 )); then
+		_message 'not a git repository'
+		return 1
+	fi
+	return 0
+}
+
+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'

+ 348 - 0
lucid.remote/.oh-my-zsh/plugins/git-hubflow/git-hubflow.plugin.zsh

@@ -0,0 +1,348 @@
+#!zsh
+#
+# Installation
+# ------------
+#
+# To achieve git-hubflow completion nirvana:
+#
+#  0. Update your zsh's git-completion module to the newest verion.
+#     From here. http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD
+#
+#  1. Install this file. Either:
+#
+#     a. Place it in your .zshrc:
+#
+#     b. Or, copy it somewhere (e.g. ~/.git-hubflow-completion.zsh) and put the following line in
+#        your .zshrc:
+#
+#            source ~/.git-hubflow-completion.zsh
+#
+#     c. Or, use this file as a oh-my-zsh plugin.
+#
+
+_git-hf ()
+{
+    local curcontext="$curcontext" state line
+    typeset -A opt_args
+
+    _arguments -C \
+        ':command:->command' \
+        '*::options:->options'
+
+    case $state in
+        (command)
+
+            local -a subcommands
+            subcommands=(
+                'init:Initialize a new git repo with support for the branching model.'
+                'feature:Manage your feature branches.'
+                'release:Manage your release branches.'
+                'hotfix:Manage your hotfix branches.'
+                'support:Manage your support branches.'
+                'update:Pull upstream changes down into your master and develop branches.'
+                'version:Shows version information.'
+            )
+            _describe -t commands 'git hf' subcommands
+        ;;
+
+        (options)
+            case $line[1] in
+
+                (init)
+                    _arguments \
+                        -f'[Force setting of gitflow branches, even if already configured]'
+                ;;
+
+                (version)
+                ;;
+
+                (hotfix)
+                    __git-hf-hotfix
+                ;;
+
+                (release)
+                    __git-hf-release
+                ;;
+
+                (feature)
+                    __git-hf-feature
+                ;;
+            esac
+        ;;
+    esac
+}
+
+__git-hf-release ()
+{
+    local curcontext="$curcontext" state line
+    typeset -A opt_args
+
+    _arguments -C \
+        ':command:->command' \
+        '*::options:->options'
+
+    case $state in
+        (command)
+
+            local -a subcommands
+            subcommands=(
+                'start:Start a new release branch.'
+                'finish:Finish a release branch.'
+                'list:List all your release branches. (Alias to `git hf release`)'
+                'cancel:Cancel release'
+                'push:Push release to github'
+                'pull:Pull release from github'
+                'track:Track release'
+            )
+            _describe -t commands 'git hf release' subcommands
+            _arguments \
+                -v'[Verbose (more) output]'
+        ;;
+
+        (options)
+            case $line[1] in
+
+                (start)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]'\
+                        ':version:__git_hf_version_list'
+                ;;
+
+                (finish)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]' \
+                        -s'[Sign the release tag cryptographically]'\
+                        -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+                        -m'[Use the given tag message]'\
+                        -p'[Push to $ORIGIN after performing finish]'\
+                        -k'[Keep branch after performing finish]'\
+                        -n"[Don't tag this release]"\
+                        ':version:__git_hf_version_list'
+                ;;
+
+                *)
+                    _arguments \
+                        -v'[Verbose (more) output]'
+                ;;
+            esac
+        ;;
+    esac
+}
+
+__git-hf-hotfix ()
+{
+    local curcontext="$curcontext" state line
+    typeset -A opt_args
+
+    _arguments -C \
+        ':command:->command' \
+        '*::options:->options'
+
+    case $state in
+        (command)
+
+            local -a subcommands
+            subcommands=(
+                'start:Start a new hotfix branch.'
+                'finish:Finish a hotfix branch.'
+                'list:List all your hotfix branches. (Alias to `git hf hotfix`)'
+                'publish:Publish the hotfix branch.'
+                'track:Track the hotfix branch.'
+                'pull:Pull the hotfix from github.'
+                'push:Push the hotfix to github.'
+                'cancel:Cancel the hotfix.'
+            )
+            _describe -t commands 'git hf hotfix' subcommands
+            _arguments \
+                -v'[Verbose (more) output]'
+        ;;
+
+        (options)
+            case $line[1] in
+
+                (start)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]'\
+                        ':hotfix:__git_hf_version_list'\
+                        ':branch-name:__git_branch_names'
+                ;;
+
+                (finish)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]' \
+                        -s'[Sign the release tag cryptographically]'\
+                        -u'[Use the given GPG-key for the digital signature (implies -s)]'\
+                        -m'[Use the given tag message]'\
+                        -p'[Push to $ORIGIN after performing finish]'\
+                        -k'[Keep branch after performing finish]'\
+                        -n"[Don't tag this release]"\
+                        ':hotfix:__git_hf_hotfix_list'
+                ;;
+
+                *)
+                    _arguments \
+                        -v'[Verbose (more) output]'
+                ;;
+            esac
+        ;;
+    esac
+}
+
+__git-hf-feature ()
+{
+    local curcontext="$curcontext" state line
+    typeset -A opt_args
+
+    _arguments -C \
+        ':command:->command' \
+        '*::options:->options'
+
+    case $state in
+        (command)
+
+            local -a subcommands
+            subcommands=(
+                'list:List all your feature branches. (Alias to `git hf feature`)'
+                'start:Start a new feature branch'
+                'finish:Finish a feature branch'
+                'submit:submit'
+                'track:track'
+                'diff:Diff'
+                'rebase:Rebase feature branch against develop'
+                'checkout:Checkout feature'
+                'pull:Pull feature branch from github'
+                'push:Push feature branch to github'
+                'cancel:Cancel feature'
+            )
+            _describe -t commands 'git hf feature' subcommands
+            _arguments \
+                -v'[Verbose (more) output]'
+        ;;
+
+        (options)
+            case $line[1] in
+
+                (start)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]'\
+                        ':feature:__git_hf_feature_list'\
+                        ':branch-name:__git_branch_names'
+                ;;
+
+                (finish)
+                    _arguments \
+                        -F'[Fetch from origin before performing finish]' \
+                        -r'[Rebase instead of merge]'\
+                        ':feature:__git_hf_feature_list'
+                ;;
+
+                (publish)
+                    _arguments \
+                        ':feature:__git_hf_feature_list'\
+                ;;
+
+                (track)
+                    _arguments \
+                        ':feature:__git_hf_feature_list'\
+                ;;
+
+                (diff)
+                    _arguments \
+                        ':branch:__git_branch_names'\
+                ;;
+
+                (rebase)
+                    _arguments \
+                        -i'[Do an interactive rebase]' \
+                        ':branch:__git_branch_names'
+                ;;
+
+                (checkout)
+                    _arguments \
+                        ':branch:__git_hf_feature_list'\
+                ;;
+
+                (pull)
+                    _arguments \
+                        ':remote:__git_remotes'\
+                        ':branch:__git_branch_names'
+                ;;
+
+                *)
+                    _arguments \
+                        -v'[Verbose (more) output]'
+                ;;
+            esac
+        ;;
+    esac
+}
+
+__git_hf_version_list ()
+{
+    local expl
+    declare -a versions
+
+    versions=(${${(f)"$(_call_program versions git hf release list 2> /dev/null | tr -d ' |*')"}})
+    __git_command_successful || return
+
+    _wanted versions expl 'version' compadd $versions
+}
+
+__git_hf_feature_list ()
+{
+    local expl
+    declare -a features
+
+    features=(${${(f)"$(_call_program features git hf feature list 2> /dev/null | tr -d ' |*')"}})
+    __git_command_successful || return
+
+    _wanted features expl 'feature' compadd $features
+}
+
+__git_remotes () {
+    local expl gitdir remotes
+
+    gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
+    __git_command_successful || return
+
+    remotes=(${${(f)"$(_call_program remotes git config --get-regexp '"^remote\..*\.url$"')"}//#(#b)remote.(*).url */$match[1]})
+    __git_command_successful || return
+
+    # TODO: Should combine the two instead of either or.
+    if (( $#remotes > 0 )); then
+        _wanted remotes expl remote compadd $* - $remotes
+    else
+        _wanted remotes expl remote _files $* - -W "($gitdir/remotes)" -g "$gitdir/remotes/*"
+    fi
+}
+
+__git_hf_hotfix_list ()
+{
+    local expl
+    declare -a hotfixes
+
+    hotfixes=(${${(f)"$(_call_program hotfixes git hf hotfix list 2> /dev/null | tr -d ' |*')"}})
+    __git_command_successful || return
+
+    _wanted hotfixes expl 'hotfix' compadd $hotfixes
+}
+
+__git_branch_names () {
+    local expl
+    declare -a branch_names
+
+    branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
+    __git_command_successful || return
+
+    _wanted branch-names expl branch-name compadd $* - $branch_names
+}
+
+__git_command_successful () {
+    if (( ${#pipestatus:#0} > 0 )); then
+        _message 'not a git repository'
+        return 1
+    fi
+    return 0
+}
+
+zstyle ':completion:*:*:git:*' user-commands flow:'description for foo'

+ 19 - 0
lucid.remote/.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

+ 110 - 0
lucid.remote/.oh-my-zsh/plugins/git/git.plugin.zsh

@@ -0,0 +1,110 @@
+# Aliases
+alias g='git'
+compdef g=git
+alias gst='git status'
+compdef _git gst=git-status
+alias gd='git diff'
+compdef _git gd=git-diff
+alias gl='git pull'
+compdef _git gl=git-pull
+alias gup='git pull --rebase'
+compdef _git gup=git-fetch
+alias gp='git push'
+compdef _git gp=git-push
+alias gd='git diff'
+gdv() { git diff -w "$@" | view - }
+compdef _git gdv=git-diff
+alias gc='git commit -v'
+compdef _git gc=git-commit
+alias gc!='git commit -v --amend'
+compdef _git gc!=git-commit
+alias gca='git commit -v -a'
+compdef _git gc=git-commit
+alias gca!='git commit -v -a --amend'
+compdef _git gca!=git-commit
+alias gco='git checkout'
+compdef _git gco=git-checkout
+alias gcm='git checkout master'
+alias gr='git remote'
+compdef _git gr=git-remote
+alias grv='git remote -v'
+compdef _git grv=git-remote
+alias grmv='git remote rename'
+compdef _git grmv=git-remote
+alias grrm='git remote remove'
+compdef _git grrm=git-remote
+alias grset='git remote set-url'
+compdef _git grset=git-remote
+alias grup='git remote update'
+compdef _git grset=git-remote
+alias gb='git branch'
+compdef _git gb=git-branch
+alias gba='git branch -a'
+compdef _git gba=git-branch
+alias gcount='git shortlog -sn'
+compdef gcount=git
+alias gcl='git config --list'
+alias gcp='git cherry-pick'
+compdef _git gcp=git-cherry-pick
+alias glg='git log --stat --max-count=5'
+compdef _git glg=git-log
+alias glgg='git log --graph --max-count=5'
+compdef _git glgg=git-log
+alias glgga='git log --graph --decorate --all'
+compdef _git glgga=git-log
+alias glo='git log --oneline'
+compdef _git glo=git-log
+alias gss='git status -s'
+compdef _git gss=git-status
+alias ga='git add'
+compdef _git ga=git-add
+alias gm='git merge'
+compdef _git gm=git-merge
+alias grh='git reset HEAD'
+alias grhh='git reset HEAD --hard'
+alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
+alias gf='git ls-files | grep'
+alias gpoat='git push origin --all && git push origin --tags'
+
+# Will cd into the top of the current repository
+# or submodule.
+alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
+
+# Git and svn mix
+alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
+compdef git-svn-dcommit-push=git
+
+alias gsr='git svn rebase'
+alias gsd='git svn dcommit'
+#
+# Will return the current branch name
+# Usage example: git pull origin $(current_branch)
+#
+function current_branch() {
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
+  echo ${ref#refs/heads/}
+}
+
+function current_repository() {
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+  ref=$(git rev-parse --short HEAD 2> /dev/null) || return
+  echo $(git remote -v | cut -d':' -f 2)
+}
+
+# these aliases take advantage of the previous function
+alias ggpull='git pull origin $(current_branch)'
+compdef ggpull=git
+alias ggpush='git push origin $(current_branch)'
+compdef ggpush=git
+alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
+compdef ggpnp=git
+
+# Pretty log messages
+function _git_log_prettily(){
+  if ! [ -z $1 ]; then
+    git log --pretty=$1
+  fi
+}
+alias glp="_git_log_prettily"
+compdef _git glp=git-log

+ 87 - 0
lucid.remote/.oh-my-zsh/plugins/gitfast/_git

@@ -0,0 +1,87 @@
+#compdef git gitk
+
+# zsh completion wrapper for git
+#
+# You need git's bash completion script installed somewhere, by default on the
+# same directory as this script.
+#
+# If your script is on ~/.git-completion.sh instead, you can configure it on
+# your ~/.zshrc:
+#
+#  zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
+#
+# The recommended way to install this script is to copy to
+# '~/.zsh/completion/_git', and then add the following to your ~/.zshrc file:
+#
+#  fpath=(~/.zsh/completion $fpath)
+
+complete ()
+{
+	# do nothing
+	return 0
+}
+
+zstyle -s ":completion:*:*:git:*" script script
+test -z "$script" && script="$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
+ZSH_VERSION='' . "$script"
+
+__gitcomp ()
+{
+	emulate -L zsh
+
+	local cur_="${3-$cur}"
+
+	case "$cur_" in
+	--*=)
+		;;
+	*)
+		local c IFS=$' \t\n'
+		local -a array
+		for c in ${=1}; do
+			c="$c${4-}"
+			case $c in
+			--*=*|*.) ;;
+			*) c="$c " ;;
+			esac
+			array+=("$c")
+		done
+		compset -P '*[=:]'
+		compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
+		;;
+	esac
+}
+
+__gitcomp_nl ()
+{
+	emulate -L zsh
+
+	local IFS=$'\n'
+	compset -P '*[=:]'
+	compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
+}
+
+__gitcomp_file ()
+{
+	emulate -L zsh
+
+	local IFS=$'\n'
+	compset -P '*[=:]'
+	compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
+}
+
+_git ()
+{
+	local _ret=1
+	() {
+		emulate -L ksh
+		local cur cword prev
+		cur=${words[CURRENT-1]}
+		prev=${words[CURRENT-2]}
+		let cword=CURRENT-1
+		__${service}_main
+	}
+	let _ret && _default -S '' && _ret=0
+	return _ret
+}
+
+_git

+ 2766 - 0
lucid.remote/.oh-my-zsh/plugins/gitfast/git-completion.bash

@@ -0,0 +1,2766 @@
+#!bash
+#
+# bash/zsh completion support for core Git.
+#
+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
+# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
+# Distributed under the GNU General Public License, version 2.0.
+#
+# The contained completion routines provide support for completing:
+#
+#    *) local and remote branch names
+#    *) local and remote tag names
+#    *) .git/remotes file names
+#    *) git 'subcommands'
+#    *) tree paths within 'ref:path/to/file' expressions
+#    *) file paths within current working directory and index
+#    *) common --long-options
+#
+# To use these routines:
+#
+#    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
+#    2) Add the following line to your .bashrc/.zshrc:
+#        source ~/.git-completion.sh
+#    3) Consider changing your PS1 to also show the current branch,
+#       see git-prompt.sh for details.
+
+case "$COMP_WORDBREAKS" in
+*:*) : great ;;
+*)   COMP_WORDBREAKS="$COMP_WORDBREAKS:"
+esac
+
+# __gitdir accepts 0 or 1 arguments (i.e., location)
+# returns location of .git repo
+__gitdir ()
+{
+	# Note: this function is duplicated in git-prompt.sh
+	# When updating it, make sure you update the other one to match.
+	if [ -z "${1-}" ]; then
+		if [ -n "${__git_dir-}" ]; then
+			echo "$__git_dir"
+		elif [ -n "${GIT_DIR-}" ]; then
+			test -d "${GIT_DIR-}" || return 1
+			echo "$GIT_DIR"
+		elif [ -d .git ]; then
+			echo .git
+		else
+			git rev-parse --git-dir 2>/dev/null
+		fi
+	elif [ -d "$1/.git" ]; then
+		echo "$1/.git"
+	else
+		echo "$1"
+	fi
+}
+
+__gitcomp_1 ()
+{
+	local c IFS=$' \t\n'
+	for c in $1; do
+		c="$c$2"
+		case $c in
+		--*=*|*.) ;;
+		*) c="$c " ;;
+		esac
+		printf '%s\n' "$c"
+	done
+}
+
+# The following function is based on code from:
+#
+#   bash_completion - programmable completion functions for bash 3.2+
+#
+#   Copyright ยฉ 2006-2008, Ian Macdonald <ian@caliban.org>
+#             ยฉ 2009-2010, Bash Completion Maintainers
+#                     <bash-completion-devel@lists.alioth.debian.org>
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software Foundation,
+#   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#   The latest version of this software can be obtained here:
+#
+#   http://bash-completion.alioth.debian.org/
+#
+#   RELEASE: 2.x
+
+# This function can be used to access a tokenized list of words
+# on the command line:
+#
+#	__git_reassemble_comp_words_by_ref '=:'
+#	if test "${words_[cword_-1]}" = -w
+#	then
+#		...
+#	fi
+#
+# The argument should be a collection of characters from the list of
+# word completion separators (COMP_WORDBREAKS) to treat as ordinary
+# characters.
+#
+# This is roughly equivalent to going back in time and setting
+# COMP_WORDBREAKS to exclude those characters.  The intent is to
+# make option types like --date=<type> and <rev>:<path> easy to
+# recognize by treating each shell word as a single token.
+#
+# It is best not to set COMP_WORDBREAKS directly because the value is
+# shared with other completion scripts.  By the time the completion
+# function gets called, COMP_WORDS has already been populated so local
+# changes to COMP_WORDBREAKS have no effect.
+#
+# Output: words_, cword_, cur_.
+
+__git_reassemble_comp_words_by_ref()
+{
+	local exclude i j first
+	# Which word separators to exclude?
+	exclude="${1//[^$COMP_WORDBREAKS]}"
+	cword_=$COMP_CWORD
+	if [ -z "$exclude" ]; then
+		words_=("${COMP_WORDS[@]}")
+		return
+	fi
+	# List of word completion separators has shrunk;
+	# re-assemble words to complete.
+	for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do
+		# Append each nonempty word consisting of just
+		# word separator characters to the current word.
+		first=t
+		while
+			[ $i -gt 0 ] &&
+			[ -n "${COMP_WORDS[$i]}" ] &&
+			# word consists of excluded word separators
+			[ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ]
+		do
+			# Attach to the previous token,
+			# unless the previous token is the command name.
+			if [ $j -ge 2 ] && [ -n "$first" ]; then
+				((j--))
+			fi
+			first=
+			words_[$j]=${words_[j]}${COMP_WORDS[i]}
+			if [ $i = $COMP_CWORD ]; then
+				cword_=$j
+			fi
+			if (($i < ${#COMP_WORDS[@]} - 1)); then
+				((i++))
+			else
+				# Done.
+				return
+			fi
+		done
+		words_[$j]=${words_[j]}${COMP_WORDS[i]}
+		if [ $i = $COMP_CWORD ]; then
+			cword_=$j
+		fi
+	done
+}
+
+if ! type _get_comp_words_by_ref >/dev/null 2>&1; then
+_get_comp_words_by_ref ()
+{
+	local exclude cur_ words_ cword_
+	if [ "$1" = "-n" ]; then
+		exclude=$2
+		shift 2
+	fi
+	__git_reassemble_comp_words_by_ref "$exclude"
+	cur_=${words_[cword_]}
+	while [ $# -gt 0 ]; do
+		case "$1" in
+		cur)
+			cur=$cur_
+			;;
+		prev)
+			prev=${words_[$cword_-1]}
+			;;
+		words)
+			words=("${words_[@]}")
+			;;
+		cword)
+			cword=$cword_
+			;;
+		esac
+		shift
+	done
+}
+fi
+
+# Generates completion reply with compgen, appending a space to possible
+# completion words, if necessary.
+# It accepts 1 to 4 arguments:
+# 1: List of possible completion words.
+# 2: A prefix to be added to each possible completion word (optional).
+# 3: Generate possible completion matches for this word (optional).
+# 4: A suffix to be appended to each possible completion word (optional).
+__gitcomp ()
+{
+	local cur_="${3-$cur}"
+
+	case "$cur_" in
+	--*=)
+		COMPREPLY=()
+		;;
+	*)
+		local IFS=$'\n'
+		COMPREPLY=($(compgen -P "${2-}" \
+			-W "$(__gitcomp_1 "${1-}" "${4-}")" \
+			-- "$cur_"))
+		;;
+	esac
+}
+
+# Generates completion reply with compgen from newline-separated possible
+# completion words by appending a space to all of them.
+# It accepts 1 to 4 arguments:
+# 1: List of possible completion words, separated by a single newline.
+# 2: A prefix to be added to each possible completion word (optional).
+# 3: Generate possible completion matches for this word (optional).
+# 4: A suffix to be appended to each possible completion word instead of
+#    the default space (optional).  If specified but empty, nothing is
+#    appended.
+__gitcomp_nl ()
+{
+	local IFS=$'\n'
+	COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
+}
+
+# Generates completion reply with compgen from newline-separated possible
+# completion filenames.
+# It accepts 1 to 3 arguments:
+# 1: List of possible completion filenames, separated by a single newline.
+# 2: A directory prefix to be added to each possible completion filename
+#    (optional).
+# 3: Generate possible completion matches for this word (optional).
+__gitcomp_file ()
+{
+	local IFS=$'\n'
+
+	# XXX does not work when the directory prefix contains a tilde,
+	# since tilde expansion is not applied.
+	# This means that COMPREPLY will be empty and Bash default
+	# completion will be used.
+	COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}"))
+
+	# Tell Bash that compspec generates filenames.
+	compopt -o filenames 2>/dev/null
+}
+
+__git_index_file_list_filter_compat ()
+{
+	local path
+
+	while read -r path; do
+		case "$path" in
+		?*/*) echo "${path%%/*}/" ;;
+		*) echo "$path" ;;
+		esac
+	done
+}
+
+__git_index_file_list_filter_bash ()
+{
+	local path
+
+	while read -r path; do
+		case "$path" in
+		?*/*)
+			# XXX if we append a slash to directory names when using
+			# `compopt -o filenames`, Bash will append another slash.
+			# This is pretty stupid, and this the reason why we have to
+			# define a compatible version for this function.
+			echo "${path%%/*}" ;;
+		*)
+			echo "$path" ;;
+		esac
+	done
+}
+
+# Process path list returned by "ls-files" and "diff-index --name-only"
+# commands, in order to list only file names relative to a specified
+# directory, and append a slash to directory names.
+__git_index_file_list_filter ()
+{
+	# Default to Bash >= 4.x
+	__git_index_file_list_filter_bash
+}
+
+# Execute git ls-files, returning paths relative to the directory
+# specified in the first argument, and using the options specified in
+# the second argument.
+__git_ls_files_helper ()
+{
+	(
+		test -n "${CDPATH+set}" && unset CDPATH
+		# NOTE: $2 is not quoted in order to support multiple options
+		cd "$1" && git ls-files --exclude-standard $2
+	) 2>/dev/null
+}
+
+
+# Execute git diff-index, returning paths relative to the directory
+# specified in the first argument, and using the tree object id
+# specified in the second argument.
+__git_diff_index_helper ()
+{
+	(
+		test -n "${CDPATH+set}" && unset CDPATH
+		cd "$1" && git diff-index --name-only --relative "$2"
+	) 2>/dev/null
+}
+
+# __git_index_files accepts 1 or 2 arguments:
+# 1: Options to pass to ls-files (required).
+#    Supported options are --cached, --modified, --deleted, --others,
+#    and --directory.
+# 2: A directory path (optional).
+#    If provided, only files within the specified directory are listed.
+#    Sub directories are never recursed.  Path must have a trailing
+#    slash.
+__git_index_files ()
+{
+	local dir="$(__gitdir)" root="${2-.}"
+
+	if [ -d "$dir" ]; then
+		__git_ls_files_helper "$root" "$1" | __git_index_file_list_filter |
+			sort | uniq
+	fi
+}
+
+# __git_diff_index_files accepts 1 or 2 arguments:
+# 1) The id of a tree object.
+# 2) A directory path (optional).
+#    If provided, only files within the specified directory are listed.
+#    Sub directories are never recursed.  Path must have a trailing
+#    slash.
+__git_diff_index_files ()
+{
+	local dir="$(__gitdir)" root="${2-.}"
+
+	if [ -d "$dir" ]; then
+		__git_diff_index_helper "$root" "$1" | __git_index_file_list_filter |
+			sort | uniq
+	fi
+}
+
+__git_heads ()
+{
+	local dir="$(__gitdir)"
+	if [ -d "$dir" ]; then
+		git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
+			refs/heads
+		return
+	fi
+}
+
+__git_tags ()
+{
+	local dir="$(__gitdir)"
+	if [ -d "$dir" ]; then
+		git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
+			refs/tags
+		return
+	fi
+}
+
+# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments
+# presence of 2nd argument means use the guess heuristic employed
+# by checkout for tracking branches
+__git_refs ()
+{
+	local i hash dir="$(__gitdir "${1-}")" track="${2-}"
+	local format refs
+	if [ -d "$dir" ]; then
+		case "$cur" in
+		refs|refs/*)
+			format="refname"
+			refs="${cur%/*}"
+			track=""
+			;;
+		*)
+			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
+				if [ -e "$dir/$i" ]; then echo $i; fi
+			done
+			format="refname:short"
+			refs="refs/tags refs/heads refs/remotes"
+			;;
+		esac
+		git --git-dir="$dir" for-each-ref --format="%($format)" \
+			$refs
+		if [ -n "$track" ]; then
+			# employ the heuristic used by git checkout
+			# Try to find a remote branch that matches the completion word
+			# but only output if the branch name is unique
+			local ref entry
+			git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \
+				"refs/remotes/" | \
+			while read -r entry; do
+				eval "$entry"
+				ref="${ref#*/}"
+				if [[ "$ref" == "$cur"* ]]; then
+					echo "$ref"
+				fi
+			done | sort | uniq -u
+		fi
+		return
+	fi
+	case "$cur" in
+	refs|refs/*)
+		git ls-remote "$dir" "$cur*" 2>/dev/null | \
+		while read -r hash i; do
+			case "$i" in
+			*^{}) ;;
+			*) echo "$i" ;;
+			esac
+		done
+		;;
+	*)
+		git ls-remote "$dir" HEAD ORIG_HEAD 'refs/tags/*' 'refs/heads/*' 'refs/remotes/*' 2>/dev/null | \
+		while read -r hash i; do
+			case "$i" in
+			*^{}) ;;
+			refs/*) echo "${i#refs/*/}" ;;
+			*) echo "$i" ;;
+			esac
+		done
+		;;
+	esac
+}
+
+# __git_refs2 requires 1 argument (to pass to __git_refs)
+__git_refs2 ()
+{
+	local i
+	for i in $(__git_refs "$1"); do
+		echo "$i:$i"
+	done
+}
+
+# __git_refs_remotes requires 1 argument (to pass to ls-remote)
+__git_refs_remotes ()
+{
+	local i hash
+	git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \
+	while read -r hash i; do
+		echo "$i:refs/remotes/$1/${i#refs/heads/}"
+	done
+}
+
+__git_remotes ()
+{
+	local i IFS=$'\n' d="$(__gitdir)"
+	test -d "$d/remotes" && ls -1 "$d/remotes"
+	for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do
+		i="${i#remote.}"
+		echo "${i/.url*/}"
+	done
+}
+
+__git_list_merge_strategies ()
+{
+	git merge -s help 2>&1 |
+	sed -n -e '/[Aa]vailable strategies are: /,/^$/{
+		s/\.$//
+		s/.*://
+		s/^[ 	]*//
+		s/[ 	]*$//
+		p
+	}'
+}
+
+__git_merge_strategies=
+# 'git merge -s help' (and thus detection of the merge strategy
+# list) fails, unfortunately, if run outside of any git working
+# tree.  __git_merge_strategies is set to the empty string in
+# that case, and the detection will be repeated the next time it
+# is needed.
+__git_compute_merge_strategies ()
+{
+	test -n "$__git_merge_strategies" ||
+	__git_merge_strategies=$(__git_list_merge_strategies)
+}
+
+__git_complete_revlist_file ()
+{
+	local pfx ls ref cur_="$cur"
+	case "$cur_" in
+	*..?*:*)
+		return
+		;;
+	?*:*)
+		ref="${cur_%%:*}"
+		cur_="${cur_#*:}"
+		case "$cur_" in
+		?*/*)
+			pfx="${cur_%/*}"
+			cur_="${cur_##*/}"
+			ls="$ref:$pfx"
+			pfx="$pfx/"
+			;;
+		*)
+			ls="$ref"
+			;;
+		esac
+
+		case "$COMP_WORDBREAKS" in
+		*:*) : great ;;
+		*)   pfx="$ref:$pfx" ;;
+		esac
+
+		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \
+				| sed '/^100... blob /{
+				           s,^.*	,,
+				           s,$, ,
+				       }
+				       /^120000 blob /{
+				           s,^.*	,,
+				           s,$, ,
+				       }
+				       /^040000 tree /{
+				           s,^.*	,,
+				           s,$,/,
+				       }
+				       s/^.*	//')" \
+			"$pfx" "$cur_" ""
+		;;
+	*...*)
+		pfx="${cur_%...*}..."
+		cur_="${cur_#*...}"
+		__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
+		;;
+	*..*)
+		pfx="${cur_%..*}.."
+		cur_="${cur_#*..}"
+		__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
+		;;
+	*)
+		__gitcomp_nl "$(__git_refs)"
+		;;
+	esac
+}
+
+
+# __git_complete_index_file requires 1 argument: the options to pass to
+# ls-file
+__git_complete_index_file ()
+{
+	local pfx cur_="$cur"
+
+	case "$cur_" in
+	?*/*)
+		pfx="${cur_%/*}"
+		cur_="${cur_##*/}"
+		pfx="${pfx}/"
+
+		__gitcomp_file "$(__git_index_files "$1" "$pfx")" "$pfx" "$cur_"
+		;;
+	*)
+		__gitcomp_file "$(__git_index_files "$1")" "" "$cur_"
+		;;
+	esac
+}
+
+# __git_complete_diff_index_file requires 1 argument: the id of a tree
+# object
+__git_complete_diff_index_file ()
+{
+	local pfx cur_="$cur"
+
+	case "$cur_" in
+	?*/*)
+		pfx="${cur_%/*}"
+		cur_="${cur_##*/}"
+		pfx="${pfx}/"
+
+		__gitcomp_file "$(__git_diff_index_files "$1" "$pfx")" "$pfx" "$cur_"
+		;;
+	*)
+		__gitcomp_file "$(__git_diff_index_files "$1")" "" "$cur_"
+		;;
+	esac
+}
+
+__git_complete_file ()
+{
+	__git_complete_revlist_file
+}
+
+__git_complete_revlist ()
+{
+	__git_complete_revlist_file
+}
+
+__git_complete_remote_or_refspec ()
+{
+	local cur_="$cur" cmd="${words[1]}"
+	local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0
+	if [ "$cmd" = "remote" ]; then
+		((c++))
+	fi
+	while [ $c -lt $cword ]; do
+		i="${words[c]}"
+		case "$i" in
+		--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
+		--all)
+			case "$cmd" in
+			push) no_complete_refspec=1 ;;
+			fetch)
+				COMPREPLY=()
+				return
+				;;
+			*) ;;
+			esac
+			;;
+		-*) ;;
+		*) remote="$i"; break ;;
+		esac
+		((c++))
+	done
+	if [ -z "$remote" ]; then
+		__gitcomp_nl "$(__git_remotes)"
+		return
+	fi
+	if [ $no_complete_refspec = 1 ]; then
+		COMPREPLY=()
+		return
+	fi
+	[ "$remote" = "." ] && remote=
+	case "$cur_" in
+	*:*)
+		case "$COMP_WORDBREAKS" in
+		*:*) : great ;;
+		*)   pfx="${cur_%%:*}:" ;;
+		esac
+		cur_="${cur_#*:}"
+		lhs=0
+		;;
+	+*)
+		pfx="+"
+		cur_="${cur_#+}"
+		;;
+	esac
+	case "$cmd" in
+	fetch)
+		if [ $lhs = 1 ]; then
+			__gitcomp_nl "$(__git_refs2 "$remote")" "$pfx" "$cur_"
+		else
+			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
+		fi
+		;;
+	pull|remote)
+		if [ $lhs = 1 ]; then
+			__gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_"
+		else
+			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
+		fi
+		;;
+	push)
+		if [ $lhs = 1 ]; then
+			__gitcomp_nl "$(__git_refs)" "$pfx" "$cur_"
+		else
+			__gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_"
+		fi
+		;;
+	esac
+}
+
+__git_complete_strategy ()
+{
+	__git_compute_merge_strategies
+	case "$prev" in
+	-s|--strategy)
+		__gitcomp "$__git_merge_strategies"
+		return 0
+	esac
+	case "$cur" in
+	--strategy=*)
+		__gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}"
+		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-ref-format) : plumbing;;
+		checkout-index)   : plumbing;;
+		commit-tree)      : plumbing;;
+		count-objects)    : infrequent;;
+		credential-cache) : credentials helper;;
+		credential-store) : 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;;
+		lost-found)       : infrequent;;
+		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;;
+		peek-remote)      : plumbing;;
+		prune)            : plumbing;;
+		prune-packed)     : plumbing;;
+		quiltimport)      : import;;
+		read-tree)        : plumbing;;
+		receive-pack)     : plumbing;;
+		remote-*)         : transport;;
+		repo-config)      : deprecated;;
+		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;;
+		tar-tree)         : deprecated;;
+		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 ()
+{
+	__git_compute_all_commands
+	test -n "$__git_porcelain_commands" ||
+	__git_porcelain_commands=$(__git_list_porcelain_commands)
+}
+
+__git_pretty_aliases ()
+{
+	local i IFS=$'\n'
+	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do
+		case "$i" in
+		pretty.*)
+			i="${i#pretty.}"
+			echo "${i/ */}"
+			;;
+		esac
+	done
+}
+
+__git_aliases ()
+{
+	local i IFS=$'\n'
+	for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do
+		case "$i" in
+		alias.*)
+			i="${i#alias.}"
+			echo "${i/ */}"
+			;;
+		esac
+	done
+}
+
+# __git_aliased_command requires 1 argument
+__git_aliased_command ()
+{
+	local word cmdline=$(git --git-dir="$(__gitdir)" \
+		config --get "alias.$1")
+	for word in $cmdline; do
+		case "$word" in
+		\!gitk|gitk)
+			echo "gitk"
+			return
+			;;
+		\!*)	: shell command alias ;;
+		-*)	: option ;;
+		*=*)	: setting env ;;
+		git)	: git itself ;;
+		*)
+			echo "$word"
+			return
+		esac
+	done
+}
+
+# __git_find_on_cmdline requires 1 argument
+__git_find_on_cmdline ()
+{
+	local word subcommand c=1
+	while [ $c -lt $cword ]; do
+		word="${words[c]}"
+		for subcommand in $1; do
+			if [ "$subcommand" = "$word" ]; then
+				echo "$subcommand"
+				return
+			fi
+		done
+		((c++))
+	done
+}
+
+__git_has_doubledash ()
+{
+	local c=1
+	while [ $c -lt $cword ]; do
+		if [ "--" = "${words[c]}" ]; then
+			return 0
+		fi
+		((c++))
+	done
+	return 1
+}
+
+# Try to count non option arguments passed on the command line for the
+# specified git command.
+# When options are used, it is necessary to use the special -- option to
+# tell the implementation were non option arguments begin.
+# XXX this can not be improved, since options can appear everywhere, as
+# an example:
+#	git mv x -n y
+#
+# __git_count_arguments requires 1 argument: the git command executed.
+__git_count_arguments ()
+{
+	local word i c=0
+
+	# Skip "git" (first argument)
+	for ((i=1; i < ${#words[@]}; i++)); do
+		word="${words[i]}"
+
+		case "$word" in
+			--)
+				# Good; we can assume that the following are only non
+				# option arguments.
+				((c = 0))
+				;;
+			"$1")
+				# Skip the specified git command and discard git
+				# main options
+				((c = 0))
+				;;
+			?*)
+				((c++))
+				;;
+		esac
+	done
+
+	printf "%d" $c
+}
+
+__git_whitespacelist="nowarn warn error error-all fix"
+
+_git_am ()
+{
+	local dir="$(__gitdir)"
+	if [ -d "$dir"/rebase-apply ]; then
+		__gitcomp "--skip --continue --resolved --abort"
+		return
+	fi
+	case "$cur" in
+	--whitespace=*)
+		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--3way --committer-date-is-author-date --ignore-date
+			--ignore-whitespace --ignore-space-change
+			--interactive --keep --no-utf8 --signoff --utf8
+			--whitespace= --scissors
+			"
+		return
+	esac
+	COMPREPLY=()
+}
+
+_git_apply ()
+{
+	case "$cur" in
+	--whitespace=*)
+		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
+		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
+			"
+		return
+	esac
+	COMPREPLY=()
+}
+
+_git_add ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--interactive --refresh --patch --update --dry-run
+			--ignore-errors --intent-to-add
+			"
+		return
+	esac
+
+	# XXX should we check for --update and --all options ?
+	__git_complete_index_file "--others --modified"
+}
+
+_git_archive ()
+{
+	case "$cur" in
+	--format=*)
+		__gitcomp "$(git archive --list)" "" "${cur##--format=}"
+		return
+		;;
+	--remote=*)
+		__gitcomp_nl "$(__git_remotes)" "" "${cur##--remote=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--format= --list --verbose
+			--prefix= --remote= --exec=
+			"
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
+_git_bisect ()
+{
+	__git_has_doubledash && return
+
+	local subcommands="start bad good skip reset visualize replay log run"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if [ -z "$subcommand" ]; then
+		if [ -f "$(__gitdir)"/BISECT_START ]; then
+			__gitcomp "$subcommands"
+		else
+			__gitcomp "replay start"
+		fi
+		return
+	fi
+
+	case "$subcommand" in
+	bad|good|reset|skip|start)
+		__gitcomp_nl "$(__git_refs)"
+		;;
+	*)
+		COMPREPLY=()
+		;;
+	esac
+}
+
+_git_branch ()
+{
+	local i c=1 only_local_ref="n" has_r="n"
+
+	while [ $c -lt $cword ]; do
+		i="${words[c]}"
+		case "$i" in
+		-d|-m)	only_local_ref="y" ;;
+		-r)	has_r="y" ;;
+		esac
+		((c++))
+	done
+
+	case "$cur" in
+	--set-upstream-to=*)
+		__gitcomp "$(__git_refs)" "" "${cur##--set-upstream-to=}"
+		;;
+	--*)
+		__gitcomp "
+			--color --no-color --verbose --abbrev= --no-abbrev
+			--track --no-track --contains --merged --no-merged
+			--set-upstream-to= --edit-description --list
+			--unset-upstream
+			"
+		;;
+	*)
+		if [ $only_local_ref = "y" -a $has_r = "n" ]; then
+			__gitcomp_nl "$(__git_heads)"
+		else
+			__gitcomp_nl "$(__git_refs)"
+		fi
+		;;
+	esac
+}
+
+_git_bundle ()
+{
+	local cmd="${words[2]}"
+	case "$cword" in
+	2)
+		__gitcomp "create list-heads verify unbundle"
+		;;
+	3)
+		# looking for a file
+		;;
+	*)
+		case "$cmd" in
+			create)
+				__git_complete_revlist
+			;;
+		esac
+		;;
+	esac
+}
+
+_git_checkout ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--conflict=*)
+		__gitcomp "diff3 merge" "" "${cur##--conflict=}"
+		;;
+	--*)
+		__gitcomp "
+			--quiet --ours --theirs --track --no-track --merge
+			--conflict= --orphan --patch
+			"
+		;;
+	*)
+		# check if --track, --no-track, or --no-guess was specified
+		# if so, disable DWIM mode
+		local flags="--track --no-track --no-guess" track=1
+		if [ -n "$(__git_find_on_cmdline "$flags")" ]; then
+			track=''
+		fi
+		__gitcomp_nl "$(__git_refs '' $track)"
+		;;
+	esac
+}
+
+_git_cherry ()
+{
+	__gitcomp "$(__git_refs)"
+}
+
+_git_cherry_pick ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--edit --no-commit"
+		;;
+	*)
+		__gitcomp_nl "$(__git_refs)"
+		;;
+	esac
+}
+
+_git_clean ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--dry-run --quiet"
+		return
+		;;
+	esac
+
+	# XXX should we check for -x option ?
+	__git_complete_index_file "--others"
+}
+
+_git_clone ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--local
+			--no-hardlinks
+			--shared
+			--reference
+			--quiet
+			--no-checkout
+			--bare
+			--mirror
+			--origin
+			--upload-pack
+			--template=
+			--depth
+			--single-branch
+			--branch
+			"
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
+_git_commit ()
+{
+	case "$prev" in
+	-c|-C)
+		__gitcomp_nl "$(__git_refs)" "" "${cur}"
+		return
+		;;
+	esac
+
+	case "$prev" in
+	-c|-C)
+		__gitcomp_nl "$(__git_refs)" "" "${cur}"
+		return
+		;;
+	esac
+
+	case "$cur" in
+	--cleanup=*)
+		__gitcomp "default strip verbatim whitespace
+			" "" "${cur##--cleanup=}"
+		return
+		;;
+	--reuse-message=*|--reedit-message=*|\
+	--fixup=*|--squash=*)
+		__gitcomp_nl "$(__git_refs)" "" "${cur#*=}"
+		return
+		;;
+	--untracked-files=*)
+		__gitcomp "all no normal" "" "${cur##--untracked-files=}"
+		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=
+			"
+		return
+	esac
+
+	if git rev-parse --verify --quiet HEAD >/dev/null; then
+		__git_complete_diff_index_file "HEAD"
+	else
+		# This is the first commit
+		__git_complete_index_file "--cached"
+	fi
+}
+
+_git_describe ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--all --tags --contains --abbrev= --candidates=
+			--exact-match --debug --long --match --always
+			"
+		return
+	esac
+	__gitcomp_nl "$(__git_refs)"
+}
+
+__git_diff_algorithms="myers minimal patience histogram"
+
+__git_diff_common_options="--stat --numstat --shortstat --summary
+			--patch-with-stat --name-only --name-status --color
+			--no-color --color-words --no-renames --check
+			--full-index --binary --abbrev --diff-filter=
+			--find-copies-harder
+			--text --ignore-space-at-eol --ignore-space-change
+			--ignore-all-space --exit-code --quiet --ext-diff
+			--no-ext-diff
+			--no-prefix --src-prefix= --dst-prefix=
+			--inter-hunk-context=
+			--patience --histogram --minimal
+			--raw
+			--dirstat --dirstat= --dirstat-by-file
+			--dirstat-by-file= --cumulative
+			--diff-algorithm=
+"
+
+_git_diff ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--diff-algorithm=*)
+		__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
+		return
+		;;
+	--*)
+		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
+			--base --ours --theirs --no-index
+			$__git_diff_common_options
+			"
+		return
+		;;
+	esac
+	__git_complete_revlist_file
+}
+
+__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
+			tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
+"
+
+_git_difftool ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--tool=*)
+		__gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
+		return
+		;;
+	--*)
+		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
+			--base --ours --theirs
+			--no-renames --diff-filter= --find-copies-harder
+			--relative --ignore-submodules
+			--tool="
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
+__git_fetch_options="
+	--quiet --verbose --append --upload-pack --force --keep --depth=
+	--tags --no-tags --all --prune --dry-run
+"
+
+_git_fetch ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "$__git_fetch_options"
+		return
+		;;
+	esac
+	__git_complete_remote_or_refspec
+}
+
+__git_format_patch_options="
+	--stdout --attach --no-attach --thread --thread= --output-directory
+	--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=
+"
+
+_git_format_patch ()
+{
+	case "$cur" in
+	--thread=*)
+		__gitcomp "
+			deep shallow
+			" "" "${cur##--thread=}"
+		return
+		;;
+	--*)
+		__gitcomp "$__git_format_patch_options"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+_git_fsck ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--tags --root --unreachable --cache --no-reflogs --full
+			--strict --verbose --lost-found
+			"
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
+_git_gc ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--prune --aggressive"
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
+_git_gitk ()
+{
+	_gitk
+}
+
+__git_match_ctag() {
+	awk "/^${1////\\/}/ { print \$1 }" "$2"
+}
+
+_git_grep ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--cached
+			--text --ignore-case --word-regexp --invert-match
+			--full-name --line-number
+			--extended-regexp --basic-regexp --fixed-strings
+			--perl-regexp
+			--files-with-matches --name-only
+			--files-without-match
+			--max-depth
+			--count
+			--and --or --not --all-match
+			"
+		return
+		;;
+	esac
+
+	case "$cword,$prev" in
+	2,*|*,-*)
+		if test -r tags; then
+			__gitcomp_nl "$(__git_match_ctag "$cur" tags)"
+			return
+		fi
+		;;
+	esac
+
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_help ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--all --info --man --web"
+		return
+		;;
+	esac
+	__git_compute_all_commands
+	__gitcomp "$__git_all_commands $(__git_aliases)
+		attributes cli core-tutorial cvs-migration
+		diffcore gitk glossary hooks ignore modules
+		namespaces repository-layout tutorial tutorial-2
+		workflows
+		"
+}
+
+_git_init ()
+{
+	case "$cur" in
+	--shared=*)
+		__gitcomp "
+			false true umask group all world everybody
+			" "" "${cur##--shared=}"
+		return
+		;;
+	--*)
+		__gitcomp "--quiet --bare --template= --shared --shared="
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
+_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
+			"
+		return
+		;;
+	esac
+
+	# XXX ignore options like --modified and always suggest all cached
+	# files.
+	__git_complete_index_file "--cached"
+}
+
+_git_ls_remote ()
+{
+	__gitcomp_nl "$(__git_remotes)"
+}
+
+_git_ls_tree ()
+{
+	__git_complete_file
+}
+
+# Options that go well for log, shortlog and gitk
+__git_log_common_options="
+	--not --all
+	--branches --tags --remotes
+	--first-parent --merges --no-merges
+	--max-count=
+	--max-age= --since= --after=
+	--min-age= --until= --before=
+	--min-parents= --max-parents=
+	--no-min-parents --no-max-parents
+"
+# Options that go well for log and gitk (not shortlog)
+__git_log_gitk_options="
+	--dense --sparse --full-history
+	--simplify-merges --simplify-by-decoration
+	--left-right --notes --no-notes
+"
+# Options that go well for log and shortlog (not gitk)
+__git_log_shortlog_options="
+	--author= --committer= --grep=
+	--all-match
+"
+
+__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 ()
+{
+	__git_has_doubledash && return
+
+	local g="$(git rev-parse --git-dir 2>/dev/null)"
+	local merge=""
+	if [ -f "$g/MERGE_HEAD" ]; then
+		merge="--merge"
+	fi
+	case "$cur" in
+	--pretty=*|--format=*)
+		__gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases)
+			" "" "${cur#*=}"
+		return
+		;;
+	--date=*)
+		__gitcomp "$__git_log_date_formats" "" "${cur##--date=}"
+		return
+		;;
+	--decorate=*)
+		__gitcomp "long short" "" "${cur##--decorate=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			$__git_log_common_options
+			$__git_log_shortlog_options
+			$__git_log_gitk_options
+			--root --topo-order --date-order --reverse
+			--follow --full-diff
+			--abbrev-commit --abbrev=
+			--relative-date --date=
+			--pretty= --format= --oneline
+			--cherry-pick
+			--graph
+			--decorate --decorate=
+			--walk-reflogs
+			--parents --children
+			$merge
+			$__git_diff_common_options
+			--pickaxe-all --pickaxe-regex
+			"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+__git_merge_options="
+	--no-commit --no-stat --log --no-log --squash --strategy
+	--commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
+"
+
+_git_merge ()
+{
+	__git_complete_strategy && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "$__git_merge_options"
+		return
+	esac
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_mergetool ()
+{
+	case "$cur" in
+	--tool=*)
+		__gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
+		return
+		;;
+	--*)
+		__gitcomp "--tool="
+		return
+		;;
+	esac
+	COMPREPLY=()
+}
+
+_git_merge_base ()
+{
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_mv ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--dry-run"
+		return
+		;;
+	esac
+
+	if [ $(__git_count_arguments "mv") -gt 0 ]; then
+		# We need to show both cached and untracked files (including
+		# empty directories) since this may not be the last argument.
+		__git_complete_index_file "--cached --others --directory"
+	else
+		__git_complete_index_file "--cached"
+	fi
+}
+
+_git_name_rev ()
+{
+	__gitcomp "--tags --all --stdin"
+}
+
+_git_notes ()
+{
+	local subcommands='add append copy edit list prune remove show'
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+
+	case "$subcommand,$cur" in
+	,--*)
+		__gitcomp '--ref'
+		;;
+	,*)
+		case "$prev" in
+		--ref)
+			__gitcomp_nl "$(__git_refs)"
+			;;
+		*)
+			__gitcomp "$subcommands --ref"
+			;;
+		esac
+		;;
+	add,--reuse-message=*|append,--reuse-message=*|\
+	add,--reedit-message=*|append,--reedit-message=*)
+		__gitcomp_nl "$(__git_refs)" "" "${cur#*=}"
+		;;
+	add,--*|append,--*)
+		__gitcomp '--file= --message= --reedit-message=
+				--reuse-message='
+		;;
+	copy,--*)
+		__gitcomp '--stdin'
+		;;
+	prune,--*)
+		__gitcomp '--dry-run --verbose'
+		;;
+	prune,*)
+		;;
+	*)
+		case "$prev" in
+		-m|-F)
+			;;
+		*)
+			__gitcomp_nl "$(__git_refs)"
+			;;
+		esac
+		;;
+	esac
+}
+
+_git_pull ()
+{
+	__git_complete_strategy && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--rebase --no-rebase
+			$__git_merge_options
+			$__git_fetch_options
+		"
+		return
+		;;
+	esac
+	__git_complete_remote_or_refspec
+}
+
+_git_push ()
+{
+	case "$prev" in
+	--repo)
+		__gitcomp_nl "$(__git_remotes)"
+		return
+	esac
+	case "$cur" in
+	--repo=*)
+		__gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--all --mirror --tags --dry-run --force --verbose
+			--receive-pack= --repo= --set-upstream
+		"
+		return
+		;;
+	esac
+	__git_complete_remote_or_refspec
+}
+
+_git_rebase ()
+{
+	local dir="$(__gitdir)"
+	if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
+		__gitcomp "--continue --skip --abort"
+		return
+	fi
+	__git_complete_strategy && return
+	case "$cur" in
+	--whitespace=*)
+		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
+		return
+		;;
+	--*)
+		__gitcomp "
+			--onto --merge --strategy --interactive
+			--preserve-merges --stat --no-stat
+			--committer-date-is-author-date --ignore-date
+			--ignore-whitespace --whitespace=
+			--autosquash
+			"
+
+		return
+	esac
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_reflog ()
+{
+	local subcommands="show delete expire"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+
+	if [ -z "$subcommand" ]; then
+		__gitcomp "$subcommands"
+	else
+		__gitcomp_nl "$(__git_refs)"
+	fi
+}
+
+__git_send_email_confirm_options="always never auto cc compose"
+__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"
+
+_git_send_email ()
+{
+	case "$cur" in
+	--confirm=*)
+		__gitcomp "
+			$__git_send_email_confirm_options
+			" "" "${cur##--confirm=}"
+		return
+		;;
+	--suppress-cc=*)
+		__gitcomp "
+			$__git_send_email_suppresscc_options
+			" "" "${cur##--suppress-cc=}"
+
+		return
+		;;
+	--smtp-encryption=*)
+		__gitcomp "ssl tls" "" "${cur##--smtp-encryption=}"
+		return
+		;;
+	--thread=*)
+		__gitcomp "
+			deep shallow
+			" "" "${cur##--thread=}"
+		return
+		;;
+	--*)
+		__gitcomp "--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
+			--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"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+_git_stage ()
+{
+	_git_add
+}
+
+__git_config_get_set_variables ()
+{
+	local prevword word config_file= c=$cword
+	while [ $c -gt 1 ]; do
+		word="${words[c]}"
+		case "$word" in
+		--system|--global|--local|--file=*)
+			config_file="$word"
+			break
+			;;
+		-f|--file)
+			config_file="$word $prevword"
+			break
+			;;
+		esac
+		prevword=$word
+		c=$((--c))
+	done
+
+	git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null |
+	while read -r line
+	do
+		case "$line" in
+		*.*=*)
+			echo "${line/=*/}"
+			;;
+		esac
+	done
+}
+
+_git_config ()
+{
+	case "$prev" in
+	branch.*.remote)
+		__gitcomp_nl "$(__git_remotes)"
+		return
+		;;
+	branch.*.merge)
+		__gitcomp_nl "$(__git_refs)"
+		return
+		;;
+	remote.*.fetch)
+		local remote="${prev#remote.}"
+		remote="${remote%.fetch}"
+		if [ -z "$cur" ]; then
+			COMPREPLY=("refs/heads/")
+			return
+		fi
+		__gitcomp_nl "$(__git_refs_remotes "$remote")"
+		return
+		;;
+	remote.*.push)
+		local remote="${prev#remote.}"
+		remote="${remote%.push}"
+		__gitcomp_nl "$(git --git-dir="$(__gitdir)" \
+			for-each-ref --format='%(refname):%(refname)' \
+			refs/heads)"
+		return
+		;;
+	pull.twohead|pull.octopus)
+		__git_compute_merge_strategies
+		__gitcomp "$__git_merge_strategies"
+		return
+		;;
+	color.branch|color.diff|color.interactive|\
+	color.showbranch|color.status|color.ui)
+		__gitcomp "always never auto"
+		return
+		;;
+	color.pager)
+		__gitcomp "false true"
+		return
+		;;
+	color.*.*)
+		__gitcomp "
+			normal black red green yellow blue magenta cyan white
+			bold dim ul blink reverse
+			"
+		return
+		;;
+	help.format)
+		__gitcomp "man info web html"
+		return
+		;;
+	log.date)
+		__gitcomp "$__git_log_date_formats"
+		return
+		;;
+	sendemail.aliasesfiletype)
+		__gitcomp "mutt mailrc pine elm gnus"
+		return
+		;;
+	sendemail.confirm)
+		__gitcomp "$__git_send_email_confirm_options"
+		return
+		;;
+	sendemail.suppresscc)
+		__gitcomp "$__git_send_email_suppresscc_options"
+		return
+		;;
+	--get|--get-all|--unset|--unset-all)
+		__gitcomp_nl "$(__git_config_get_set_variables)"
+		return
+		;;
+	*.*)
+		COMPREPLY=()
+		return
+		;;
+	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
+			"
+		return
+		;;
+	branch.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "remote merge mergeoptions rebase" "$pfx" "$cur_"
+		return
+		;;
+	branch.*)
+		local pfx="${cur%.*}." cur_="${cur#*.}"
+		__gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "."
+		return
+		;;
+	guitool.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "
+			argprompt cmd confirm needsfile noconsole norescan
+			prompt revprompt revunmerged title
+			" "$pfx" "$cur_"
+		return
+		;;
+	difftool.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "cmd path" "$pfx" "$cur_"
+		return
+		;;
+	man.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "cmd path" "$pfx" "$cur_"
+		return
+		;;
+	mergetool.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "cmd path trustExitCode" "$pfx" "$cur_"
+		return
+		;;
+	pager.*)
+		local pfx="${cur%.*}." cur_="${cur#*.}"
+		__git_compute_all_commands
+		__gitcomp_nl "$__git_all_commands" "$pfx" "$cur_"
+		return
+		;;
+	remote.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "
+			url proxy fetch push mirror skipDefaultUpdate
+			receivepack uploadpack tagopt pushurl
+			" "$pfx" "$cur_"
+		return
+		;;
+	remote.*)
+		local pfx="${cur%.*}." cur_="${cur#*.}"
+		__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
+		return
+		;;
+	url.*.*)
+		local pfx="${cur%.*}." cur_="${cur##*.}"
+		__gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_"
+		return
+		;;
+	esac
+	__gitcomp "
+		add.ignoreErrors
+		advice.commitBeforeMerge
+		advice.detachedHead
+		advice.implicitIdentity
+		advice.pushNonFastForward
+		advice.resolveConflict
+		advice.statusHints
+		alias.
+		am.keepcr
+		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.nobranch
+		color.status.untracked
+		color.status.updated
+		color.ui
+		commit.status
+		commit.template
+		core.abbrev
+		core.askpass
+		core.attributesfile
+		core.autocrlf
+		core.bare
+		core.bigFileThreshold
+		core.compression
+		core.createObject
+		core.deltaBaseCacheLimit
+		core.editor
+		core.eol
+		core.excludesfile
+		core.fileMode
+		core.fsyncobjectfiles
+		core.gitProxy
+		core.ignoreCygwinFSTricks
+		core.ignoreStat
+		core.ignorecase
+		core.logAllRefUpdates
+		core.loosecompression
+		core.notesRef
+		core.packedGitLimit
+		core.packedGitWindowSize
+		core.pager
+		core.preferSymlinkRefs
+		core.preloadindex
+		core.quotepath
+		core.repositoryFormatVersion
+		core.safecrlf
+		core.sharedRepository
+		core.sparseCheckout
+		core.symlinks
+		core.trustctime
+		core.warnAmbiguousRefs
+		core.whitespace
+		core.worktree
+		diff.autorefreshindex
+		diff.statGraphWidth
+		diff.external
+		diff.ignoreSubmodules
+		diff.mnemonicprefix
+		diff.noprefix
+		diff.renameLimit
+		diff.renames
+		diff.suppressBlankEmpty
+		diff.tool
+		diff.wordRegex
+		diff.algorithm
+		difftool.
+		difftool.prompt
+		fetch.recurseSubmodules
+		fetch.unpackLimit
+		format.attach
+		format.cc
+		format.headers
+		format.numbered
+		format.pretty
+		format.signature
+		format.signoff
+		format.subjectprefix
+		format.suffix
+		format.thread
+		format.to
+		gc.
+		gc.aggressiveWindow
+		gc.auto
+		gc.autopacklimit
+		gc.packrefs
+		gc.pruneexpire
+		gc.reflogexpire
+		gc.reflogexpireunreachable
+		gc.rerereresolved
+		gc.rerereunresolved
+		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.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
+		rebase.autosquash
+		rebase.stat
+		receive.autogc
+		receive.denyCurrentBranch
+		receive.denyDeleteCurrent
+		receive.denyDeletes
+		receive.denyNonFastForwards
+		receive.fsckObjects
+		receive.unpackLimit
+		receive.updateserverinfo
+		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.validate
+		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 ()
+{
+	local subcommands="add rename remove set-head set-branches set-url show prune update"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if [ -z "$subcommand" ]; then
+		__gitcomp "$subcommands"
+		return
+	fi
+
+	case "$subcommand" in
+	rename|remove|set-url|show|prune)
+		__gitcomp_nl "$(__git_remotes)"
+		;;
+	set-head|set-branches)
+		__git_complete_remote_or_refspec
+		;;
+	update)
+		local i c='' IFS=$'\n'
+		for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do
+			i="${i#remotes.}"
+			c="$c ${i/ */}"
+		done
+		__gitcomp "$c"
+		;;
+	*)
+		COMPREPLY=()
+		;;
+	esac
+}
+
+_git_replace ()
+{
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_reset ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "--merge --mixed --hard --soft --patch"
+		return
+		;;
+	esac
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_revert ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--edit --mainline --no-edit --no-commit --signoff"
+		return
+		;;
+	esac
+	__gitcomp_nl "$(__git_refs)"
+}
+
+_git_rm ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
+		return
+		;;
+	esac
+
+	__git_complete_index_file "--cached"
+}
+
+_git_shortlog ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--*)
+		__gitcomp "
+			$__git_log_common_options
+			$__git_log_shortlog_options
+			--numbered --summary
+			"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+_git_show ()
+{
+	__git_has_doubledash && return
+
+	case "$cur" in
+	--pretty=*|--format=*)
+		__gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases)
+			" "" "${cur#*=}"
+		return
+		;;
+	--diff-algorithm=*)
+		__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
+		return
+		;;
+	--*)
+		__gitcomp "--pretty= --format= --abbrev-commit --oneline
+			$__git_diff_common_options
+			"
+		return
+		;;
+	esac
+	__git_complete_file
+}
+
+_git_show_branch ()
+{
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--all --remotes --topo-order --current --more=
+			--list --independent --merge-base --no-name
+			--color --no-color
+			--sha1-name --sparse --topics --reflog
+			"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+_git_stash ()
+{
+	local save_opts='--keep-index --no-keep-index --quiet --patch'
+	local subcommands='save list show apply clear drop pop create branch'
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if [ -z "$subcommand" ]; then
+		case "$cur" in
+		--*)
+			__gitcomp "$save_opts"
+			;;
+		*)
+			if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
+				__gitcomp "$subcommands"
+			else
+				COMPREPLY=()
+			fi
+			;;
+		esac
+	else
+		case "$subcommand,$cur" in
+		save,--*)
+			__gitcomp "$save_opts"
+			;;
+		apply,--*|pop,--*)
+			__gitcomp "--index --quiet"
+			;;
+		show,--*|drop,--*|branch,--*)
+			COMPREPLY=()
+			;;
+		show,*|apply,*|drop,*|pop,*|branch,*)
+			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
+					| sed -n -e 's/:.*//p')"
+			;;
+		*)
+			COMPREPLY=()
+			;;
+		esac
+	fi
+}
+
+_git_submodule ()
+{
+	__git_has_doubledash && return
+
+	local subcommands="add status init update summary foreach sync"
+	if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
+		case "$cur" in
+		--*)
+			__gitcomp "--quiet --cached"
+			;;
+		*)
+			__gitcomp "$subcommands"
+			;;
+		esac
+		return
+	fi
+}
+
+_git_svn ()
+{
+	local subcommands="
+		init fetch clone rebase dcommit log find-rev
+		set-tree commit-diff info create-ignore propget
+		proplist show-ignore show-externals branch tag blame
+		migrate mkdirs reset gc
+		"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
+	if [ -z "$subcommand" ]; then
+		__gitcomp "$subcommands"
+	else
+		local remote_opts="--username= --config-dir= --no-auth-cache"
+		local fc_opts="
+			--follow-parent --authors-file= --repack=
+			--no-metadata --use-svm-props --use-svnsync-props
+			--log-window-size= --no-checkout --quiet
+			--repack-flags --use-log-author --localtime
+			--ignore-paths= $remote_opts
+			"
+		local init_opts="
+			--template= --shared= --trunk= --tags=
+			--branches= --stdlayout --minimize-url
+			--no-metadata --use-svm-props --use-svnsync-props
+			--rewrite-root= --prefix= --use-log-author
+			--add-author-from $remote_opts
+			"
+		local cmt_opts="
+			--edit --rmdir --find-copies-harder --copy-similarity=
+			"
+
+		case "$subcommand,$cur" in
+		fetch,--*)
+			__gitcomp "--revision= --fetch-all $fc_opts"
+			;;
+		clone,--*)
+			__gitcomp "--revision= $fc_opts $init_opts"
+			;;
+		init,--*)
+			__gitcomp "$init_opts"
+			;;
+		dcommit,--*)
+			__gitcomp "
+				--merge --strategy= --verbose --dry-run
+				--fetch-all --no-rebase --commit-url
+				--revision --interactive $cmt_opts $fc_opts
+				"
+			;;
+		set-tree,--*)
+			__gitcomp "--stdin $cmt_opts $fc_opts"
+			;;
+		create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\
+		show-externals,--*|mkdirs,--*)
+			__gitcomp "--revision="
+			;;
+		log,--*)
+			__gitcomp "
+				--limit= --revision= --verbose --incremental
+				--oneline --show-commit --non-recursive
+				--authors-file= --color
+				"
+			;;
+		rebase,--*)
+			__gitcomp "
+				--merge --verbose --strategy= --local
+				--fetch-all --dry-run $fc_opts
+				"
+			;;
+		commit-diff,--*)
+			__gitcomp "--message= --file= --revision= $cmt_opts"
+			;;
+		info,--*)
+			__gitcomp "--url"
+			;;
+		branch,--*)
+			__gitcomp "--dry-run --message --tag"
+			;;
+		tag,--*)
+			__gitcomp "--dry-run --message"
+			;;
+		blame,--*)
+			__gitcomp "--git-format"
+			;;
+		migrate,--*)
+			__gitcomp "
+				--config-dir= --ignore-paths= --minimize
+				--no-auth-cache --username=
+				"
+			;;
+		reset,--*)
+			__gitcomp "--revision= --parent"
+			;;
+		*)
+			COMPREPLY=()
+			;;
+		esac
+	fi
+}
+
+_git_tag ()
+{
+	local i c=1 f=0
+	while [ $c -lt $cword ]; do
+		i="${words[c]}"
+		case "$i" in
+		-d|-v)
+			__gitcomp_nl "$(__git_tags)"
+			return
+			;;
+		-f)
+			f=1
+			;;
+		esac
+		((c++))
+	done
+
+	case "$prev" in
+	-m|-F)
+		COMPREPLY=()
+		;;
+	-*|tag)
+		if [ $f = 1 ]; then
+			__gitcomp_nl "$(__git_tags)"
+		else
+			COMPREPLY=()
+		fi
+		;;
+	*)
+		__gitcomp_nl "$(__git_refs)"
+		;;
+	esac
+}
+
+_git_whatchanged ()
+{
+	_git_log
+}
+
+__git_main ()
+{
+	local i c=1 command __git_dir
+
+	while [ $c -lt $cword ]; do
+		i="${words[c]}"
+		case "$i" in
+		--git-dir=*) __git_dir="${i#--git-dir=}" ;;
+		--bare)      __git_dir="." ;;
+		--help) command="help"; break ;;
+		-c) c=$((++c)) ;;
+		-*) ;;
+		*) command="$i"; break ;;
+		esac
+		((c++))
+	done
+
+	if [ -z "$command" ]; then
+		case "$cur" in
+		--*)   __gitcomp "
+			--paginate
+			--no-pager
+			--git-dir=
+			--bare
+			--version
+			--exec-path
+			--exec-path=
+			--html-path
+			--info-path
+			--work-tree=
+			--namespace=
+			--no-replace-objects
+			--help
+			"
+			;;
+		*)     __git_compute_porcelain_commands
+		       __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;;
+		esac
+		return
+	fi
+
+	local completion_func="_git_${command//-/_}"
+	declare -f $completion_func >/dev/null && $completion_func && return
+
+	local expansion=$(__git_aliased_command "$command")
+	if [ -n "$expansion" ]; then
+		completion_func="_git_${expansion//-/_}"
+		declare -f $completion_func >/dev/null && $completion_func
+	fi
+}
+
+__gitk_main ()
+{
+	__git_has_doubledash && return
+
+	local g="$(__gitdir)"
+	local merge=""
+	if [ -f "$g/MERGE_HEAD" ]; then
+		merge="--merge"
+	fi
+	case "$cur" in
+	--*)
+		__gitcomp "
+			$__git_log_common_options
+			$__git_log_gitk_options
+			$merge
+			"
+		return
+		;;
+	esac
+	__git_complete_revlist
+}
+
+if [[ -n ${ZSH_VERSION-} ]]; then
+	echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
+
+	autoload -U +X compinit && compinit
+
+	__gitcomp ()
+	{
+		emulate -L zsh
+
+		local cur_="${3-$cur}"
+
+		case "$cur_" in
+		--*=)
+			;;
+		*)
+			local c IFS=$' \t\n'
+			local -a array
+			for c in ${=1}; do
+				c="$c${4-}"
+				case $c in
+				--*=*|*.) ;;
+				*) c="$c " ;;
+				esac
+				array[$#array+1]="$c"
+			done
+			compset -P '*[=:]'
+			compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
+			;;
+		esac
+	}
+
+	__gitcomp_nl ()
+	{
+		emulate -L zsh
+
+		local IFS=$'\n'
+		compset -P '*[=:]'
+		compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
+	}
+
+	__gitcomp_file ()
+	{
+		emulate -L zsh
+
+		local IFS=$'\n'
+		compset -P '*[=:]'
+		compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
+	}
+
+	__git_zsh_helper ()
+	{
+		emulate -L ksh
+		local cur cword prev
+		cur=${words[CURRENT-1]}
+		prev=${words[CURRENT-2]}
+		let cword=CURRENT-1
+		__${service}_main
+	}
+
+	_git ()
+	{
+		emulate -L zsh
+		local _ret=1
+		__git_zsh_helper
+		let _ret && _default -S '' && _ret=0
+		return _ret
+	}
+
+	compdef _git git gitk
+	return
+elif [[ -n ${BASH_VERSION-} ]]; then
+	if ((${BASH_VERSINFO[0]} < 4)); then
+		# compopt is not supported
+		__git_index_file_list_filter ()
+		{
+			__git_index_file_list_filter_compat
+		}
+	fi
+fi
+
+__git_func_wrap ()
+{
+	local cur words cword prev
+	_get_comp_words_by_ref -n =: cur words cword prev
+	$1
+}
+
+# Setup completion for certain functions defined above by setting common
+# variables and workarounds.
+# This is NOT a public function; use at your own risk.
+__git_complete ()
+{
+	local wrapper="__git_wrap${2}"
+	eval "$wrapper () { __git_func_wrap $2 ; }"
+	complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
+		|| complete -o default -o nospace -F $wrapper $1
+}
+
+# wrapper for backwards compatibility
+_git ()
+{
+	__git_wrap__git_main
+}
+
+# wrapper for backwards compatibility
+_gitk ()
+{
+	__git_wrap__gitk_main
+}
+
+__git_complete git __git_main
+__git_complete gitk __gitk_main
+
+# The following are necessary only for Cygwin, and only are needed
+# when the user has tab-completed the executable name and consequently
+# included the '.exe' suffix.
+#
+if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
+__git_complete git.exe __git_main
+fi

+ 399 - 0
lucid.remote/.oh-my-zsh/plugins/gitfast/git-prompt.sh

@@ -0,0 +1,399 @@
+# bash/zsh git prompt support
+#
+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
+# Distributed under the GNU General Public License, version 2.0.
+#
+# This script allows you to see the current branch in your prompt.
+#
+# To enable:
+#
+#    1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
+#    2) Add the following line to your .bashrc/.zshrc:
+#        source ~/.git-prompt.sh
+#    3a) Change your PS1 to call __git_ps1 as
+#        command-substitution:
+#        Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
+#        ZSH:  PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
+#        the optional argument will be used as format string.
+#    3b) Alternatively, if you are using bash, __git_ps1 can be
+#        used for PROMPT_COMMAND with two parameters, <pre> and
+#        <post>, which are strings you would put in $PS1 before
+#        and after the status string generated by the git-prompt
+#        machinery.  e.g.
+#           PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
+#        will show username, at-sign, host, colon, cwd, then
+#        various status string, followed by dollar and SP, as
+#        your prompt.
+#        Optionally, you can supply a third argument with a printf
+#        format string to finetune the output of the branch status
+#
+# The argument to __git_ps1 will be displayed only if you are currently
+# in a git repository.  The %s token will be the name of the current
+# branch.
+#
+# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
+# unstaged (*) and staged (+) changes will be shown next to the branch
+# name.  You can configure this per-repository with the
+# bash.showDirtyState variable, which defaults to true once
+# GIT_PS1_SHOWDIRTYSTATE is enabled.
+#
+# You can also see if currently something is stashed, by setting
+# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
+# then a '$' will be shown next to the branch name.
+#
+# If you would like to see if there're untracked files, then you can set
+# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
+# files, then a '%' will be shown next to the branch name.  You can
+# configure this per-repository with the bash.showUntrackedFiles
+# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
+# enabled.
+#
+# If you would like to see the difference between HEAD and its upstream,
+# set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
+# indicates you are ahead, "<>" indicates you have diverged and "="
+# indicates that there is no difference. You can further control
+# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
+# of values:
+#
+#     verbose       show number of commits ahead/behind (+/-) upstream
+#     legacy        don't use the '--count' option available in recent
+#                   versions of git-rev-list
+#     git           always compare HEAD to @{upstream}
+#     svn           always compare HEAD to your SVN upstream
+#
+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
+# find one, or @{upstream} otherwise.  Once you have set
+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
+# setting the bash.showUpstream config variable.
+#
+# If you would like to see more information about the identity of
+# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
+# to one of these values:
+#
+#     contains      relative to newer annotated tag (v1.6.3.2~35)
+#     branch        relative to newer tag or branch (master~4)
+#     describe      relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
+#     default       exactly matching tag
+#
+# If you would like a colored hint about the current dirty state, set
+# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
+# the colored output of "git status -sb".
+
+# __gitdir accepts 0 or 1 arguments (i.e., location)
+# returns location of .git repo
+__gitdir ()
+{
+	# Note: this function is duplicated in git-completion.bash
+	# When updating it, make sure you update the other one to match.
+	if [ -z "${1-}" ]; then
+		if [ -n "${__git_dir-}" ]; then
+			echo "$__git_dir"
+		elif [ -n "${GIT_DIR-}" ]; then
+			test -d "${GIT_DIR-}" || return 1
+			echo "$GIT_DIR"
+		elif [ -d .git ]; then
+			echo .git
+		else
+			git rev-parse --git-dir 2>/dev/null
+		fi
+	elif [ -d "$1/.git" ]; then
+		echo "$1/.git"
+	else
+		echo "$1"
+	fi
+}
+
+# stores the divergence from upstream in $p
+# used by GIT_PS1_SHOWUPSTREAM
+__git_ps1_show_upstream ()
+{
+	local key value
+	local svn_remote svn_url_pattern count n
+	local upstream=git legacy="" verbose=""
+
+	svn_remote=()
+	# get some config options from git-config
+	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
+	while read -r key value; do
+		case "$key" in
+		bash.showupstream)
+			GIT_PS1_SHOWUPSTREAM="$value"
+			if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
+				p=""
+				return
+			fi
+			;;
+		svn-remote.*.url)
+			svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
+			svn_url_pattern+="\\|$value"
+			upstream=svn+git # default upstream is SVN if available, else git
+			;;
+		esac
+	done <<< "$output"
+
+	# parse configuration values
+	for option in ${GIT_PS1_SHOWUPSTREAM}; do
+		case "$option" in
+		git|svn) upstream="$option" ;;
+		verbose) verbose=1 ;;
+		legacy)  legacy=1  ;;
+		esac
+	done
+
+	# Find our upstream
+	case "$upstream" in
+	git)    upstream="@{upstream}" ;;
+	svn*)
+		# get the upstream from the "git-svn-id: ..." in a commit message
+		# (git-svn uses essentially the same procedure internally)
+		local svn_upstream=($(git log --first-parent -1 \
+					--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
+		if [[ 0 -ne ${#svn_upstream[@]} ]]; then
+			svn_upstream=${svn_upstream[ ${#svn_upstream[@]} - 2 ]}
+			svn_upstream=${svn_upstream%@*}
+			local n_stop="${#svn_remote[@]}"
+			for ((n=1; n <= n_stop; n++)); do
+				svn_upstream=${svn_upstream#${svn_remote[$n]}}
+			done
+
+			if [[ -z "$svn_upstream" ]]; then
+				# default branch name for checkouts with no layout:
+				upstream=${GIT_SVN_ID:-git-svn}
+			else
+				upstream=${svn_upstream#/}
+			fi
+		elif [[ "svn+git" = "$upstream" ]]; then
+			upstream="@{upstream}"
+		fi
+		;;
+	esac
+
+	# Find how many commits we are ahead/behind our upstream
+	if [[ -z "$legacy" ]]; then
+		count="$(git rev-list --count --left-right \
+				"$upstream"...HEAD 2>/dev/null)"
+	else
+		# produce equivalent output to --count for older versions of git
+		local commits
+		if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)"
+		then
+			local commit behind=0 ahead=0
+			for commit in $commits
+			do
+				case "$commit" in
+				"<"*) ((behind++)) ;;
+				*)    ((ahead++))  ;;
+				esac
+			done
+			count="$behind	$ahead"
+		else
+			count=""
+		fi
+	fi
+
+	# calculate the result
+	if [[ -z "$verbose" ]]; then
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p="=" ;;
+		"0	"*) # ahead of upstream
+			p=">" ;;
+		*"	0") # behind upstream
+			p="<" ;;
+		*)	    # diverged from upstream
+			p="<>" ;;
+		esac
+	else
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p=" u=" ;;
+		"0	"*) # ahead of upstream
+			p=" u+${count#0	}" ;;
+		*"	0") # behind upstream
+			p=" u-${count%	0}" ;;
+		*)	    # diverged from upstream
+			p=" u+${count#*	}-${count%	*}" ;;
+		esac
+	fi
+
+}
+
+
+# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
+# when called from PS1 using command substitution
+# in this mode it prints text to add to bash PS1 prompt (includes branch name)
+#
+# __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc)
+# in that case it _sets_ PS1. The arguments are parts of a PS1 string.
+# when two arguments are given, the first is prepended and the second appended
+# to the state string when assigned to PS1.
+# The optional third parameter will be used as printf format string to further
+# customize the output of the git-status string.
+# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
+__git_ps1 ()
+{
+	local pcmode=no
+	local detached=no
+	local ps1pc_start='\u@\h:\w '
+	local ps1pc_end='\$ '
+	local printf_format=' (%s)'
+
+	case "$#" in
+		2|3)	pcmode=yes
+			ps1pc_start="$1"
+			ps1pc_end="$2"
+			printf_format="${3:-$printf_format}"
+		;;
+		0|1)	printf_format="${1:-$printf_format}"
+		;;
+		*)	return
+		;;
+	esac
+
+	local g="$(__gitdir)"
+	if [ -z "$g" ]; then
+		if [ $pcmode = yes ]; then
+			#In PC mode PS1 always needs to be set
+			PS1="$ps1pc_start$ps1pc_end"
+		fi
+	else
+		local r=""
+		local b=""
+		if [ -f "$g/rebase-merge/interactive" ]; then
+			r="|REBASE-i"
+			b="$(cat "$g/rebase-merge/head-name")"
+		elif [ -d "$g/rebase-merge" ]; then
+			r="|REBASE-m"
+			b="$(cat "$g/rebase-merge/head-name")"
+		else
+			if [ -d "$g/rebase-apply" ]; then
+				if [ -f "$g/rebase-apply/rebasing" ]; then
+					r="|REBASE"
+				elif [ -f "$g/rebase-apply/applying" ]; then
+					r="|AM"
+				else
+					r="|AM/REBASE"
+				fi
+			elif [ -f "$g/MERGE_HEAD" ]; then
+				r="|MERGING"
+			elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
+				r="|CHERRY-PICKING"
+			elif [ -f "$g/BISECT_LOG" ]; then
+				r="|BISECTING"
+			fi
+
+			b="$(git symbolic-ref HEAD 2>/dev/null)" || {
+				detached=yes
+				b="$(
+				case "${GIT_PS1_DESCRIBE_STYLE-}" in
+				(contains)
+					git describe --contains HEAD ;;
+				(branch)
+					git describe --contains --all HEAD ;;
+				(describe)
+					git describe HEAD ;;
+				(* | default)
+					git describe --tags --exact-match HEAD ;;
+				esac 2>/dev/null)" ||
+
+				b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." ||
+				b="unknown"
+				b="($b)"
+			}
+		fi
+
+		local w=""
+		local i=""
+		local s=""
+		local u=""
+		local c=""
+		local p=""
+
+		if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
+			if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
+				c="BARE:"
+			else
+				b="GIT_DIR!"
+			fi
+		elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
+			if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
+			   [ "$(git config --bool bash.showDirtyState)" != "false" ]
+			then
+				git diff --no-ext-diff --quiet --exit-code || w="*"
+				if git rev-parse --quiet --verify HEAD >/dev/null; then
+					git diff-index --cached --quiet HEAD -- || i="+"
+				else
+					i="#"
+				fi
+			fi
+			if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then
+				git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$"
+			fi
+
+			if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
+			   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
+			   [ -n "$(git ls-files --others --exclude-standard)" ]
+			then
+				u="%%"
+			fi
+
+			if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
+				__git_ps1_show_upstream
+			fi
+		fi
+
+		local f="$w$i$s$u"
+		if [ $pcmode = yes ]; then
+			local gitstring=
+			if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+				local c_red='\e[31m'
+				local c_green='\e[32m'
+				local c_lblue='\e[1;34m'
+				local c_clear='\e[0m'
+				local bad_color=$c_red
+				local ok_color=$c_green
+				local branch_color="$c_clear"
+				local flags_color="$c_lblue"
+				local branchstring="$c${b##refs/heads/}"
+
+				if [ $detached = no ]; then
+					branch_color="$ok_color"
+				else
+					branch_color="$bad_color"
+				fi
+
+				# Setting gitstring directly with \[ and \] around colors
+				# is necessary to prevent wrapping issues!
+				gitstring="\[$branch_color\]$branchstring\[$c_clear\]"
+
+				if [ -n "$w$i$s$u$r$p" ]; then
+					gitstring="$gitstring "
+				fi
+				if [ "$w" = "*" ]; then
+					gitstring="$gitstring\[$bad_color\]$w"
+				fi
+				if [ -n "$i" ]; then
+					gitstring="$gitstring\[$ok_color\]$i"
+				fi
+				if [ -n "$s" ]; then
+					gitstring="$gitstring\[$flags_color\]$s"
+				fi
+				if [ -n "$u" ]; then
+					gitstring="$gitstring\[$bad_color\]$u"
+				fi
+				gitstring="$gitstring\[$c_clear\]$r$p"
+			else
+				gitstring="$c${b##refs/heads/}${f:+ $f}$r$p"
+			fi
+			gitstring=$(printf -- "$printf_format" "$gitstring")
+			PS1="$ps1pc_start$gitstring$ps1pc_end"
+		else
+			# NO color option unless in PROMPT_COMMAND mode
+			printf -- "$printf_format" "$c${b##refs/heads/}${f:+ $f}$r$p"
+		fi
+	fi
+}

+ 8 - 0
lucid.remote/.oh-my-zsh/plugins/gitfast/gitfast.plugin.zsh

@@ -0,0 +1,8 @@
+dir=$(dirname $0)
+source $dir/../git/git.plugin.zsh
+source $dir/git-prompt.sh
+
+function git_prompt_info() {
+  dirty="$(parse_git_dirty)"
+  __git_ps1 "${ZSH_THEME_GIT_PROMPT_PREFIX//\%/%%}%s${dirty//\%/%%}${ZSH_THEME_GIT_PROMPT_SUFFIX//\%/%%}"
+}

+ 40 - 0
lucid.remote/.oh-my-zsh/plugins/github/_github

@@ -0,0 +1,40 @@
+#compdef github
+#autoload
+
+# in order to make this work, you will need to have the github gem installed
+# http://github.com/defunkt/github-gem
+
+# github zsh completion, based on homebrew completion
+
+local -a _1st_arguments
+_1st_arguments=(
+  'browse:Open this repo in a web browser'
+  'clone:Clone a repo'
+  'config:Automatically set configuration info, or pass args to specify'
+  'create-from-local:Create a new GitHub repository from the current local repository'
+  'create:Create a new empty GitHub repository'
+  'fetch:Fetch from a remote to a local branch'
+  'fetch_all:Fetch all refs from a user'
+  'fork:Forks a GitHub repository'
+  'home:Open this repos master branch in a web browser'
+  'ignore:Ignore a SHA from github network commits'
+  'info:Info about this project'
+  'issues:Project issues tools'
+  'network:Project network tools - sub-commands : web [user], list, fetch, commits'
+  'open:Open the given user/project in a web browser'
+  'pull-request:Generate the text for a pull request'
+  'pull:Pull from a remote'
+  'search:Search GitHub for the given repository name'
+  'track:Track another users repository'
+)
+
+local expl
+local -a pkgs installed_pkgs
+
+_arguments \
+  '*:: :->subcmds' && return 0
+
+if (( CURRENT == 1 )); then
+  _describe -t commands "github subcommand" _1st_arguments
+  return
+fi

+ 88 - 0
lucid.remote/.oh-my-zsh/plugins/github/github.plugin.zsh

@@ -0,0 +1,88 @@
+# Setup hub function for git, if it is available; http://github.com/defunkt/hub
+if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
+    # Autoload _git completion functions
+    if declare -f _git > /dev/null; then
+      _git
+    fi
+    
+    if declare -f _git_commands > /dev/null; then
+        _hub_commands=(
+            'alias:show shell instructions for wrapping git'
+            'pull-request:open a pull request on GitHub'
+            'fork:fork origin repo on GitHub'
+            'create:create new repo on GitHub for the current project'
+            'browse:browse the project on GitHub'
+            'compare:open GitHub compare view'
+        )
+        # Extend the '_git_commands' function with hub commands
+        eval "$(declare -f _git_commands | sed -e 's/base_commands=(/base_commands=(${_hub_commands} /')"
+    fi
+    # eval `hub alias -s zsh`
+    function git(){
+        if ! (( $+_has_working_hub  )); then
+            hub --version &> /dev/null
+            _has_working_hub=$(($? == 0))
+        fi
+        if (( $_has_working_hub )) ; then
+            hub "$@"
+        else
+            command git "$@"
+        fi
+    }
+fi
+
+# Functions #################################################################
+
+# https://github.com/dbb 
+
+
+# empty_gh [NAME_OF_REPO]
+#
+# Use this when creating a new repo from scratch.
+empty_gh() { # [NAME_OF_REPO]
+    repo = $1
+    ghuser=$(  git config github.user )
+
+    mkdir "$repo"
+    cd "$repo"
+    git init
+    touch README
+    git add README
+    git commit -m 'Initial commit.'
+    git remote add origin git@github.com:${ghuser}/${repo}.git
+    git push -u origin master
+}
+
+# new_gh [DIRECTORY]
+#
+# Use this when you have a directory that is not yet set up for git.
+# This function will add all non-hidden files to git.
+new_gh() { # [DIRECTORY]
+    cd "$1"
+    ghuser=$( git config github.user )
+
+    git init
+    # add all non-dot files
+    print '.*'"\n"'*~' >> .gitignore
+    git add ^.*
+    git commit -m 'Initial commit.'
+    git remote add origin git@github.com:${ghuser}/${repo}.git
+    git push -u origin master
+}
+
+# exist_gh [DIRECTORY]
+#
+# Use this when you have a git repo that's ready to go and you want to add it
+# to your GitHub.
+exist_gh() { # [DIRECTORY]
+    cd "$1"
+    name=$( git config user.name )
+    ghuser=$( git config github.user )
+    repo=$1
+
+    git remote add origin git@github.com:${ghuser}/${repo}.git
+    git push -u origin master
+}
+
+# End Functions #############################################################
+

+ 80 - 0
lucid.remote/.oh-my-zsh/plugins/gnu-utils/gnu-utils.plugin.zsh

@@ -0,0 +1,80 @@
+# ------------------------------------------------------------------------------
+#          FILE:  gnu-utils.plugin.zsh
+#   DESCRIPTION:  oh-my-zsh plugin file.
+#        AUTHOR:  Sorin Ionescu (sorin.ionescu@gmail.com)
+#       VERSION:  1.0.0
+# ------------------------------------------------------------------------------
+
+
+if [[ -x "${commands[gwhoami]}" ]]; then 
+  __gnu_utils() {
+    emulate -L zsh
+    local gcmds
+    local gcmd
+    local cmd
+    local prefix
+
+    # coreutils 
+    gcmds=('g[' 'gbase64' 'gbasename' 'gcat' 'gchcon' 'gchgrp' 'gchmod'
+    'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
+    'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
+    'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
+    'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
+    'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
+    'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
+    'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
+    'gsha256sum' 'gsha384sum' 'gsha512sum' 'gshred' 'gshuf' 'gsleep' 'gsort'
+    'gsplit' 'gstat' 'gstty' 'gsum' 'gsync' 'gtac' 'gtail' 'gtee' 'gtest'
+    'gtimeout' 'gtouch' 'gtr' 'gtrue' 'gtruncate' 'gtsort' 'gtty' 'guname'
+    'gunexpand' 'guniq' 'gunlink' 'guptime' 'gusers' 'gvdir' 'gwc' 'gwho'
+    'gwhoami' 'gyes')
+
+    # Not part of coreutils, installed separately.
+    gcmds+=('gsed' 'gtar' 'gtime')
+
+    for gcmd in "${gcmds[@]}"; do
+      #
+      # This method allows for builtin commands to be primary but it's
+      # lost if hash -r or rehash -f is executed. Thus, those two 
+      # functions have to be wrapped.
+      #
+      (( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
+
+      #
+      # This method generates wrapper functions.
+      # It will override shell builtins.
+      #
+      # (( ${+commands[$gcmd]} )) && \
+      # eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
+
+      #
+      # This method is inflexible since the aliases are at risk of being
+      # overriden resulting in the BSD coreutils being called.
+      #
+      # (( ${+commands[$gcmd]} )) && \
+      # alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
+    done
+
+    return 0
+  }
+  __gnu_utils;
+
+  function hash() {
+    if [[ "$*" =~ "-(r|f)" ]]; then
+      builtin hash "$@"
+      __gnu_utils
+    else
+      builtin hash "$@"
+    fi
+  }
+
+  function rehash() {
+    if [[ "$*" =~ "-f" ]]; then
+      builtin rehash "$@"
+      __gnu_utils
+    else
+      builtin rehash "$@"
+    fi
+  }
+fi
+

+ 151 - 0
lucid.remote/.oh-my-zsh/plugins/go/go.plugin.zsh

@@ -0,0 +1,151 @@
+# install in /etc/zsh/zshrc or your personal .zshrc
+
+# gc
+prefixes=(5 6 8)
+for p in $prefixes; do
+	compctl -g "*.${p}" ${p}l
+	compctl -g "*.go" ${p}g
+done
+
+# standard go tools
+compctl -g "*.go" gofmt
+
+# gccgo
+compctl -g "*.go" gccgo
+
+# go tool
+__go_tool_complete() {
+  typeset -a commands build_flags
+  commands+=(
+    'build[compile packages and dependencies]'
+    'clean[remove object files]'
+    'doc[run godoc on package sources]'
+    'fix[run go tool fix on packages]'
+    'fmt[run gofmt on package sources]'
+    'get[download and install packages and dependencies]'
+    'help[display help]'
+    'install[compile and install packages and dependencies]'
+    'list[list packages]'
+    'run[compile and run Go program]'
+    'test[test packages]'
+    'tool[run specified go tool]'
+    'version[print Go version]'
+    'vet[run go tool vet on packages]'
+  )
+  if (( CURRENT == 2 )); then
+    # explain go commands
+    _values 'go tool commands' ${commands[@]}
+    return
+  fi
+  build_flags=(
+    '-a[force reinstallation of packages that are already up-to-date]'
+    '-n[print the commands but do not run them]'
+    "-p[number of parallel builds]:number"
+    '-x[print the commands]'
+    "-work[print temporary directory name and keep it]"
+    "-gcflags[flags for 5g/6g/8g]:flags"
+    "-ldflags[flags for 5l/6l/8l]:flags"
+    "-gccgoflags[flags for gccgo]:flags"
+  )
+  __go_list() {
+      local expl importpaths
+      declare -a importpaths
+      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
+      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
+  }
+  case ${words[2]} in
+  clean|doc)
+      _arguments -s -w : '*:importpaths:__go_list'
+      ;;
+  fix|fmt|list|vet)
+      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
+      ;;
+  install)
+      _arguments -s -w : ${build_flags[@]} \
+        "-v[show package names]" \
+	'*:importpaths:__go_list'
+      ;;
+  get)
+      _arguments -s -w : \
+        ${build_flags[@]}
+      ;;
+  build)
+      _arguments -s -w : \
+        ${build_flags[@]} \
+        "-v[show package names]" \
+        "-o[output file]:file:_files" \
+        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
+      ;;
+  test)
+      _arguments -s -w : \
+        ${build_flags[@]} \
+        "-c[do not run, compile the test binary]" \
+        "-i[do not run, install dependencies]" \
+        "-v[print test output]" \
+        "-x[print the commands]" \
+        "-short[use short mode]" \
+        "-parallel[number of parallel tests]:number" \
+        "-cpu[values of GOMAXPROCS to use]:number list" \
+        "-run[run tests and examples matching regexp]:regexp" \
+        "-bench[run benchmarks matching regexp]:regexp" \
+        "-benchtime[run each benchmark during n seconds]:duration" \
+        "-timeout[kill test after that duration]:duration" \
+        "-cpuprofile[write CPU profile to file]:file:_files" \
+        "-memprofile[write heap profile to file]:file:_files" \
+        "-memprofilerate[set heap profiling rate]:number" \
+        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
+      ;;
+  help)
+      _values "${commands[@]}" \
+        'gopath[GOPATH environment variable]' \
+        'importpath[description of import paths]' \
+        'remote[remote import path syntax]' \
+        'testflag[description of testing flags]' \
+        'testfunc[description of testing functions]'
+      ;;
+  run)
+      _arguments -s -w : \
+          ${build_flags[@]} \
+          '*:file:_path_files -g "*.go"'
+      ;;
+  tool)
+      if (( CURRENT == 3 )); then
+          _values "go tool" $(go tool)
+          return
+      fi
+      case ${words[3]} in
+      [568]g)
+          _arguments -s -w : \
+              '-I[search for packages in DIR]:includes:_path_files -/' \
+              '-L[show full path in file:line prints]' \
+              '-S[print the assembly language]' \
+              '-V[print the compiler version]' \
+              '-e[no limit on number of errors printed]' \
+              '-h[panic on an error]' \
+              '-l[disable inlining]' \
+              '-m[print optimization decisions]' \
+              '-o[file specify output file]:file' \
+              '-p[assumed import path for this code]:importpath' \
+              '-u[disable package unsafe]' \
+              "*:file:_files -g '*.go'"
+          ;;
+      [568]l)
+          local O=${words[3]%l}
+          _arguments -s -w : \
+              '-o[file specify output file]:file' \
+              '-L[search for packages in DIR]:includes:_path_files -/' \
+              "*:file:_files -g '*.[ao$O]'"
+          ;;
+      dist)
+          _values "dist tool" banner bootstrap clean env install version
+          ;;
+      *)
+          # use files by default
+          _files
+          ;;
+      esac
+      ;;
+  esac
+}
+
+compdef __go_tool_complete go

+ 150 - 0
lucid.remote/.oh-my-zsh/plugins/golang/golang.plugin.zsh

@@ -0,0 +1,150 @@
+# From : http://golang.org/misc/zsh/go?m=text
+# gc
+prefixes=(5 6 8)
+for p in $prefixes; do
+    compctl -g "*.${p}" ${p}l
+    compctl -g "*.go" ${p}g
+done
+
+# standard go tools
+compctl -g "*.go" gofmt
+
+# gccgo
+compctl -g "*.go" gccgo
+
+# go tool
+__go_tool_complete() {
+  typeset -a commands build_flags
+  commands+=(
+    'build[compile packages and dependencies]'
+    'clean[remove object files]'
+    'doc[run godoc on package sources]'
+    'fix[run go tool fix on packages]'
+    'fmt[run gofmt on package sources]'
+    'get[download and install packages and dependencies]'
+    'help[display help]'
+    'install[compile and install packages and dependencies]'
+    'list[list packages]'
+    'run[compile and run Go program]'
+    'test[test packages]'
+    'tool[run specified go tool]'
+    'version[print Go version]'
+    'vet[run go tool vet on packages]'
+  )
+  if (( CURRENT == 2 )); then
+    # explain go commands
+    _values 'go tool commands' ${commands[@]}
+    return
+  fi
+  build_flags=(
+    '-a[force reinstallation of packages that are already up-to-date]'
+    '-n[print the commands but do not run them]'
+    "-p[number of parallel builds]:number"
+    '-x[print the commands]'
+    "-work[print temporary directory name and keep it]"
+    "-gcflags[flags for 5g/6g/8g]:flags"
+    "-ldflags[flags for 5l/6l/8l]:flags"
+    "-gccgoflags[flags for gccgo]:flags"
+  )
+  __go_list() {
+      local expl importpaths
+      declare -a importpaths
+      importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
+      _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
+  }
+  case ${words[2]} in
+  clean|doc)
+      _arguments -s -w : '*:importpaths:__go_list'
+      ;;
+  fix|fmt|list|vet)
+      _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
+      ;;
+  install)
+      _arguments -s -w : ${build_flags[@]} \
+        "-v[show package names]" \
+    '*:importpaths:__go_list'
+      ;;
+  get)
+      _arguments -s -w : \
+        ${build_flags[@]}
+      ;;
+  build)
+      _arguments -s -w : \
+        ${build_flags[@]} \
+        "-v[show package names]" \
+        "-o[output file]:file:_files" \
+        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
+      ;;
+  test)
+      _arguments -s -w : \
+        ${build_flags[@]} \
+        "-c[do not run, compile the test binary]" \
+        "-i[do not run, install dependencies]" \
+        "-v[print test output]" \
+        "-x[print the commands]" \
+        "-short[use short mode]" \
+        "-parallel[number of parallel tests]:number" \
+        "-cpu[values of GOMAXPROCS to use]:number list" \
+        "-run[run tests and examples matching regexp]:regexp" \
+        "-bench[run benchmarks matching regexp]:regexp" \
+        "-benchtime[run each benchmark during n seconds]:duration" \
+        "-timeout[kill test after that duration]:duration" \
+        "-cpuprofile[write CPU profile to file]:file:_files" \
+        "-memprofile[write heap profile to file]:file:_files" \
+        "-memprofilerate[set heap profiling rate]:number" \
+        "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
+      ;;
+  help)
+      _values "${commands[@]}" \
+        'gopath[GOPATH environment variable]' \
+        'importpath[description of import paths]' \
+        'remote[remote import path syntax]' \
+        'testflag[description of testing flags]' \
+        'testfunc[description of testing functions]'
+      ;;
+  run)
+      _arguments -s -w : \
+          ${build_flags[@]} \
+          '*:file:_path_files -g "*.go"'
+      ;;
+  tool)
+      if (( CURRENT == 3 )); then
+          _values "go tool" $(go tool)
+          return
+      fi
+      case ${words[3]} in
+      [568]g)
+          _arguments -s -w : \
+              '-I[search for packages in DIR]:includes:_path_files -/' \
+              '-L[show full path in file:line prints]' \
+              '-S[print the assembly language]' \
+              '-V[print the compiler version]' \
+              '-e[no limit on number of errors printed]' \
+              '-h[panic on an error]' \
+              '-l[disable inlining]' \
+              '-m[print optimization decisions]' \
+              '-o[file specify output file]:file' \
+              '-p[assumed import path for this code]:importpath' \
+              '-u[disable package unsafe]' \
+              "*:file:_files -g '*.go'"
+          ;;
+      [568]l)
+          local O=${words[3]%l}
+          _arguments -s -w : \
+              '-o[file specify output file]:file' \
+              '-L[search for packages in DIR]:includes:_path_files -/' \
+              "*:file:_files -g '*.[ao$O]'"
+          ;;
+      dist)
+          _values "dist tool" banner bootstrap clean env install version
+          ;;
+      *)
+          # use files by default
+          _files
+          ;;
+      esac
+      ;;
+  esac
+}
+
+compdef __go_tool_complete go

+ 30 - 0
lucid.remote/.oh-my-zsh/plugins/gpg-agent/gpg-agent.plugin.zsh

@@ -0,0 +1,30 @@
+local GPG_ENV=$HOME/.gnupg/gpg-agent.env
+
+function start_agent_nossh {
+    eval $(/usr/bin/env gpg-agent --quiet --daemon --write-env-file ${GPG_ENV} 2> /dev/null)
+    chmod 600 ${GPG_ENV}
+    export GPG_AGENT_INFO
+}
+
+function start_agent_withssh {
+    eval $(/usr/bin/env gpg-agent --quiet --daemon --enable-ssh-support --write-env-file ${GPG_ENV} 2> /dev/null)
+    chmod 600 ${GPG_ENV}
+    export GPG_AGENT_INFO
+    export SSH_AUTH_SOCK
+    export SSH_AGENT_PID
+}
+
+# source settings of old agent, if applicable
+if [ -f "${GPG_ENV}" ]; then
+  . ${GPG_ENV} > /dev/null
+fi
+
+# check for existing ssh-agent
+if ssh-add -l > /dev/null 2> /dev/null; then
+    start_agent_nossh;
+else
+    start_agent_withssh;
+fi
+
+GPG_TTY=$(tty)
+export GPG_TTY

+ 106 - 0
lucid.remote/.oh-my-zsh/plugins/gradle/gradle.plugin.zsh

@@ -0,0 +1,106 @@
+#!zsh
+##############################################################################
+# A descriptive listing of core Gradle commands 
+############################################################################
+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]' \
+    '-h[Help]' \
+    '-D[System property]' \
+    '-d[Log at the debug level]' \
+    '--gui[Launches the Gradle GUI app]' \
+    '--stop[Stop the Gradle daemon]' \
+    '--daemon[Use the Gradle daemon]' \
+    '--no-daemon[Do not use the Gradle daemon]' \
+    '--no-opt[Do not perform any task optimization]' \
+    '-i[Log at the info level]' \
+    '-m[Dry run]' \
+    '-P[Set a project property]' \
+    '--profile[Profile the build time]' \
+    '-q[Log at the quiet level (only show errors)]' \
+    '-v[Print the Gradle version info]' \
+    '-x[Specify a task to be excluded]' \
+    '*::command:->command' \
+    && return 0
+}
+
+
+##############################################################################
+# Are we in a directory containing a build.gradle file?
+############################################################################
+function in_gradle() {
+    if [[ -f build.gradle ]]; then
+        echo 1
+    fi
+}
+
+############################################################################## Examine the build.gradle file to see if its
+# timestamp has changed, and if so, regen
+# the .gradle_tasks cache file
+############################################################################
+_gradle_does_task_list_need_generating () {
+  [ ! -f .gradletasknamecache ] && return 0;
+  [ .gradletasknamecache -nt build.gradle ] && return 0;
+  return 1;
+}
+
+
+##############################################################################
+# Discover the gradle tasks by running "gradle tasks --all"
+############################################################################
+_gradle_tasks () {
+  if [ in_gradle ]; then
+    _gradle_arguments
+    if _gradle_does_task_list_need_generating; then
+     gradle tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .gradletasknamecache
+    fi
+    compadd -X "==== Gradle Tasks ====" `cat .gradletasknamecache`
+  fi
+}
+
+_gradlew_tasks () {
+  if [ in_gradle ]; then
+    _gradle_arguments
+    if _gradle_does_task_list_need_generating; then
+     gradlew tasks --all | grep "^[ ]*[a-zA-Z0-9]*\ -\ " | sed "s/ - .*$//" | sed "s/[\ ]*//" > .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
+
+
+##############################################################################
+# Open questions for future improvements:
+# 1) Should 'gradle tasks' use --all or just the regular set?
+# 2) Should gradlew use the same approach as gradle?
+# 3) Should only the " - " be replaced with a colon so it can work
+#     with the richer descriptive method of _arguments?
+#     gradle tasks | grep "^[a-zA-Z0-9]*\ -\ " | sed "s/ - /\:/"
+#############################################################################

+ 60 - 0
lucid.remote/.oh-my-zsh/plugins/grails/grails.plugin.zsh

@@ -0,0 +1,60 @@
+_enumerateGrailsScripts() {
+    # Default directoryies
+    directories=($GRAILS_HOME/scripts ~/.grails/scripts ./scripts)
+
+    # Check all of the plugins directories, if they exist
+    if [ -d plugins ]
+    then
+        directories+=(plugins/*/scripts)
+    fi
+    
+    # Enumerate all of the Groovy files
+    files=()
+    for dir in $directories;
+    do
+        if [ -d $dir ]
+        then
+            files+=($dir/[^_]*.groovy)
+        fi
+    done
+    
+    # Don't try to basename ()
+    if [ ${#files} -eq 0 ];
+    then
+        return
+    fi
+    
+    scripts=()
+    for file in $files
+    do
+        # - Strip the path
+        # - Remove all scripts with a leading '_'
+        # - PackagePlugin_.groovy -> PackagePlugin
+        # - PackagePlugin         -> Package-Plugin
+        # - Package-Plugin        -> package-plugin
+        command=$(basename $file                              \
+            | sed -E  -e 's/^_?([^_]+)_?.groovy/\1/'\
+                      -e 's/([a-z])([A-Z])/\1-\2/g' \
+            | tr "[:upper:]" "[:lower:]"            \
+            | sort                                  \
+            | uniq)
+        scripts+=($command)
+    done
+    echo $scripts
+}
+ 
+_grails() {
+    if (( CURRENT == 2 )); then
+        scripts=( $(_enumerateGrailsScripts) )
+        
+        if [ ${#scripts} -ne 0 ];
+        then
+            _multi_parts / scripts
+            return
+        fi
+    fi
+    
+    _files
+}
+ 
+compdef _grails grails

+ 159 - 0
lucid.remote/.oh-my-zsh/plugins/heroku/_heroku

@@ -0,0 +1,159 @@
+#compdef heroku
+
+# Heroku Autocomplete plugin for Oh-My-Zsh
+# Requires: The Heroku client gem (https://github.com/heroku/heroku)
+# Author: Ali B. (http://awhitebox.com)
+
+local -a _1st_arguments
+_1st_arguments=(
+  "account\:confirm_billing":"Confirm that your account can be billed at the end of the month"
+  "addons":"list installed addons"
+  "addons\:list":"list all available addons"
+  "addons\:add":"install an addon"
+  "addons\:upgrade":"upgrade an existing addon"
+  "addons\:downgrade":"downgrade an existing addon"
+  "addons\:remove":"uninstall an addon"
+  "addons\:open":"open an addon's dashboard in your browser"
+  "apps":"list your apps"
+  "apps\:info":"show detailed app information"
+  "apps\:create":"create a new app"
+  "apps\:rename":"rename the app"
+  "apps\:open":"open the app in a web browser"
+  "apps\:destroy":"permanently destroy an app"
+  "auth\:login":"log in with your heroku credentials"
+  "auth\:logout":"clear local authentication credentials"
+  "config":"display the config vars for an app"
+  "config\:add":"add one or more config vars"
+  "config\:remove":"remove a config var"
+  "db\:push":"push local data up to your app"
+  "db\:pull":"pull heroku data down into your local database"
+  "domains":"list custom domains for an app"
+  "domains\:add":"add a custom domain to an app"
+  "domains\:remove":"remove a custom domain from an app"
+  "domains\:clear":"remove all custom domains from an app"
+  "help":"list available commands or display help for a specific command"
+  "keys":"display keys for the current user"
+  "keys\:add":"add a key for the current user"
+  "keys\:remove":"remove a key from the current user"
+  "keys\:clear":"remove all authentication keys from the current user"
+  "logs":"display recent log output"
+  "logs\:cron":"DEPRECATED: display cron logs from legacy logging"
+  "logs\:drains":"manage syslog drains"
+  "maintenance\:on":"put the app into maintenance mode"
+  "maintenance\:off":"take the app out of maintenance mode"
+  "pg\:info":"display database information"
+  "pg\:ingress":"allow direct connections to the database from this IP for one minute"
+  "pg\:promote":"sets DATABASE as your DATABASE_URL"
+  "pg\:psql":"open a psql shell to the database"
+  "pg\:reset":"delete all data in DATABASE"
+  "pg\:unfollow":"stop a replica from following and make it a read/write database"
+  "pg\:wait":"monitor database creation, exit when complete"
+  "pgbackups":"list captured backups"
+  "pgbackups\:url":"get a temporary URL for a backup"
+  "pgbackups\:capture":"capture a backup from a database id"
+  "pgbackups\:restore":"restore a backup to a database"
+  "pgbackups\:destroy":"destroys a backup"
+  "plugins":"list installed plugins"
+  "plugins\:install":"install a plugin"
+  "plugins\:uninstall":"uninstall a plugin"
+  "ps\:dynos":"scale to QTY web processes"
+  "ps\:workers":"scale to QTY background processes"
+  "ps":"list processes for an app"
+  "ps\:restart":"restart an app process"
+  "ps\:scale":"scale processes by the given amount"
+  "releases":"list releases"
+  "releases\:info":"view detailed information for a release"
+  "rollback":"roll back to an older release"
+  "run":"run an attached process"
+  "run\:rake":"remotely execute a rake command"
+  "run\:console":"open a remote console session"
+  "sharing":"list collaborators on an app"
+  "sharing\:add":"add a collaborator to an app"
+  "sharing\:remove":"remove a collaborator from an app"
+  "sharing\:transfer":"transfer an app to a new owner"
+  "ssl":"list certificates for an app"
+  "ssl\:add":"add an ssl certificate to an app"
+  "ssl\:remove":"remove an ssl certificate from an app"
+  "ssl\:clear":"remove all ssl certificates from an app"
+  "stack":"show the list of available stacks"
+  "stack\:migrate":"prepare migration of this app to a new stack"
+  "version":"show heroku client version"
+)
+
+_arguments '*:: :->command'
+
+if (( CURRENT == 1 )); then
+  _describe -t commands "heroku command" _1st_arguments
+  return
+fi
+
+local -a _command_args
+case "$words[1]" in
+  apps:info)
+    _command_args=(
+      '(-r|--raw)'{-r,--raw}'[output info as raw key/value pairs]' \
+    )
+    ;;
+  apps:create)
+    _command_args=(
+      '(-a|--addons)'{-a,--addons}'[a list of addons to install]' \
+      '(-r|--remote)'{-r,--remote}'[the git remote to create, default "heroku"]' \
+      '(-s|--stack)'{-s,--stack}'[the stack on which to create the app]' \
+    )
+    ;;
+  config)
+    _command_args=(
+      '(-s|--shell)'{-s,--shell}'[output config vars in shell format]' \
+    )
+    ;;
+  db:push)
+    _command_args=(
+      '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
+      '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
+      '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the push]' \
+      '(-f|--filter)'{-f,--filter}'[only push certain tables]' \
+      '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
+      '(-t|--tables)'{-t,--tables}'[only push the specified tables]' \
+    )
+    ;;
+  db:pull)
+    _command_args=(
+      '(-c|--chunksize)'{-c,--chunksize}'[specify the number of rows to send in each batch]' \
+      '(-d|--debug)'{-d,--debug}'[enable debugging output]' \
+      '(-e|--exclude)'{-e,--exclude}'[exclude the specified tables from the pull]' \
+      '(-f|--filter)'{-f,--filter}'[only pull certain tables]' \
+      '(-r|--resume)'{-r,--resume}'[resume transfer described by a .dat file]' \
+      '(-t|--tables)'{-t,--tables}'[only pull the specified tables]' \
+    )
+    ;;
+  keys)
+    _command_args=(
+      '(-l|--long)'{-l,--long}'[display extended information for each key]' \
+    )
+    ;;
+  logs)
+    _command_args=(
+      '(-n|--num)'{-n,--num}'[the number of lines to display]' \
+      '(-p|--ps)'{-p,--ps}'[only display logs from the given process]' \
+      '(-s|--source)'{-s,--source}'[only display logs from the given source]' \
+      '(-t|--tail)'{-t,--tail}'[continually stream logs]' \
+    )
+    ;;
+  pgbackups:capture)
+    _command_args=(
+      '(-e|--expire)'{-e,--expire}'[if no slots are available to capture, delete the oldest backup to make room]' \
+    )
+    ;;
+  stack)
+    _command_args=(
+      '(-a|--all)'{-a,--all}'[include deprecated stacks]' \
+    )
+    ;;
+  esac
+
+_arguments \
+  $_command_args \
+  '(--app)--app[the app name]' \
+  '(--remote)--remote[the remote name]' \
+  &&  return 0
+

+ 7 - 0
lucid.remote/.oh-my-zsh/plugins/history-substring-search/README

@@ -0,0 +1,7 @@
+To activate this script, load it into an interactive ZSH session:
+
+  % source history-substring-search.zsh
+
+See the "history-substring-search.zsh" file for more information:
+
+  % sed -n '2,/^$/s/^#//p' history-substring-search.zsh | more

+ 12 - 0
lucid.remote/.oh-my-zsh/plugins/history-substring-search/history-substring-search.plugin.zsh

@@ -0,0 +1,12 @@
+# This file integrates the history-substring-search script into oh-my-zsh.
+
+source "$ZSH/plugins/history-substring-search/history-substring-search.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

+ 642 - 0
lucid.remote/.oh-my-zsh/plugins/history-substring-search/history-substring-search.zsh

@@ -0,0 +1,642 @@
+#!/usr/bin/env zsh
+#
+# This is a clean-room implementation of the Fish[1] shell's history search
+# 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.
+#
+#-----------------------------------------------------------------------------
+# Usage
+#-----------------------------------------------------------------------------
+#
+# 1. Load this script into your interactive ZSH session:
+#
+#       % source history-substring-search.zsh
+#
+#    If you want to use the zsh-syntax-highlighting[6] script along with this
+#    script, then make sure that you load it *before* you load this script:
+#
+#       % source zsh-syntax-highlighting.zsh
+#       % source history-substring-search.zsh
+#
+# 2. Type any part of any previous command and then:
+#
+#     * 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 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.
+#
+# 3. 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 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
+#   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
+#   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
+#   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
+#-----------------------------------------------------------------------------
+#
+# 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[3] project in January 2011.
+#
+# It was later extracted from fizsh[3] 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.
+#
+# It was further developed[4] by Guido van Steen, Suraj N. Kurapati, Sorin
+# Ionescu, and Vincent Guerci in 2011.
+#
+# [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
+# [5]: https://github.com/sunaku/zsh-history-substring-search
+# [6]: https://github.com/nicoulaj/zsh-syntax-highlighting
+#
+##############################################################################
+#
+# Copyright (c) 2009 Peter Stephenson
+# Copyright (c) 2011 Guido van Steen
+# Copyright (c) 2011 Suraj N. Kurapati
+# Copyright (c) 2011 Sorin Ionescu
+# Copyright (c) 2011 Vincent Guerci
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+#  * Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#  * Redistributions in binary form must reproduce the above
+#    copyright notice, this list of conditions and the following
+#    disclaimer in the documentation and/or other materials provided
+#    with the distribution.
+#
+#  * Neither the name of the FIZSH nor the names of its contributors
+#    may be used to endorse or promote products derived from this
+#    software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+##############################################################################
+
+#-----------------------------------------------------------------------------
+# configuration variables
+#-----------------------------------------------------------------------------
+
+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
+#-----------------------------------------------------------------------------
+
+function history-substring-search-up() {
+  _history-substring-search-begin
+
+  _history-substring-search-up-history ||
+  _history-substring-search-up-buffer ||
+  _history-substring-search-up-search
+
+  _history-substring-search-end
+}
+
+function history-substring-search-down() {
+  _history-substring-search-begin
+
+  _history-substring-search-down-history ||
+  _history-substring-search-down-buffer ||
+  _history-substring-search-down-search
+
+  _history-substring-search-end
+}
+
+zle -N history-substring-search-up
+zle -N history-substring-search-down
+
+bindkey '\e[A' history-substring-search-up
+bindkey '\e[B' history-substring-search-down
+
+#-----------------------------------------------------------------------------
+# implementation details
+#-----------------------------------------------------------------------------
+
+setopt extendedglob
+zmodload -F zsh/parameter
+
+#
+# We have to "override" some keys and widgets if the
+# zsh-syntax-highlighting plugin has not been loaded:
+#
+# https://github.com/nicoulaj/zsh-syntax-highlighting
+#
+if [[ $+functions[_zsh_highlight] -eq 0 ]]; then
+  #
+  # Dummy implementation of _zsh_highlight()
+  # that simply removes existing highlights
+  #
+  function _zsh_highlight() {
+    region_highlight=()
+  }
+
+  #
+  # Remove existing highlights when the user
+  # inserts printable characters into $BUFFER
+  #
+  function ordinary-key-press() {
+    if [[ $KEYS == [[:print:]] ]]; then
+      region_highlight=()
+    fi
+    zle .self-insert
+  }
+  zle -N self-insert ordinary-key-press
+
+  #
+  # Override ZLE widgets to invoke _zsh_highlight()
+  #
+  # https://github.com/nicoulaj/zsh-syntax-highlighting/blob/
+  # bb7fcb79fad797a40077bebaf6f4e4a93c9d8163/zsh-syntax-highlighting.zsh#L121
+  #
+  #--------------8<-------------------8<-------------------8<-----------------
+  #
+  # Copyright (c) 2010-2011 zsh-syntax-highlighting contributors
+  # All rights reserved.
+  #
+  # Redistribution and use in source and binary forms, with or without
+  # modification, are permitted provided that the following conditions are
+  # met:
+  #
+  #  * Redistributions of source code must retain the above copyright
+  #    notice, this list of conditions and the following disclaimer.
+  #
+  #  * Redistributions in binary form must reproduce the above copyright
+  #    notice, this list of conditions and the following disclaimer in the
+  #    documentation and/or other materials provided with the distribution.
+  #
+  #  * Neither the name of the zsh-syntax-highlighting contributors nor the
+  #    names of its contributors may be used to endorse or promote products
+  #    derived from this software without specific prior written permission.
+  #
+  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+  # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+  # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+  # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+  # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+  # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+  # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+  # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+  # Load ZSH module zsh/zleparameter, needed to override user defined widgets.
+  zmodload zsh/zleparameter 2>/dev/null || {
+    echo 'zsh-syntax-highlighting: failed loading zsh/zleparameter, exiting.' >&2
+    return -1
+  }
+
+  # Override ZLE widgets to make them invoke _zsh_highlight.
+  for event in ${${(f)"$(zle -la)"}:#(_*|orig-*|.run-help|.which-command)}; do
+    if [[ "$widgets[$event]" == completion:* ]]; then
+      eval "zle -C orig-$event ${${${widgets[$event]}#*:}/:/ } ; $event() { builtin zle orig-$event && _zsh_highlight } ; zle -N $event"
+    else
+      case $event in
+        accept-and-menu-complete)
+          eval "$event() { builtin zle .$event && _zsh_highlight } ; zle -N $event"
+          ;;
+
+        # The following widgets should NOT remove any previously
+        # applied highlighting. Therefore we do not remap them.
+        .forward-char|.backward-char|.up-line-or-history|.down-line-or-history)
+          ;;
+
+        .*)
+          clean_event=$event[2,${#event}] # Remove the leading dot in the event name
+          case ${widgets[$clean_event]-} in
+            (completion|user):*)
+              ;;
+            *)
+              eval "$clean_event() { builtin zle $event && _zsh_highlight } ; zle -N $clean_event"
+              ;;
+          esac
+          ;;
+        *)
+          ;;
+      esac
+    fi
+  done
+  unset event clean_event
+  #-------------->8------------------->8------------------->8-----------------
+fi
+
+function _history-substring-search-begin() {
+  _history_substring_search_move_cursor_eol=false
+  _history_substring_search_query_highlight=
+
+  #
+  # Continue using the previous $_history_substring_search_result by default,
+  # unless the current query was cleared or a new/different query was entered.
+  #
+  if [[ -z $BUFFER || $BUFFER != $_history_substring_search_result ]]; then
+    #
+    # For the purpose of highlighting we will also keep
+    # a version without doubly-escaped meta characters.
+    #
+    _history_substring_search_query=$BUFFER
+
+    #
+    # $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 "\\\)".
+    #
+    _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH}
+
+    #
+    # Find all occurrences of the search query in the history file.
+    #
+    # (k) turns it an array of line numbers.
+    #
+    # (on) seems to remove duplicates, which are default
+    #      options. They can be turned off by (ON).
+    #
+    _history_substring_search_matches=(${(kon)history[(R)(#$HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS)*${_history_substring_search_query_escaped}*]})
+
+    #
+    # 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_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
+}
+
+function _history-substring-search-end() {
+  _history_substring_search_result=$BUFFER
+
+  # move the cursor to the end of the command line
+  if [[ $_history_substring_search_move_cursor_eol == true ]]; then
+    CURSOR=${#BUFFER}
+  fi
+
+  # highlight command line using zsh-syntax-highlighting
+  _zsh_highlight
+
+  # highlight the search query inside the command line
+  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:
+  # zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches}
+  # read -k -t 200 && zle -U $REPLY
+
+  # Exit successfully from the history-substring-search-* widgets.
+  true
+}
+
+function _history-substring-search-up-buffer() {
+  #
+  # Check if the UP arrow was pressed to move the cursor within a multi-line
+  # buffer. This amounts to three tests:
+  #
+  # 1. $#buflines -gt 1.
+  #
+  # 2. $CURSOR -ne $#BUFFER.
+  #
+  # 3. Check if we are on the first line of the current multi-line buffer.
+  #    If so, pressing UP would amount to leaving the multi-line buffer.
+  #
+  #    We check this by adding an extra "x" to $LBUFFER, which makes
+  #    sure that xlbuflines is always equal to the number of lines
+  #    until $CURSOR (including the line with the cursor on it).
+  #
+  local buflines XLBUFFER xlbuflines
+  buflines=(${(f)BUFFER})
+  XLBUFFER=$LBUFFER"x"
+  xlbuflines=(${(f)XLBUFFER})
+
+  if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xlbuflines -ne 1 ]]; then
+    zle up-line-or-history
+    return true
+  fi
+
+  false
+}
+
+function _history-substring-search-down-buffer() {
+  #
+  # Check if the DOWN arrow was pressed to move the cursor within a multi-line
+  # buffer. This amounts to three tests:
+  #
+  # 1. $#buflines -gt 1.
+  #
+  # 2. $CURSOR -ne $#BUFFER.
+  #
+  # 3. Check if we are on the last line of the current multi-line buffer.
+  #    If so, pressing DOWN would amount to leaving the multi-line buffer.
+  #
+  #    We check this by adding an extra "x" to $RBUFFER, which makes
+  #    sure that xrbuflines is always equal to the number of lines
+  #    from $CURSOR (including the line with the cursor on it).
+  #
+  local buflines XRBUFFER xrbuflines
+  buflines=(${(f)BUFFER})
+  XRBUFFER="x"$RBUFFER
+  xrbuflines=(${(f)XRBUFFER})
+
+  if [[ $#buflines -gt 1 && $CURSOR -ne $#BUFFER && $#xrbuflines -ne 1 ]]; then
+    zle down-line-or-history
+    return true
+  fi
+
+  false
+}
+
+function _history-substring-search-up-history() {
+  #
+  # Behave like up in ZSH, except clear the $BUFFER
+  # when beginning of history is reached like in Fish.
+  #
+  if [[ -z $_history_substring_search_query ]]; then
+
+    # we have reached the absolute top of history
+    if [[ $HISTNO -eq 1 ]]; then
+      BUFFER=
+
+    # going up from somewhere below the top of history
+    else
+      zle up-history
+    fi
+
+    return true
+  fi
+
+  false
+}
+
+function _history-substring-search-down-history() {
+  #
+  # Behave like down-history in ZSH, except clear the
+  # $BUFFER when end of history is reached like in Fish.
+  #
+  if [[ -z $_history_substring_search_query ]]; then
+
+    # going down from the absolute top of history
+    if [[ $HISTNO -eq 1 && -z $BUFFER ]]; then
+      BUFFER=${history[1]}
+      _history_substring_search_move_cursor_eol=true
+
+    # going down from somewhere above the bottom of history
+    else
+      zle down-history
+    fi
+
+    return true
+  fi
+
+  false
+}
+
+function _history-substring-search-up-search() {
+  _history_substring_search_move_cursor_eol=true
+
+  #
+  # Highlight matches during history-substring-up-search:
+  #
+  # The following constants have been initialized in
+  # _history-substring-search-up/down-search():
+  #
+  # $_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
+  #
+  # The range of values that $_history_substring_search_match_index can take
+  # 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_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
+  # $_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
+
+  elif [[ $_history_substring_search_match_index -eq 1 ]]; then
+    #
+    # We will move beyond the end of $_history_substring_search_matches:
+    #
+    # 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_old_buffer=$BUFFER
+    BUFFER=$_history_substring_search_query
+    _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
+
+  elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count_plus ]]; then
+    #
+    # We were beyond the beginning of $_history_substring_search_matches but
+    # UP makes us move back to $_history_substring_search_matches:
+    #
+    # 1. Decrease the value of $_history_substring_search_match_index.
+    #
+    # 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
+  fi
+}
+
+function _history-substring-search-down-search() {
+  _history_substring_search_move_cursor_eol=true
+
+  #
+  # Highlight matches during history-substring-up-search:
+  #
+  # The following constants have been initialized in
+  # _history-substring-search-up/down-search():
+  #
+  # $_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
+  #
+  # The range of values that $_history_substring_search_match_index can take
+  # 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_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
+  # $_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
+
+  elif [[ $_history_substring_search_match_index -eq $_history_substring_search_matches_count ]]; then
+    #
+    # We will move beyond the beginning of $_history_substring_search_matches:
+    #
+    # 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_old_buffer=$BUFFER
+    BUFFER=$_history_substring_search_query
+    _history_substring_search_query_highlight=$HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
+
+  elif [[ $_history_substring_search_match_index -eq 0 ]]; then
+    #
+    # We were beyond the end of $_history_substring_search_matches but DOWN
+    # makes us move back to the $_history_substring_search_matches:
+    #
+    # 1. Increase $_history_substring_search_match_index by 1.
+    #
+    # 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
+  fi
+}
+
+# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
+# vim: ft=zsh sw=2 ts=2 et

+ 8 - 0
lucid.remote/.oh-my-zsh/plugins/history/history.plugin.zsh

@@ -0,0 +1,8 @@
+alias h='history'
+
+function hs
+{
+    history | grep $*
+}
+
+alias hsi='hs -i'

+ 14 - 0
lucid.remote/.oh-my-zsh/plugins/jake-node/jake-node.plugin.zsh

@@ -0,0 +1,14 @@
+#---oh-my-zsh plugin : task Autocomplete for Jake tool---
+# Jake : https://github.com/mde/jake
+# Warning : Jakefile should have the right case : Jakefile or jakefile
+# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
+# Author : Alexandre Lacheze (@al3xstrat)
+# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh 
+
+function _jake () {
+  if [ -f Jakefile ]||[ -f jakefile ]; then
+    compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
+  fi
+}
+
+compdef _jake jake

+ 38 - 0
lucid.remote/.oh-my-zsh/plugins/jira/jira.plugin.zsh

@@ -0,0 +1,38 @@
+# To use: add a .jira-url file in the base of your project
+#         You can also set JIRA_URL in your .zshrc or put .jira-url in your home directory
+#         .jira-url in the current directory takes precedence
+#
+# If you use Rapid Board, set:
+#JIRA_RAPID_BOARD="yes"
+# in you .zshrc
+#
+# Setup: cd to/my/project
+#        echo "https://name.jira.com" >> .jira-url
+# Usage: jira           # opens a new issue
+#        jira ABC-123   # Opens an existing issue
+open_jira_issue () {
+  if [ -f .jira-url ]; then
+    jira_url=$(cat .jira-url)
+  elif [ -f ~/.jira-url ]; then
+    jira_url=$(cat ~/.jira-url)
+  elif [[ "x$JIRA_URL" != "x" ]]; then
+    jira_url=$JIRA_URL
+  else
+    echo "JIRA url is not specified anywhere."
+    return 0
+  fi
+
+  if [ -z "$1" ]; then
+    echo "Opening new issue"
+    `open $jira_url/secure/CreateIssue!default.jspa`
+  else
+    echo "Opening issue #$1"
+    if [[ "x$JIRA_RAPID_BOARD" = "yes" ]]; then
+      `open $jira_url/issues/$1`
+    else
+      `open $jira_url/browse/$1`
+    fi
+  fi
+}
+
+alias jira='open_jira_issue'

+ 4 - 0
lucid.remote/.oh-my-zsh/plugins/jruby/jruby.plugin.zsh

@@ -0,0 +1,4 @@
+# Aliases
+alias jrspec='jruby --debug -S rspec --debug'
+alias jprofile='jruby --profile.api -S rspec'
+alias jexec='jruby -S'

+ 9 - 0
lucid.remote/.oh-my-zsh/plugins/kate/kate.plugin.zsh

@@ -0,0 +1,9 @@
+
+# Kate
+# Start kate always silent
+alias kate='kate >/dev/null 2>&1'
+
+function kt () {
+  cd $1
+  kate $1
+}

+ 198 - 0
lucid.remote/.oh-my-zsh/plugins/knife/_knife

@@ -0,0 +1,198 @@
+#compdef knife
+
+# You can override the path to knife.rb and your cookbooks by setting
+# KNIFE_CONF_PATH=/path/to/my/.chef/knife.rb
+# KNIFE_COOKBOOK_PATH=/path/to/my/chef/cookbooks
+# Read around where these are used for more detail.
+
+# These flags should be available everywhere according to man knife
+knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
+
+# knife has a very special syntax, some example calls are:
+# knife status
+# knife cookbook list
+# knife role show ROLENAME
+# knife data bag show DATABAGNAME
+# knife role show ROLENAME --attribute ATTRIBUTENAME
+# knife cookbook show COOKBOOKNAME COOKBOOKVERSION recipes
+
+# 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
+_knife() {
+  local curcontext="$curcontext" state line
+  typeset -A opt_args
+  cloudproviders=(bluebox ec2 rackspace slicehost terremark)
+  _arguments \
+    '1: :->knifecmd'\
+    '2: :->knifesubcmd'\
+    '3: :->knifesubcmd2' \
+    '4: :->knifesubcmd3' \
+    '5: :->knifesubcmd4' \
+    '6: :->knifesubcmd5'
+  
+  case $state in
+  knifecmd)
+    compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload windows $cloudproviders
+  ;;
+  knifesubcmd)
+    case $words[2] in
+    (bluebox|ec2|rackspace|slicehost|terremark)
+      compadd "$@" server images
+    ;;
+    client)
+      compadd -Q "$@" "bulk delete" list create show delete edit reregister
+    ;;
+    configure)
+      compadd "$@" client
+    ;;
+    cookbook)
+      compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
+    ;;
+    diff)
+      _arguments '*:file or directory:_files -g "*"'
+    ;;
+    environment)
+      compadd -Q "$@" list create delete edit show "from file"
+    ;;
+    node)
+     compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
+    ;;
+    recipe)
+     compadd "$@" list
+    ;;
+    role)
+      compadd -Q "$@" "bulk delete" create delete edit "from file" list show
+    ;; 
+    upload)
+     _arguments '*:file or directory:_files -g "*"'
+    ;;
+    windows)
+      compadd "$@" bootstrap
+    ;;
+    *)
+    _arguments '2:Subsubcommands:($(_knife_options1))'
+    esac
+   ;;
+   knifesubcmd2)
+    case $words[3] in
+     server)
+      compadd "$@" list create delete
+    ;;
+     images)
+      compadd "$@" list
+    ;;
+     site)
+      compadd "$@" vendor show share search download list unshare
+    ;;
+     (show|delete|edit)
+     _arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
+    ;;
+    (upload|test)
+     _arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
+    ;;
+    list)
+     compadd -a "$@" knife_general_flags
+    ;;
+    bag)
+      compadd -Q "$@" show edit list "from file" create delete
+    ;;
+    *)
+      _arguments '3:Subsubcommands:($(_knife_options2))'
+    esac
+   ;;
+   knifesubcmd3)
+     case $words[3] in
+      show)
+       case $words[2] in
+       cookbook)
+          versioncomp=1
+          _arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
+       ;;
+       (node|client|role)
+         compadd "$@" --attribute
+       esac
+     esac
+     case $words[4] in
+     (show|edit)
+     _arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
+    ;;
+     file)
+     _arguments '*:file or directory:_files -g "*.(rb|json)"'
+    ;;
+      list)
+     compadd -a "$@" knife_general_flags
+    ;;
+        *)
+       _arguments '*:Subsubcommands:($(_knife_options3))'
+    esac
+    ;;
+    knifesubcmd4)
+      if (( versioncomp > 0 )); then
+        compadd "$@" attributes definitions files libraries providers recipes resources templates
+      else
+       _arguments '*:Subsubcommands:($(_knife_options2))'
+      fi
+    ;; 
+    knifesubcmd5) 
+      _arguments '*:Subsubcommands:($(_knife_options3))'
+   esac
+}
+
+# Helper functions to provide the argument completion for several depths of commands
+_knife_options1() {
+ ( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+_knife_options2() {
+ ( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+_knife_options3() {
+ ( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
+}
+
+# The chef_x_remote functions use knife to get a list of objects of type x on the server
+_chef_roles_remote() {
+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_clients_remote() {
+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_nodes_remote() {
+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_cookbooks_remote() {
+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_sitecookbooks_remote() {
+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_data_bags_remote() {
+ (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+}
+
+_chef_environments_remote() {
+  (knife environment list | awk '{print $1}')
+}
+
+# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
+_chef_cookbooks_local() {
+  
+  local knife_rb=${KNIFE_CONF_PATH:-${HOME}/.chef/knife.rb}
+  if [ -f ./.chef/knife.rb ]; then
+    knife_rb="./.chef/knife.rb"
+  fi
+  local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
+  (for i in $cookbook_path; do ls $i; done)
+}
+
+# This function extracts the available cookbook versions on the chef server
+_cookbook_versions() {
+  (knife cookbook show $words[4] | grep -v $words[4] | grep -v -E '\]|\[|\{|\}' | sed 's/ //g' | sed 's/"//g')
+}
+
+_knife "$@"

+ 40 - 0
lucid.remote/.oh-my-zsh/plugins/laravel/_artisan

@@ -0,0 +1,40 @@
+#compdef artisan
+
+# Laravel autocompletion
+# Author: John Hamelink <john@johnhamelink.com>
+#
+# This plugin does the following:
+#  - Adds aliases and autocompletion for artisan
+#  - Adds aliases and autocompletion for bob
+
+local curcontext="$curcontext" state line _opts _bundles ret=1
+_arguments -C \
+    '1: :->cmds' \
+    '*:: :->args' && ret=0
+
+case $state in
+    cmds)
+
+    _values "Artisan command" \
+        'session\:install[Create a session table]' \
+        'migrate[Manage Migrations]' \
+        'test[Run a test]' \
+        'route\:\:call[Call a route in the CLI]' \
+        'key\:\:generate[Generate a key]'
+        ret=0
+        ;;
+    args)
+        case $line[1] in
+            migrate)
+                _values \
+                    'install[Create the Laravel migration table' \
+                    'make[Create a migration]' \
+                    'rollback[Roll back to the last migration operation]' \
+                    'reset[Roll back all migrations that have ever run]'
+                ret=0
+                ;;
+        esac
+        ;;
+esac
+
+return ret

+ 3 - 0
lucid.remote/.oh-my-zsh/plugins/laravel/laravel.plugin.zsh

@@ -0,0 +1,3 @@
+#!zsh
+alias artisan='php artisan'
+alias bob='php artisan bob::build'

+ 25 - 0
lucid.remote/.oh-my-zsh/plugins/last-working-dir/last-working-dir.plugin.zsh

@@ -0,0 +1,25 @@
+#!/usr/bin/env zsh
+# Keeps track of the last used working directory and automatically jumps
+# into it for new shells.
+
+# Flag indicating if we've previously jumped to last directory.
+typeset -g ZSH_LAST_WORKING_DIRECTORY
+mkdir -p "$ZSH/cache"
+local cache_file="$ZSH/cache/last-working-dir"
+
+# Updates the last directory once directory is changed.
+function chpwd() {
+  # Use >| in case noclobber is set to avoid "file exists" error
+	pwd >| "$cache_file"
+}
+
+# Changes directory to the last working directory.
+function lwd() {
+	[[ ! -r "$cache_file" ]] || cd `cat "$cache_file"`
+}
+
+# Automatically jump to last working directory unless this isn't the first time
+# this plugin has been loaded.
+if [[ -z "$ZSH_LAST_WORKING_DIRECTORY" ]]; then
+	lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true
+fi

+ 41 - 0
lucid.remote/.oh-my-zsh/plugins/lein/lein.plugin.zsh

@@ -0,0 +1,41 @@
+function _lein_commands() {
+    local ret=1 state
+    _arguments ':subcommand:->subcommand' && ret=0
+
+    case $state in
+      subcommand)
+        subcommands=(
+          "classpath:print the classpath of the current project"
+          "clean:remove compiled files and dependencies from project"
+          "compile:ahead-of-time compile the project"
+          "deploy:build jar and deploy to remote repository"
+          "deps:download and install all dependencies"
+          "help:display a list of tasks or help for a given task"
+          "install:install the project and its dependencies in your local repository"
+          "int:enter an interactive task shell"
+          "interactive:enter an interactive task shell"
+          "jack-in:jack in to a clojure slime session from emacs."
+          "jar:create a jar file containing the compiled .class files"
+          "javac:compile java source files"
+          "new:create a new project skeleton"
+          "plugin:manage user-level plugins"
+          "pom:write a pom.xml file to disk for maven interop"
+          "repl:start a repl session either with the current project or standalone"
+          "retest:run only the test namespaces which failed last time around"
+          "run:run the project's -main function"
+          "search:search remote maven repositories for matching jars"
+          "swank:launch swank server for Emacs to connect"
+          "test:run the project's tests"
+          "test!:run a project's tests after cleaning and fetching dependencies"
+          "trampoline:run a task without nesting the project's JVM inside Leiningen's."
+          "uberjar:Create a jar including the contents of each of deps"
+          "upgrade:upgrade leiningen to the latest stable release"
+          "version:print leiningen's version"
+        )
+        _describe -t subcommands 'leiningen subcommands' subcommands && ret=0
+    esac
+
+    return ret
+}
+
+compdef _lein_commands lein

+ 16 - 0
lucid.remote/.oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh

@@ -0,0 +1,16 @@
+# To use: add a .lighthouse file into your directory with the URL to the
+# individual project. For example:
+# https://rails.lighthouseapp.com/projects/8994
+# Example usage: http://screencast.com/t/ZDgwNDUwNT
+open_lighthouse_ticket () {
+  if [ ! -f .lighthouse-url ]; then
+    echo "There is no .lighthouse-url file in the current directory..."
+    return 0;
+  else
+    lighthouse_url=$(cat .lighthouse-url);
+    echo "Opening ticket #$1";
+    `open $lighthouse_url/tickets/$1`;
+  fi
+}
+
+alias lho='open_lighthouse_ticket'

Some files were not shown because too many files changed in this diff