Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. if [ -f ~/.bash_aliases ]; then
  2. . ~/.bash_aliases
  3. fi
  4.  
  5. # Alias Creator function
  6. function mkalias ()
  7. {
  8. alias "$*";
  9. echo alias "$*" >> ~/.bash_aliases
  10. }
  11.  
  12. # enable the git bash completion commands
  13. source ~/.git-completion.sh
  14.  
  15. # enable git unstaged indicators - set to a non-empty value
  16. GIT_PS1_SHOWDIRTYSTATE="."
  17.  
  18. # enable showing of untracked files - set to a non-empty value
  19. GIT_PS1_SHOWUNTRACKEDFILES="."
  20.  
  21. # enable stash checking - set to a non-empty value
  22. GIT_PS1_SHOWSTASHSTATE="."
  23.  
  24. # enable showing of HEAD vs its upstream
  25. GIT_PS1_SHOWUPSTREAM="auto"
  26.  
  27. BLACK=$(tput setaf 0)
  28. RED=$(tput setaf 1)
  29. GREEN=$(tput setaf 2)
  30. YELLOW=$(tput setaf 3)
  31. LIME_YELLOW=$(tput setaf 190)
  32. POWDER_BLUE=$(tput setaf 153)
  33. BLUE=$(tput setaf 4)
  34. MAGENTA=$(tput setaf 5)
  35. CYAN=$(tput setaf 6)
  36. WHITE=$(tput setaf 7)
  37. BRIGHT=$(tput bold)
  38. NORMAL=$(tput sgr0)
  39. BLINK=$(tput blink)
  40. REVERSE=$(tput smso)
  41. UNDERLINE=$(tput smul)
  42.  
  43. # set the prompt to show current working directory and git branch name, if it exists
  44.  
  45. # this prompt is a green username, black @ symbol, cyan host, magenta current working directory and white git branch (only shows if you're in a git branch)
  46. # unstaged and untracked symbols are shown, too (see above)
  47. # this prompt uses the short colour codes defined above
  48. # PS1='${GREEN}\u${BLACK}@${CYAN}\h:${MAGENTA}\w${WHITE}`__git_ps1 " (%s)"`\$ '
  49.  
  50. # this is a cyan username, @ symbol and host, magenta current working directory and white git branch
  51. # it uses the shorter , but visibly more complex, codes for text colours (shorter because the colour code definitions aren't needed)
  52. # PS1='\[33[0;36m\]\u@\h\[33[01m\]:\[33[0;35m\]\w\[33[00m\]\[33[1;30m\]\[33[0;37m\]`__git_ps1 " (%s)"`\[33[00m\]\[33[0;37m\]\$ '
  53.  
  54. # return the prompt prefix for the second line
  55. function set_prefix {
  56. BRANCH=`__git_ps1`
  57. if [[ -z $BRANCH ]]; then
  58. echo "${NORMAL}o"
  59. else
  60. echo "${UNDERLINE}+"
  61. fi
  62. }
  63.  
  64. # and here's one similar to Paul Irish's famous prompt ... not sure if this is the way he does it, but it works <span class="wp-smiley wp-emoji wp-emoji-smile" title=":)">:)</span>
  65. # 33[s = save cursor position
  66. # 33[u = restore cursor position
  67.  
  68. PS1='${MAGENTA}\u${WHITE} in ${GREEN}\w${WHITE}${MAGENTA}`__git_ps1 " on %s"`${WHITE}\r\n`set_prefix`${NORMAL}${CYAN}33[s33[60C (`date "+%a, %b %d %H:%M"`)33[u${WHITE} '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement