Skip to content

Instantly share code, notes, and snippets.

@saneshark
Created August 26, 2014 17:57
Show Gist options
  • Save saneshark/06936fd86cadd9dc42be to your computer and use it in GitHub Desktop.
Save saneshark/06936fd86cadd9dc42be to your computer and use it in GitHub Desktop.
custom bash profile
# terminal color setting
#terminal color setting
export PATH="/usr/local/bin:$PATH"
export TERM=xterm-color
export CLICOLOR=1
export LSCOLORS=gxfxaxdxcxegedabagacad
# color the ls output
alias ls='ls -G'
# shortcut for detailed listing
alias ll='ls -GFlash'
alias la='ls -a'
alias grep='grep --color=auto'
# The Tree Command for Mac
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
alias ..='cd ..'
alias db:migrate='bundle exec rake db:migrate && bundle exec rake test:prepare'
alias rails_s='bundle exec rails s'
alias rails_c='bundle exec rails c'
alias reload='source ~/.bash_profile'
alias reload_profile='source ~/.bash_profile'
alias profile='subl ~/.bash_profile'
alias edit_profile='subl ~/.bash_profile'
alias simulator='open -a iPhone\ Simulator'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
source ~/.git-completion.bash
source ~/.git-prompt.sh
source ~/.profile
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS="yes"
GIT_PS1_SHOWDIRTYSTATE=true
# drops first portion of a path $1 if length is greater than $2
function __droppath {
if [[ ${#1} -gt $2 ]]; then
p=$1
while [ ${#p} -gt $2 ]; do
p="/"$(echo "$p"|cut -d"/" -f3-)
done
echo "..."$p
else
echo $1
fi
}
export PS1='\[\033[01;32m\][$(__droppath "\w" 50)\[\033[00m\]\[\033[01;34m\]$(__git_ps1 " (%s)")\033[01;32m\]]\[\033[00m\]\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment