Skip to content

Instantly share code, notes, and snippets.

@sbone
Created February 17, 2012 16:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbone/1854202 to your computer and use it in GitHub Desktop.
Save sbone/1854202 to your computer and use it in GitHub Desktop.
Customized .bashrc
# RVM
export PATH="./bin:$PATH"
[[ -s "/Users/Steven/.rvm/scripts/rvm" ]] && source "/Users/Steven/.rvm/scripts/rvm"
# Git command and branch name tab-completion
source ~/git-completion.bash
# Check if directory is a Git repo
# Customized from http://vvv.tobiassjosten.net/git/add-current-git-branch-to-your-bash-prompt
git_prompt ()
{
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2; then
git_color="${c_git_clean}"
else
git_color=${c_git_dirty}
fi
echo " [$git_color$git_branch${c_reset}]"
}
# The prompt [Show Git branch if applicable]
PS1='\e[0;34m\w\e[m\e[0;36m$(git_prompt)\e[m
==> '
# Aliases
# Sublime
alias sub="~/bin/subl"
alias s="sub ."
# System
alias ..="cd .."
alias ls="ls -la"
alias rs="rails s"
alias rs31="rails s -p 3001"
alias rs32="rails s -p 3002"
alias ors="ruby script/server"
# Use Sublime as default text editor
export EDITOR="~/bin/subl -w"
# Recursively delete .DS_Store files
# http://alex.tsd.net.au/2010/09/14/recursively-remove-ds_store-files/
alias rmdst="find . -name '*.DS_Store' -type f -delete"
# instant simple server
# https://gist.github.com/1525217
alias server="open http://localhost:8000 && python -m SimpleHTTPServer"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment