Zac autocomplete anaconda environment

Can I get zsh to autocomplete anaconda environments that display under source activate ? It is annoying to always run conda info -e to find out what each environment name is.

+7
source share
2 answers

As pointed out by asmeurer , there is conda-zsh-complete .

Install it by cloning the repository to your computer

 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 use oh-my-zsh , the first line should go before the line where you initiate oh-my-zsh , and the second after initialization.

Now you can autocomplete as

 conda a<TAB> env-name-parti<TAB> 
0
source

You can create an alias in your ~/.zshrc file to execute this command.

open the ~ / .zshrc file in a text editor

add the following line: alias NAME='conda info -e'

You can set any name for the alias you want
then save the file and restart your terminal.

You should be able to run NAME to display the environment name.

-1
source

All Articles