Created
October 10, 2013 16:33
-
-
Save michaelminter/6921394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Have no idea which one is the right one | |
| ## | |
| # Your previous /Users/michaelminter/.bash_profile file was backed up as /Users/michaelminter/.bash_profile.macports-saved_2011-12-30_at_11:11:57 | |
| ## | |
| # MacPorts Installer addition on 2011-12-30_at_11:11:57: adding an appropriate PATH variable for use with MacPorts. | |
| export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
| export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH" | |
| export PATH="/Users/michaelminter/bin:$PATH" | |
| # Finished adapting your PATH environment variable for use with MacPorts. | |
| # Changes PS1 | |
| # export PS1='\[\033[00;35m\]\w\[\033[00m\]\[\033[01;33m\]`git branch 2>/dev/null|cut -f2 -d\* -s`\[\033[00m\]\$ ' | |
| # Git status bash prompt | |
| # | |
| # In addition to printing the current working directory, this prompt will | |
| # show a number of things if you are in a git repository: | |
| # - The current branch you are in | |
| # - Whether there are untracked files in the repository (there will be an | |
| # asterisk after the branch nome if there are) | |
| # - Whether there are any unmerged/unstaged/staged changes or if the directory | |
| # is clean. See below for the colors that will be used, and change them if | |
| # you'd like. | |
| # Storing these color codes for later use | |
| txtblk='\033[0;30m' # Black - Regular | |
| txtred='\033[0;31m' # Red | |
| txtgrn='\033[0;32m' # Green | |
| txtylw='\033[0;33m' # Yellow | |
| txtblu='\033[0;34m' # Blue | |
| txtpur='\033[0;35m' # Purple | |
| txtcyn='\033[0;36m' # Cyan | |
| bldblk='\033[1;30m' # Black - Bold | |
| bldred='\033[1;31m' # Red | |
| bldgrn='\033[1;32m' # Green | |
| bldylw='\033[1;33m' # Yellow | |
| bldblu='\033[1;34m' # Blue | |
| bldpur='\033[1;35m' # Purple | |
| bldcyn='\033[1;36m' # Cyan | |
| # Set color for the directory listing in the prompt | |
| dir_listing_color=$txtpur | |
| # Set colors for different repository states | |
| unmerged_color=$bldpur | |
| unstaged_color=$bldred | |
| staged_color=$bldcyn | |
| clean_color=$bldblu | |
| function git_color { | |
| git_status=`git status 2> /dev/null` | |
| if [ -n "`echo $git_status | grep "# Unmerged paths:"`" ]; then | |
| echo -e $unmerged_color | |
| elif [ -n "`echo $git_status | grep "# Changes not staged for commit:"`" ]; then | |
| echo -e $unstaged_color | |
| elif [ -n "`echo $git_status | grep "# Changes to be committed:"`" ]; then | |
| echo -e $staged_color | |
| else | |
| echo -e $clean_color | |
| fi | |
| } | |
| function git_branch { | |
| git_branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
| if [ -n "`git status 2> /dev/null | grep "# Untracked files:"`" ]; then | |
| untracked="*" | |
| fi | |
| if [ "`expr "$git_branch" : '.*'`" -gt "0" ]; then | |
| echo " "$git_branch$untracked | |
| fi | |
| } | |
| PS1='\[`echo -e $dir_listing_color`\]\w\[`git_color`\]`git_branch`\[\e[0m\]$ ' | |
| PS2="> " | |
| # Aliases | |
| alias ls='ls -G' | |
| alias ll='ls -G -l' | |
| alias sfm='cd ~/Sites/sfm' | |
| alias c='script/console' | |
| alias start='script/server start' | |
| alias log='tail -f log/development.log' | |
| alias co='git checkout' | |
| alias pull='git pull origin' | |
| alias push='git push origin' | |
| alias s='git status' | |
| alias firefox='/Applications/Firefox.app/Contents/MacOS/firefox' | |
| alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" | |
| alias gdiff="git diff --color-words" | |
| alias hpush='git push heroku master' | |
| alias grep='GREP_COLOR="1;33;40" LANG=C grep --colour=auto' | |
| alias n='notes.rb' | |
| alias pry="pry -r ./config/environment" | |
| alias e="gem env gemdir" | |
| mkdir -p ~/Library/LaunchAgents | |
| cp /usr/local/Cellar/mongodb/2.0.2-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents/ | |
| launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment