function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
NEWLINE=$'\n'
export PROMPT="%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f ${NEWLINE} %F{normal}$%f "
Created
August 27, 2021 14:42
-
-
Save jhonoryza/667df01400d0e86956f88cea7895d956 to your computer and use it in GitHub Desktop.
show branch and color in zsh terminal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment