Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. # This function gets current git branch
  2. function parse_git_branch {
  3. brs=$(git branch 2>/dev/null | grep '^*' | colrm 1 2) || return
  4. if [ -z "$brs" ]
  5. then echo ""
  6. else echo "⌥ $brs"
  7. fi
  8. }
  9.  
  10. # Properly reset console output color if you have custom color for command typing
  11. trap 'echo -ne "\033[0m"' DEBUG
  12.  
  13. # Display PS1 with git branch
  14. # without colors PS1="\u@\h: \W\$(parse_git_branch)\$ "
  15. # Define colors
  16. CYAN="\[\e[0;36m\]"
  17. BLUE="\[\e[0;34m\]"
  18. RED="\[\e[0;31m\]"
  19. GREEN="\[\e[0;32m\]"
  20. #WHITE="\[\033[0m\]"
  21.  
  22.  
  23. # display username and hostname in PS1 PS1="$CYAN\u@\h: $BLUE\W$RED\$(parse_git_branch) $GREEN\$ "
  24. PS1="$BLUE\W:$RED\$(parse_git_branch) $GREEN\$ "
  25. #username@hostname as tab title
  26. PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"'
  27.  
  28. # Aliases for mysql commands
  29. alias mysql=/usr/local/mysql/bin/mysql
  30. alias mysqladmin=/usr/local/mysql/bin/mysqladmin
  31.  
  32.  
  33. # MacPorts Installer addition on 2011-08-23_at_17:02:51: adding an appropriate PATH variable for use with MacPorts.
  34. export PATH=/opt/local/bin:/opt/local/sbin:$PATH
  35. # Finished adapting your PATH environment variable for use with MacPorts.
  36.  
  37. # Enable colors in terminal
  38. export CLICOLOR=1;
  39.  
  40. # This loads RVM into a shell session.
  41. [[ -s "~/.rvm/scripts/rvm" ]] && source "~/.rvm/scripts/rvm"
  42.  
  43. # Loads git and git flow completions
  44. source ~/.git-completion.bash
  45. source ~/.git-flow-completion.bash
Add Comment
Please, Sign In to add comment