summaryrefslogtreecommitdiff
path: root/themes/dallas.zsh-theme
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-11-06 17:20:11 -0500
committerMarc Cornellà <marc.cornella@live.com>2019-05-08 08:45:34 +0200
commit299cd4777a8b9da1934a1ed0c80767eea6691a70 (patch)
treeacdc36193f390e01f4144ff8feefd126b5aecd8b /themes/dallas.zsh-theme
parentea3e666e04bfae31b37ef42dfe54801484341e46 (diff)
downloadzsh-299cd4777a8b9da1934a1ed0c80767eea6691a70.tar.gz
zsh-299cd4777a8b9da1934a1ed0c80767eea6691a70.tar.bz2
zsh-299cd4777a8b9da1934a1ed0c80767eea6691a70.zip
Themes: switch to using ruby_prompt_info()
Changes themes displaying RVM or other Ruby version info to use the central ruby_prompt_info function. This supports more Ruby versioning mechanisms, reduces copy-and-paste code, and avoids "zsh: no such file or directory: rvm-prompt" when run on machines that do not have RVM installed. Changes the prefix/suffix variable names to ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX, since they apply to all Ruby versioning mechanisms, not just RVM. Allows empty ZSH_THEME_RUBY_PROMPT_PREFIX and ZSH_THEME_RUBY_PROMPT_SUFFIX.
Diffstat (limited to 'themes/dallas.zsh-theme')
-rw-r--r--themes/dallas.zsh-theme13
1 files changed, 4 insertions, 9 deletions
diff --git a/themes/dallas.zsh-theme b/themes/dallas.zsh-theme
index e9e86177b..d6c417fc3 100644
--- a/themes/dallas.zsh-theme
+++ b/themes/dallas.zsh-theme
@@ -2,14 +2,6 @@
# 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]
-if [ -e ~/.rvm/bin/rvm-prompt ]; 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
@@ -28,5 +20,8 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
# Add 3 cyan ✗s if this branch is diiirrrty! Dirty branch!
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[cyan]%}✗✗✗"
+ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[white]%}[%{$fg[magenta]%}"
+ZSH_THEME_RUBY_PROMPT_SUFFIX="%{$fg[white]%}]%{$reset_color%}"
+
# Put it all together!
-PROMPT="$DALLAS_CURRENT_TIME_$DALLAS_CURRENT_RUBY_$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ "
+PROMPT="$DALLAS_CURRENT_TIME_\$(ruby_prompt_info)$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ "