From 299cd4777a8b9da1934a1ed0c80767eea6691a70 Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Fri, 6 Nov 2015 17:20:11 -0500 Subject: 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. --- themes/macovsky-ruby.zsh-theme | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) mode change 100644 => 120000 themes/macovsky-ruby.zsh-theme (limited to 'themes/macovsky-ruby.zsh-theme') diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme deleted file mode 100644 index abda6232c..000000000 --- a/themes/macovsky-ruby.zsh-theme +++ /dev/null @@ -1,15 +0,0 @@ -# ZSH Theme - Preview: https://i.gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png -local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" - -if [ -e ~/.rvm/bin/rvm-prompt ]; 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]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" diff --git a/themes/macovsky-ruby.zsh-theme b/themes/macovsky-ruby.zsh-theme new file mode 120000 index 000000000..d3ee200a9 --- /dev/null +++ b/themes/macovsky-ruby.zsh-theme @@ -0,0 +1 @@ +macovsky.zsh-theme \ No newline at end of file -- cgit v1.2.3-70-g09d2