f5041025844a2509f42e0bb19cb8d5418340e10c
- Author
- fred-o <fredrik.appelberg@gmail.com>
- Committer
- fred-o <fredrik.appelberg@gmail.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/README.textile b/README.textile
2index 2dbfbe5a658d8bba2d387bbab272e189ab9e8fca..eca96808974a9f89b2c57095a7ca6dd5bd85c124 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
20diff --git a/lib/completion.zsh b/lib/completion.zsh
21index b3cc918229ce3cdf60f6434cda1ecf1e7a385a77..b964595edfbaec82a87a7b44c1c3b2088dbd3a69 100644
22--- a/lib/completion.zsh
23+++ b/lib/completion.zsh
24@@ -32,12 +32,14 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
25 cdpath=(.)
26
27 # use /etc/hosts and known_hosts for hostname completion
28+[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
29 [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
30 [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
31 hosts=(
32+ "$_global_ssh_hosts[@]"
33 "$_ssh_hosts[@]"
34 "$_etc_hosts[@]"
35- `hostname`
36+ "$HOST"
37 localhost
38 )
39 zstyle ':completion:*:hosts' hosts $hosts
40diff --git a/lib/functions.zsh b/lib/functions.zsh
41index ef7cc6383038b7e6f9a02c857f13ea498ba5a8fe..d2dcadd0cb4d7235c8876556eb863140c315df12 100644
42--- a/lib/functions.zsh
43+++ b/lib/functions.zsh
44@@ -3,11 +3,11 @@ function zsh_stats() {
45 }
46
47 function uninstall_oh_my_zsh() {
48- /bin/sh $ZSH/tools/uninstall.sh
49+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
50 }
51
52 function upgrade_oh_my_zsh() {
53- /bin/sh $ZSH/tools/upgrade.sh
54+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
55 }
56
57 function take() {
58diff --git a/lib/git.zsh b/lib/git.zsh
59index f04343650f65ddaaa6f9eba34b718d5f5d1bfd9c..defa062c6cb7cce62a7cbdf826f9850ae3a0298d 100644
60--- a/lib/git.zsh
61+++ b/lib/git.zsh
62@@ -6,7 +6,7 @@ function git_prompt_info() {
63
64 # Checks if working tree is dirty
65 parse_git_dirty() {
66- if [[ -n $(git status -s 2> /dev/null) ]]; then
67+ if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then
68 echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
69 else
70 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
71diff --git a/lib/history.zsh b/lib/history.zsh
72index ca6f57079aef8e953154aa176159c8635e333228..876936b87888a60d1fc7ece2cdfa8dcdd6d9d8c8 100644
73--- a/lib/history.zsh
74+++ b/lib/history.zsh
75@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
76 HISTSIZE=10000
77 SAVEHIST=10000
78
79-setopt hist_ignore_dups # ignore duplication command history list
80-setopt share_history # share command history data
81-
82-setopt hist_verify
83-setopt inc_append_history
84+setopt append_history
85 setopt extended_history
86 setopt hist_expire_dups_first
87+setopt hist_ignore_dups # ignore duplication command history list
88 setopt hist_ignore_space
89-
90-setopt SHARE_HISTORY
91-setopt APPEND_HISTORY
92+setopt hist_verify
93+setopt inc_append_history
94+setopt share_history # share command history data
95diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
96index 22e7f372fffdb1da78ffd3852130340a5d9aa448..221989502360e4182d14489765578b5ee9ff5491 100644
97--- a/lib/termsupport.zsh
98+++ b/lib/termsupport.zsh
99@@ -4,7 +4,7 @@
100 #Limited support for Apple Terminal (Terminal can't set window or tab separately)
101 function title {
102 [ "$DISABLE_AUTO_TITLE" != "true" ] || return
103- if [[ "$TERM" == screen* ]]; then
104+ if [[ "$TERM" == screen* ]]; then
105 print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
106 elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
107 print -Pn "\e]2;$2:q\a" #set window name
108@@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
109 ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
110
111 #Appears when you have the prompt
112-function precmd {
113+function omz_termsupport_precmd {
114 title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
115 }
116
117 #Appears at the beginning of (and during) of command execution
118-function preexec {
119+function omz_termsupport_preexec {
120 emulate -L zsh
121 setopt extended_glob
122 local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
123 title "$CMD" "%100>...>$2%<<"
124 }
125+
126+autoload -U add-zsh-hook
127+add-zsh-hook precmd omz_termsupport_precmd
128+add-zsh-hook preexec omz_termsupport_preexec
129diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
130index 891e8d467335aa42409b6ae331e32aaa86bcbd2b..aeeaa3daff380c9d556da4af4eb372e5fd6e6140 100644
131--- a/oh-my-zsh.sh
132+++ b/oh-my-zsh.sh
133@@ -13,20 +13,27 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
134 # TIP: Add files you don't want in git to .gitignore
135 for config_file ($ZSH/lib/*.zsh) source $config_file
136
137-# Add all defined plugins to fpath
138+# Set ZSH_CUSTOM to the path where your custom config files
139+# and plugins exists, or else we will use the default custom/
140+if [[ -z "$ZSH_CUSTOM" ]]; then
141+ ZSH_CUSTOM="$ZSH/custom"
142+fi
143+
144+# Add all defined plugins to fpath. This must be done
145+# before running compinit.
146 plugin=${plugin:=()}
147-for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
148+for plugin ($plugins); do
149+ if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
150+ fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
151+ elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
152+ fpath=($ZSH/plugins/$plugin $fpath)
153+ fi
154+done
155
156 # Load and run compinit
157 autoload -U compinit
158 compinit -i
159
160-# Set ZSH_CUSTOM to the path where your custom config files
161-# and plugins exists, or else we will use the default custom/
162-if [ "$ZSH_CUSTOM" = "" ]
163-then
164- ZSH_CUSTOM="$ZSH/custom"
165-fi
166
167 # Load all of the plugins that were defined in ~/.zshrc
168 for plugin ($plugins); do
169@@ -52,7 +59,12 @@ then
170 else
171 if [ ! "$ZSH_THEME" = "" ]
172 then
173- source "$ZSH/themes/$ZSH_THEME.zsh-theme"
174+ if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
175+ then
176+ source "$ZSH/custom/$ZSH_THEME.zsh-theme"
177+ else
178+ source "$ZSH/themes/$ZSH_THEME.zsh-theme"
179+ fi
180 fi
181 fi
182
183diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh
184index b5e519036229b856c7a92854130d7fccaf848957..294dc5354cce12627ab52e0d0d69f45ec9859131 100644
185--- a/plugins/archlinux/archlinux.plugin.zsh
186+++ b/plugins/archlinux/archlinux.plugin.zsh
187@@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then
188 alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
189 # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
190 alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
191+ alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
192 alias yain='yaourt -S' # Install specific package(s) from the repositories
193 alias yains='yaourt -U' # Install specific package not from the repositories but from a file
194 alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
195diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
196index da0a1276572dc655cc82eedc762e2996dac8b0b6..6f9b80bffa077a9928ba2a2b7647b96c7588a3f1 100644
197--- a/plugins/autojump/autojump.plugin.zsh
198+++ b/plugins/autojump/autojump.plugin.zsh
199@@ -1,3 +1,5 @@
200-if [ -f `brew --prefix`/etc/autojump ]; then
201+if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
202+ . /opt/local/etc/profile.d/autojump.sh
203+elif [ -f `brew --prefix`/etc/autojump ]; then
204 . `brew --prefix`/etc/autojump
205 fi
206diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
207new file mode 100644
208index 0000000000000000000000000000000000000000..bc75c5cf9ad01bd58ef29c4d83782ce5a849baff
209--- /dev/null
210+++ b/plugins/battery/battery.plugin.zsh
211@@ -0,0 +1,20 @@
212+if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
213+ function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
214+ function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
215+ function battery_pct_prompt() {
216+ b=$(battery_pct_remaining)
217+ if [ $b -gt 50 ] ; then
218+ color='green'
219+ elif [ $b -gt 20 ] ; then
220+ color='yellow'
221+ else
222+ color='red'
223+ fi
224+ echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
225+ }
226+else
227+ error_msg='no battery'
228+ function battery_pct_remaining() { echo $error_msg }
229+ function battery_time_remaining() { echo $error_msg }
230+ function battery_pct_prompt() { echo '' }
231+fi
232diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
233index 3c96b8da99ea0779d0cd148402558a4c5407761a..55564a252fce5d6d62ec745612067398ec4f8fce 100644
234--- a/plugins/bundler/bundler.plugin.zsh
235+++ b/plugins/bundler/bundler.plugin.zsh
236@@ -10,7 +10,7 @@ alias bu="bundle update"
237
238 # The following is based on https://github.com/gma/bundler-exec
239
240-bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
241+bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails)
242
243 ## Functions
244
245@@ -41,6 +41,6 @@ for cmd in $bundled_commands; do
246 alias $cmd=bundled_$cmd
247
248 if which _$cmd > /dev/null 2>&1; then
249- compdef _$cmd bundled_$cmd
250+ compdef _$cmd bundled_$cmd=$cmd
251 fi
252 done
253diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
254index 09771881dfc255f8c984626e9c6c21b3b87d474a..16a5d54cadb59c99533956e0f1f565531613aa6e 100644
255--- a/plugins/debian/debian.plugin.zsh
256+++ b/plugins/debian/debian.plugin.zsh
257@@ -54,7 +54,7 @@ if [[ $use_sudo -eq 1 ]]; then
258
259 # apt-get only
260 alias ads="sudo $apt_pref dselect-upgrade"
261-
262+
263 # Install all .deb files in the current directory.
264 # Warning: you will need to put the glob in single quotes if you use:
265 # glob_subst
266@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
267 alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
268
269
270-
271-
272-
273 # Functions #################################################################
274 # create a simple script that can be used to 'duplicate' a system
275 apt-copy() {
276@@ -132,11 +129,46 @@ apt-copy() {
277 chmod +x apt-copy.sh
278 }
279
280+# Prints apt history
281+# Usage:
282+# apt-history install
283+# apt-history upgrade
284+# apt-history remove
285+# apt-history rollback
286+# apt-history list
287+# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
288+apt-history () {
289+ case "$1" in
290+ install)
291+ zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
292+ ;;
293+ upgrade|remove)
294+ zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
295+ ;;
296+ rollback)
297+ zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
298+ grep "$2" -A10000000 | \
299+ grep "$3" -B10000000 | \
300+ awk '{print $4"="$5}'
301+ ;;
302+ list)
303+ zcat $(ls -rt /var/log/dpkg*)
304+ ;;
305+ *)
306+ echo "Parameters:"
307+ echo " install - Lists all packages that have been installed."
308+ echo " upgrade - Lists all packages that have been upgraded."
309+ echo " remove - Lists all packages that have been removed."
310+ echo " rollback - Lists rollback information."
311+ echo " list - Lists all contains of dpkg logs."
312+ ;;
313+ esac
314+}
315
316 # Kernel-package building shortcut
317 kerndeb () {
318 # temporarily unset MAKEFLAGS ( '-j3' will fail )
319- MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
320+ MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )
321 print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
322 appendage='-custom' # this shows up in $ (uname -r )
323 revision=$(date +"%Y%m%d") # this shows up in the .deb file name
324diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
325index 183c56c1c6fef531e3c0b300debfa745774365fd..c1b382b2c2df245817fb2998b9c31ea4144de526 100644
326--- a/plugins/git/git.plugin.zsh
327+++ b/plugins/git/git.plugin.zsh
328@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
329 compdef _git gca=git-commit
330 alias gco='git checkout'
331 compdef _git gco=git-checkout
332+alias gcm='git checkout master'
333 alias gb='git branch'
334 compdef _git gb=git-branch
335 alias gba='git branch -a'
336diff --git a/plugins/jake-node/jake-node.plugin.zsh b/plugins/jake-node/jake-node.plugin.zsh
337new file mode 100644
338index 0000000000000000000000000000000000000000..a9eef4029620dc3901399d0a4973feda73f4860f
339--- /dev/null
340+++ b/plugins/jake-node/jake-node.plugin.zsh
341@@ -0,0 +1,14 @@
342+#---oh-my-zsh plugin : task Autocomplete for Jake tool---
343+# Jake : https://github.com/mde/jake
344+# Warning : Jakefile should have the right case : Jakefile or jakefile
345+# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
346+# Author : Alexandre Lacheze (@al3xstrat)
347+# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh
348+
349+function _jake () {
350+ if [ -f Jakefile ]||[ -f jakefile ]; then
351+ compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
352+ fi
353+}
354+
355+compdef _jake jake
356diff --git a/plugins/knife/_knife b/plugins/knife/_knife
357index 7f8c95ee5a470810785cb719828371a5e7463e6c..8453af5be60abb5412a28010dc500f7fb1512cc9 100644
358--- a/plugins/knife/_knife
359+++ b/plugins/knife/_knife
360@@ -26,7 +26,7 @@ _knife() {
361
362 case $state in
363 knifecmd)
364- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
365+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
366 ;;
367 knifesubcmd)
368 case $words[2] in
369@@ -42,6 +42,9 @@ _knife() {
370 cookbook)
371 compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
372 ;;
373+ environment)
374+ compadd -Q "$@" list create delete edit show "from file"
375+ ;;
376 node)
377 compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
378 ;;
379@@ -138,27 +141,31 @@ _knife_options3() {
380
381 # The chef_x_remote functions use knife to get a list of objects of type x on the server
382 _chef_roles_remote() {
383- (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
384+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
385 }
386
387 _chef_clients_remote() {
388- (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
389+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
390 }
391
392 _chef_nodes_remote() {
393- (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
394+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
395 }
396
397 _chef_cookbooks_remote() {
398- (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
399+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
400 }
401
402 _chef_sitecookbooks_remote() {
403- (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
404+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
405 }
406
407 _chef_data_bags_remote() {
408- (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
409+ (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
410+}
411+
412+_chef_environments_remote() {
413+ (knife environment list | awk '{print $1}')
414 }
415
416 # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
417diff --git a/plugins/pip/_pip b/plugins/pip/_pip
418index b58010173a5028b0dc0db651f042e56df861d497..df53ba5ce8ec788d3ff7da94a9936ffee94267db 100644
419--- a/plugins/pip/_pip
420+++ b/plugins/pip/_pip
421@@ -3,30 +3,43 @@
422
423 # pip zsh completion, based on homebrew completion
424
425+_pip_all() {
426+ # we cache the list of packages (originally from the macports plugin)
427+ if (( ! $+piplist )); then
428+ echo -n " (caching package index...)"
429+ piplist=($(pip search * | cut -d ' ' -f 1 | tr '[A-Z]' '[a-z]'))
430+ fi
431+}
432+
433 _pip_installed() {
434- installed_pkgs=(`pip freeze`)
435+ installed_pkgs=(`pip freeze | cut -d '=' -f 1`)
436 }
437
438 local -a _1st_arguments
439 _1st_arguments=(
440- 'bundle:Create pybundles (archives containing multiple packages)'
441- 'freeze:Output all currently installed packages (exact versions) to stdout'
442- 'help:Show available commands'
443- 'install:Install packages'
444- 'search:Search PyPI'
445- 'uninstall:Uninstall packages'
446- 'unzip:Unzip individual packages'
447- 'zip:Zip individual packages'
448+ 'bundle:create pybundles (archives containing multiple packages)'
449+ 'freeze:output all currently installed packages (exact versions) to stdout'
450+ 'help:show available commands'
451+ 'install:install packages'
452+ 'search:search PyPI'
453+ 'uninstall:uninstall packages'
454+ 'unzip:unzip individual packages'
455+ 'zip:zip individual packages'
456 )
457
458 local expl
459-local -a pkgs installed_pkgs
460+local -a all_pkgs installed_pkgs
461
462 _arguments \
463- '(--version)--version[Show version number of program and exit]' \
464- '(-v --verbose)'{-v,--verbose}'[Give more output]' \
465- '(-q --quiet)'{-q,--quiet}'[Give less output]' \
466- '(-h --help)'{-h,--help}'[Show help]' \
467+ '(--version)--version[show version number of program and exit]' \
468+ '(-h --help)'{-h,--help}'[show help]' \
469+ '(-E --environment)'{-E,--environment}'[virtualenv environment to run pip in]' \
470+ '(-s --enable-site-packages)'{-s,--enable-site-packages}'[include site-packages in virtualenv]' \
471+ '(-v --verbose)'{-v,--verbose}'[give more output]' \
472+ '(-q --quiet)'{-q,--quiet}'[give less output]' \
473+ '(--log)--log[log file location]' \
474+ '(--proxy)--proxy[proxy in form user:passwd@proxy.server:port]' \
475+ '(--timeout)--timeout[socket timeout (default 15s)]' \
476 '*:: :->subcmds' && return 0
477
478 if (( CURRENT == 1 )); then
479@@ -35,10 +48,25 @@ if (( CURRENT == 1 )); then
480 fi
481
482 case "$words[1]" in
483- list)
484- if [[ "$state" == forms ]]; then
485- _pip_installed
486- _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
487+ search)
488+ _arguments \
489+ '(--index)--index[base URL of Python Package Index]' ;;
490+ freeze)
491+ _arguments \
492+ '(-l --local)'{-l,--local}'[report only virtualenv packages]' ;;
493+ install)
494+ _arguments \
495+ '(-U --upgrade)'{-U,--upgrade}'[upgrade all packages to the newest available version]' \
496+ '(-f --find-links)'{-f,--find-links}'[URL for finding packages]' \
497+ '(--no-deps --no-dependencies)'{--no-deps,--no-dependencies}'[iIgnore package dependencies]' \
498+ '(--no-install)--no-install[only download packages]' \
499+ '(--no-download)--no-download[only install downloaded packages]' \
500+ '(--install-option)--install-option[extra arguments to be supplied to the setup.py]' \
501+ '1: :->packages' && return 0
502+
503+ if [[ "$state" == packages ]]; then
504+ _pip_all
505+ _wanted piplist expl 'packages' compadd -a piplist
506 fi ;;
507 uninstall)
508 _pip_installed
509diff --git a/plugins/rails3/rails3.plugin.zsh b/plugins/rails3/rails3.plugin.zsh
510index f4ee637e6b45522afdee404804b12edf0f1e992e..792cde2bd07b472d55c41393439a3306288db7cb 100644
511--- a/plugins/rails3/rails3.plugin.zsh
512+++ b/plugins/rails3/rails3.plugin.zsh
513@@ -17,3 +17,5 @@ alias rp='_rails_command plugin'
514 alias rs='_rails_command server'
515 alias rsd='_rails_command server --debugger'
516 alias devlog='tail -f log/development.log'
517+alias rdm='rake db:migrate'
518+alias rdr='rake db:rollback'
519diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
520new file mode 100644
521index 0000000000000000000000000000000000000000..ae37404cd8328ab621cb4f8ab804cc143efbe9c0
522--- /dev/null
523+++ b/plugins/rbenv/rbenv.plugin.zsh
524@@ -0,0 +1,44 @@
525+FOUND_RBENV=0
526+for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
527+ if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
528+ FOUND_RBENV=1
529+ export RBENV_ROOT=$rbenvdir
530+ export PATH=${rbenvdir}/bin:$PATH
531+ eval "$(rbenv init -)"
532+
533+ alias rubies="rbenv versions"
534+ alias gemsets="rbenv gemset list"
535+
536+ function current_ruby() {
537+ echo "$(rbenv version-name)"
538+ }
539+
540+ function current_gemset() {
541+ echo "$(rbenv gemset active 2&>/dev/null | sed -e ":a" -e '$ s/\n/+/gp;N;b a' | head -n1)"
542+ }
543+
544+ function gems {
545+ local rbenv_path=$(rbenv prefix)
546+ gem list $@ | sed \
547+ -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
548+ -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \
549+ -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
550+ -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
551+ }
552+
553+ function rbenv_prompt_info() {
554+ if [[ -n $(current_gemset) ]] ; then
555+ echo "$(current_ruby)@$(current_gemset)"
556+ else
557+ echo "$(current_ruby)"
558+ fi
559+ }
560+ fi
561+done
562+unset rbenvdir
563+
564+if [ $FOUND_RBENV -eq 0 ] ; then
565+ alias rubies='ruby -v'
566+ function gemsets() { echo 'not supported' }
567+ function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" }
568+fi
569diff --git a/plugins/ruby/ruby.plugin.zsh b/plugins/ruby/ruby.plugin.zsh
570index 08ca9c60178faf69bb92b4bcd1a5fd66b31f49eb..38e4d7cd01c1c708a8dcfc5afcbd2e78fe7deea7 100644
571--- a/plugins/ruby/ruby.plugin.zsh
572+++ b/plugins/ruby/ruby.plugin.zsh
573@@ -3,4 +3,4 @@
574 alias sgem='sudo gem'
575
576 # Find ruby file
577-alias rfind='find . -name *.rb | xargs grep -n'
578+alias rfind='find . -name "*.rb" | xargs grep -n'
579diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
580index 24621fe0b57e02b76d3179241ee2c78fc53934eb..604c0071393b07f0edcc6dbd80a4c6b0d290e7cd 100644
581--- a/plugins/rvm/rvm.plugin.zsh
582+++ b/plugins/rvm/rvm.plugin.zsh
583@@ -37,7 +37,7 @@ function gems {
584 local current_gemset=`rvm-prompt g`
585
586 gem list $@ | sed \
587- -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \
588+ -Ee "s/\([0-9, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \
589 -Ee "s|$(echo $rvm_path)|$fg[magenta]\$rvm_path$reset_color|g" \
590 -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
591 -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
592diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh
593new file mode 100644
594index 0000000000000000000000000000000000000000..9f9432ac8c0cb593e6fe43f3be4ef131f707fbc4
595--- /dev/null
596+++ b/plugins/sprunge/sprunge.plugin.zsh
597@@ -0,0 +1,64 @@
598+# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf <parwok -at- gmail>
599+# Created by the blogger at the URL below...I don't know where to find his/her name
600+# Original found at http://www.shellperson.net/sprunge-pastebin-script/
601+
602+usage() {
603+description | fmt -s >&2
604+}
605+
606+description() {
607+cat << HERE
608+
609+DESCRIPTION
610+ Upload data and fetch URL from the pastebin http://sprunge.us
611+
612+USAGE
613+ $0 filename.txt
614+ $0 text string
615+ $0 < filename.txt
616+ piped_data | $0
617+
618+NOTES
619+--------------------------------------------------------------------------
620+* INPUT METHODS *
621diff --git a/plugins/symfony2/symfony2.plugin.zsh b/plugins/symfony2/symfony2.plugin.zsh
622new file mode 100644
623index 0000000000000000000000000000000000000000..644266841fe11393c8b253da3479f52383f7dfdf
624--- /dev/null
625+++ b/plugins/symfony2/symfony2.plugin.zsh
626@@ -0,0 +1,13 @@
627+# Symfony2 basic command completion
628+
629+_symfony2_get_command_list () {
630+ app/console --no-ansi | sed "1,/Available commands/d" | awk '/^ [a-z]+/ { print $1 }'
631+}
632+
633+_symfony2 () {
634+ if [ -f app/console ]; then
635+ compadd `_symfony2_get_command_list`
636+ fi
637+}
638+
639+compdef _symfony2 app/console
640diff --git a/plugins/terminalapp/terminalapp.plugin.zsh b/plugins/terminalapp/terminalapp.plugin.zsh
641new file mode 100644
642index 0000000000000000000000000000000000000000..4695ad0556d62806bf335408a7ed79171860f1f4
643--- /dev/null
644+++ b/plugins/terminalapp/terminalapp.plugin.zsh
645@@ -0,0 +1,11 @@
646+# Set Apple Terminal.app resume directory
647+# based on this answer: http://superuser.com/a/315029
648+
649+function chpwd {
650+ local SEARCH=' '
651+ local REPLACE='%20'
652+ local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
653+ printf '\e]7;%s\a' "$PWD_URL"
654+}
655+
656+chpwd
657diff --git a/plugins/wakeonlan/README b/plugins/wakeonlan/README
658new file mode 100644
659index 0000000000000000000000000000000000000000..16fdd4587060ce16895373d3bd5e9713113994c3
660--- /dev/null
661+++ b/plugins/wakeonlan/README
662@@ -0,0 +1,29 @@
663+This plugin provides a wrapper around the "wakeonlan" tool available from most
664+distributions' package repositories, or from the following website:
665+
666+http://gsd.di.uminho.pt/jpo/software/wakeonlan/
667+
668+In order to use this wrapper, create the ~/.wakeonlan directory, and place in
669+that directory one file for each device you would like to be able to wake. Give
670+the file a name that describes the device, such as its hostname. Each file
671+should contain a line with the mac address of the target device and the network
672+broadcast address.
673+
674+For instance, there might be a file ~/.wakeonlan/leto with the following
675+contents:
676+
677+00:11:22:33:44:55:66 192.168.0.255
678+
679+To wake that device, use the following command:
680+
681+# wake leto
682+
683+The available device names will be autocompleted, so:
684+
685+# wake <tab>
686+
687+...will suggest "leto", along with any other configuration files that were
688+placed in the ~/.wakeonlan directory.
689+
690+For more information regarding the configuration file format, check the
691+wakeonlan man page.
692diff --git a/plugins/wakeonlan/_wake b/plugins/wakeonlan/_wake
693new file mode 100644
694index 0000000000000000000000000000000000000000..4ab10d374a6e5d82d953d3d32b5f2ade2ec9ddd6
695--- /dev/null
696+++ b/plugins/wakeonlan/_wake
697@@ -0,0 +1,4 @@
698+#compdef wake
699+#autoload
700+
701+_arguments "1:device to wake:_files -W '$HOME/.wakeonlan'" && return 0
702diff --git a/plugins/wakeonlan/wakeonlan.plugin.zsh b/plugins/wakeonlan/wakeonlan.plugin.zsh
703new file mode 100644
704index 0000000000000000000000000000000000000000..6cef7d44ad72f59690093b6e13cdd95d629cff69
705--- /dev/null
706+++ b/plugins/wakeonlan/wakeonlan.plugin.zsh
707@@ -0,0 +1,14 @@
708+function wake() {
709+ local config_file="$HOME/.wakeonlan/$1"
710+ if [[ ! -f "$config_file" ]]; then
711+ echo "ERROR: There is no configuration file at \"$config_file\"."
712+ return 1
713+ fi
714+
715+ if (( ! $+commands[wakeonlan] )); then
716+ echo "ERROR: Can't find \"wakeonlan\". Are you sure it's installed?"
717+ return 1
718+ fi
719+
720+ wakeonlan -f "$config_file"
721+}
722diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
723index 1ab40aba6d39eca4648267dfc25420b355c10b5b..e525532414557e76e924159dc592ea61fe635bb2 100644
724--- a/templates/zshrc.zsh-template
725+++ b/templates/zshrc.zsh-template
726@@ -7,6 +7,10 @@ ZSH=$HOME/.oh-my-zsh
727 # time that oh-my-zsh is loaded.
728 ZSH_THEME="robbyrussell"
729
730+# Example aliases
731+# alias zshconfig="mate ~/.zshrc"
732+# alias ohmyzsh="mate ~/.oh-my-zsh"
733+
734 # Set to this to use case-sensitive completion
735 # CASE_SENSITIVE="true"
736
737@@ -23,6 +27,7 @@ ZSH_THEME="robbyrussell"
738 # COMPLETION_WAITING_DOTS="true"
739
740 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
741+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
742 # Example format: plugins=(rails git textmate ruby lighthouse)
743 plugins=(git)
744
745diff --git a/themes/apple.zsh-theme b/themes/apple.zsh-theme
746index 92f1df941e7c0f027b78df4b86ebeeb7db4b82b3..275341dc67a8d85caafe92d78ab414787f104cdc 100644
747--- a/themes/apple.zsh-theme
748+++ b/themes/apple.zsh-theme
749@@ -2,7 +2,7 @@ function toon {
750 echo -n ""
751 }
752
753-get_git_dirty() {
754+get_git_dirty() {
755 git diff --quiet || echo '*'
756 }
757
758@@ -18,9 +18,12 @@ zstyle ':vcs_info:*' formats \
759 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
760 zstyle ':vcs_info:*' enable git cvs svn
761
762-precmd () {
763+theme_precmd () {
764 vcs_info
765 }
766
767 setopt prompt_subst
768 PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
769+
770+autoload -U add-zsh-hook
771+add-zsh-hook precmd theme_precmd
772diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
773index 259640ba40cdee547cc8826126dae6f9e4a9d748..f9406dd966d1132f556ad3cb120b4a542cdd88d8 100644
774--- a/themes/gallois.zsh-theme
775+++ b/themes/gallois.zsh-theme
776@@ -14,6 +14,8 @@ git_custom_status() {
777 #RVM and git settings
778 if [[ -s ~/.rvm/scripts/rvm ]] ; then
779 RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
780+else
781+ RPS1='$(git_custom_status) $EPS1'
782 fi
783
784 PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
785diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
786index add485279cfcc0df29817e1cabc8b8224e9948af..a170a13d0b435e835244c1cb945dbf07f4474beb 100644
787--- a/themes/jonathan.zsh-theme
788+++ b/themes/jonathan.zsh-theme
789@@ -1,19 +1,19 @@
790-function precmd {
791+function theme_precmd {
792 local TERMWIDTH
793 (( TERMWIDTH = ${COLUMNS} - 1 ))
794
795
796 ###
797 # Truncate the path if it's too long.
798-
799+
800 PR_FILLBAR=""
801 PR_PWDLEN=""
802-
803+
804 local promptsize=${#${(%):---(%n@%m:%l)---()--}}
805 local rubyprompt=`rvm_prompt_info`
806 local rubypromptsize=${#${rubyprompt}}
807 local pwdsize=${#${(%):-%~}}
808-
809+
810 if [[ "$promptsize + $rubypromptsize + $pwdsize" -gt $TERMWIDTH ]]; then
811 ((PR_PWDLEN=$TERMWIDTH - $promptsize))
812 else
813@@ -24,7 +24,7 @@ function precmd {
814
815
816 setopt extended_glob
817-preexec () {
818+theme_preexec () {
819 if [[ "$TERM" == "screen" ]]; then
820 local CMD=${1[(wr)^(*=*|sudo|-*)]}
821 echo -n "\ek$CMD\e\\"
822@@ -69,7 +69,7 @@ setprompt () {
823
824 ###
825 # See if we can use extended characters to look nicer.
826-
827+
828 typeset -A altchar
829 set -A altchar ${(s..)terminfo[acsc]}
830 PR_SET_CHARSET="%{$terminfo[enacs]%}"
831@@ -81,10 +81,10 @@ setprompt () {
832 PR_LRCORNER=${altchar[j]:--}
833 PR_URCORNER=${altchar[k]:--}
834
835-
836+
837 ###
838 # Decide if we need to set titlebar text.
839-
840+
841 case $TERM in
842 xterm*)
843 PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
844@@ -96,8 +96,8 @@ setprompt () {
845 PR_TITLEBAR=''
846 ;;
847 esac
848-
849-
850+
851+
852 ###
853 # Decide whether to set a screen title
854 if [[ "$TERM" == "screen" ]]; then
855@@ -105,8 +105,8 @@ setprompt () {
856 else
857 PR_STITLE=''
858 fi
859-
860-
861+
862+
863 ###
864 # Finally, the prompt.
865
866@@ -135,3 +135,7 @@ $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
867 }
868
869 setprompt
870+
871+autoload -U add-zsh-hook
872+add-zsh-hook precmd theme_precmd
873+add-zsh-hook preexec theme_preexec
874diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme
875index 6e04e1595aa4d0d0dfc96f1961bfb756252ed9f4..e743289c35aff6561f519b4702c5b070df08320a 100644
876--- a/themes/kolo.zsh-theme
877+++ b/themes/kolo.zsh-theme
878@@ -7,7 +7,7 @@ zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
879 zstyle ':vcs_info:*' check-for-changes true
880 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
881 zstyle ':vcs_info:*' enable git svn
882-precmd () {
883+theme_precmd () {
884 if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
885 zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]'
886 } else {
887@@ -19,3 +19,6 @@ precmd () {
888
889 setopt prompt_subst
890 PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% '
891+
892+autoload -U add-zsh-hook
893+add-zsh-hook precmd theme_precmd
894diff --git a/themes/mh.zsh-theme b/themes/mh.zsh-theme
895new file mode 100644
896index 0000000000000000000000000000000000000000..34a3765b1b1fdbfa433e033a1c7d571e3fbc1880
897--- /dev/null
898+++ b/themes/mh.zsh-theme
899@@ -0,0 +1,24 @@
900+# mh theme
901+# preview: http://cl.ly/1y2x0W0E3t2C0F29043z
902+
903+# features:
904+# path is autoshortened to ~30 characters
905+# displays git status (if applicable in current folder)
906+# turns username green if superuser, otherwise it is white
907+
908+# if superuser make the username green
909+if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi
910+
911+# prompt
912+PROMPT='[%{$fg[$NCOLOR]%}%B%n%b%{$reset_color%}:%{$fg[red]%}%30<...<%~%<<%{$reset_color%}]%(!.#.$) '
913+RPROMPT='$(git_prompt_info)'
914+
915+# git theming
916+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[gray]%}(%{$fg_no_bold[yellow]%}%B"
917+ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[gray]%})%{$reset_color%} "
918+ZSH_THEME_GIT_PROMPT_CLEAN=""
919+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✱"
920+
921+# LS colors, made with http://geoff.greer.fm/lscolors/
922+export LSCOLORS="Gxfxcxdxbxegedabagacad"
923diff --git a/themes/pygmalion.zsh-theme b/themes/pygmalion.zsh-theme
924new file mode 100644
925index 0000000000000000000000000000000000000000..cf3bb908f217a9ed67228963609306da6aa8065d
926--- /dev/null
927+++ b/themes/pygmalion.zsh-theme
928@@ -0,0 +1,9 @@
929+# Yay! High voltage and arrows!
930+
931+ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
932+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
933+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
934+ZSH_THEME_GIT_PROMPT_CLEAN=""
935+
936+PROMPT='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} '
937+
938diff --git a/themes/sammy.zsh-theme b/themes/sammy.zsh-theme
939new file mode 100644
940index 0000000000000000000000000000000000000000..52e6e4bb6bcf2ab52b7a676a5d3517fa07c83c9c
941--- /dev/null
942+++ b/themes/sammy.zsh-theme
943@@ -0,0 +1,6 @@
944+PROMPT='%{$fg[white]%}%c$(git_prompt_info)$ % %{$reset_color%}'
945+
946+ZSH_THEME_GIT_PROMPT_PREFIX="("
947+ZSH_THEME_GIT_PROMPT_SUFFIX=""
948+ZSH_THEME_GIT_PROMPT_DIRTY="*)"
949+ZSH_THEME_GIT_PROMPT_CLEAN=")"
950diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
951new file mode 100644
952index 0000000000000000000000000000000000000000..f50657db2c909def178fa5762def0f9ab613157d
953--- /dev/null
954+++ b/themes/suvash.zsh-theme
955@@ -0,0 +1,23 @@
956+function prompt_char {
957+ git branch >/dev/null 2>/dev/null && echo '±' && return
958+ hg root >/dev/null 2>/dev/null && echo 'Hg' && return
959+ echo '○'
960+}
961+
962+function virtualenv_info {
963+ [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
964+}
965+
966+function collapse_pwd {
967+ echo $(pwd | sed -e "s,^$HOME,~,")
968+}
969+
970+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%}
971+$(virtualenv_info)$(prompt_char) '
972+
973+
974+ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
975+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
976+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
977+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
978+ZSH_THEME_GIT_PROMPT_CLEAN=""
979diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
980new file mode 100644
981index 0000000000000000000000000000000000000000..3dff29c9c71cfaac9f0d67d0b7fb752e6224edc1
982--- /dev/null
983+++ b/themes/zhann.zsh-theme
984@@ -0,0 +1,7 @@
985+PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
986+RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
987+
988+ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
989+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
990+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
991+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
992diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
993index aeaa0e415f496a7b0d895efe582833bb9f87dc2d..524aa509d5bf5525ecc6b4e5ac3e879e1b5fb98b 100644
994--- a/tools/check_for_upgrade.sh
995+++ b/tools/check_for_upgrade.sh
996@@ -8,6 +8,12 @@ function _update_zsh_update() {
997 echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
998 }
999
1000+function _upgrade_zsh() {
1001+ /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
1002+ # update the zsh file
1003+ _update_zsh_update
1004+}
1005+
1006 if [ -f ~/.zsh-update ]
1007 then
1008 . ~/.zsh-update
1009@@ -19,17 +25,21 @@ then
1010 epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
1011 if [ $epoch_diff -gt 6 ]
1012 then
1013- echo "[Oh My Zsh] Would you like to check for updates?"
1014- echo "Type Y to update oh-my-zsh: \c"
1015- read line
1016- if [ "$line" = Y ] || [ "$line" = y ]
1017+ if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
1018 then
1019- /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
1020- # update the zsh file
1021- _update_zsh_update
1022+ _upgrade_zsh
1023+ else
1024+ echo "[Oh My Zsh] Would you like to check for updates?"
1025+ echo "Type Y to update oh-my-zsh: \c"
1026+ read line
1027+ if [ "$line" = Y ] || [ "$line" = y ]
1028+ then
1029+ _upgrade_zsh
1030+ fi
1031 fi
1032 fi
1033 else
1034 # create the zsh file
1035 _update_zsh_update
1036 fi
1037+
1038diff --git a/tools/upgrade.sh b/tools/upgrade.sh
1039index 52a8cc4da7bb4ea28e61a7f57390b3a7c933802d..6ffe56f4caa1c353c759c2586b8ef25f50ca2487 100644
1040--- a/tools/upgrade.sh
1041+++ b/tools/upgrade.sh
1042@@ -1,12 +1,12 @@
1043 current_path=`pwd`
1044-echo -e "\033[0;34mUpgrading Oh My Zsh\033[0m"
1045+printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh"
1046 ( cd $ZSH && git pull origin master )
1047-echo -e "\033[0;32m"' __ __ '"\033[0m"
1048-echo -e "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
1049-echo -e "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
1050-echo -e "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
1051-echo -e "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
1052-echo -e "\033[0;32m"' /____/ '"\033[0m"
1053-echo -e "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m"
1054-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"
1055+printf '\033[0;32m%s\033[0m\n' ' __ __ '
1056+printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ '
1057+printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '
1058+printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '
1059+printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '
1060+printf '\033[0;32m%s\033[0m\n' ' /____/ '
1061+printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.'
1062+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'
1063 cd "$current_path"