themes/steeef: support conda env in prompt

Add support for showing the conda env in the prompt and not only the
virtualenv.
This commit is contained in:
Amit Beka 2017-04-08 00:03:43 +03:00
parent 66bae5a5de
commit de13050d07

View File

@ -9,8 +9,12 @@
export VIRTUAL_ENV_DISABLE_PROMPT=1 export VIRTUAL_ENV_DISABLE_PROMPT=1
function virtualenv_info { function virtualenv_or_conda_info {
[ $VIRTUAL_ENV ] && echo '('%F{blue}`basename $VIRTUAL_ENV`%f') ' if [[ -n "$VIRTUAL_ENV" ]]; then
echo '('%F{blue}`basename $VIRTUAL_ENV`%f') '
elif [[ -n "$CONDA_DEFAULT_ENV" ]]; then
echo '('%F{blue}`basename $CONDA_DEFAULT_ENV`%f') '
fi
} }
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
@ -96,5 +100,5 @@ function steeef_precmd {
add-zsh-hook precmd steeef_precmd add-zsh-hook precmd steeef_precmd
PROMPT=$' PROMPT=$'
%{$purple%}%n${PR_RST} at %{$orange%}%m${PR_RST} in %{$limegreen%}%~${PR_RST} $vcs_info_msg_0_$(virtualenv_info) %{$purple%}%n${PR_RST} at %{$orange%}%m${PR_RST} in %{$limegreen%}%~${PR_RST} $vcs_info_msg_0_$(virtualenv_or_conda_info)
$ ' $ '