]> git.r.bdr.sh - rbdr/dotfiles/blame - bash_profile
Add vim again :)
[rbdr/dotfiles] / bash_profile
CommitLineData
b100af91
BB
1export PATH=/usr/local/bin:/usr/local/sbin:$PATH
2export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
3
4#Java HOME Adition
5export JAVA_HOME=$(/usr/libexec/java_home)
6
7#Amazon Stuff
8export EC2_HOME=/Users/benbeltran/Documents/code/tools/ec2-api-tools-1.5.2.4
9export PATH=$PATH:$EC2_HOME/bin
10export EC2_PRIVATE_KEY=~/.ec2/pk-XBFB3HSRRZAILOFUPE44QAJI5M4Z5TNN.pem
11export EC2_CERT=~/.ec2/cert-XBFB3HSRRZAILOFUPE44QAJI5M4Z5TNN.pem
12
13export TERM=screen-256color
14
15#git function
16function _set_git_envar_info() {
17 GIT_BRANCH=""
18 GIT_PREFIX=""
19 GIT_STATE=""
20 CHECK_SHIT="lol"
21 RVM_COMMAND=$(rvm-prompt)
22 if [[ $RVM_COMMAND == "" ]]
23 then
24 RVM_COMMAND="system"
25 fi
26 if [[ $(which git 2> /dev/null) ]]
27 then
28 local STATUS
29 STATUS=$(git status 2>/dev/null)
30 if [[ -z $STATUS ]]
31 then
32 return
33 fi
34 GIT_BRANCH="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
35 if [[ -n "$GIT_BRANCH" ]]
36 then
37 GIT_PREFIX=" on "
38 fi
39 if [[ "$STATUS" == *'working directory clean'* ]]
40 then
41 GIT_STATE=""
42 else
43 GIT_STATE=""
44 if [[ "$STATUS" == *'Changes to be committed:'* ]]
45 then
46 GIT_STATE='!' # Index has files staged for commit
47 fi
48 if [[ "$STATUS" == *'Changed but not updated:'* ]]
49 then
50 GIT_STATE="?" # Working tree has files modified but unstaged
51 fi
52 if [[ "$STATUS" == *'Untracked files:'* ]]
53 then
54 GIT_STATE='?' # Working tree has untracked files
55 fi
56 fi
57 fi
58}
59
60export -f _set_git_envar_info
61
62#this thing for my prompt.
63export PROMPT_COMMAND="_set_git_envar_info"
64export PS1='\[\e[0;31m\]\u\[\e[0m\] at \[\e[0;33m\]\h\[\e[0m\] in \[\e[0;32m\]\w\[\e[0m\]$GIT_PREFIX\[\e[1;34m\]$GIT_BRANCH\[\e[0m\]\[\e[0;32m\]$GIT_STATE \[\e[0;33m\]($RVM_COMMAND) \[\e[0m\] \n\$ '
65
66#display fortune when I start
67echo -e "\033[30m"
68/usr/local/bin/fortune
69echo -e "\033[m"
70
71#Editor.
72export EDITOR="vim"
73export VISUAL="vim"
74
75#some aliases.
76alias dwarffortress="/Applications/Dwarf\ Fortress/df"
77alias ls="ls -FG"
78alias rspec="rspec --color"
79
80#Git utility aliases
81alias gpsc="git push origin "+$GIT_BRANCH
82alias gplc="git pull origin "+$GIT_BRANCH
83
84#Enable Bash Completion
85if [ -f `brew --prefix`/etc/bash_completion ]; then
86 . `brew --prefix`/etc/bash_completion
87fi
88
89#Screeninator and RVM scripts
90[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
91