ubuntu下终端提示符颜色配置以及git分支配置
向~/.bashrc复制下面内容,然后重新打开终端就可以了。颜色配置:
PS1=’${debian_chroot:+($debian_chroot)}//u@/h/: //w//$ ‘
颜色配置加git分支:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git::\1)/'
}
export PS1="${debian_chroot:+($debian_chroot)}\[\033\u@\h\[\033: \w \[\033\$(parse_git_branch)\[\033$\[\033 "
页:
[1]