Last active
August 9, 2020 17:31
-
-
Save njgibbon/e21bf8e857135571ccfe8edab8d81d34 to your computer and use it in GitHub Desktop.
Minimal .zshrc to output git branch name in prompt using vcs_info.
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
# ~/.zshrc | |
# Enabling and setting git info var to be used in prompt config. | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' enable git svn | |
# This line obtains information from the vcs. | |
zstyle ':vcs_info:git*' formats "- (%b) " | |
precmd() { | |
vcs_info | |
} | |
# Enable substitution in the prompt. | |
setopt prompt_subst | |
# Config for the prompt. PS1 synonym. | |
prompt='%2/ ${vcs_info_msg_0_}> ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment