summaryrefslogtreecommitdiff
path: root/themes/amuse.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/amuse.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/amuse.zsh-theme')
-rw-r--r--themes/amuse.zsh-theme27
1 files changed, 8 insertions, 19 deletions
diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme
index d3f15ace5..3f7ec0bc5 100644
--- a/themes/amuse.zsh-theme
+++ b/themes/amuse.zsh-theme
@@ -1,17 +1,5 @@
# vim:ft=zsh ts=2 sw=2 sts=2
-rvm_current() {
- rvm current 2>/dev/null
-}
-
-rbenv_version() {
- rbenv version 2>/dev/null | awk '{print $1}'
-}
-
-PROMPT='
-%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
-$ '
-
# Must use Powerline font, for \uE0A0 to render.
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}\uE0A0 "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@@ -19,11 +7,12 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
-if [ -e ~/.rvm/bin/rvm-prompt ]; then
- RPROMPT='%{$fg_bold[red]%}‹$(rvm_current)›%{$reset_color%}'
-else
- if which rbenv &> /dev/null; then
- RPROMPT='%{$fg_bold[red]%}$(rbenv_version)%{$reset_color%}'
- fi
-fi
+ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹"
+ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"
+
+PROMPT='
+%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
+$ '
+
+RPROMPT='$(ruby_prompt_info)'