Skip to content

Instantly share code, notes, and snippets.

@willfolsom
Last active December 9, 2020 20:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willfolsom/43d26018be685c651968431124a79906 to your computer and use it in GitHub Desktop.
Save willfolsom/43d26018be685c651968431124a79906 to your computer and use it in GitHub Desktop.
Add Git Branch Information to .zshrc (then save and run `source .zshrc`)
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats '%F{green}[%b]%f '
# Set up the prompt (with git branch name)
setopt PROMPT_SUBST
PROMPT='%n ${PWD/#$HOME/~} ${vcs_info_msg_0_}$ '
@willfolsom
Copy link
Author

willfolsom commented Dec 9, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment