Skip to content

Instantly share code, notes, and snippets.

@josegonzalez

josegonzalez/.bashrc

Created Mar 28, 2012
Embed
What would you like to do?
My ~/.bashrc
export PATH="$(brew --prefix)/bin:$(brew --prefix php)/bin:$(brew --prefix python)/bin:/usr/local/share/python:/usr/local/lib/node_modules:/usr/local/PEAR:$PATH"
export NODE_PATH=/usr/local/lib/node_modules
export GIT_EDITOR="subl -w" # Change to whatever you want your default git editor to be
export RUBYOPT=rubygems
# a crap-ton of ssh aliases
alias update='brew update && brew outdated | xargs brew upgrade'
alias ls='ls -alh'
alias ll='ls -alh'
alias stress='ab -kc 10 -t 30'
alias gd='git branch -d'
#### Work Aliases ####
#### PS1 customization ####
NONE="\[\033[0m\]" # unsets color to term fg color
# regular colors
K="\[\033[0;30m\]" # black
R="\[\033[0;31m\]" # red
G="\[\033[0;32m\]" # green
Y="\[\033[0;33m\]" # yellow
B="\[\033[0;34m\]" # blue
M="\[\033[0;35m\]" # magenta
C="\[\033[0;36m\]" # cyan
W="\[\033[0;37m\]" # white
# emphasized (bolded) colors
EMK="\[\033[1;30m\]"
EMR="\[\033[1;31m\]"
EMG="\[\033[1;32m\]"
EMY="\[\033[1;33m\]"
EMB="\[\033[1;34m\]"
EMM="\[\033[1;35m\]"
EMC="\[\033[1;36m\]"
EMW="\[\033[1;37m\]"
# background colors
BGK="\[\033[40m\]"
BGR="\[\033[41m\]"
BGG="\[\033[42m\]"
BGY="\[\033[43m\]"
BGB="\[\033[44m\]"
BGM="\[\033[45m\]"
BGC="\[\033[46m\]"
BGW="\[\033[47m\]"
clean_ds() {
find $1 -name ".DS_Store" -ok rm '{}' \;
}
branches() {
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
# git checkout ${branch##*/}
# git pull origin ${branch##*/}
done
}
# the name of the git branch in the current directory
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/git:\1/'
}
# revision of the svn repo in the current directory
parse_svn_rev() {
svn info 2> /dev/null | grep "Revision" | sed 's/Revision: \(.*\)/svn:r\1 /'
}
update_prompt() {
PS1="\[\033[00m\]\u@\h:\[\033[1;34m\]\w \[\033[31m\]\$(parse_git_branch)\$(parse_svn_rev) \[\033[00m\]$\[\033[00m\] "
}
g() {
if [[ $# == '0' ]]; then
git status
else
git "$@";
fi
}
PROMPT_COMMAND=update_prompt
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment