This is a simple shell to help you quickly select conda environment.
When you want to change conda env, you may:
- To excute
conda env list
to check out the env name you want to use and copy it. - To knock up
conda activate
on the keyboard and paste the env name.
🎉 Now,you only need to knock xconda
The script only support
bash
orzsh
, don't supportsh
echo $SHELL
=>
/bin/bash
or
/bin/zsh
Due to the difference of array between
zsh
andbash
, the script can't compatible with the two shell environment automatically. By default, the script is compatible withbash
. if you usezsh
, you can change the value of a variable, named array_len_delta, in the first few lines, to 1.
vim ~/.bashrc
if you use bash shell orvim ~/.zshrc
if you use zsh shell.- add the content of
xconda.sh
to the tail of your shell config file.
you can also excuteecho xcd.sh >> ~/.bashrc
to simple the above operations
You can restart a shell window or excute:
source ~/.bashrc
or
source ~/.zshrc