This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git branch in command prompts | |
autoload -Uz vcs_info | |
precmd() {vcs_info} | |
setopt PROMPT_SUBST | |
# the last part of this command dictates what is shown for git info, referenced later by the prompt command. | |
# here, showing branch name %b in color 38 (blue) and the repo name %r in color 226 (yellow) | |
zstyle ':vcs_info:git:*' formats '%F{38}%b%f %F{226}(%r)%f' | |
# can set both the left (PROMPT) and right (RPROMPT) prompts |