Added virtualenv support

New Functionnality:
  + plugins/virtualenv/... plugin: stop virtualenv from prepending
'(virtualenv_name)' to the prompt
  + lib/virtualenv.zsh: provide a virtualenv_prompt_info function that
behaves similarly to lib/git.zsh's git_prompt_info

Uses:
  + ZSH_THEME_VIRTUALENV_PROMPT_PREFIX
  + ZSH_THEME_VIRTUALENV_PROMPT_SUFFIX
These variables are added to the output of virtualenv_prompt_info
This commit is contained in:
Thomas Orozco 2012-10-27 18:51:32 +02:00
commit ed20f71544
2 changed files with 8 additions and 0 deletions

5
lib/virtualenv.zsh Normal file
View file

@ -0,0 +1,5 @@
# get the name of the virtualenv we are on
function virtualenv_prompt_info() {
active_virtualenv=$(basename $VIRTUAL_ENV 2> /dev/null) || return
[[ -n active_virtualenv ]] && echo "$ZSH_THEME_VIRTUALENV_PROMPT_PREFIX$active_virtualenv$ZSH_THEME_VIRTUALENV_PROMPT_SUFFIX"
}

View file

@ -0,0 +1,3 @@
# Prevent virtualenv from prepending (virtualenv name) to your prompt
# Use virtualenv_prompt_info to add the env to your prompt.
export VIRTUAL_ENV_DISABLE_PROMPT=1