Created
March 8, 2016 02:13
-
-
Save s2kw/8a62f12d4c1ea65e23da to your computer and use it in GitHub Desktop.
.bash_profileに書き込むとbranch名が表示されつつ適当にカラフルになるからCUI苦手な人用に
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
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " | |
export PS1="\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " | |
# \[\e[0;32m\]\u\[\e[m\] green color with user name | |
# \[\e[1;34m\]\w\[\e[m\] blue color with path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source ~/.bash_profile