-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_profile
More file actions
76 lines (69 loc) · 2.28 KB
/
bash_profile
File metadata and controls
76 lines (69 loc) · 2.28 KB
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
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
export BASH_SILENCE_DEPRECATION_WARNING=1
export PATH=$PATH:/usr/local/sbin
export PATH="$PATH:/usr/local/opt/node@6/bin"
export EDITOR="atom -nw"
# initialize rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
if [ -f ~/.aliases.bash ]; then source ~/.aliases.bash; fi
if [ -f ~/.git-completion.bash ]; then source ~/.git-completion.bash; fi
if [ -f ~/.passwords.bash ]; then source ~/.passwords.bash; fi
if [ -f ~/.ssh_shortcuts.bash ]; then source ~/.ssh_shortcuts.bash; fi
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[0;34m\]'
c_git_clean='\[\e[0;36m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;35m\]'
else
c_reset=
c_user=
c_path=
c_git_clean=
c_git_staged=
c_git_unstaged=
fi
# Colorized man pages
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
git_prompt ()
{
GIT_DIR=`git rev-parse --git-dir 2>/dev/null`
if [ -z "$GIT_DIR" ]; then
return 0
fi
GIT_HEAD=`cat $GIT_DIR/HEAD`
GIT_BRANCH=${GIT_HEAD##*/}
if [ ${#GIT_BRANCH} -eq 40 ]; then
GIT_BRANCH="(no branch)"
fi
STATUS=`git status --porcelain`
if [ -z "$STATUS" ]; then
git_color="${c_git_clean}"
else
echo -e "$STATUS" | grep -q '^ [A-Z\?]'
if [ $? -eq 0 ]; then
git_color="${c_git_unstaged}"
else
git_color="${c_git_staged}"
fi
fi
echo "[$git_color$GIT_BRANCH$c_reset] "
}
PROMPT_COMMAND="PS1=\"\$(git_prompt)${c_user}\u${c_reset} ${c_path}\w${c_reset} :: \" ;"