9ba6daa1b5d0b60c89525d679eb30fe3ed9947de
- Author
- Sebastian Müller <senpo@posteo.de>
- Committer
- Marc Cornellà <marc@mcornella.com>
- Date
Message
feat(conda): add `conda` aliases plugin
Closes #7318
Closed #9691
Co-authored-by: garywei944 <33930674+garywei944@users.noreply.github.com>
Co-authored-by: Marc Cornellà <marc@mcornella.com>
Diff
1diff --git a/plugins/conda/README.md b/plugins/conda/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..70530d01e3205fda5cd589c77649eb72ca4db4ed
4--- /dev/null
5+++ b/plugins/conda/README.md
6@@ -0,0 +1,37 @@
7+# conda plugin
8+
9+The conda plugin provides [aliases](#aliases) for `conda`, usually installed via [anaconda](https://www.anaconda.com/) or [miniconda](https://docs.conda.io/en/latest/miniconda.html).
10+
11+To use it, add `conda` to the plugins array in your zshrc file:
12+
13+```zsh
14+plugins=(... conda)
15+```
16+
17+## Aliases
18+
19+| Alias | Command | Description |
20+| :------- | :-------------------------------------- | :------------------------------------------------------------------------------ |
21+| `cna` | `conda activate` | Activate the specified conda environment |
22+| `cnab` | `conda activate base` | Activate the base conda environment |
23+| `cncf` | `conda env create -f` | Create a new conda environment from a YAML file |
24+| `cncn` | `conda create -y -n` | Create a new conda environment with the given name |
25+| `cnconf` | `conda config` | View or modify conda configuration |
26+| `cncp` | `conda create -y -p` | Create a new conda environment with the given prefix |
27+| `cncr` | `conda create -n` | Create new virtual environment with given name |
28+| `cncss` | `conda config --show-source` | Show the locations of conda configuration sources |
29+| `cnde` | `conda deactivate` | Deactivate the current conda environment |
30+| `cnel` | `conda env list` | List all available conda environments |
31+| `cni` | `conda install` | Install given package |
32+| `cniy` | `conda install -y` | Install given package without confirmation |
33+| `cnl` | `conda list` | List installed packages in the current environment |
34+| `cnle` | `conda list --export` | Export the list of installed packages in the current environment |
35+| `cnles` | `conda list --explicit > spec-file.txt` | Export the list of installed packages in the current environment to a spec file |
36+| `cnr` | `conda remove` | Remove given package |
37+| `cnrn` | `conda remove -y -all -n` | Remove all packages in the specified environment |
38+| `cnrp` | `conda remove -y -all -p` | Remove all packages in the specified prefix |
39+| `cnry` | `conda remove -y` | Remove given package without confirmation |
40+| `cnsr` | `conda search` | Search conda repositories for package |
41+| `cnu` | `conda update` | Update conda package manager |
42+| `cnua` | `conda update --all` | Update all installed packages |
43+| `cnuc` | `conda update conda` | Update conda package manager |
44diff --git a/plugins/conda/conda.plugin.zsh b/plugins/conda/conda.plugin.zsh
45new file mode 100644
46index 0000000000000000000000000000000000000000..a93ceeb95ba4f5679a9de7e4bba85110ad73aa50
47--- /dev/null
48+++ b/plugins/conda/conda.plugin.zsh
49@@ -0,0 +1,23 @@
50+alias cna='conda activate'
51+alias cnab='conda activate base'
52+alias cncf='conda env create -f'
53+alias cncn='conda create -y -n'
54+alias cnconf='conda config'
55+alias cncp='conda create -y -p'
56+alias cncr='conda create -n'
57+alias cncss='conda config --show-source'
58+alias cnde='conda deactivate'
59+alias cnel='conda env list'
60+alias cni='conda install'
61+alias cniy='conda install -y'
62+alias cnl='conda list'
63+alias cnle='conda list --export'
64+alias cnles='conda list --explicit > spec-file.txt'
65+alias cnr='conda remove'
66+alias cnrn='conda remove -y -all -n'
67+alias cnrp='conda remove -y -all -p'
68+alias cnry='conda remove -y'
69+alias cnsr='conda search'
70+alias cnu='conda update'
71+alias cnua='conda update --all'
72+alias cnuc='conda update conda'