Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This function gets current git branch
- function parse_git_branch {
- brs=$(git branch 2>/dev/null | grep '^*' | colrm 1 2) || return
- if [ -z "$brs" ]
- then echo ""
- else echo "⌥ $brs"
- fi
- }
- # Properly reset console output color if you have custom color for command typing
- trap 'echo -ne "\033[0m"' DEBUG
- # Display PS1 with git branch
- # without colors PS1="\u@\h: \W\$(parse_git_branch)\$ "
- # Define colors
- CYAN="\[\e[0;36m\]"
- BLUE="\[\e[0;34m\]"
- RED="\[\e[0;31m\]"
- GREEN="\[\e[0;32m\]"
- #WHITE="\[\033[0m\]"
- # display username and hostname in PS1 PS1="$CYAN\u@\h: $BLUE\W$RED\$(parse_git_branch) $GREEN\$ "
- PS1="$BLUE\W:$RED\$(parse_git_branch) $GREEN\$ "
- #username@hostname as tab title
- PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}\007"'
- # Aliases for mysql commands
- alias mysql=/usr/local/mysql/bin/mysql
- alias mysqladmin=/usr/local/mysql/bin/mysqladmin
- # MacPorts Installer addition on 2011-08-23_at_17:02:51: adding an appropriate PATH variable for use with MacPorts.
- export PATH=/opt/local/bin:/opt/local/sbin:$PATH
- # Finished adapting your PATH environment variable for use with MacPorts.
- # Enable colors in terminal
- export CLICOLOR=1;
- # This loads RVM into a shell session.
- [[ -s "~/.rvm/scripts/rvm" ]] && source "~/.rvm/scripts/rvm"
- # Loads git and git flow completions
- source ~/.git-completion.bash
- source ~/.git-flow-completion.bash
Add Comment
Please, Sign In to add comment