1 # *_prompt_info functions for usage in your prompt
3 # Plugin creators, please add your *_prompt_info function to the list
4 # of dummy implementations to help theme creators not receiving errors
5 # without the need of implementing conditional clauses.
7 # See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
8 # git_prompt_info, bzr_prompt_info and nvm_prompt_info
10 # Dummy implementations that return false to prevent command_not_found
11 # errors with themes, that implement these functions
12 # Real implementations will be used when the respective plugins are loaded
13 function chruby_prompt_info \
19 virtualenv_prompt_info \
26 # oh-my-zsh supports an rvm prompt by default
27 # get the name of the rvm ruby version
28 function rvm_prompt_info() {
29 [ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
31 rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
32 [[ -z "${rvm_prompt}" ]] && return 1
33 echo "${ZSH_THEME_RUBY_PROMPT_PREFIX}${rvm_prompt:gs/%/%%}${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
36 ZSH_THEME_RVM_PROMPT_OPTIONS="i v g"
39 # use this to enable users to see their ruby version, no matter which
40 # version management system they use
41 function ruby_prompt_info() {
42 echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)