]> git.r.bdr.sh - rbdr/dotfiles/blobdiff - prompt_ben_setup
Update prompt to show ruby & node envs
[rbdr/dotfiles] / prompt_ben_setup
index 63706cfb6fc3afb7e2ad9bad13ec53a882e75a49..0399e4ec1c26ab9cff17694de753919c40a949ab 100644 (file)
@@ -8,7 +8,25 @@ function virtualenv_info {
   else
     venv="${VIRTUAL_ENV##*/}"
   fi
   else
     venv="${VIRTUAL_ENV##*/}"
   fi
-  echo "(${venv})"
+  echo "🐍${venv}"
+}
+
+function rvm_info {
+  if [[ -z "$RUBY_VERSION" ]]; then
+    rvminfo="default"
+  else
+    rvminfo=`rvm-prompt`
+  fi
+  echo "💎${rvminfo}"
+}
+
+function nvm_info {
+  if [[ -z "$NVM_BIN" ]]; then
+    nvminfo="default"
+  else
+    nvminfo=`nvm current`
+  fi
+  echo "💛${nvminfo}"
 }
 
 function box_name {
 }
 
 function box_name {
@@ -47,7 +65,8 @@ function prompt_ben_setup {
 
   # Define prompts.
   PROMPT='
 
   # Define prompts.
   PROMPT='
-%{%F{red}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%F{black}%}$(virtualenv_info)%{%f%}
+%{%F{black}%}$(nvm_info) $(rvm_info) $(virtualenv_info)
+%{%F{red}%}%n%{%f%}@%{%F{yellow}%}$(box_name)%{%f%} %{%B%F{green}%}${PWD/#$HOME/~}%{%f%b%}${git_info[prompt]} %{%f%}
 %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ '
 }
 
 %(?,,%{${%B%F{white}%}[%?]%{%f%b%} )$ '
 }