Skip to content

Instantly share code, notes, and snippets.

@dcalacci
Created September 6, 2012 23:48
Show Gist options
  • Save dcalacci/3661500 to your computer and use it in GitHub Desktop.
Save dcalacci/3661500 to your computer and use it in GitHub Desktop.
bash_profile
# Added by install_latest_perl_osx.pl
[ -r /Users/Dan/.bashrc ] && source /Users/Dan/.bashrc
[[ -s "/Users/Dan/.rvm/scripts/rvm" ]] && source "/Users/Dan/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
## PATH variables
export PATH="$HOME/bin/Racket\ v5.2.1/bin/:$PATH" # Racket
export PATH=/Users/Dan/bin/google/android-sdk-macosx/tools/:$PATH #Android development
alias mips='java -jar /Users/Dan/Dropbox/work/classes/cs2600/assembly/Mars_4_1.jar' #MIPS emulator (MARS)
function git_prompt() {
local status=`git status 2>&1`
if ! [[ $status =~ "Not a git repository" ]]; then
# get the current branch
local branch=`git branch | ack -o '(?<=\* ).*'`
# set the color according to the status of the git repo
if [[ $status =~ "nothing to commit" ]]; then
local color=32
elif [[ $status =~ "nothing added to commit but untracked files present" ]]; then
local color=34
else
local color=31
fi
echo -ne "\033["$color"m"$branch"\033[49m "
fi
}
function my_prompt() {
## PWD IN TITLE FOR NEW TAB LOCATION DETECTION
update_terminal_cwd
## GIT BRANCH AND STATUS DISPLAY
git_prompt
}
## SETTINGS ############################################################
########################################################################
# custom bash prompt
PS1='\[\e[1;31m\]\W \[\e[0;30m\]\$\[\e[0m\] '
# scripts that need to be run before display of bash prompt
PROMPT_COMMAND=my_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment