[[ $(hostname) == "tardis" ]] && hostcolor=red
precmd() {
- PROMPT='%T %n@%{$fg[$hostcolor]%}%m%(1j. $fg_bold[white]↵%{$fg_bold[red]%}%j.)%{$reset_color%}%-0>..>$(git_prompt_status)%>>
+ PROMPT='%T $(virtualenv_prompt)%n@%{$fg[$hostcolor]%}%m%(1j. $fg_bold[white]↵%{$fg_bold[red]%}%j.)%{$reset_color%}%-0>..>$(git_prompt_status)%>>
%(?..%{$fg_bold[white]%}%?)%{$reset_color%}$(vi_prompt_info)%{%(!.$fg[red]❰.$fg[green]❱)%1G%} '
RPROMPT='%{$fg[green]%}%~%{$reset_color%}'
}
echo $git_status
}
+function virtualenv_prompt() {
+ if [[ -z $VIRTUAL_ENV ]] then
+ echo ""
+ else
+ echo "(${VIRTUAL_ENV##*/}) "
+ fi
+}
+
function print_if_fits() {
local zero length