diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-05-08 08:50:31 +0200 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2019-05-08 08:50:31 +0200 |
commit | 76c7bd57c332b3d9231dc2c6167f3c5d3e56e110 (patch) | |
tree | acdc36193f390e01f4144ff8feefd126b5aecd8b /lib/prompt_info_functions.zsh | |
parent | ea3e666e04bfae31b37ef42dfe54801484341e46 (diff) | |
parent | 299cd4777a8b9da1934a1ed0c80767eea6691a70 (diff) | |
download | zsh-76c7bd57c332b3d9231dc2c6167f3c5d3e56e110.tar.gz zsh-76c7bd57c332b3d9231dc2c6167f3c5d3e56e110.tar.bz2 zsh-76c7bd57c332b3d9231dc2c6167f3c5d3e56e110.zip |
Merge branch 'apjanke/themes-rvm-prompt-function' (#4588)
Fixes #4272
Fixes #4182
Closes #4197
Closes #4588
Diffstat (limited to 'lib/prompt_info_functions.zsh')
-rw-r--r-- | lib/prompt_info_functions.zsh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 1d5c23e41..5069c4b21 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -10,9 +10,15 @@ # Dummy implementations that return false to prevent command_not_found # errors with themes, that implement these functions # Real implementations will be used when the respective plugins are loaded -function chruby_prompt_info hg_prompt_info pyenv_prompt_info \ - rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \ - virtualenv_prompt_info jenv_prompt_info { +function chruby_prompt_info \ + rbenv_prompt_info \ + hg_prompt_info \ + pyenv_prompt_info \ + svn_prompt_info \ + vi_mode_prompt_info \ + virtualenv_prompt_info \ + jenv_prompt_info \ +{ return 1 } @@ -22,10 +28,13 @@ function rvm_prompt_info() { [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1 local rvm_prompt rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null) - [[ "${rvm_prompt}x" == "x" ]] && return 1 - echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}" + [[ -z "${rvm_prompt}" ]] && return 1 + echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt}${ZSH_THEME_RUBY_PROMPT_SUFFIX}" } +ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" + + # use this to enable users to see their ruby version, no matter which # version management system they use function ruby_prompt_info() { |