ubuntu下终端提示符颜色配置以及git分支配置

前端之家收集整理的这篇文章主要介绍了ubuntu下终端提示符颜色配置以及git分支配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
ubuntu下终端提示符颜色配置以及git分支配置
向~/.bashrc复制下面内容,然后重新打开终端就可以了。

颜色配置:
PS1='${debian_chroot:+($debian_chroot)}/[/033[01;32m/]/u@/h/[/033[00m/]: /[/033[01;34m/]/w/[/033[00m/]/$'
颜色配置加git 分支:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \w \[\033[31m\]\$(parse_git_branch)\[\033[00m\]$\[\033[00m\] " 原文链接:https://www.f2er.com/ubuntu/354062.html

猜你在找的Ubuntu相关文章