Guest User

Untitled

a guest
Jul 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function parse_git_branch {
  2. git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
  3. }
  4.  
  5. function prompt {
  6. local BLUE="\[\033[0;34m\]"
  7.  
  8. # OPTIONAL - if you want to use any of these other colors:
  9. local RED="\[\033[0;31m\]"
  10. local LIGHT_RED="\[\033[1;31m\]"
  11. local GREEN="\[\033[0;32m\]"
  12. local LIGHT_GREEN="\[\033[1;32m\]"
  13. local WHITE="\[\033[1;37m\]"
  14. local LIGHT_GRAY="\[\033[0;37m\]"
  15. # END OPTIONAL
  16. local DEFAULT="\[\033[0m\]"
  17. export PS1="\h:\w \u$LIGHT_RED\$(parse_git_branch) $DEFAULT\$ "
  18. }
  19.  
  20. prompt
Add Comment
Please, Sign In to add comment