Skip to content

Instantly share code, notes, and snippets.

@AVGVSTVS96
Last active June 3, 2023 03:56
Show Gist options
  • Save AVGVSTVS96/cd33ab1b79036176b2697c07a6b43345 to your computer and use it in GitHub Desktop.
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'
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