Skip to content

Instantly share code, notes, and snippets.

@wesgarrison
Created September 8, 2011 15:28
Show Gist options
  • Save wesgarrison/1203678 to your computer and use it in GitHub Desktop.
Save wesgarrison/1203678 to your computer and use it in GitHub Desktop.
bash setup
LSCOLORS='gxfxcxdxbxegedabagacad'
export LSCOLORS
alias ls='ls -hGF' # --color=auto not valid on OS X
alias ll='ls -alhGF' # --color=auto not valid on OS X
alias flushdns='dscacheutil -flushcache'
# git
alias gb='git branch -a -v'
alias gs='git status'
alias gd='git diff'
alias gsm='git submodule'
alias gitx='gitx --all'
# alias copy_mysql_gem_for_rvm="cp -R /usr/local-old/lib/ruby/gems/1.8/gems/mysql-2.7 `rvm gemdir`"
# gc => git checkout master
# gc bugs => git checkout bugs
function gc {
if [ -z "$1" ]; then
git checkout master
else
git checkout $1
fi
}
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}"$(parse_git_dirty))"
}
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
WHITE="\[\033[0;0m\]"
CYAN="\[\033[0;36m\]"
export PS1=" $CYAN\$(~/.rvm/bin/rvm-prompt) $RED\w $YELLOW\$(parse_git_branch)$WHITE\n\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment