aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2019-03-13 11:40:33 +0100
committerBen Beltran <ben@nsovocal.com>2019-03-13 11:40:33 +0100
commitea8982397a1ce09223736c396901809e5f75a398 (patch)
treeaf5bf85a46092fec0025931148f7dfb62dad8ffb
parent59e3c78da63c4c4ef7e637c222928dfcb1ac759a (diff)
Update prompt to show ruby & node envs
-rw-r--r--prompt_ben_setup23
1 files changed, 21 insertions, 2 deletions
diff --git a/prompt_ben_setup b/prompt_ben_setup
index 63706cf..0399e4e 100644
--- a/prompt_ben_setup
+++ b/prompt_ben_setup
@@ -8,7 +8,25 @@ function virtualenv_info {
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 {
@@ -47,7 +65,8 @@ function prompt_ben_setup {
# 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%} )$ '
}