Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh autocomplete anaconda environments

Is it possible to get zsh to autocomplete anaconda environments that show up under source activate? It is annoying to always have to run conda info -e to figure out what each environment's name is.

like image 642
tlnagy Avatar asked Aug 04 '15 20:08

tlnagy


1 Answers

As indicated by asmeurer there is conda-zsh-completion.

Install it by cloning the repository to your machine

git clone https://github.com/esc/conda-zsh-completion

and add the following to your .zshrc

fpath+=/path/to/where/you/installed/conda-zsh-completion
compinit conda

Note that if you're using oh-my-zsh the first line has to go before the line where you initiate oh-my-zsh and the second one after the initialisation.

Now you're able to autocomplete conda like

conda a<TAB> env-name-parti<TAB>
like image 154
joleroi Avatar answered Oct 10 '22 23:10

joleroi