Diff
1diff --git a/lib/rbenv.zsh b/lib/rbenv.zsh
2new file mode 100644
3index 0000000000000000000000000000000000000000..a8b6c323ccae4f9bbe3f4955e258b88463b14e60
4--- /dev/null
5+++ b/lib/rbenv.zsh
6@@ -0,0 +1,2 @@
7+# using the rbenv plugin will override this with a real implementation
8+function rbenv_prompt_info() {}
9diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme
10index b2759a1b0fe9d7f05b04f34baac42de073b8092a..2fc066381ca13d0a7f40f548bf957bdeedd0093f 100644
11--- a/themes/crunch.zsh-theme
12+++ b/themes/crunch.zsh-theme
13@@ -29,7 +29,7 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗"
14
15 # Our elements:
16 CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}"
17-if which rvm-prompt &> /dev/null; then
18+if [ -e ~/.rvm/bin/rvm-prompt ]; then
19 CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
20 else
21 if which rbenv &> /dev/null; then
22diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme
23index c9e33552128976c96be5d4f39dbd5862385d5078..e9e86177b498fa09cdcb09e4c67d73bece5f8dde 100644
24--- a/themes/dallas.zsh-theme
25+++ b/themes/dallas.zsh-theme
26@@ -3,7 +3,7 @@
27 # Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
28 DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}"
29 # Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
30-if which rvm-prompt &> /dev/null; then
31+if [ -e ~/.rvm/bin/rvm-prompt ]; then
32 DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
33 else
34 if which rbenv &> /dev/null; then
35diff --git a/themes/half-life.zsh-theme b/themes/half-life.zsh-theme
36new file mode 100644
37index 0000000000000000000000000000000000000000..c8d09ce47fe2a178b906970fdea866dc777cbe9f
38--- /dev/null
39+++ b/themes/half-life.zsh-theme
40@@ -0,0 +1,99 @@
41+# prompt style and colors based on Steve Losh's Prose theme:
42+# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
43+#
44+# vcs_info modifications from Bart Trojanowski's zsh prompt:
45+# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
46+#
47+# git untracked files modification from Brian Carper:
48+# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
49+
50+function virtualenv_info {
51+ [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
52+}
53+PR_GIT_UPDATE=1
54+
55+setopt prompt_subst
56+autoload colors
57+colors
58+
59+autoload -U add-zsh-hook
60+autoload -Uz vcs_info
61+
62+#use extended color pallete if available
63+if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
64+ turquoise="%F{81}"
65+ orange="%F{166}"
66+ purple="%F{135}"
67+ hotpink="%F{161}"
68+ limegreen="%F{118}"
69+else
70+ turquoise="$fg[cyan]"
71+ orange="$fg[yellow]"
72+ purple="$fg[magenta]"
73+ hotpink="$fg[red]"
74+ limegreen="$fg[green]"
75+fi
76+
77+# enable VCS systems you use
78+zstyle ':vcs_info:*' enable git svn
79+
80+# check-for-changes can be really slow.
81+# you should disable it, if you work with large repositories
82+zstyle ':vcs_info:*:prompt:*' check-for-changes true
83+
84+# set formats
85+# %b - branchname
86+# %u - unstagedstr (see below)
87+# %c - stagedstr (see below)
88+# %a - action (e.g. rebase-i)
89+# %R - repository path
90+# %S - path in the repository
91+PR_RST="%{${reset_color}%}"
92+FMT_BRANCH=" on %{$turquoise%}%b%u%c${PR_RST}"
93+FMT_ACTION=" performing a %{$limegreen%}%a${PR_RST}"
94+FMT_UNSTAGED="%{$orange%}●"
95+FMT_STAGED="%{$limegreen%}●"
96+
97+zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}"
98+zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}"
99+zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}"
100+zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
101+zstyle ':vcs_info:*:prompt:*' nvcsformats ""
102+
103+
104+function steeef_preexec {
105+ case "$(history $HISTCMD)" in
106+ *git*)
107+ PR_GIT_UPDATE=1
108+ ;;
109+ *svn*)
110+ PR_GIT_UPDATE=1
111+ ;;
112+ esac
113+}
114+add-zsh-hook preexec steeef_preexec
115+
116+function steeef_chpwd {
117+ PR_GIT_UPDATE=1
118+}
119+add-zsh-hook chpwd steeef_chpwd
120+
121+function steeef_precmd {
122+ if [[ -n "$PR_GIT_UPDATE" ]] ; then
123+ # check for untracked files or updated submodules, since vcs_info doesn't
124+ if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
125+ PR_GIT_UPDATE=1
126+ FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST}"
127+ else
128+ FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c${PR_RST}"
129+ fi
130+ zstyle ':vcs_info:*:prompt:*' formats "${FMT_BRANCH}"
131+
132+ vcs_info 'prompt'
133+ PR_GIT_UPDATE=
134+ fi
135+}
136+add-zsh-hook precmd steeef_precmd
137+
138+PROMPT=$'
139+%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} '
140diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme
141index 0453767613524b9b8d55ad480db8232d0628d438..69d80d588448eafb5a50d50714897a6d0a17fcf5 100644
142--- a/themes/macovsky-ruby.zsh-theme
143+++ b/themes/macovsky-ruby.zsh-theme
144@@ -1,7 +1,7 @@
145 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
146 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
147
148-if which rvm-prompt &> /dev/null; then
149+if [ -e ~/.rvm/bin/rvm-prompt ]; then
150 PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
151 else
152 if which rbenv &> /dev/null; then
153diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme
154index b6978b9290fce5b6a5b27509cdcef12c9d507e0a..2e6dce42d164c04b0ccbecc6b75bac8fb589653b 100644
155--- a/themes/macovsky.zsh-theme
156+++ b/themes/macovsky.zsh-theme
157@@ -1,7 +1,7 @@
158 # ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
159 local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
160
161-if which rvm-prompt &> /dev/null; then
162+if [ -e ~/.rvm/bin/rvm-prompt ]; then
163 PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
164 else
165 if which rbenv &> /dev/null; then
166diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme
167index 0be816de0af852876b34a9ee817a81cd7fc97f4e..86955a5605f01c1ab1e460b0a9a2ad743a9f61dd 100644
168--- a/themes/superjarin.zsh-theme
169+++ b/themes/superjarin.zsh-theme
170@@ -1,5 +1,5 @@
171 # Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
172-if which rvm-prompt &> /dev/null; then
173+if [ -e ~/.rvm/bin/rvm-prompt ]; then
174 JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
175 else
176 if which rbenv &> /dev/null; then
177diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
178index 574e0cec3b17b8549d4a66dc81b8b0b8a2262b8e..5c49fe79b5e769bff7711c8f2d27b89d67005a5b 100644
179--- a/themes/zhann.zsh-theme
180+++ b/themes/zhann.zsh-theme
181@@ -1,6 +1,6 @@
182 PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
183
184-if which rvm-prompt &> /dev/null; then
185+if [ -e ~/.rvm/bin/rvm-prompt ]; then
186 RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
187 else
188 if which rbenv &> /dev/null; then