From d71ec555e68fe4d266da1f5f71864245765f0139 Mon Sep 17 00:00:00 2001 From: Pandu POLUAN Date: Fri, 13 Oct 2017 00:09:17 +0700 Subject: [PATCH] Replace GCE_PROJECT with something more generic GCE_PROJECT was a local need; it should be in .zshrc instead of in the theme. Replacing with an overridable system. --- themes/ys-pep.zsh-theme | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/themes/ys-pep.zsh-theme b/themes/ys-pep.zsh-theme index 86d9a2dbc..0f45d9470 100644 --- a/themes/ys-pep.zsh-theme +++ b/themes/ys-pep.zsh-theme @@ -55,9 +55,6 @@ local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%} )" ### BEGIN: pepoluan changes ### local dgrey="$terminfo[bold]$fg[black]" -# Local need: Show the GCE_PROJECT var -local gce_env="%{\${GCE_PROJECT:+$fg[yellow] GCE:}\$GCE_PROJECT$reset_color%}" - # Show my IP Address ZSH_THEME_SHOW_IP=1 yspep_my_ip() { @@ -78,6 +75,13 @@ ZSH_THEME_VIRTUALENV_PREFIX=" V:" ZSH_THEME_VIRTUALENV_SUFFIX=" " local venv_info="%{$terminfo[bold]$fg[blue]\$(virtualenv_prompt_info)$reset_color%}" +# Other info, you can override this function in .zshrc +yspep_other_info() { + # Example: Show the GCE_PROJECT variable in yellow: + : echo "%{\${GCE_PROJECT:+$fg[yellow] GCE:}\$GCE_PROJECT%}" +} +local other_info='$(yspep_other_info)' + # Prompt format: # # PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE V:VIRTUALENV @@ -94,7 +98,7 @@ PROMPT=" %{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\ ${hg_info}\ ${git_info}\ - $exit_code$gce_env$venv_info + $exit_code$venv_info$other_info %{$terminfo[bold]$fg[red]%}$ %{$reset_color%}" unset RPROMPT