diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2015-11-16 01:35:15 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2015-11-16 01:35:15 +0300 |
commit | 643555a30c9576838157e04d45632080472e1b8b (patch) | |
tree | 17eee2431a69353e067eccd656101f03108671fc /powerlevel9k.zsh-theme | |
parent | 0673352e7e02f8c5d539197ed58ac2327a264ee6 (diff) |
Huge performance improvement if you use `rvm` segment.
Thanks to @rjorgenson for the hint.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index b4f993ec..9b0f31bd 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -492,10 +492,13 @@ prompt_rspec_stats() { # Ruby Version Manager information prompt_rvm() { - local rvm_prompt - rvm_prompt=$(rvm-prompt) - if [ "$rvm_prompt" != "" ]; then - "$1_prompt_segment" "$0" "240" "$DEFAULT_COLOR" "$rvm_prompt $(print_icon 'RUBY_ICON') " + local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') + [ "$gemset" != "" ] && gemset="@$gemset" + + local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}') + + if [[ -n "$version$gemset" ]]; then + "$1_prompt_segment" "$0" "240" "$DEFAULT_COLOR" "$version$gemset $(print_icon 'RUBY_ICON') " fi } |