summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.textile2
-rw-r--r--plugins/autojump/autojump.plugin.zsh12
-rw-r--r--plugins/bundler/bundler.plugin.zsh4
-rw-r--r--plugins/git/git.plugin.zsh2
-rw-r--r--plugins/github/github.plugin.zsh12
-rw-r--r--plugins/mercurial/mercurial.plugin.zsh10
-rw-r--r--plugins/taskwarrior/_task162
-rw-r--r--themes/alanpeabody.zsh-theme10
-rw-r--r--themes/bira.zsh-theme9
-rw-r--r--themes/crunch.zsh-theme8
-rw-r--r--themes/dallas.zsh-theme8
-rw-r--r--themes/eastwood.zsh-theme4
-rw-r--r--themes/fino.zsh-theme9
-rw-r--r--themes/gallois.zsh-theme6
-rw-r--r--themes/jonathan.zsh-theme4
-rw-r--r--themes/josh.zsh-theme4
-rw-r--r--themes/macovsky-ruby.zsh-theme9
-rw-r--r--themes/macovsky.zsh-theme8
-rw-r--r--themes/murilasso.zsh-theme2
-rw-r--r--themes/nebirhos.zsh-theme4
-rw-r--r--themes/superjarin.zsh-theme8
-rw-r--r--themes/suvash.zsh-theme9
-rw-r--r--themes/wuffers.zsh-theme2
-rw-r--r--themes/zhann.zsh-theme10
24 files changed, 190 insertions, 128 deletions
diff --git a/README.textile b/README.textile
index eca968089..bf6776665 100644
--- a/README.textile
+++ b/README.textile
@@ -56,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
-If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
+If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
index 6f9b80bff..6f0edb062 100644
--- a/plugins/autojump/autojump.plugin.zsh
+++ b/plugins/autojump/autojump.plugin.zsh
@@ -1,5 +1,9 @@
-if [ -f /opt/local/etc/profile.d/autojump.sh ]; then
- . /opt/local/etc/profile.d/autojump.sh
-elif [ -f `brew --prefix`/etc/autojump ]; then
- . `brew --prefix`/etc/autojump
+if [ $commands[autojump] ]; then # check if autojump is installed
+ if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
+ . /usr/share/autojump/autojump.zsh
+ elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
+ . /etc/profile.d/autojump.zsh
+ elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
+ . `brew --prefix`/etc/autojump
+ fi
fi
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 12123eea6..5e9b82336 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -6,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec
-bundled_commands=(annotate cap capify cucumber foreman guard heroku nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
+bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
## Functions
@@ -16,7 +16,7 @@ _bundler-installed() {
_within-bundled-project() {
local check_dir=$PWD
- while [ "$(dirname $check_dir)" != "/" ]; do
+ while [ $check_dir != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)"
done
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index c1b382b2c..ae080662f 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -36,6 +36,8 @@ alias ga='git add'
compdef _git ga=git-add
alias gm='git merge'
compdef _git gm=git-merge
+alias grh='git reset HEAD'
+alias grhh='git reset HEAD --hard'
# Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
index 9b0d54602..197e86a48 100644
--- a/plugins/github/github.plugin.zsh
+++ b/plugins/github/github.plugin.zsh
@@ -1,7 +1,17 @@
# Setup hub function for git, if it is available; http://github.com/defunkt/hub
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
# eval `hub alias -s zsh`
- function git(){hub "$@"}
+ function git(){
+ if ! (( $+_has_working_hub )); then
+ hub --version &> /dev/null
+ _has_working_hub=$(($? == 0))
+ fi
+ if (( $_has_working_hub )) ; then
+ hub "$@"
+ else
+ command git "$@"
+ fi
+ }
fi
# Functions #################################################################
diff --git a/plugins/mercurial/mercurial.plugin.zsh b/plugins/mercurial/mercurial.plugin.zsh
index 2988f0a46..caf0d9efc 100644
--- a/plugins/mercurial/mercurial.plugin.zsh
+++ b/plugins/mercurial/mercurial.plugin.zsh
@@ -1,14 +1,14 @@
# Mercurial
-alias hgc='hg commit -v'
-alias hgb='hg branch -v'
+alias hgc='hg commit'
+alias hgb='hg branch'
alias hgba='hg branches'
alias hgco='hg checkout'
alias hgd='hg diff'
alias hged='hg diffmerge'
# pull and update
-alias hgl='hg pull -u -v'
-alias hgp='hg push -v'
-alias hgs='hg status -v'
+alias hgl='hg pull -u'
+alias hgp='hg push'
+alias hgs='hg status'
# this is the 'git commit --amend' equivalent
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task
index 5bffa9119..0bda738bb 100644
--- a/plugins/taskwarrior/_task
+++ b/plugins/taskwarrior/_task
@@ -1,37 +1,37 @@
#compdef task
-#
# zsh completion for taskwarrior
#
+# taskwarrior - a command line task list manager.
+#
# Copyright 2010 - 2011 Johannes Schlatow
# Copyright 2009 P.C. Shyamshankar
-# All rights reserved.
-#
-# This script is part of the taskwarrior project.
#
-# This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
#
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor,
-# Boston, MA
-# 02110-1301
-# USA
+# http://www.opensource.org/licenses/mit-license.php
#
typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
_task_projects=($(task _projects))
_task_tags=($(task _tags))
_task_ids=($(task _ids))
_task_config=($(task _config))
+_task_columns=($(task _columns))
_task_modifiers=(
'before' \
'after' \
@@ -46,39 +46,19 @@ _task_modifiers=(
'word' \
'noword'
)
+_task_conjunctions=(
+ 'and' \
+ 'or' \
+ 'xor' \
+ '\)'
+ '\('
+)
_task_cmds=($(task _commands))
_task_zshcmds=( ${(f)"$(task _zshcommands)"} )
-
-_task_idCmds=(
- 'append' \
- 'prepend' \
- 'annotate' \
- 'denotate' \
- 'edit' \
- 'duplicate' \
- 'info' \
- 'start' \
- 'stop' \
- 'done'
-)
-
-_task_idCmdsDesc=(
- 'append:Appends more description to an existing task.' \
- 'prepend:Prepends more description to an existing task.' \
- 'annotate:Adds an annotation to an existing task.' \
- 'denotate:Deletes an annotation of an existing task.' \
- 'edit:Launches an editor to let you modify a task directly.' \
- 'duplicate:Duplicates the specified task, and allows modifications.' \
- 'info:Shows all data, metadata for specified task.' \
- 'start:Marks specified task as started.' \
- 'stop:Removes the start time from a task.' \
- 'done:Marks the specified task as completed.'
-)
-
_task() {
_arguments -s -S \
- "*::task command:_task_commands"
+ "*::task default:_task_default"
return 0
}
@@ -148,6 +128,7 @@ _regex_words values 'task frequencies' \
'weekly:Every week' \
'biweekly:Every two weeks' \
'fortnight:Every two weeks' \
++ 'monthly:Every month' \
'quarterly:Every three months' \
'semiannual:Every six months' \
'annual:Every year' \
@@ -196,22 +177,13 @@ _regex_arguments _task_attributes "${args[@]}"
## task commands
-# default completion
-(( $+functions[_task_default] )) ||
-_task_default() {
+# filter completion
+(( $+functions[_task_filter] )) ||
+_task_filter() {
_task_attributes "$@"
-}
-# commands expecting an ID
-(( $+functions[_task_id] )) ||
-_task_id() {
- if (( CURRENT < 3 )); then
- # update IDs
- _task_zshids=( ${(f)"$(task _zshids)"} )
- _describe -t values 'task IDs' _task_zshids
- else
- _task_attributes "$@"
- fi
+ # TODO complete conjunctions only if the previous word is a filter expression, i.e. attribute, ID, any non-command
+ _describe -t default 'task conjunctions' _task_conjunctions
}
# merge completion
@@ -235,46 +207,42 @@ _task_pull() {
_files
}
+# execute completion
+(( $+functions[_task_execute] )) ||
+_task_execute() {
+ _files
+}
-# modify (task [0-9]* ...) completion
-(( $+functions[_task_modify] )) ||
-_task_modify() {
- _describe -t commands 'task command' _task_idCmdsDesc
- _task_attributes "$@"
+# id-only completion
+(( $+functions[_task_id] )) ||
+_task_id() {
+ _describe -t values 'task IDs' _task_zshids
}
## first level completion => task sub-command completion
-(( $+functions[_task_commands] )) ||
-_task_commands() {
+(( $+functions[_task_default] )) ||
+_task_default() {
local cmd ret=1
- if (( CURRENT == 1 )); then
- # update IDs
- _task_zshids=( ${(f)"$(task _zshids)"} )
-
- _describe -t commands 'task command' _task_zshcmds
- _describe -t values 'task IDs' _task_zshids
- # TODO match more than one ID
- elif [[ $words[1] =~ ^[0-9]*$ ]] then
- _call_function ret _task_modify
- return ret
- else
-# local curcontext="${curcontext}"
-# cmd="${_task_cmds[(r)$words[1]:*]%%:*}"
- cmd="${_task_cmds[(r)$words[1]]}"
- idCmd="${(M)_task_idCmds[@]:#$words[1]}"
- if (( $#cmd )); then
-# curcontext="${curcontext%:*:*}:task-${cmd}"
- if (( $#idCmd )); then
- _call_function ret _task_id
- else
- _call_function ret _task_${cmd} ||
- _call_function ret _task_default ||
- _message "No command remaining."
- fi
- else
- _message "Unknown subcommand ${cmd}"
- fi
- return ret
- fi
+ integer i=1
+ while (( i < $#words ))
+ do
+ cmd="${_task_cmds[(r)$words[$i]]}"
+ if (( $#cmd )); then
+ _call_function ret _task_${cmd} ||
+ _call_function ret _task_filter ||
+ _message "No command remaining."
+ return ret
+ fi
+ (( i++ ))
+ done
+
+ # update IDs
+ _task_zshids=( ${(f)"$(task _zshids)"} )
+
+ _describe -t commands 'task command' _task_zshcmds
+ _describe -t values 'task IDs' _task_zshids
+ _call_function ret _task_filter
+
+ return ret
}
diff --git a/themes/alanpeabody.zsh-theme b/themes/alanpeabody.zsh-theme
index 1f66f1ec3..4a1b1b386 100644
--- a/themes/alanpeabody.zsh-theme
+++ b/themes/alanpeabody.zsh-theme
@@ -1,7 +1,14 @@
local user='%{$fg[magenta]%}%n@%{$fg[magenta]%}%m%{$reset_color%}'
local pwd='%{$fg[blue]%}%~%{$reset_color%}'
-local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
+local rvm=''
+if which rvm-prompt &> /dev/null; then
+ rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
+else
+ if which rbenv &> /dev/null; then
+ rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
+ fi
+fi
local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})'
local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}'
@@ -19,4 +26,3 @@ ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
PROMPT="${user} ${pwd}$ "
RPROMPT="${return_code} ${git_branch} ${rvm}"
-
diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme
index 5642eaeb8..215720477 100644
--- a/themes/bira.zsh-theme
+++ b/themes/bira.zsh-theme
@@ -3,7 +3,14 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
-local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
+local rvm_ruby=''
+if which rvm-prompt &> /dev/null; then
+ rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
+else
+ if which rbenv &> /dev/null; then
+ rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
+ fi
+fi
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
diff --git a/themes/crunch.zsh-theme b/themes/crunch.zsh-theme
index 2473cd230..b2759a1b0 100644
--- a/themes/crunch.zsh-theme
+++ b/themes/crunch.zsh-theme
@@ -29,7 +29,13 @@ ZSH_THEME_GIT_PROMPT_DIRTY=" $CRUNCH_GIT_DIRTY_COLOR✗"
# Our elements:
CRUNCH_TIME_="$CRUNCH_BRACKET_COLOR{$CRUNCH_TIME_COLOR%T$CRUNCH_BRACKET_COLOR}%{$reset_color%}"
-CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
+if which rvm-prompt &> /dev/null; then
+ CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(~/.rvm/bin/rvm-prompt i v g)#ruby-}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
+else
+ if which rbenv &> /dev/null; then
+ CRUNCH_RVM_="$CRUNCH_BRACKET_COLOR"["$CRUNCH_RVM_COLOR\${\$(rbenv version | sed -e 's/ (set.*$//' -e 's/^ruby-//')}$CRUNCH_BRACKET_COLOR"]"%{$reset_color%}"
+ fi
+fi
CRUNCH_DIR_="$CRUNCH_DIR_COLOR%~\$(git_prompt_info) "
CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR➭ "
diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme
index eef32e998..e9b4f852a 100644
--- a/themes/dallas.zsh-theme
+++ b/themes/dallas.zsh-theme
@@ -3,7 +3,13 @@
# Grab the current date (%D) and time (%T) wrapped in {}: {%D %T}
DALLAS_CURRENT_TIME_="%{$fg[white]%}{%{$fg[yellow]%}%D %T%{$fg[white]%}}%{$reset_color%}"
# Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
-DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
+if which rvm-prompt &> /dev/null; then
+ DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
+else
+ if which rbenv &> /dev/null; then
+ DALLAS_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[magenta]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}"
+ fi
+fi
# Grab the current machine name: muscato
DALLAS_CURRENT_MACH_="%{$fg[green]%}%m%{$fg[white]%}:%{$reset_color%}"
# Grab the current filepath, use shortcuts: ~/Desktop
diff --git a/themes/eastwood.zsh-theme b/themes/eastwood.zsh-theme
index 83664515a..db2529990 100644
--- a/themes/eastwood.zsh-theme
+++ b/themes/eastwood.zsh-theme
@@ -1,6 +1,10 @@
#RVM settings
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
+else
+ if which rbenv &> /dev/null; then
+ RPS1="%{$fg[yellow]%}rbenv:%{$reset_color%}%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$reset_color%} $EPS1"
+ fi
fi
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
diff --git a/themes/fino.zsh-theme b/themes/fino.zsh-theme
index 17cf59708..26e547176 100644
--- a/themes/fino.zsh-theme
+++ b/themes/fino.zsh-theme
@@ -25,7 +25,14 @@ function box_name {
}
-local rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}'
+local rvm_ruby=''
+if which rvm-prompt &> /dev/null; then
+ rvm_ruby='‹$(rvm-prompt i v g)›%{$reset_color%}'
+else
+ if which rbenv &> /dev/null; then
+ rvm_ruby='‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
+ fi
+fi
local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
index f9406dd96..3eac14867 100644
--- a/themes/gallois.zsh-theme
+++ b/themes/gallois.zsh-theme
@@ -15,7 +15,11 @@ git_custom_status() {
if [[ -s ~/.rvm/scripts/rvm ]] ; then
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
else
- RPS1='$(git_custom_status) $EPS1'
+ if which rbenv &> /dev/null; then
+ RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
+ else
+ RPS1='$(git_custom_status) $EPS1'
+ fi
fi
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
index a170a13d0..2f0c4b917 100644
--- a/themes/jonathan.zsh-theme
+++ b/themes/jonathan.zsh-theme
@@ -10,7 +10,7 @@ function theme_precmd {
PR_PWDLEN=""
local promptsize=${#${(%):---(%n@%m:%l)---()--}}
- local rubyprompt=`rvm_prompt_info`
+ local rubyprompt=`rvm_prompt_info || rbenv_prompt_info`
local rubypromptsize=${#${rubyprompt}}
local pwdsize=${#${(%):-%~}}
@@ -113,7 +113,7 @@ setprompt () {
PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
$PR_GREEN%$PR_PWDLEN<...<%~%<<\
-$PR_GREY)`rvm_prompt_info`$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_HBAR${(e)PR_FILLBAR}$PR_HBAR$PR_SHIFT_OUT$PR_GREY(\
+$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(\
$PR_CYAN%(!.%SROOT%s.%n)$PR_GREY@$PR_GREEN%m:%l\
$PR_GREY)$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_URCORNER$PR_SHIFT_OUT\
diff --git a/themes/josh.zsh-theme b/themes/josh.zsh-theme
index 6bed1a70e..142e76838 100644
--- a/themes/josh.zsh-theme
+++ b/themes/josh.zsh-theme
@@ -10,7 +10,7 @@ function josh_prompt {
prompt=" "
branch=$(current_branch)
- ruby_version=$(rvm_prompt_info)
+ ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
path_size=${#PWD}
branch_size=${#branch}
ruby_size=${#ruby_version}
@@ -31,7 +31,7 @@ function josh_prompt {
prompt=" $prompt"
done
- prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info)%{$reset_color%} $(git_prompt_info)"
+ prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_prompt_info)"
echo $prompt
}
diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme
index 4eb410233..045376761 100644
--- a/themes/macovsky-ruby.zsh-theme
+++ b/themes/macovsky-ruby.zsh-theme
@@ -1,7 +1,14 @@
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+if which rvm-prompt &> /dev/null; then
+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+else
+ if which rbenv &> /dev/null; then
+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+ fi
+fi
+
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
diff --git a/themes/macovsky.zsh-theme b/themes/macovsky.zsh-theme
index 4eb410233..b6978b929 100644
--- a/themes/macovsky.zsh-theme
+++ b/themes/macovsky.zsh-theme
@@ -1,7 +1,13 @@
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
-PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+if which rvm-prompt &> /dev/null; then
+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(~/.rvm/bin/rvm-prompt i v)› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+else
+ if which rbenv &> /dev/null; then
+ PROMPT='%{$fg[green]%}%~%{$reset_color%} %{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")› %{$reset_color%} $(git_prompt_info)%{$reset_color%}%B$%b '
+ fi
+fi
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
diff --git a/themes/murilasso.zsh-theme b/themes/murilasso.zsh-theme
index 310357b45..bc2b9b224 100644
--- a/themes/murilasso.zsh-theme
+++ b/themes/murilasso.zsh-theme
@@ -1,7 +1,7 @@
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%}%~%{$reset_color%}'
-local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info)%{$reset_color%}'
+local rvm_ruby='%{$fg[red]%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%}'
local git_branch='%{$fg[blue]%}$(git_prompt_info)%{$reset_color%}'
PROMPT="${user_host}:${current_dir} ${rvm_ruby}
diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme
index c49df972e..c5864d9b8 100644
--- a/themes/nebirhos.zsh-theme
+++ b/themes/nebirhos.zsh-theme
@@ -4,6 +4,10 @@
# Get the current ruby version in use with RVM:
if [ -e ~/.rvm/bin/rvm-prompt ]; then
RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} "
+else
+ if which rbenv &> /dev/null; then
+ RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} "
+ fi
fi
# Get the host name (first 4 chars)
diff --git a/themes/superjarin.zsh-theme b/themes/superjarin.zsh-theme
index 16eeb5316..0be816de0 100644
--- a/themes/superjarin.zsh-theme
+++ b/themes/superjarin.zsh-theme
@@ -1,5 +1,11 @@
# Grab the current version of ruby in use (via RVM): [ruby-1.8.7]
-JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
+if which rvm-prompt &> /dev/null; then
+ JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}"
+else
+ if which rbenv &> /dev/null; then
+ JARIN_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}"
+ fi
+fi
# Grab the current filepath, use shortcuts: ~/Desktop
# Append the current git branch, if in a git repository
diff --git a/themes/suvash.zsh-theme b/themes/suvash.zsh-theme
index f50657db2..c87f64558 100644
--- a/themes/suvash.zsh-theme
+++ b/themes/suvash.zsh-theme
@@ -12,8 +12,15 @@ function collapse_pwd {
echo $(pwd | sed -e "s,^$HOME,~,")
}
-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%}
+if which rvm-prompt &> /dev/null; then
+ 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%}
$(virtualenv_info)$(prompt_char) '
+else
+ if which rbenv &> /dev/null; then
+ 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%}
+$(virtualenv_info)$(prompt_char) '
+ fi
+fi
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
diff --git a/themes/wuffers.zsh-theme b/themes/wuffers.zsh-theme
index 182d8a34f..4019d0a51 100644
--- a/themes/wuffers.zsh-theme
+++ b/themes/wuffers.zsh-theme
@@ -2,4 +2,4 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%} x%{$fg_bold[blue]%}"
-PROMPT='%{$(git_prompt_info)%}%{$fg_bold[green]%}{%{$(rvm current)%}}%{$reset_color%} %{$fg[cyan]%}%c%{$reset_color%} '
+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%} '
diff --git a/themes/zhann.zsh-theme b/themes/zhann.zsh-theme
index 3dff29c9c..574e0cec3 100644
--- a/themes/zhann.zsh-theme
+++ b/themes/zhann.zsh-theme
@@ -1,5 +1,13 @@
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
-RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
+
+if which rvm-prompt &> /dev/null; then
+ RPROMPT='%{$reset_color%} %{$fg[red]%}$(~/.rvm/bin/rvm-prompt i v g) %{$reset_color%}'
+else
+ if which rbenv &> /dev/null; then
+ RPROMPT='%{$reset_color%} %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//") %{$reset_color%}'
+ fi
+fi
+
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"