Created
July 20, 2021 16:44
-
-
Save solomonrothman/6754f53354f2dba29905090b9d0775bb to your computer and use it in GitHub Desktop.
Add git branch to ZSH shell (.zshrc)
This file contains hidden or 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
# Load version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats 'on branch %b' | |
# Set up the prompt (with git branch name) | |
setopt PROMPT_SUBST | |
PROMPT='%n in ${PWD/#$HOME/~} ${vcs_info_msg_0_} > ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment