Created
September 23, 2010 19:01
-
-
Save coshx/594148 to your computer and use it in GitHub Desktop.
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
# for .zshrc git branch | |
autoload -U colors && colors | |
parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
setPrompt() { | |
PS1="%{$fg[cyan]%}%n%{$fg[magenta]%}@%{$fg[red]%}%m%{$fg[cyan]%}$(parse_git_branch)%{$fg[magenta]%}%#%{$reset_color%} " | |
RPS1="%{$fg[magenta]%}%~%{$reset_color%}" | |
} | |
precmd() { | |
setPrompt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment