Created
October 17, 2013 02:59
-
-
Save s5ot/7018600 to your computer and use it in GitHub Desktop.
This file contains 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
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
. $(brew --prefix)/etc/bash_completion | |
fi | |
source /usr/local/Cellar/git/1.8.2.3/etc/bash_completion.d/git-completion.bash | |
source /usr/local/Cellar/git/1.8.2.3/etc/bash_completion.d/git-prompt.sh | |
#GIT_PS1_SHOWDIRTYSTATE=true | |
#export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ ' | |
hg_branch() { | |
hg branch 2> /dev/null | awk '{print " (hg:"$1""}' | |
} | |
hg_rev() { | |
hg parents --template "r{rev}\n" 2> /dev/null | awk '{print " "$1")"}' | |
} | |
git_branch() { | |
git branch 2>/dev/null | awk '/^\*/ {print " " " (git:" $2 ")"}' | |
} | |
export PS1="\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[00m\]\[\033[0;36m\]\$(git_branch)\$(hg_branch)\$(hg_rev)\[\033[0m\] \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See:
http://d.hatena.ne.jp/CortYuming/20121006/p2