Last active
June 3, 2023 03:56
-
-
Save AVGVSTVS96/cd33ab1b79036176b2697c07a6b43345 to your computer and use it in GitHub Desktop.
ZSH Prompt - Displays current Git branch and directory with colors in terminal. Customize name 'MacBook-Pro'
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
setopt PROMPT_SUBST | |
PROMPT='%F{cyan}MacBook-Pro%f:%F{green}%1~%f %F{yellow}$(parse_git_branch)%f$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment