Skip to content

Instantly share code, notes, and snippets.

@mattmeng
Last active January 2, 2018 17:06
Show Gist options
  • Save mattmeng/dccbfc6859afd049085ba559577c73ea to your computer and use it in GitHub Desktop.
Save mattmeng/dccbfc6859afd049085ba559577c73ea to your computer and use it in GitHub Desktop.
.bashrc
GIT_PS1_SHOWCOLORHINTS=true
green="$(tput setaf 2)"
red="$(tput setaf 1)"
blue="$(tput setaf 4)"
yellow="$(tput setaf 3)"
white="$(tput setaf 7)"
bold="$(tput bold)"
reset="$(tput sgr0)"
PS1="\`if [[ \$? = "0" ]]; then echo '\n$green'; else echo '\n$red'; fi\`\$(s=\$(printf "%*s" \$COLUMNS); echo \${s// /-})\n \[$reset\]\[$blue\]\W\$(__git_ps1 \"\[$bold\](\[$reset\]\[$green\]%s\[$reset\]\[$blue\]\[$bold\])\") \[$reset\]\[$yellow\]\[$reset\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment