Guest User

Untitled

a guest
Apr 22nd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #
  2. # PLACE THE CONTENTS IN YOUR ~/.bashrc
  3. # AFTERWARDS YOU'LL NEED TO RELOAD IT: source ~/.bashrc
  4. #
  5.  
  6. # Colors
  7. BLACK='\[\e[0;30m\]'
  8. BLUE='\[\e[0;34m\]'
  9. GREEN='\[\e[0;32m\]'
  10. CYAN='\[\e[0;36m\]'
  11. RED='\[\e[0;31m\]'
  12. PURPLE='\[\e[0;35m\]'
  13. BROWN='\[\e[0;33m\]'
  14. LIGHTGRAY='\[\e[0;37m\]'
  15. DARKGRAY='\[\e[1;30m\]'
  16. LIGHTBLUE='\[\e[1;34m\]'
  17. LIGHTGREEN='\[\e[1;32m\]'
  18. LIGHTCYAN='\[\e[1;36m\]'
  19. LIGHTRED='\[\e[1;31m\]'
  20. LIGHTPURPLE='\[\e[1;35m\]'
  21. YELLOW='\[\e[1;33m\]'
  22. WHITE='\[\e[1;37m\]'
  23. NC='\[\033[00m\]' #'\e[0m' # No Color
  24.  
  25. # make git branch show up in prompt
  26. parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ git:\1/' ; }
  27. parse_has_git_submodules() {
  28. if [ -f .gitmodules ]; then
  29. echo "*"
  30. fi
  31. }
  32.  
  33. function git_prompt_additions
  34. {
  35. if [ $? -eq 0 ]; then
  36. echo "$(parse_git_branch)$(parse_has_git_submodules)"
  37. else
  38. echo "died: $?" >> /tmp/gitrclog
  39. fi
  40. }
  41.  
  42.  
  43. export PS1="${YELLOW}\w${CYAN}\$(git_prompt_additions)${NC} "
Add Comment
Please, Sign In to add comment