https://github.com/saravanabalagi/zsh-plugin-condaenv
Plugin provides condaenv_prompt_info which can be used in a theme
https://github.com/saravanabalagi/zsh-plugin-condaenv
conda-env condaenv condaenv-prompt-info virtualenv zsh-plugin
Last synced: 19 days ago
JSON representation
Plugin provides condaenv_prompt_info which can be used in a theme
- Host: GitHub
- URL: https://github.com/saravanabalagi/zsh-plugin-condaenv
- Owner: saravanabalagi
- License: gpl-3.0
- Created: 2019-07-15T21:53:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-14T03:52:53.000Z (almost 2 years ago)
- Last Synced: 2024-12-25T20:40:56.659Z (11 months ago)
- Topics: conda-env, condaenv, condaenv-prompt-info, virtualenv, zsh-plugin
- Language: Shell
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - condaenv - Provides a `condaenv_prompt_info` function which returns the current `conda` environment name. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - condaenv - Provides a `condaenv_prompt_info` function which returns the current `conda` environment name. (Plugins / ZSH on Windows)
README
# zsh-condaenv
Plugin provides `condaenv_prompt_info` function which returns the current conda environment name.

## Installation
1. Download the plugin
```
git clone https://github.com/saravanabalagi/zsh-plugin-condaenv $ZSH_CUSTOM/plugins/condaenv
```
1. Add to `plugins` in `.zshrc` file
```
plugins=(
...
condaenv
)
```
Then launch a new terminal or source `.zshrc` in your current terminal.
## Usage
This plugin exposes:
- `condaenv_prompt_info` function based on two env vars
1. `ZSH_THEME_CONDAENV_PREFIX` default `(`
1. `ZSH_THEME_CONDAENV_SUFFIX` default `)`
Using this you can build a theme as below:
```zsh
base_prompt=PROMPT
PROMPT=$(condaenv_prompt_info)"$base_prompt"
ZSH_THEME_CONDAENV_PREFIX="%{$fg[blue]%}("
ZSH_THEME_CONDAENV_SUFFIX=")%{$reset_color%}"
```
## License
Please refer to the [License](LICENSE) file.