Skip to content

Instantly share code, notes, and snippets.

@Farid-NL
Created March 22, 2024 19:59
Show Gist options
  • Save Farid-NL/602f74034747b388cea5a9e177131234 to your computer and use it in GitHub Desktop.
Save Farid-NL/602f74034747b388cea5a9e177131234 to your computer and use it in GitHub Desktop.
Lazy loading for (mini)conda in zsh
export CONDA_DIR="$HOME/.miniconda"
source ~/your/path/conda-lazy.zsh
conda() {
unfunction conda
__conda_setup="$("$CONDA_DIR/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$CONDA_DIR/etc/profile.d/conda.sh" ]; then
. "$CONDA_DIR/etc/profile.d/conda.sh"
else
export PATH="$CONDA_DIR/bin:$PATH"
fi
fi
unset __conda_setup
conda "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment