add support for conda; i now support two dev frameworky things so lets mention this in the readme too

This commit is contained in:
2023-06-30 16:18:38 -07:00
parent 9c7014bf32
commit ba91da045c
3 changed files with 24 additions and 0 deletions

21
modules/conda.zsh Normal file
View File

@@ -0,0 +1,21 @@
# Note: location of conda can be unpredictable; user is expected to
# run `conda init zsh` as normal then move resulting .zshrc
# modifications to .zshrc.local
# recommended settings for .condarc:
# auto_assign_base: false
# changeps1: false
local orig_rprompt="${RPROMPT}"
function precmd_conda_prompt() {
if [[ -v CONDA_DEFAULT_ENV && "$CONDA_DEFAULT_ENV" != "base" ]]; then
RPROMPT="%{$fg[cyan]%}$CONDA_DEFAULT_ENV %{$reset_color%} ${orig_rprompt}"
else
RPROMPT="${orig_rprompt}"
fi
}
if (( ${+commands[conda]} )); then
precmd_functions+=precmd_conda_prompt
fi