7441438afa9f96ff1d39a6cd0d8692c2b9044bf2
- Author
- Max Masnick <max@masnick.me>
- Committer
- Max Masnick <max@masnick.me>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/README.textile b/README.textile
2index 2dbfbe5a658d8bba2d387bbab272e189ab9e8fca..bf6776665fa72c8025dc64ff72d7a38d36e0380a 100644
3--- a/README.textile
4+++ b/README.textile
5@@ -8,6 +8,14 @@ h2. Setup
6
7 h3. The automatic installer... (do you trust me?)
8
9+You can install this via the command line with either `curl` or `wget`.
10+
11+h4. via `curl`
12+
13+@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
14+
15+h4. via `wget`
16+
17 @wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
18
19 h3. The manual way
20@@ -48,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
21 h3. Customization
22
23 If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
24-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
25+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.
26 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/@.
27
28
29diff --git a/lib/completion.zsh b/lib/completion.zsh
30index b3cc918229ce3cdf60f6434cda1ecf1e7a385a77..b964595edfbaec82a87a7b44c1c3b2088dbd3a69 100644
31--- a/lib/completion.zsh
32+++ b/lib/completion.zsh
33@@ -32,12 +32,14 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
34 cdpath=(.)
35
36 # use /etc/hosts and known_hosts for hostname completion
37+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
38 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
39 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
40 hosts=(
41+ "$_global_ssh_hosts[@]"
42 "$_ssh_hosts[@]"
43 "$_etc_hosts[@]"
44- `hostname`
45+ "$HOST"
46 localhost
47 )
48 zstyle ':completion:*:hosts' hosts $hosts
49diff --git a/lib/functions.zsh b/lib/functions.zsh
50index ef7cc6383038b7e6f9a02c857f13ea498ba5a8fe..d2dcadd0cb4d7235c8876556eb863140c315df12 100644
51--- a/lib/functions.zsh
52+++ b/lib/functions.zsh
53@@ -3,11 +3,11 @@ function zsh_stats() {
54 }
55
56 function uninstall_oh_my_zsh() {
57- /bin/sh $ZSH/tools/uninstall.sh
58+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
59 }
60
61 function upgrade_oh_my_zsh() {
62- /bin/sh $ZSH/tools/upgrade.sh
63+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
64 }
65
66 function take() {
67diff --git a/lib/git.zsh b/lib/git.zsh
68index f04343650f65ddaaa6f9eba34b718d5f5d1bfd9c..fb4ad8ca64ffbf7bcfd34ca82b1acbe8947d36bf 100644
69--- a/lib/git.zsh
70+++ b/lib/git.zsh
71@@ -4,15 +4,21 @@ function git_prompt_info() {
72 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
73 }
74
75+
76 # Checks if working tree is dirty
77 parse_git_dirty() {
78- if [[ -n $(git status -s 2> /dev/null) ]]; then
79+ local SUBMODULE_SYNTAX=''
80+ if [[ $POST_1_7_2_GIT -gt 0 ]]; then
81+ SUBMODULE_SYNTAX="--ignore-submodules=dirty"
82+ fi
83+ if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
84 echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
85 else
86 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
87 fi
88 }
89
90+
91 # Checks if there are commits ahead from remote
92 function git_prompt_ahead() {
93 if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
94@@ -62,3 +68,29 @@ git_prompt_status() {
95 fi
96 echo $STATUS
97 }
98+
99+#compare the provided version of git to the version installed and on path
100+#prints 1 if input version <= installed version
101+#prints -1 otherwise
102+function git_compare_version() {
103+ local INPUT_GIT_VERSION=$1;
104+ local INSTALLED_GIT_VERSION
105+ INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
106+ INSTALLED_GIT_VERSION=($(git --version));
107+ INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
108+
109+ for i in {1..3}; do
110+ if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
111+ echo -1
112+ return 0
113+ fi
114+ done
115+ echo 1
116+}
117+
118+#this is unlikely to change so make it all statically assigned
119+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
120+#clean up the namespace slightly by removing the checker function
121+unset -f git_compare_version
122+
123+
124diff --git a/lib/history.zsh b/lib/history.zsh
125index ca6f57079aef8e953154aa176159c8635e333228..876936b87888a60d1fc7ece2cdfa8dcdd6d9d8c8 100644
126--- a/lib/history.zsh
127+++ b/lib/history.zsh
128@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
129 HISTSIZE=10000
130 SAVEHIST=10000
131
132-setopt hist_ignore_dups # ignore duplication command history list
133-setopt share_history # share command history data
134-
135-setopt hist_verify
136-setopt inc_append_history
137+setopt append_history
138 setopt extended_history
139 setopt hist_expire_dups_first
140+setopt hist_ignore_dups # ignore duplication command history list
141 setopt hist_ignore_space
142-
143-setopt SHARE_HISTORY
144-setopt APPEND_HISTORY
145+setopt hist_verify
146+setopt inc_append_history
147+setopt share_history # share command history data
148diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
149index 22e7f372fffdb1da78ffd3852130340a5d9aa448..221989502360e4182d14489765578b5ee9ff5491 100644
150--- a/lib/termsupport.zsh
151+++ b/lib/termsupport.zsh
152@@ -4,7 +4,7 @@
153 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
154 function title {
155 [ "$DISABLE_AUTO_TITLE" != "true" ] || return
156- if [[ "$TERM" == screen* ]]; then
157+ if [[ "$TERM" == screen* ]]; then
158 print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
159 elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
160 print -Pn "\e]2;$2:q\a" #set window name
161@@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
162 ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
163
164 #Appears when you have the prompt
165-function precmd {
166+function omz_termsupport_precmd {
167 title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
168 }
169
170 #Appears at the beginning of (and during) of command execution
171-function preexec {
172+function omz_termsupport_preexec {
173 emulate -L zsh
174 setopt extended_glob
175 local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
176 title "$CMD" "%100>...>$2%<<"
177 }
178+
179+autoload -U add-zsh-hook
180+add-zsh-hook precmd omz_termsupport_precmd
181+add-zsh-hook preexec omz_termsupport_preexec
182diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
183index 891e8d467335aa42409b6ae331e32aaa86bcbd2b..732a403b74c7f04ee2f283feb5b851c19c173889 100644
184--- a/oh-my-zsh.sh
185+++ b/oh-my-zsh.sh
186@@ -13,20 +13,33 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
187 # TIP: Add files you don't want in git to .gitignore
188 for config_file ($ZSH/lib/*.zsh) source $config_file
189
190-# Add all defined plugins to fpath
191-plugin=${plugin:=()}
192-for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
193+# Set ZSH_CUSTOM to the path where your custom config files
194+# and plugins exists, or else we will use the default custom/
195+if [[ -z "$ZSH_CUSTOM" ]]; then
196+ ZSH_CUSTOM="$ZSH/custom"
197+fi
198+
199+
200+is_plugin() {
201+ local base_dir=$1
202+ local name=$2
203+ test -f $base_dir/plugins/$name/$name.plugin.zsh \
204+ || test -f $base_dir/plugins/$name/_$name
205+}
206+# Add all defined plugins to fpath. This must be done
207+# before running compinit.
208+for plugin ($plugins); do
209+ if is_plugin $ZSH_CUSTOM $plugin; then
210+ fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
211+ elif is_plugin $ZSH $plugin; then
212+ fpath=($ZSH/plugins/$plugin $fpath)
213+ fi
214+done
215
216 # Load and run compinit
217 autoload -U compinit
218 compinit -i
219
220-# Set ZSH_CUSTOM to the path where your custom config files
221-# and plugins exists, or else we will use the default custom/
222-if [ "$ZSH_CUSTOM" = "" ]
223-then
224- ZSH_CUSTOM="$ZSH/custom"
225-fi
226
227 # Load all of the plugins that were defined in ~/.zshrc
228 for plugin ($plugins); do
229@@ -52,7 +65,12 @@ then
230 else
231 if [ ! "$ZSH_THEME" = "" ]
232 then
233- source "$ZSH/themes/$ZSH_THEME.zsh-theme"
234+ if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
235+ then
236+ source "$ZSH/custom/$ZSH_THEME.zsh-theme"
237+ else
238+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
239+ fi
240 fi
241 fi
242
243diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
244index b5e519036229b856c7a92854130d7fccaf848957..294dc5354cce12627ab52e0d0d69f45ec9859131 100644
245--- a/plugins/archlinux/archlinux.plugin.zsh
246+++ b/plugins/archlinux/archlinux.plugin.zsh
247@@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then
248 alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
249 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
250 alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
251+ alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
252 alias yain='yaourt -S' # Install specific package(s) from the repositories
253 alias yains='yaourt -U' # Install specific package not from the repositories but from a file
254 alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
255diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
256index da0a1276572dc655cc82eedc762e2996dac8b0b6..6f0edb062ac60bba4abc7b5fe84962ba286f8dee 100644
257--- a/plugins/autojump/autojump.plugin.zsh
258+++ b/plugins/autojump/autojump.plugin.zsh
259@@ -1,3 +1,9 @@
260-if [ -f `brew --prefix`/etc/autojump ]; then
261- . `brew --prefix`/etc/autojump
262+if [ $commands[autojump] ]; then # check if autojump is installed
263+ if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
264+ . /usr/share/autojump/autojump.zsh
265+ elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
266+ . /etc/profile.d/autojump.zsh
267+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
268+ . `brew --prefix`/etc/autojump
269+ fi
270 fi
271diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
272new file mode 100644
273index 0000000000000000000000000000000000000000..bc75c5cf9ad01bd58ef29c4d83782ce5a849baff
274--- /dev/null
275+++ b/plugins/battery/battery.plugin.zsh
276@@ -0,0 +1,20 @@
277+if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
278+ function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
279+ function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
280+ function battery_pct_prompt() {
281+ b=$(battery_pct_remaining)
282+ if [ $b -gt 50 ] ; then
283+ color='green'
284+ elif [ $b -gt 20 ] ; then
285+ color='yellow'
286+ else
287+ color='red'
288+ fi
289+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
290+ }
291+else
292+ error_msg='no battery'
293+ function battery_pct_remaining() { echo $error_msg }
294+ function battery_time_remaining() { echo $error_msg }
295+ function battery_pct_prompt() { echo '' }
296+fi
297diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
298index 3c96b8da99ea0779d0cd148402558a4c5407761a..e1f571237a74f75d5522b073e8cdbfaa9efc502a 100644
299--- a/plugins/bundler/bundler.plugin.zsh
300+++ b/plugins/bundler/bundler.plugin.zsh
301@@ -1,7 +1,3 @@
302-fpath=($ZSH/plugins/bundler $fpath)
303-autoload -U compinit
304-compinit -i
305-
306 alias be="bundle exec"
307 alias bi="bundle install"
308 alias bl="bundle list"
309@@ -10,7 +6,7 @@ alias bu="bundle update"
310
311 # The following is based on https://github.com/gma/bundler-exec
312
313-bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
314+bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
315
316 ## Functions
317
318@@ -20,7 +16,7 @@ _bundler-installed() {
319
320 _within-bundled-project() {
321 local check_dir=$PWD
322- while [ "$(dirname $check_dir)" != "/" ]; do
323+ while [ $check_dir != "/" ]; do
324 [ -f "$check_dir/Gemfile" ] && return
325 check_dir="$(dirname $check_dir)"
326 done
327@@ -41,6 +37,6 @@ for cmd in $bundled_commands; do
328 alias $cmd=bundled_$cmd
329
330 if which _$cmd > /dev/null 2>&1; then
331- compdef _$cmd bundled_$cmd
332+ compdef _$cmd bundled_$cmd=$cmd
333 fi
334 done
335diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
336index 09771881dfc255f8c984626e9c6c21b3b87d474a..16a5d54cadb59c99533956e0f1f565531613aa6e 100644
337--- a/plugins/debian/debian.plugin.zsh
338+++ b/plugins/debian/debian.plugin.zsh
339@@ -54,7 +54,7 @@ if [[ $use_sudo -eq 1 ]]; then
340
341 # apt-get only
342 alias ads="sudo $apt_pref dselect-upgrade"
343-
344+
345 # Install all .deb files in the current directory.
346 # Warning: you will need to put the glob in single quotes if you use:
347 # glob_subst
348@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
349 alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
350
351
352-
353-
354-
355 # Functions #################################################################
356 # create a simple script that can be used to 'duplicate' a system
357 apt-copy() {
358@@ -132,11 +129,46 @@ apt-copy() {
359 chmod +x apt-copy.sh
360 }
361
362+# Prints apt history
363+# Usage:
364+# apt-history install
365+# apt-history upgrade
366+# apt-history remove
367+# apt-history rollback
368+# apt-history list
369+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
370+apt-history () {
371+ case "$1" in
372+ install)
373+ zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
374+ ;;
375+ upgrade|remove)
376+ zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
377+ ;;
378+ rollback)
379+ zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
380+ grep "$2" -A10000000 | \
381+ grep "$3" -B10000000 | \
382+ awk '{print $4"="$5}'
383+ ;;
384+ list)
385+ zcat $(ls -rt /var/log/dpkg*)
386+ ;;
387+ *)
388+ echo "Parameters:"
389+ echo " install - Lists all packages that have been installed."
390+ echo " upgrade - Lists all packages that have been upgraded."
391+ echo " remove - Lists all packages that have been removed."
392+ echo " rollback - Lists rollback information."
393+ echo " list - Lists all contains of dpkg logs."
394+ ;;
395+ esac
396+}
397
398 # Kernel-package building shortcut
399 kerndeb () {
400 # temporarily unset MAKEFLAGS ( '-j3' will fail )
401- MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
402+ MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
403 print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
404 appendage='-custom' # this shows up in $ (uname -r )
405 revision=$(date +"%Y%m%d") # this shows up in the .deb file name
406diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
407index 1d72a2f2c13f20d33ee63f5ec9918621bdb6827a..0bbd031fe01c257af863551e5be86e6a3ea023b5 100644
408--- a/plugins/django/django.plugin.zsh
409+++ b/plugins/django/django.plugin.zsh
410@@ -220,3 +220,4 @@ _managepy() {
411
412 compdef _managepy manage.py
413 compdef _managepy django
414+compdef _managepy django-manage
415diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
416index 8cc17f7d4be725da84afaf018cb8343e3048ad5d..5c125e98b06d1daa9dd18d2ad5054f5e86c3a27e 100644
417--- a/plugins/extract/extract.plugin.zsh
418+++ b/plugins/extract/extract.plugin.zsh
419@@ -78,8 +78,3 @@ function extract() {
420
421 alias x=extract
422
423-# add extract completion function to path
424-fpath=($ZSH/plugins/extract $fpath)
425-autoload -U compinit
426-compinit -i
427-
428diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
429index 183c56c1c6fef531e3c0b300debfa745774365fd..e1d68250885a7e29e286e30b469fc17e9ae5cc3b 100644
430--- a/plugins/git/git.plugin.zsh
431+++ b/plugins/git/git.plugin.zsh
432@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase'
433 compdef _git gup=git-fetch
434 alias gp='git push'
435 compdef _git gp=git-push
436-gdv() { git-diff -w "$@" | view - }
437+gdv() { git diff -w "$@" | view - }
438 compdef _git gdv=git-diff
439 alias gc='git commit -v'
440 compdef _git gc=git-commit
441@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
442 compdef _git gca=git-commit
443 alias gco='git checkout'
444 compdef _git gco=git-checkout
445+alias gcm='git checkout master'
446 alias gb='git branch'
447 compdef _git gb=git-branch
448 alias gba='git branch -a'
449@@ -35,6 +36,8 @@ alias ga='git add'
450 compdef _git ga=git-add
451 alias gm='git merge'
452 compdef _git gm=git-merge
453+alias grh='git reset HEAD'
454+alias grhh='git reset HEAD --hard'
455
456 # Git and svn mix
457 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
458@@ -57,4 +60,4 @@ compdef ggpull=git
459 alias ggpush='git push origin $(current_branch)'
460 compdef ggpush=git
461 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
462-compdef ggpnp=git
463+compdef ggpnp=git
464diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
465index 9b0d54602fcfe03edc072921cbe2134908250286..197e86a48743419f79cceb8f4d4ebdafca0a5972 100644
466--- a/plugins/github/github.plugin.zsh
467+++ b/plugins/github/github.plugin.zsh
468@@ -1,7 +1,17 @@
469 # Setup hub function for git, if it is available; http://github.com/defunkt/hub
470 if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
471 # eval `hub alias -s zsh`
472- function git(){hub "$@"}
473+ function git(){
474+ if ! (( $+_has_working_hub )); then
475+ hub --version &> /dev/null
476+ _has_working_hub=$(($? == 0))
477+ fi
478+ if (( $_has_working_hub )) ; then
479+ hub "$@"
480+ else
481+ command git "$@"
482+ fi
483+ }
484 fi
485
486 # Functions #################################################################
487diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh
488new file mode 100644
489index 0000000000000000000000000000000000000000..a9eef4029620dc3901399d0a4973feda73f4860f
490--- /dev/null
491+++ b/plugins/jake-node/jake-node.plugin.zsh
492@@ -0,0 +1,14 @@
493+#---oh-my-zsh plugin : task Autocomplete for Jake tool---
494+# Jake : https://github.com/mde/jake
495+# Warning : Jakefile should have the right case : Jakefile or jakefile
496+# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
497+# Author : Alexandre Lacheze (@al3xstrat)
498+# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh
499+
500+function _jake () {
501+ if [ -f Jakefile ]||[ -f jakefile ]; then
502+ compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
503+ fi
504+}
505+
506+compdef _jake jake
507diff --git a/plugins/knife/_knife b/plugins/knife/_knife
508index 7f8c95ee5a470810785cb719828371a5e7463e6c..8453af5be60abb5412a28010dc500f7fb1512cc9 100644
509--- a/plugins/knife/_knife
510+++ b/plugins/knife/_knife
511@@ -26,7 +26,7 @@ _knife() {
512
513 case $state in
514 knifecmd)
515- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
516+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
517 ;;
518 knifesubcmd)
519 case $words[2] in
520@@ -42,6 +42,9 @@ _knife() {
521 cookbook)
522 compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
523 ;;
524+ environment)
525+ compadd -Q "$@" list create delete edit show "from file"
526+ ;;
527 node)
528 compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
529 ;;
530@@ -138,27 +141,31 @@ _knife_options3() {
531
532 # The chef_x_remote functions use knife to get a list of objects of type x on the server
533 _chef_roles_remote() {
534- (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
535+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
536 }
537
538 _chef_clients_remote() {
539- (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
540+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
541 }
542
543 _chef_nodes_remote() {
544- (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
545+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
546 }
547
548 _chef_cookbooks_remote() {
549- (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
550+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
551 }
552
553 _chef_sitecookbooks_remote() {
554- (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
555+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
556 }
557
558 _chef_data_bags_remote() {
559- (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
560+ (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
561+}
562+
563+_chef_environments_remote() {
564+ (knife environment list | awk '{print $1}')
565 }
566
567 # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
568diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
569index 2988f0a4678b3a337312e8ee80bce20ce34889cc..caf0d9efc81196a73e9b8592fd3a0a3b0f46ed17 100644
570--- a/plugins/mercurial/mercurial.plugin.zsh
571+++ b/plugins/mercurial/mercurial.plugin.zsh
572@@ -1,14 +1,14 @@
573
574 # Mercurial
575-alias hgc='hg commit -v'
576-alias hgb='hg branch -v'
577+alias hgc='hg commit'
578+alias hgb='hg branch'
579 alias hgba='hg branches'
580 alias hgco='hg checkout'
581 alias hgd='hg diff'
582 alias hged='hg diffmerge'
583 # pull and update
584-alias hgl='hg pull -u -v'
585-alias hgp='hg push -v'
586-alias hgs='hg status -v'
587+alias hgl='hg pull -u'
588+alias hgp='hg push'
589+alias hgs='hg status'
590 # this is the 'git commit --amend' equivalent
591 alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
592diff --git a/plugins/nyan/nyan.plugin.zsh b/plugins/nyan/nyan.plugin.zsh
593new file mode 100644
594index 0000000000000000000000000000000000000000..6321e5f5a02c05a691ec3a7f44e1f0416b50349c
595--- /dev/null
596+++ b/plugins/nyan/nyan.plugin.zsh
597@@ -0,0 +1,5 @@
598+if [[ -x `which nc` ]]; then
599+ alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat
600+fi
601+
602+
603diff --git a/plugins/pip/_pip b/plugins/pip/_pip
604index b58010173a5028b0dc0db651f042e56df861d497..df53ba5ce8ec788d3ff7da94a9936ffee94267db 100644
605--- a/plugins/pip/_pip
606+++ b/plugins/pip/_pip
607@@ -3,30 +3,43 @@
608
609 # pip zsh completion, based on homebrew completion
610
611+_pip_all() {
612+ # we cache the list of packages (originally from the macports plugin)
613+ if (( ! $+piplist )); then
614+ echo -n " (caching package index...)"
615+ piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
616+ fi
617+}
618+
619 _pip_installed() {
620- installed_pkgs=(`pip freeze`)
621+ installed_pkgs=(`pip freeze | cut -d '=' -f 1`)
622 }
623
624 local -a _1st_arguments
625 _1st_arguments=(
626- 'bundle:Create pybundles (archives containing multiple packages)'
627- 'freeze:Output all currently installed packages (exact versions) to stdout'
628- 'help:Show available commands'
629- 'install:Install packages'
630- 'search:Search PyPI'
631- 'uninstall:Uninstall packages'
632- 'unzip:Unzip individual packages'
633- 'zip:Zip individual packages'
634+ 'bundle:create pybundles (archives containing multiple packages)'
635+ 'freeze:output all currently installed packages (exact versions) to stdout'
636+ 'help:show available commands'
637+ 'install:install packages'
638+ 'search:search PyPI'
639+ 'uninstall:uninstall packages'
640+ 'unzip:unzip individual packages'
641+ 'zip:zip individual packages'
642 )
643
644 local expl
645-local -a pkgs installed_pkgs
646+local -a all_pkgs installed_pkgs
647
648 _arguments \
649- '(--version)--version[Show version number of program and exit]' \
650- '(-v --verbose)'{-v,--verbose}'[Give more output]' \
651- '(-q --quiet)'{-q,--quiet}'[Give less output]' \
652- '(-h --help)'{-h,--help}'[Show help]' \
653+ '(--version)--version[show version number of program and exit]' \
654+ '(-h --help)'{-h,--help}'[show help]' \
655+ '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
656+ '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
657+ '(-v --verbose)'{-v,--verbose}'[give more output]' \
658+ '(-q --quiet)'{-q,--quiet}'[give less output]' \
659+ '(--log)--log[log file location]' \
660+ '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
661+ '(--timeout)--timeout[socket timeout (default 15s)]' \
662 '*:: :->subcmds' && return 0
663
664 if (( CURRENT == 1 )); then
665@@ -35,10 +48,25 @@ if (( CURRENT == 1 )); then
666 fi
667
668 case "$words[1]" in
669- list)
670- if [[ "$state" == forms ]]; then
671- _pip_installed
672- _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
673+ search)
674+ _arguments \
675+ '(--index)--index[base URL of Python Package Index]' ;;
676+ freeze)
677+ _arguments \
678+ '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
679+ install)
680+ _arguments \
681+ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
682+ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
683+ '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
684+ '(--no-install)--no-install[only download packages]' \
685+ '(--no-download)--no-download[only install downloaded packages]' \
686+ '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
687+ '1: :->packages' && return 0
688+
689+ if [[ "$state" == packages ]]; then
690+ _pip_all
691+ _wanted piplist expl 'packages' compadd -a piplist
692 fi ;;
693 uninstall)
694 _pip_installed
695diff --git a/plugins/pow/pow.plugin.zsh b/plugins/pow/pow.plugin.zsh
696index 6b2a6f2be0f3636c9026eb82a0405eebc79669b4..399a54cb02aae802afb95f72a343b35b1412f779 100644
697--- a/plugins/pow/pow.plugin.zsh
698+++ b/plugins/pow/pow.plugin.zsh
699@@ -1,10 +1,66 @@
700-# Thanks to Christopher Sexton
701-# https://gist.github.com/965032
702-function kapow {
703- touch ~/.pow/$1/tmp/restart.txt
704- if [ $? -eq 0 ]; then
705- echo "$fg[yellow]Pow restarting $1...$reset_color"
706- fi
707+# Restart a rack app running under pow
708+# http://pow.cx/
709+#
710+# Adds a kapow command that will restart an app
711+#
712+# $ kapow myapp
713+#
714+# Supports command completion.
715+#
716+# If you are not already using completion you might need to enable it with
717+#
718+# autoload -U compinit compinit
719+#
720+# Changes:
721+#
722+# Defaults to the current application, and will walk up the tree to find
723+# a config.ru file and restart the corresponding app
724+#
725+# Will Detect if a app does not exist in pow and print a (slightly) helpful
726+# error message
727+
728+rack_root_detect(){
729+ setopt chaselinks
730+ local orgdir=$(pwd)
731+ local basedir=$(pwd)
732+
733+ while [[ $basedir != '/' ]]; do
734+ test -e "$basedir/config.ru" && break
735+ builtin cd ".." 2>/dev/null
736+ basedir="$(pwd)"
737+ done
738+
739+ builtin cd $orgdir 2>/dev/null
740+ [[ ${basedir} == "/" ]] && return 1
741+ echo `basename $basedir | sed -E "s/.(com|net|org)//"`
742 }
743
744+kapow(){
745+ local vhost=$1
746+ [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
747+ if [ ! -h ~/.pow/$vhost ]
748+ then
749+ echo "pow: This domain isn’t set up yet. Symlink your application to ${vhost} first."
750+ return 1
751+ fi
752+
753+ [ ! -d ~/.pow/${vhost}/tmp ] && mkdir -p ~/.pow/$vhost/tmp
754+ touch ~/.pow/$vhost/tmp/restart.txt;
755+ [ $? -eq 0 ] && echo "pow: restarting $vhost.dev"
756+}
757 compctl -W ~/.pow -/ kapow
758+
759+powit(){
760+ local basedir=$(pwd)
761+ local vhost=$1
762+ [ ! -n "$vhost" ] && vhost=$(rack_root_detect)
763+ if [ ! -h ~/.pow/$vhost ]
764+ then
765+ echo "pow: Symlinking your app with pow. ${vhost}"
766+ [ ! -d ~/.pow/${vhost} ] && ln -s $basedir ~/.pow/$vhost
767+ return 1
768+ fi
769+}
770+
771+# View the standard out (puts) from any pow app
772+alias kaput="tail -f ~/Library/Logs/Pow/apps/*"
773diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh
774index ac8119e837611d4a19ea146a8e7c4242a8982922..4aa7a05d6db43ff6a824cf90553564e9fa9572ec 100644
775--- a/plugins/rails/rails.plugin.zsh
776+++ b/plugins/rails/rails.plugin.zsh
777@@ -2,6 +2,7 @@ alias ss='thin --stats "/thin/stats" start'
778 alias sg='ruby script/generate'
779 alias sd='ruby script/destroy'
780 alias sp='ruby script/plugin'
781+alias sr='ruby script/runner'
782 alias ssp='ruby script/spec'
783 alias rdbm='rake db:migrate'
784 alias sc='ruby script/console'
785diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
786index f4ee637e6b45522afdee404804b12edf0f1e992e..d4c7df6548740c9c34c3729b34c03a4e7b9b5ecf 100644
787--- a/plugins/rails3/rails3.plugin.zsh
788+++ b/plugins/rails3/rails3.plugin.zsh
789@@ -14,6 +14,9 @@ alias rdb='_rails_command dbconsole'
790 alias rdbm='rake db:migrate db:test:clone'
791 alias rg='_rails_command generate'
792 alias rp='_rails_command plugin'
793+alias ru='_rails_command runner'
794 alias rs='_rails_command server'
795 alias rsd='_rails_command server --debugger'
796 alias devlog='tail -f log/development.log'
797+alias rdm='rake db:migrate'
798+alias rdr='rake db:rollback'
799diff --git a/plugins/rake/rake.plugin.zsh b/plugins/rake/rake.plugin.zsh
800new file mode 100644
801index 0000000000000000000000000000000000000000..16b933c14c104dc953bed61dbe31ff1570cd0904
802--- /dev/null
803+++ b/plugins/rake/rake.plugin.zsh
804@@ -0,0 +1,6 @@
805+alias rake="noglob rake" # allows square brackts for rake task invocation
806+alias brake='noglob bundle exec rake' # execute the bundled rake gem
807+alias srake='noglob sudo rake' # noglob must come before sudo
808+alias sbrake='noglob sudo bundle exec rake' # altogether now ...
809+
810+
811diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
812new file mode 100644
813index 0000000000000000000000000000000000000000..ae37404cd8328ab621cb4f8ab804cc143efbe9c0
814--- /dev/null
815+++ b/plugins/rbenv/rbenv.plugin.zsh
816@@ -0,0 +1,44 @@
817+FOUND_RBENV=0
818+for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
819+ if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
820+ FOUND_RBENV=1
821+ export RBENV_ROOT=$rbenvdir
822+ export PATH=${rbenvdir}/bin:$PATH
823+ eval "$(rbenv init -)"
824+
825+ alias rubies="rbenv versions"
826+ alias gemsets="rbenv gemset list"
827+
828+ function current_ruby() {
829+ echo "$(rbenv version-name)"
830+ }
831+
832+ function current_gemset() {
833+ echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)"
834+ }
835+
836+ function gems {
837+ local rbenv_path=$(rbenv prefix)
838+ gem list $@ | sed \
839+ -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
840+ -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
841+ -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
842+ -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
843+ }
844+
845+ function rbenv_prompt_info() {
846+ if [[ -n $(current_gemset) ]] ; then
847+ echo "$(current_ruby)@$(current_gemset)"
848+ else
849+ echo "$(current_ruby)"
850+ fi
851+ }
852+ fi
853+done
854+unset rbenvdir
855+
856+if [ $FOUND_RBENV -eq 0 ] ; then
857+ alias rubies='ruby -v'
858+ function gemsets() { echo 'not supported' }
859+ function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" }
860+fi
861diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
862index 08ca9c60178faf69bb92b4bcd1a5fd66b31f49eb..38e4d7cd01c1c708a8dcfc5afcbd2e78fe7deea7 100644
863--- a/plugins/ruby/ruby.plugin.zsh
864+++ b/plugins/ruby/ruby.plugin.zsh
865@@ -3,4 +3,4 @@
866 alias sgem='sudo gem'
867
868 # Find ruby file
869-alias rfind='find . -name *.rb | xargs grep -n'
870+alias rfind='find . -name "*.rb" | xargs grep -n'
871diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
872index 24621fe0b57e02b76d3179241ee2c78fc53934eb..604c0071393b07f0edcc6dbd80a4c6b0d290e7cd 100644
873--- a/plugins/rvm/rvm.plugin.zsh
874+++ b/plugins/rvm/rvm.plugin.zsh
875@@ -37,7 +37,7 @@ function gems {
876 local current_gemset=`rvm-prompt g`
877
878 gem list $@ | sed \
879- -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
880+ -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \
881 -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
882 -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
883 -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
884diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh
885new file mode 100644
886index 0000000000000000000000000000000000000000..9f9432ac8c0cb593e6fe43f3be4ef131f707fbc4
887--- /dev/null
888+++ b/plugins/sprunge/sprunge.plugin.zsh
889@@ -0,0 +1,64 @@
890+# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf <parwok -at- gmail>
891+# Created by the blogger at the URL below...I don't know where to find his/her name
892+# Original found at http://www.shellperson.net/sprunge-pastebin-script/
893+
894+usage() {
895+description | fmt -s >&2
896+}
897+
898+description() {
899+cat << HERE
900+
901+DESCRIPTION
902+ Upload data and fetch URL from the pastebin http://sprunge.us
903+
904+USAGE
905+ $0 filename.txt
906+ $0 text string
907+ $0 < filename.txt
908+ piped_data | $0
909+
910+NOTES
911+--------------------------------------------------------------------------
912+* INPUT METHODS *
913diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
914new file mode 100644
915index 0000000000000000000000000000000000000000..644266841fe11393c8b253da3479f52383f7dfdf
916--- /dev/null
917+++ b/plugins/symfony2/symfony2.plugin.zsh
918@@ -0,0 +1,13 @@
919+# Symfony2 basic command completion
920+
921+_symfony2_get_command_list () {
922+ app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
923+}
924+
925+_symfony2 () {
926+ if [ -f app/console ]; then
927+ compadd `_symfony2_get_command_list`
928+ fi
929+}
930+
931+compdef _symfony2 app/console
932diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
933index 5bffa9119e439c633ef8fd156b7233fd4ed9b61e..0bda738bb85ee766af63a4db4de6e64c946265a9 100644
934--- a/plugins/taskwarrior/_task
935+++ b/plugins/taskwarrior/_task
936@@ -1,37 +1,37 @@
937 #compdef task
938-#
939 # zsh completion for taskwarrior
940 #
941+# taskwarrior - a command line task list manager.
942+#
943 # Copyright 2010 - 2011 Johannes Schlatow
944 # Copyright 2009 P.C. Shyamshankar
945-# All rights reserved.
946-#
947-# This script is part of the taskwarrior project.
948 #
949-# This program is free software; you can redistribute it and/or modify it under
950-# the terms of the GNU General Public License as published by the Free Software
951-# Foundation; either version 2 of the License, or (at your option) any later
952-# version.
953+# Permission is hereby granted, free of charge, to any person obtaining a copy
954+# of this software and associated documentation files (the "Software"), to deal
955+# in the Software without restriction, including without limitation the rights
956+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
957+# copies of the Software, and to permit persons to whom the Software is
958+# furnished to do so, subject to the following conditions:
959 #
960-# This program is distributed in the hope that it will be useful, but WITHOUT
961-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
962-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
963-# details.
964+# The above copyright notice and this permission notice shall be included
965+# in all copies or substantial portions of the Software.
966 #
967-# You should have received a copy of the GNU General Public License along with
968-# this program; if not, write to the
969+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
970+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
971+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
972+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
973+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
974+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
975+# SOFTWARE.
976 #
977-# Free Software Foundation, Inc.,
978-# 51 Franklin Street, Fifth Floor,
979-# Boston, MA
980-# 02110-1301
981-# USA
982+# http://www.opensource.org/licenses/mit-license.php
983 #
984 typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
985 _task_projects=($(task _projects))
986 _task_tags=($(task _tags))
987 _task_ids=($(task _ids))
988 _task_config=($(task _config))
989+_task_columns=($(task _columns))
990 _task_modifiers=(
991 'before' \
992 'after' \
993@@ -46,39 +46,19 @@ _task_modifiers=(
994 'word' \
995 'noword'
996 )
997+_task_conjunctions=(
998+ 'and' \
999+ 'or' \
1000+ 'xor' \
1001+ '\)'
1002+ '\('
1003+)
1004 _task_cmds=($(task _commands))
1005 _task_zshcmds=( ${(f)"$(task _zshcommands)"} )
1006
1007-
1008-_task_idCmds=(
1009- 'append' \
1010- 'prepend' \
1011- 'annotate' \
1012- 'denotate' \
1013- 'edit' \
1014- 'duplicate' \
1015- 'info' \
1016- 'start' \
1017- 'stop' \
1018- 'done'
1019-)
1020-
1021-_task_idCmdsDesc=(
1022- 'append:Appends more description to an existing task.' \
1023- 'prepend:Prepends more description to an existing task.' \
1024- 'annotate:Adds an annotation to an existing task.' \
1025- 'denotate:Deletes an annotation of an existing task.' \
1026- 'edit:Launches an editor to let you modify a task directly.' \
1027- 'duplicate:Duplicates the specified task, and allows modifications.' \
1028- 'info:Shows all data, metadata for specified task.' \
1029- 'start:Marks specified task as started.' \
1030- 'stop:Removes the start time from a task.' \
1031- 'done:Marks the specified task as completed.'
1032-)
1033-
1034 _task() {
1035 _arguments -s -S \
1036diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh
1037new file mode 100644
1038index 0000000000000000000000000000000000000000..4695ad0556d62806bf335408a7ed79171860f1f4
1039--- /dev/null
1040+++ b/plugins/terminalapp/terminalapp.plugin.zsh
1041@@ -0,0 +1,11 @@
1042+# Set Apple Terminal.app resume directory
1043+# based on this answer: http://superuser.com/a/315029
1044+
1045+function chpwd {
1046+ local SEARCH=' '
1047+ local REPLACE='%20'
1048+ local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
1049+ printf '\e]7;%s\a' "$PWD_URL"
1050+}
1051+
1052+chpwd
1053diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README
1054new file mode 100644
1055index 0000000000000000000000000000000000000000..16fdd4587060ce16895373d3bd5e9713113994c3
1056--- /dev/null
1057+++ b/plugins/wakeonlan/README
1058@@ -0,0 +1,29 @@
1059+This plugin provides a wrapper around the "wakeonlan" tool available from most
1060+distributions' package repositories, or from the following website:
1061+
1062+http://gsd.di.uminho.pt/jpo/software/wakeonlan/
1063+
1064+In order to use this wrapper, create the ~/.wakeonlan directory, and place in
1065+that directory one file for each device you would like to be able to wake. Give
1066+the file a name that describes the device, such as its hostname. Each file
1067+should contain a line with the mac address of the target device and the network
1068+broadcast address.
1069+
1070+For instance, there might be a file ~/.wakeonlan/leto with the following
1071+contents:
1072+
1073+00:11:22:33:44:55:66 192.168.0.255
1074+
1075+To wake that device, use the following command:
1076+
1077+# wake leto
1078+
1079+The available device names will be autocompleted, so:
1080+
1081+# wake <tab>
1082+
1083+...will suggest "leto", along with any other configuration files that were
1084+placed in the ~/.wakeonlan directory.
1085+
1086+For more information regarding the configuration file format, check the
1087+wakeonlan man page.
1088diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake
1089new file mode 100644
1090index 0000000000000000000000000000000000000000..4ab10d374a6e5d82d953d3d32b5f2ade2ec9ddd6
1091--- /dev/null
1092+++ b/plugins/wakeonlan/_wake
1093@@ -0,0 +1,4 @@
1094+#compdef wake
1095+#autoload
1096+
1097+_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0
1098diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh
1099new file mode 100644
1100index 0000000000000000000000000000000000000000..6cef7d44ad72f59690093b6e13cdd95d629cff69
1101--- /dev/null
1102+++ b/plugins/wakeonlan/wakeonlan.plugin.zsh
1103@@ -0,0 +1,14 @@
1104+function wake() {
1105+ local config_file="$HOME/.wakeonlan/$1"
1106+ if [[ ! -f "$config_file" ]]; then
1107+ echo "ERROR: There is no configuration file at \"$config_file\"."
1108+ return 1
1109+ fi
1110+
1111+ if (( ! $+commands[wakeonlan] )); then
1112+ echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?"
1113+ return 1
1114+ fi
1115+
1116+ wakeonlan -f "$config_file"
1117+}
1118diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
1119index 1ab40aba6d39eca4648267dfc25420b355c10b5b..e525532414557e76e924159dc592ea61fe635bb2 100644
1120--- a/templates/zshrc.zsh-template
1121+++ b/templates/zshrc.zsh-template
1122@@ -7,6 +7,10 @@ ZSH=$HOME/.oh-my-zsh
1123 # time that oh-my-zsh is loaded.
1124 ZSH_THEME="robbyrussell"
1125
1126+# Example aliases
1127+# alias zshconfig="mate ~/.zshrc"
1128+# alias ohmyzsh="mate ~/.oh-my-zsh"
1129+
1130 # Set to this to use case-sensitive completion
1131 # CASE_SENSITIVE="true"
1132
1133@@ -23,6 +27,7 @@ ZSH_THEME="robbyrussell"
1134 # COMPLETION_WAITING_DOTS="true"
1135
1136 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
1137+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
1138 # Example format: plugins=(rails git textmate ruby lighthouse)
1139 plugins=(git)
1140
1141diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme
1142index 1f66f1ec36e50a75f6f8503b5ec3a08bb66c0da0..4a1b1b3861d7f70e7471ec94b2854182f47c0773 100644
1143--- a/themes/alanpeabody.zsh-theme
1144+++ b/themes/alanpeabody.zsh-theme
1145@@ -1,7 +1,14 @@
1146
1147 local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
1148 local pwd='%{$fg[blue]%}%~%{$reset_color%}'
1149-local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
1150+local rvm=''
1151+if which rvm-prompt &> /dev/null; then
1152+ rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
1153+else
1154+ if which rbenv &> /dev/null; then
1155+ rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
1156+ fi
1157+fi
1158 local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
1159 local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
1160
1161@@ -19,4 +26,3 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
1162
1163 PROMPT="${user} ${pwd}$ "
1164 RPROMPT="${return_code} ${git_branch} ${rvm}"
1165-
1166diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
1167index 92f1df941e7c0f027b78df4b86ebeeb7db4b82b3..275341dc67a8d85caafe92d78ab414787f104cdc 100644
1168--- a/themes/apple.zsh-theme
1169+++ b/themes/apple.zsh-theme
1170@@ -2,7 +2,7 @@ function toon {
1171 echo -n ""
1172 }
1173
1174-get_git_dirty() {
1175+get_git_dirty() {
1176 git diff --quiet || echo '*'
1177 }
1178
1179@@ -18,9 +18,12 @@ zstyle ':vcs_info:*' formats \
1180 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
1181 zstyle ':vcs_info:*' enable git cvs svn
1182
1183-precmd () {
1184+theme_precmd () {
1185 vcs_info
1186 }
1187
1188 setopt prompt_subst
1189 PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
1190+
1191+autoload -U add-zsh-hook
1192+add-zsh-hook precmd theme_precmd
1193diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
1194index 5642eaeb86001bd4d4257f89f63b76cd0ab43842..2157204778f6c346569e4f69d638ce7c792a685f 100644
1195--- a/themes/bira.zsh-theme
1196+++ b/themes/bira.zsh-theme
1197@@ -3,7 +3,14 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1198
1199 local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
1200 local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
1201-local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
1202+local rvm_ruby=''
1203+if which rvm-prompt &> /dev/null; then
1204+ rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
1205+else
1206+ if which rbenv &> /dev/null; then
1207+ rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
1208+ fi
1209+fi
1210 local git_branch='$(git_prompt_info)%{$reset_color%}'
1211
1212 PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
1213diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme
1214index 2473cd230e9f95e303bd0f5ff4c4434b020e4bfe..b2759a1b0fe9d7f05b04f34baac42de073b8092a 100644
1215--- a/themes/crunch.zsh-theme
1216+++ b/themes/crunch.zsh-theme
1217@@ -29,7 +29,13 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗"
1218
1219 # Our elements:
1220 CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}"
1221-CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
1222+if which rvm-prompt &> /dev/null; then
1223+ CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
1224+else
1225+ if which rbenv &> /dev/null; then
1226+ CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
1227+ fi
1228+fi
1229 CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) "
1230 CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ "
1231
1232diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme
1233index eef32e998221760ca1eea9a4bd13e7474dcd80fe..e9b4f852a36d45c65e634b9209da8d40f95867de 100644
1234--- a/themes/dallas.zsh-theme
1235+++ b/themes/dallas.zsh-theme
1236@@ -3,7 +3,13 @@
1237 # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
1238 DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}"
1239 # Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
1240-DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
1241+if which rvm-prompt &> /dev/null; then
1242+ DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
1243+else
1244+ if which rbenv &> /dev/null; then
1245+ DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}"
1246+ fi
1247+fi
1248 # Grab the current machine name: muscato
1249 DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
1250 # Grab the current filepath, use shortcuts: ~/Desktop
1251diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme
1252index 83664515adf78e8b3136f68e4a2e8bdd7c2f2d14..db2529990be4c95dce739357ec7633b7844b718f 100644
1253--- a/themes/eastwood.zsh-theme
1254+++ b/themes/eastwood.zsh-theme
1255@@ -1,6 +1,10 @@
1256 #RVM settings
1257 if [[ -s ~/.rvm/scripts/rvm ]] ; then
1258 RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
1259+else
1260+ if which rbenv &> /dev/null; then
1261+ RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1"
1262+ fi
1263 fi
1264
1265 ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
1266diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
1267index a7a63f66101d288df35ae4e1e51f5c2df428bb01..2159e54a85d89e42812ea4f89f33e8d581644c22 100644
1268--- a/themes/fino.zsh-theme
1269+++ b/themes/fino.zsh-theme
1270@@ -21,6 +21,15 @@ function box_name {
1271 [ -f ~/.box-name ] && cat ~/.box-name || hostname -s
1272 }
1273
1274+local rvm_ruby=''
1275+if which rvm-prompt &> /dev/null; then
1276+ rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}'
1277+else
1278+ if which rbenv &> /dev/null; then
1279+ rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
1280+ fi
1281+fi
1282+
1283 local current_dir='${PWD/#$HOME/~}'
1284 local git_info='$(git_prompt_info)'
1285 local prompt_char='$(prompt_char)'
1286diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
1287index 259640ba40cdee547cc8826126dae6f9e4a9d748..3eac14867e68cfbcc965a58b0f1978d2a7094f5b 100644
1288--- a/themes/gallois.zsh-theme
1289+++ b/themes/gallois.zsh-theme
1290@@ -14,6 +14,12 @@ git_custom_status() {
1291 #RVM and git settings
1292 if [[ -s ~/.rvm/scripts/rvm ]] ; then
1293 RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
1294+else
1295+ if which rbenv &> /dev/null; then
1296+ RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
1297+ else
1298+ RPS1='$(git_custom_status) $EPS1'
1299+ fi
1300 fi
1301
1302 PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
1303diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
1304index add485279cfcc0df29817e1cabc8b8224e9948af..2f0c4b917a18d7023d1bc26d7f3235a58a6ca8a8 100644
1305--- a/themes/jonathan.zsh-theme
1306+++ b/themes/jonathan.zsh-theme
1307@@ -1,19 +1,19 @@
1308-function precmd {
1309+function theme_precmd {
1310 local TERMWIDTH
1311 (( TERMWIDTH = ${COLUMNS} - 1 ))
1312
1313
1314 ###
1315 # Truncate the path if it's too long.
1316-
1317+
1318 PR_FILLBAR=""
1319 PR_PWDLEN=""
1320-
1321+
1322 local promptsize=${#${(%):---(%n@%m:%l)---()--}}
1323- local rubyprompt=`rvm_prompt_info`
1324+ local rubyprompt=`rvm_prompt_info || rbenv_prompt_info`
1325 local rubypromptsize=${#${rubyprompt}}
1326 local pwdsize=${#${(%):-%~}}
1327-
1328+
1329 if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
1330 ((PR_PWDLEN=$TERMWIDTH - $promptsize))
1331 else
1332@@ -24,7 +24,7 @@ function precmd {
1333
1334
1335 setopt extended_glob
1336-preexec () {
1337+theme_preexec () {
1338 if [[ "$TERM" == "screen" ]]; then
1339 local CMD=${1[(wr)^(*=*|sudo|-*)]}
1340 echo -n "\ek$CMD\e\\"
1341@@ -69,7 +69,7 @@ setprompt () {
1342
1343 ###
1344 # See if we can use extended characters to look nicer.
1345-
1346+
1347 typeset -A altchar
1348 set -A altchar ${(s..)terminfo[acsc]}
1349 PR_SET_CHARSET="%{$terminfo[enacs]%}"
1350@@ -81,10 +81,10 @@ setprompt () {
1351 PR_LRCORNER=${altchar[j]:--}
1352 PR_URCORNER=${altchar[k]:--}
1353
1354-
1355+
1356 ###
1357 # Decide if we need to set titlebar text.
1358-
1359+
1360 case $TERM in
1361 xterm*)
1362 PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
1363@@ -96,8 +96,8 @@ setprompt () {
1364 PR_TITLEBAR=''
1365 ;;
1366 esac
1367-
1368-
1369+
1370+
1371 ###
1372 # Decide whether to set a screen title
1373 if [[ "$TERM" == "screen" ]]; then
1374@@ -105,15 +105,15 @@ setprompt () {
1375 else
1376 PR_STITLE=''
1377 fi
1378-
1379-
1380+
1381+
1382 ###
1383 # Finally, the prompt.
1384
1385 PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
1386 $PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
1387 $PR_GREEN%$PR_PWDLEN<...<%~%<<\
1388-$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
1389+$PR_GREY)`rvm_prompt_info || rbenv_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
1390 $PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\
1391 $PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\
1392
1393@@ -135,3 +135,7 @@ $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
1394 }
1395
1396 setprompt
1397+
1398+autoload -U add-zsh-hook
1399+add-zsh-hook precmd theme_precmd
1400+add-zsh-hook preexec theme_preexec
1401diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
1402index 6bed1a70e46716437afb494ed699c724bd8df670..142e768380e23b1d0b11b4b63fc4ca31a2b43867 100644
1403--- a/themes/josh.zsh-theme
1404+++ b/themes/josh.zsh-theme
1405@@ -10,7 +10,7 @@ function josh_prompt {
1406 prompt=" "
1407
1408 branch=$(current_branch)
1409- ruby_version=$(rvm_prompt_info)
1410+ ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
1411 path_size=${#PWD}
1412 branch_size=${#branch}
1413 ruby_size=${#ruby_version}
1414@@ -31,7 +31,7 @@ function josh_prompt {
1415 prompt=" $prompt"
1416 done
1417
1418- prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
1419+ prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)"
1420
1421 echo $prompt
1422 }
1423diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
1424index 6e04e1595aa4d0d0dfc96f1961bfb756252ed9f4..e743289c35aff6561f519b4702c5b070df08320a 100644
1425--- a/themes/kolo.zsh-theme
1426+++ b/themes/kolo.zsh-theme
1427@@ -7,7 +7,7 @@ zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
1428 zstyle ':vcs_info:*' check-for-changes true
1429 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
1430 zstyle ':vcs_info:*' enable git svn
1431-precmd () {
1432+theme_precmd () {
1433 if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
1434 zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
1435 } else {
1436@@ -19,3 +19,6 @@ precmd () {
1437
1438 setopt prompt_subst
1439 PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
1440+
1441+autoload -U add-zsh-hook
1442+add-zsh-hook precmd theme_precmd
1443diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme
1444index 4eb410233f96bbfa0f43b47122964eaee3ee893f..0453767613524b9b8d55ad480db8232d0628d438 100644
1445--- a/themes/macovsky-ruby.zsh-theme
1446+++ b/themes/macovsky-ruby.zsh-theme
1447@@ -1,7 +1,14 @@
1448 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
1449 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1450
1451-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1452+if which rvm-prompt &> /dev/null; then
1453+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1454+else
1455+ if which rbenv &> /dev/null; then
1456+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1457+ fi
1458+fi
1459+
1460 RPS1="${return_code}"
1461
1462 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
1463diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme
1464index 4eb410233f96bbfa0f43b47122964eaee3ee893f..b6978b9290fce5b6a5b27509cdcef12c9d507e0a 100644
1465--- a/themes/macovsky.zsh-theme
1466+++ b/themes/macovsky.zsh-theme
1467@@ -1,7 +1,13 @@
1468 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
1469 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
1470
1471-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1472+if which rvm-prompt &> /dev/null; then
1473+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1474+else
1475+ if which rbenv &> /dev/null; then
1476+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
1477+ fi
1478+fi
1479 RPS1="${return_code}"
1480
1481 ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
1482diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme
1483new file mode 100644
1484index 0000000000000000000000000000000000000000..34a3765b1b1fdbfa433e033a1c7d571e3fbc1880
1485--- /dev/null
1486+++ b/themes/mh.zsh-theme
1487@@ -0,0 +1,24 @@
1488+# mh theme
1489+# preview: http://cl.ly/1y2x0W0E3t2C0F29043z
1490+
1491+# features:
1492+# path is autoshortened to ~30 characters
1493+# displays git status (if applicable in current folder)
1494+# turns username green if superuser, otherwise it is white
1495+
1496+# if superuser make the username green
1497+if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi
1498+
1499+# prompt
1500+PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) '
1501+RPROMPT='$(git_prompt_info)'
1502+
1503+# git theming
1504+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B"
1505+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} "
1506+ZSH_THEME_GIT_PROMPT_CLEAN=""
1507+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱"
1508+
1509+# LS colors, made with http://geoff.greer.fm/lscolors/
1510+export LSCOLORS="Gxfxcxdxbxegedabagacad"