]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - bash_profile
Update atoms
[rbdr/dotfiles] / bash_profile
... / ...
CommitLineData
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
7export TERM=screen-256color
8
9#git function
10function _set_git_envar_info() {
11 GIT_BRANCH=""
12 GIT_PREFIX=""
13 GIT_STATE=""
14 CHECK_SHIT="lol"
15 RVM_COMMAND=$(rvm-prompt)
16 if [[ $RVM_COMMAND == "" ]]
17 then
18 RVM_COMMAND="system"
19 fi
20 if [ -f `which git` ];
21 then
22 local STATUS
23 STATUS=$(git status 2>/dev/null)
24 if [[ -z $STATUS ]]
25 then
26 return
27 fi
28 GIT_BRANCH="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
29 if [[ -n "$GIT_BRANCH" ]]
30 then
31 GIT_PREFIX=" on "
32 fi
33 if [[ "$STATUS" == *'working directory clean'* ]]
34 then
35 GIT_STATE=""
36 else
37 GIT_STATE=""
38 if [[ "$STATUS" == *'Changes to be committed:'* ]]
39 then
40 GIT_STATE='!' # Index has files staged for commit
41 fi
42 if [[ "$STATUS" == *'Changed but not updated:'* ]]
43 then
44 GIT_STATE="?" # Working tree has files modified but unstaged
45 fi
46 if [[ "$STATUS" == *'Untracked files:'* ]]
47 then
48 GIT_STATE='?' # Working tree has untracked files
49 fi
50 fi
51 fi
52}
53
54export -f _set_git_envar_info
55
56#this thing for my prompt.
57export PROMPT_COMMAND="_set_git_envar_info"
58export 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;30m\]($RVM_COMMAND) \[\e[0m\] \n\$ '
59
60#display fortune when I start
61echo -e "\033[30m"
62/usr/local/bin/fortune
63echo -e "\033[m"
64
65#Editor.
66export EDITOR="vim"
67export VISUAL="vim"
68
69#some aliases.
70alias dwarffortress="/Applications/Dwarf\ Fortress/df"
71alias ls="ls -FG"
72alias rspec="rspec --color"
73
74#Git utility aliases
75alias gpsc="git push origin $GIT_BRANCH"
76alias gplc="git pull origin $GIT_BRANCH"
77
78#Enable Bash Completion
79if [ -f `brew --prefix`/etc/bash_completion ]; then
80 . `brew --prefix`/etc/bash_completion
81fi
82
83#Screeninator and RVM scripts
84[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
85