add support for conda; i now support two dev frameworky things so lets mention this in the readme too
This commit is contained in:
21
modules/conda.zsh
Normal file
21
modules/conda.zsh
Normal 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
|
Reference in New Issue
Block a user