Last active
February 23, 2026 03:32
-
-
Save edwinwong90/4513ead4c81ca981c8d6f31b11341db2 to your computer and use it in GitHub Desktop.
Show Git branch [zsh]
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
| # 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 "%F{green}(%b)%F{none} " | |
| 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