Skip to content

Instantly share code, notes, and snippets.

@rafeca
Created March 12, 2012 09:42
Show Gist options
  • Save rafeca/2020947 to your computer and use it in GitHub Desktop.
Save rafeca/2020947 to your computer and use it in GitHub Desktop.
Change Python virtualenv based on finding a .venv file in the current directory
function chpwd() {
if [ -e .venv ]; then
echo "$fg[green]Switching to virtualenv \"`cat .venv`\"$reset_color"
workon `cat .venv`
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment