cstrap
7/12/2016 - 7:01 AM

Post activate virtualenvwrapper = prompt on the right

Post activate virtualenvwrapper = prompt on the right

#!/bin/zsh
# This hook is sourced after every virtualenv is activated.
#
PS1="$_OLD_VIRTUAL_PS1"
_OLD_RPROMPT="$RPROMPT"
RPROMPT="%{${fg_bold[white]}%}(env: %{${fg[green]}%}`basename \"$VIRTUAL_ENV\"`%{${fg_bold[white]}%})%{${reset_color}%} $RPROMPT"


#!/bin/zsh
# This hook is sourced after every virtualenv is activated.

hg_in_repo() {
    hg branch 2> /dev/null | awk '{print "on "}'
}

hg_branch() {
    hg branch 2> /dev/null | awk '{print $1}'
}

precmd() {
    change_prompt
}

change_prompt() {
    RPROMPT=""
    RPROMPT="%{${fg_bold[white]}%}(env: %{${fg[green]}%}`basename \"$VIRTUAL_ENV\"`%{${fg_bold[white]}%} on %{${fg[green]}%}$(hg_branch)%{${fg_bold[white]}%})%{${reset_color}%} $RPROMPT"
}

PS1="🐍  $_OLD_VIRTUAL_PS1"
_OLD_RPROMPT="$RPROMPT"
# RPROMPT="%{${fg_bold[white]}%}(env: %{${fg[green]}%}`basename \"$VIRTUAL_ENV\"`%{${fg_bold[white]}%} on %{${fg[green]}%}$(hg_branch)%{${fg_bold[white]}%})%{${reset_color}%} $RPROMPT"

PROMPT_COMMAND='change_prompt'