Speedup parse_git_branch()
This commit is contained in:
parent
1505eeb17d
commit
4e6c65ee9f
|
@ -1,3 +1,5 @@
|
|||
#set -x # Print out all of the commands that are executing.
|
||||
|
||||
# For Windows setup
|
||||
test -f ~/.functions && . ~/.functions
|
||||
test -f ~/.aliases && . ~/.aliases
|
||||
|
@ -21,7 +23,9 @@ export TMPDIR=/tmp
|
|||
|
||||
# Customize the shell prompt
|
||||
parse_git_branch() {
|
||||
if [[ "$PWD" != "$HOME" ]]; then
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
fi
|
||||
}
|
||||
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user