-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbash_profile.mac
66 lines (56 loc) · 2.1 KB
/
bash_profile.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
. /etc/profile
#export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
#export EC2_PRIVATE_KEY="$(/bin/ls $HOME/.ec2/pk-*.pem)"
#export EC2_CERT="$(/bin/ls $HOME/.ec2/cert-*.pem)"
#export EC2_HOME="/usr/local/Cellar/ec2-api-tools/1.3-57419/jars"
#export PATH=$PATH:/Users/Luke/Scripts:/usr/local/bin:$EC2_HOME/bin
#export PATH=/opt/local/bin:/opt/local/sbin:$PATH
#export PATH=$PATH:$HOME/.gem/ruby/1.8/bin
export PATH=$PATH:$HOME/bin
export LSCOLORS="cxgxcbdbdxegeddxdxcxcx"
export EDITOR="/usr/bin/vim"
function find_git_branch {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head == ref:\ refs/heads/* ]]; then
git_branch="${head#*/*/} "
elif [[ $head != '' ]]; then
git_branch='(detached) '
else
git_branch='(unknown) '
fi
return
fi
dir="../$dir"
done
git_branch=''
}
function munge_path {
munged_path=`ruby -e "y='$PWD'.sub('$HOME','~');x='';p=y.split('/');x+='.../' if p.length > 4; x+=p[[0,p.length-4].max,p.length].join('/');x+='/' if p.length==0;if x.length < y.length then print x; else print y; end;"`
}
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# colors found at http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim
RS="\[\033[0m\]" # reset
BOLD="\[\033[38;5;220m\]"
if [ "$USER" != "lehresman" ] && [ "$USER" != "lehresma" ]; then
FG="\[\033[38;5;160m\]"
else
FG="\[\033[38;5;238m\]"
fi
PS1="${FG}[${BOLD}\$git_branch${FG}\u@\h \$munged_path]\$${RS} "
PROMPT_COMMAND="munge_path; find_git_branch; $PROMPT_COMMAND"
alias ls="ls -GF"
test -r /sw/bin/init.sh && . /sw/bin/init.sh
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export REVEAL_HOME=$HOME/Code/cuegg/reveal
export GOPATH=~/Projects
[[ -s "$HOME/.bash_custom" ]] && source "$HOME/.bash_custom"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*