1
0
Fork 0

Added conda virtualenv support to python module.

pull/1144/head
Patrick Bos 9 years ago committed by E. G. Patrick Bos
parent 876f426581
commit 3ea8d23b01

@ -4,6 +4,7 @@
# #
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Patrick Bos <egpbos@gmail.com>
# #
local virtualenv_format local virtualenv_format
@ -19,3 +20,10 @@ if [[ -n "$VIRTUAL_ENV" ]]; then
zformat -f virtualenv_formatted "$virtualenv_format" "v:${VIRTUAL_ENV:t}" zformat -f virtualenv_formatted "$virtualenv_format" "v:${VIRTUAL_ENV:t}"
python_info[virtualenv]="$virtualenv_formatted" python_info[virtualenv]="$virtualenv_formatted"
fi fi
# Do the same for Conda virtual environments
if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
zstyle -s ':prezto:module:python:info:virtualenv' format 'virtualenv_format'
zformat -f virtualenv_formatted "$virtualenv_format" "v:${CONDA_DEFAULT_ENV:t}"
python_info[virtualenv]="$virtualenv_formatted"
fi

@ -4,6 +4,7 @@
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Sebastian Wiesner <lunaryorn@googlemail.com> # Sebastian Wiesner <lunaryorn@googlemail.com>
# Patrick Bos <egpbos@gmail.com>
# #
# Load manually installed pyenv into the shell session. # Load manually installed pyenv into the shell session.
@ -46,6 +47,14 @@ if (( $? && $+commands[virtualenvwrapper.sh] )); then
source "$commands[virtualenvwrapper.sh]" source "$commands[virtualenvwrapper.sh]"
fi fi
# Load conda into the shell session, if requested
zstyle -T ':prezto:module:python' conda-init
if (( $? && $+commands[conda] )); then
if (( $(conda ..changeps1) )); then
echo "To make sure Conda doesn't change your prompt (should do that in the prompt module) run:\n conda config --set changeps1 false"
fi
fi
# #
# Aliases # Aliases
# #

Loading…
Cancel
Save