This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# command: source | |
# Allow autocomplete for conda environments | |
_complete_source_activate_conda(){ | |
if [ ${COMP_WORDS[COMP_CWORD-1]} != "activate" ] | |
then | |
return 0 | |
fi | |
local cur=${COMP_WORDS[COMP_CWORD]} | |
COMPREPLY=($(ls ~/anaconda3/envs | xargs -I dirs bash -c "compgen -W dirs $cur")) |