Add shell function venv to activate python virtual environment

This commit is contained in:
Peter J. Holzer 2017-09-27 09:40:01 +02:00
parent 6b10b8dba3
commit d9831c2115
1 changed files with 10 additions and 0 deletions

10
.zshrc
View File

@ -79,6 +79,16 @@ man () {
command man "$@"
}
venv() {
for d in venv/"$1" ve/"$1" ~/venv/"$1"
do
if [ -f "$d"/bin/activate ]
then
. "$d"/bin/activate
fi
done
}
source ~/.znewterm
# assume pseudo terminals are from a "safe" terminal