diff --git a/zsh/.zshrc b/zsh/.zshrc index 3395442..63bf9a0 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -43,14 +43,22 @@ precmd_functions+=( precmd_vcs_info ) # %r == repo name # %b == branch name # %S == relative directory -zstyle ':vcs_info:git*' formats '%%S%r%%s:%{$fg[red]%}%b%{$reset_color%} %S' +zstyle ':vcs_info:git*' formats '%r (%b):%S' zstyle ':vcs_info:git*' actionformats '%%S%r%%s:%{$fg[red]%}%b:%a%{$reset_color%} %S' function set_prompt() { - if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then - PROMPT="%B${vcs_info_msg_0_}> %b" + + if [[ -n "$AWS_ENVIRONMENT" ]]; then + aws_prompt=" +%S%B$AWS_ENVIRONMENT%b%s +" else - PROMPT="%B%m:%~> %b" + aws_prompt="" + fi + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + PROMPT=$aws_prompt"%B${vcs_info_msg_0_}> %b" + else + PROMPT=$aws_prompt"%B%m:%~> %b" fi } precmd_functions+=( set_prompt )