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