Skip to content

Instantly share code, notes, and snippets.

@nvictus
Created October 9, 2014 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvictus/240c9e9ee33e20d02a36 to your computer and use it in GitHub Desktop.
Save nvictus/240c9e9ee33e20d02a36 to your computer and use it in GitHub Desktop.
conda "workon" alias
CONDA_DIR="$HOME/miniconda"
alias workon='source $CONDA_DIR/bin/activate'
# function workon () {
# source "$CONDA_DIR/bin/activate" "$1"
# }
function __conda_user_setup () {
_workon_tab_completion_bash () {
local cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $(compgen -W "`\ls --color=never $CONDA_DIR/envs 2>/dev/null`" -- ${cur}) )
}
complete -o default -o nospace -F _workon_tab_completion_bash workon
}
__conda_user_setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment