From 0b2da8f11b2e84a73f3fbe019a086da28ae6d2a3 Mon Sep 17 00:00:00 2001 From: Justin Caratzas Date: Wed, 11 Jul 2012 23:40:12 -0400 Subject: [PATCH] Add very basic virtualenv plugin checks for $VIRTUAL_ENV and provides to basename in a function for the prompt. --- plugins/virtualenv/virtualenv.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/virtualenv/virtualenv.plugin.zsh diff --git a/plugins/virtualenv/virtualenv.plugin.zsh b/plugins/virtualenv/virtualenv.plugin.zsh new file mode 100644 index 00000000..e8458389 --- /dev/null +++ b/plugins/virtualenv/virtualenv.plugin.zsh @@ -0,0 +1,9 @@ +function virtualenv_prompt_info(){ + local virtualenv_path="$VIRTUAL_ENV" + if [[ -n $virtualenv_path ]]; then + local virtualenv_name=`basename $virtualenv_path` + printf "%s[%s] " "%{${fg[yellow]}%}" $virtualenv_name + fi +} + +export VIRTUAL_ENV_DISABLE_PROMPT=1