From 3d6c513aa33f0c66c4d7d730116acb0d9ad30740 Mon Sep 17 00:00:00 2001 From: Teddy Masters Date: Mon, 8 Jul 2024 10:23:29 -0400 Subject: [PATCH] added conda to bira enviroment --- lib/prompt_info_functions.zsh | 9 +++++++++ themes/bira.zsh-theme | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/prompt_info_functions.zsh b/lib/prompt_info_functions.zsh index 29aca9b48..c86a78b64 100644 --- a/lib/prompt_info_functions.zsh +++ b/lib/prompt_info_functions.zsh @@ -42,3 +42,12 @@ ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" function ruby_prompt_info() { echo "$(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)" } + +# use this to enable users to see their conda env info +conda_prompt_info() { + if [ -n "$CONDA_DEFAULT_ENV" ]; then + echo -n "%{$terminfo[bold]$fg[yellow]%}($CONDA_DEFAULT_ENV) %{$reset_color%}" + else + echo -n '' + fi +} diff --git a/themes/bira.zsh-theme b/themes/bira.zsh-theme index f909afa62..00697d04d 100644 --- a/themes/bira.zsh-theme +++ b/themes/bira.zsh-theme @@ -2,6 +2,7 @@ local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local user_host="%B%(!.%{$fg[red]%}.%{$fg[green]%})%n@%m%{$reset_color%} " local user_symbol='%(!.#.$)' local current_dir="%B%{$fg[blue]%}%~ %{$reset_color%}" +local conda_prompt='$(conda_prompt_info)' local vcs_branch='$(git_prompt_info)$(hg_prompt_info)' local rvm_ruby='$(ruby_prompt_info)' @@ -14,7 +15,8 @@ fi ZSH_THEME_RVM_PROMPT_OPTIONS="i v g" -PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} +#PROMPT="╭─${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} +PROMPT="╭─${conda_prompt}${user_host}${current_dir}${rvm_ruby}${vcs_branch}${venv_prompt}${kube_prompt} ╰─%B${user_symbol}%b " RPROMPT="%B${return_code}%b"