Skip to content

Instantly share code, notes, and snippets.

@swarut
Created September 13, 2012 15:00
Show Gist options
  • Save swarut/3714887 to your computer and use it in GitHub Desktop.
Save swarut/3714887 to your computer and use it in GitHub Desktop.
Bash : My Bash Profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
export CLICOLOR=1
export LSCOLORS=cxfxcxdxbxegedabagacad
export GREP_OPTIONS='--color=auto'
source "`brew --prefix`/etc/grc.bashrc"
[[ -s "/Users/swarut/.rvm/scripts/rvm" ]] && source "/Users/swarut/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
PATH=/usr/local/bin:/usr/local/mysql/bin:$PATH
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
NO_COLOR="\[\033[0m\]"
git_status() {
if current_git_status=$(git status | grep 'added to commit' 2> /dev/null); then
echo -e "\033[0;31m‡€"
fi
}
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
status_icon=$(git_status)
echo "["${ref#refs/heads/}"]$status_icon"
}
PS1="\$(rvm-prompt v p g)$GREEN\w$YELLOW\$(parse_git_branch)$NO_COLOR\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment