Diff
1diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh
2index 29aca9b486f091c045962b0ab8e3933b741e9aba..722ae58c0a7009bea8ae4cd5107041042da51848 100644
3--- a/lib/prompt_info_functions.zsh
4+++ b/lib/prompt_info_functions.zsh
5@@ -20,6 +20,7 @@ function chruby_prompt_info \
6 jenv_prompt_info \
7 azure_prompt_info \
8 tf_prompt_info \
9+ conda_prompt_info \
10 {
11 return 1
12 }
13diff --git a/plugins/conda-env/README.md b/plugins/conda-env/README.md
14new file mode 100644
15index 0000000000000000000000000000000000000000..ccf48a3920357af7edddab82aec202bc21d22ef8
16--- /dev/null
17+++ b/plugins/conda-env/README.md
18@@ -0,0 +1,44 @@
19+# conda-env
20+
21+The plugin displays information of the created virtual container of conda and allows background theming.
22+
23+To use it, add `conda-env` to the plugins array of your zshrc file:
24+```
25+plugins=(... conda-env)
26+```
27+
28+The plugin creates a `conda_prompt_info` function that you can use in your theme, which displays the
29+basename of the current `$CONDA_DEFAULT_ENV`.
30+
31+You can use this prompt function in your themes, by adding it to the `PROMPT` or `RPROMPT` variables. See [Example](#example) for more information.
32+
33+## Settings
34+
35+It uses two variables to control how the information is shown:
36+
37+- `ZSH_THEME_CONDA_PREFIX`: sets the prefix of the CONDA_DEFAULT_ENV.
38+Defaults to `[`.
39+
40+- `ZSH_THEME_CONDA_SUFFIX`: sets the suffix of the CONDA_DEFAULT_ENV.
41+Defaults to `]`.
42+
43+## Example
44+
45+```sh
46+ZSH_THEME_CONDA_PREFIX='conda:%F{green}'
47+ZSH_THEME_CONDA_SUFFIX='%f'
48+RPROMPT='$(conda_prompt_info)'
49+```
50+
51+## `CONDA_CHANGEPS1`
52+
53+This plugin also automatically sets the `CONDA_CHANGEPS1` variable to `false` to avoid conda changing the prompt
54+automatically. This has the same effect as running `conda config --set changeps1 false`.
55+
56+You can override this behavior by adding `unset CONDA_CHANGEPS1` in your `.zshrc` file, after Oh My Zsh has been
57+sourced.
58+
59+References:
60+
61+- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
62+- https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence
63diff --git a/plugins/conda-env/conda-env.plugin.zsh b/plugins/conda-env/conda-env.plugin.zsh
64new file mode 100644
65index 0000000000000000000000000000000000000000..c710c952ff51e0e72b2efdb2f67fe29377772135
66--- /dev/null
67+++ b/plugins/conda-env/conda-env.plugin.zsh
68@@ -0,0 +1,9 @@
69+function conda_prompt_info(){
70+ [[ -n ${CONDA_DEFAULT_ENV} ]] || return
71+ echo "${ZSH_THEME_CONDA_PREFIX=[}${CONDA_DEFAULT_ENV:t:gs/%/%%}${ZSH_THEME_CONDA_SUFFIX=]}"
72+}
73+
74+# Has the same effect as `conda config --set changeps1 false`
75+# - https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
76+# - https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence
77+export CONDA_CHANGEPS1=false