blob: df81cbe677a17a3d97cf70e5e4eba190a0150dce (
plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
#Java HOME Adition
export JAVA_HOME=$(/usr/libexec/java_home)
export TERM=screen-256color
#git function
function _set_git_envar_info() {
GIT_BRANCH=""
GIT_PREFIX=""
GIT_STATE=""
CHECK_SHIT="lol"
RVM_COMMAND=$(rvm-prompt)
if [[ $RVM_COMMAND == "" ]]
then
RVM_COMMAND="system"
fi
if [ -f `which git` ];
then
local STATUS
STATUS=$(git status 2>/dev/null)
if [[ -z $STATUS ]]
then
return
fi
GIT_BRANCH="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
if [[ -n "$GIT_BRANCH" ]]
then
GIT_PREFIX=" on "
fi
if [[ "$STATUS" == *'working directory clean'* ]]
then
GIT_STATE=""
else
GIT_STATE=""
if [[ "$STATUS" == *'Changes to be committed:'* ]]
then
GIT_STATE='!' # Index has files staged for commit
fi
if [[ "$STATUS" == *'Changed but not updated:'* ]]
then
GIT_STATE="?" # Working tree has files modified but unstaged
fi
if [[ "$STATUS" == *'Untracked files:'* ]]
then
GIT_STATE='?' # Working tree has untracked files
fi
fi
fi
}
export -f _set_git_envar_info
#this thing for my prompt.
export PROMPT_COMMAND="_set_git_envar_info"
export 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\$ '
#display fortune when I start
echo -e "\033[30m"
/usr/local/bin/fortune
echo -e "\033[m"
#Editor.
export EDITOR="vim"
export VISUAL="vim"
#some aliases.
alias dwarffortress="/Applications/Dwarf\ Fortress/df"
alias ls="ls -FG"
alias rspec="rspec --color"
#Git utility aliases
alias gpsc="git push origin $GIT_BRANCH"
alias gplc="git pull origin $GIT_BRANCH"
#Enable Bash Completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
#Screeninator and RVM scripts
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
|