Plugin provides condaenv_prompt_info function which returns the current conda environment name.
-
Download the plugin
git clone https://github.com/saravanabalagi/zsh-plugin-condaenv $ZSH_CUSTOM/plugins/condaenv -
Add to
pluginsin.zshrcfileplugins=( ... condaenv )
Then launch a new terminal or source .zshrc in your current terminal.
This plugin exposes:
condaenv_prompt_infofunction based on two env varsZSH_THEME_CONDAENV_PREFIXdefault(ZSH_THEME_CONDAENV_SUFFIXdefault)
Using this you can build a theme as below:
base_prompt=PROMPT
PROMPT=$(condaenv_prompt_info)"$base_prompt"
ZSH_THEME_CONDAENV_PREFIX="%{$fg[blue]%}("
ZSH_THEME_CONDAENV_SUFFIX=")%{$reset_color%}"Please refer to the License file.
