Show current gcloud config in zsh prompt.
This script is inspired by zsh-kubectl-prompt.
$ git clone https://github.com/ocadaruma/zsh-gcloud-prompt.git /path/to/zsh-gcloud-prompt
Current gcloud config is stored in ZSH_GCLOUD_PROMPT
. (in the form of "${active-account}:${active-project}"
)
For example, add following lines to ~/.zshrc
autoload -Uz colors; colors
source /path/to/zsh-gcloud-prompt/gcloud.zsh
RPROMPT='%{$fg[cyan]%}($ZSH_GCLOUD_PROMPT)%{$reset_color%}'