Skip to content

Instantly share code, notes, and snippets.

@Cadair
Created February 24, 2015 11:22
Show Gist options
  • Save Cadair/78da7930c6dafeb1003a to your computer and use it in GitHub Desktop.
Save Cadair/78da7930c6dafeb1003a to your computer and use it in GitHub Desktop.
Some ZSH code to configure an optional miniconda installation. This will also work for anaconda.
# Anaconda
function conda_prompt () {
if [ -n "${CONDA_DEFAULT_ENV+1}" ]; then
REPLY=${CONDA_DEFAULT_ENV+(${CONDA_DEFAULT_ENV:t}) }
elif [ -n "${CONDA_ON+1}" ]; then
REPLY="(miniconda) "
fi
}
grml_theme_add_token conda -f conda_prompt '%B%F{white}' '%f%b'
zstyle ':prompt:grml:left:setup' items rc conda virtual-env change-root \
user at host path vcs percent
alias cac="source activate"
alias cde="source deactivate"
export ANACONDA_ROOT=/opt/miniconda
alias condaon="export PATH=$ANACONDA_ROOT/bin:$PATH; export CONDA_ON=TRUE"
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ANACONDA_ROOT/lib/"
alias condaoff="export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/miniconda/ {next} {print}'`; export LD_LIBRARY_PATH=`echo ${LD_LIBRARAY_PATH} | awk -v RS=: -v ORS=: '/miniconda/ {next} {print}'`;unset CONDA_ON"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment