summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Müller <senpo@posteo.de>2018-10-21 13:00:03 +0200
committerMarc Cornellà <marc@mcornella.com>2024-08-14 09:18:18 +0200
commit9ba6daa1b5d0b60c89525d679eb30fe3ed9947de (patch)
treef1fb1c078612eca3f741097e19c5a3f63852dbb9
parentd6f84f3e7d2515cee8ba776d05ee2009ffd471d7 (diff)
downloadzsh-9ba6daa1b5d0b60c89525d679eb30fe3ed9947de.tar.gz
zsh-9ba6daa1b5d0b60c89525d679eb30fe3ed9947de.tar.bz2
zsh-9ba6daa1b5d0b60c89525d679eb30fe3ed9947de.zip
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>
-rw-r--r--plugins/conda/README.md37
-rw-r--r--plugins/conda/conda.plugin.zsh23
2 files changed, 60 insertions, 0 deletions
diff --git a/plugins/conda/README.md b/plugins/conda/README.md
new file mode 100644
index 000000000..70530d01e
--- /dev/null
+++ b/plugins/conda/README.md
@@ -0,0 +1,37 @@
+# conda plugin
+
+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).
+
+To use it, add `conda` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... conda)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+| :------- | :-------------------------------------- | :------------------------------------------------------------------------------ |
+| `cna` | `conda activate` | Activate the specified conda environment |
+| `cnab` | `conda activate base` | Activate the base conda environment |
+| `cncf` | `conda env create -f` | Create a new conda environment from a YAML file |
+| `cncn` | `conda create -y -n` | Create a new conda environment with the given name |
+| `cnconf` | `conda config` | View or modify conda configuration |
+| `cncp` | `conda create -y -p` | Create a new conda environment with the given prefix |
+| `cncr` | `conda create -n` | Create new virtual environment with given name |
+| `cncss` | `conda config --show-source` | Show the locations of conda configuration sources |
+| `cnde` | `conda deactivate` | Deactivate the current conda environment |
+| `cnel` | `conda env list` | List all available conda environments |
+| `cni` | `conda install` | Install given package |
+| `cniy` | `conda install -y` | Install given package without confirmation |
+| `cnl` | `conda list` | List installed packages in the current environment |
+| `cnle` | `conda list --export` | Export the list of installed packages in the current environment |
+| `cnles` | `conda list --explicit > spec-file.txt` | Export the list of installed packages in the current environment to a spec file |
+| `cnr` | `conda remove` | Remove given package |
+| `cnrn` | `conda remove -y -all -n` | Remove all packages in the specified environment |
+| `cnrp` | `conda remove -y -all -p` | Remove all packages in the specified prefix |
+| `cnry` | `conda remove -y` | Remove given package without confirmation |
+| `cnsr` | `conda search` | Search conda repositories for package |
+| `cnu` | `conda update` | Update conda package manager |
+| `cnua` | `conda update --all` | Update all installed packages |
+| `cnuc` | `conda update conda` | Update conda package manager |
diff --git a/plugins/conda/conda.plugin.zsh b/plugins/conda/conda.plugin.zsh
new file mode 100644
index 000000000..a93ceeb95
--- /dev/null
+++ b/plugins/conda/conda.plugin.zsh
@@ -0,0 +1,23 @@
+alias cna='conda activate'
+alias cnab='conda activate base'
+alias cncf='conda env create -f'
+alias cncn='conda create -y -n'
+alias cnconf='conda config'
+alias cncp='conda create -y -p'
+alias cncr='conda create -n'
+alias cncss='conda config --show-source'
+alias cnde='conda deactivate'
+alias cnel='conda env list'
+alias cni='conda install'
+alias cniy='conda install -y'
+alias cnl='conda list'
+alias cnle='conda list --export'
+alias cnles='conda list --explicit > spec-file.txt'
+alias cnr='conda remove'
+alias cnrn='conda remove -y -all -n'
+alias cnrp='conda remove -y -all -p'
+alias cnry='conda remove -y'
+alias cnsr='conda search'
+alias cnu='conda update'
+alias cnua='conda update --all'
+alias cnuc='conda update conda'