Skip to content

Instantly share code, notes, and snippets.

@bootandy
Last active October 12, 2015 06:58
Show Gist options
  • Save bootandy/3988716 to your computer and use it in GitHub Desktop.
Save bootandy/3988716 to your computer and use it in GitHub Desktop.
bash_profile for macbook
# colors
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=gxgxcxdxbxegedabagacad # cyan directories
# old Prompt
#export PS1='\[\033[01;32m\]\u@:\[\033[01;36m\]\w\[\033[00m\]\$ '
#Android sdk add to PATH
#PATH=$PATH:/System/Library/android-sdk-mac_x86/tools/
# Postgres added to PATH for ruby gems
PATH=$PATH:/Library/PostgreSQL/9.1/bin/
#Giant history
export HISTSIZE=99999999
alias l='ls -alF'
alias 'ps?'='ps ax | grep '
alias gs='git status'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias re='cd ~/dev/retechnica'
alias gr='cd ~/dev/retechnica/Grata'
alias apache='sudo /usr/sbin/apachectl restart'
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
alias cgrep="egrep --color=always"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
function git_branch() {
git branch &>/dev/null; if [ $? -eq 0 ]; then echo " ($(git branch | grep ^* |sed s/\*\ //))"; fi
}
function print_v_env() {
if [ ! -z $VIRTUAL_ENV ]; then
echo $VIRTUAL_ENV|awk -F'/' '{print "("$NF")"}'
fi
}
#prompt changes color if last command failed
function exitstatus {
EXITSTATUS="$?"
BOLD="\[\033[1m\]"
RED="\[\033[1;31m\]"
GREEN="\[\e[32;1m\]"
BLUE="\[\e[34;1m\]"
CYAN="\[\033[01;36m\]"
OFF="\[\033[m\]"
PRE="$(print_v_env)$(git_branch)"
PROMPT="\u:${CYAN}(\j):\w"
if [ "${EXITSTATUS}" -eq 0 ]
then
export PS1="${PRE}${GREEN}${PROMPT}${OFF}\$${OFF} "
else
export PS1="${PRE}${RED}${PROMPT}${RED}\$${OFF} "
fi
PS2="${BOLD}>${OFF} "
}
PROMPT_COMMAND=exitstatus
#export PS1='\[\033[01;32m\]\u@:\[\033[01;36m\]\w\[\033[00m\]\$ '
# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
# To install:
# pip, virtualenv, virtualenvwrapper
# Download pip and venv and add them to root python or vew wont work
# http://www.pip-installer.org/en/latest/installing.html
# ack:
# sudo curl http://betterthangrep.com/ack-standalone > /usr/local/bin/ack
# Command line Fu:
# https://github.com/samirahmed/fu/tree/master/src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment