# # Exposes information about the Python environment via the $python_info # associative array. # # Authors: # Sorin Ionescu # Patrick Bos # local virtualenv_format local virtualenv_formatted # Clean up previous $python_info. unset python_info typeset -gA python_info # Format virtualenv. if [[ -n "$VIRTUAL_ENV" ]]; then zstyle -s ':prezto:module:python:info:virtualenv' format 'virtualenv_format' zformat -f virtualenv_formatted "$virtualenv_format" "v:${VIRTUAL_ENV:t}" python_info[virtualenv]="$virtualenv_formatted" 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