1.安装ZSH
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
2.方便git使用的一段脚本
把这段代码 加到 .bash_profile里面:
__setup_ps1 () {
GIT_ACTIVE_BRANCH=$(git branch 2>/dev/null | grep * | sed "s/*\ //")
test -z "$GIT_ACTIVE_BRANCH" || GIT_ACTIVE_BRANCH=" <${txtcyn}${GIT_ACTIVE_BRANCH}${txtrst}>"
PS1="[${bldwht}!${txtrst}]$GIT_ACTIVE_BRANCH \u@${txtylw}\h${txtrst}:${txtred}\w${txtrst}$ "
}
PROMPT_COMMAND='__setup_ps1'
网友评论