-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_bash_profile
148 lines (122 loc) · 3.73 KB
/
_bash_profile
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Theuns Alberts .bash_profile
export EDITOR=vim
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
PLATFORM=`uname`
if [ $PLATFORM == "Darwin" ]; then
#export LSCOLORS=ExGxFxDxCxHxHxCbCeEbEb
export LSCOLORS=exgxfxdxcxhxhxcbceebeb
export LC_CTYPE=en_US.utf-8
export LC_ALL=en_US.utf-8
alias ls='ls -lF'
alias la='ls -alF'
else
alias ls='ls --color=auto'
fi
# Bash colors:
# Dark: for i in {0..9}; do echo $'\033[0;3'$i'm text' = \\033[0\;3$i\m; done
# Light: for i in {0..9}; do echo $'\033[1;3'$i'm text' = \\033[1\;3$i\m; done
DEFAULT_COLOR="[00m"
GRAY_COLOR="[0;37m"
PINK_COLOR="[0;35m"
GREEN_COLOR="[0;32m"
RED_COLOR="[0;31m"
#USER_COLOR="[1;30m"
USER_COLOR="[0;35m"
BASH_lastcommandfailed() {
code=$?
if [ $code != 0 ]; then
echo -n $'\033[31m[exited '
echo -n $code
echo -n $'] \033[37m'
fi
}
BASH_backgroundjobs() {
jobs | python -c 'if 1:
import sys
items = [i.split()[2] for i in sys.stdin.read().splitlines()]
# TA: I get (sh, sh) processes on new iterm window, so do not
# show "sh" processes
items = ["\033[36m%s\033[37m" % i for i in items if not i.startswith("sh")]
if items:
if len(items) > 2:
string = "%s, and %s" % (", ".join(items[:-1]), items[-1])
else:
string = ", ".join(items)
print("\033[37m running %s" % string)
'
}
BASH_workonvirtualenv() {
if [ x$VIRTUAL_ENV != x ]; then
if [[ $VIRTUAL_ENV == *venvs/* ]]; then
ENV_NAME=`basename "${VIRTUAL_ENV}"`
else
folder=`dirname "${VIRTUAL_ENV}"`
ENV_NAME=`basename "$folder"`
fi
echo -n $' \033[37mworkon \033[34m'
echo -n $ENV_NAME
echo -n $'\033[00m'
fi
}
BASH_parse_git_branch() {
ref=`git symbolic-ref HEAD 2> /dev/null` || return
if [[ $? == 0 ]]; then
#echo -n $' \033[37mbranch \033[30m'
echo -n $' \033[1;32m'
echo -n "["${ref#refs/heads/}"]"
echo -n $'\033[00m'
fi
}
export BASEPROMPT='\n\
`BASH_lastcommandfailed`\
\e${USER_COLOR}\u@\e${USER_COLOR}\h:\
\e${GREEN_COLOR}\w\
\e${GRAY_COLOR}\
`BASH_parse_git_branch`\
`BASH_backgroundjobs`\
`BASH_workonvirtualenv`\
\e${DEFAULT_COLOR}'
export PS1="\[\033[G\]${BASEPROMPT}
$ "
# don't let virtualenv show prompts by itself
VIRTUAL_ENV_DISABLE_PROMPT=1
if [ $PLATFORM == "Darwin" ]; then
# Some vi aliases
alias vim='mvim -v'
alias vi='mvim -v'
fi
# virtualenvwrapper
if [ `id -u` != '0' ]; then
export VIRTUALENV_DISTRIBUTE=1
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
export WORKON_HOME=$HOME/venvs
export PROJECT_HOME=$HOME/devel
source /usr/local/bin/virtualenvwrapper.sh
fi
fi
if [ $PLATFORM == "Darwin" ]; then
# Enable brew git completion and fancy prompt
if [ -d $(brew --prefix)/etc/bash_completion.d ]; then
. $(brew --prefix)/etc/bash_completion.d/git-completion.bash
fi
fi
# The next line updates PATH for the Google Cloud SDK.
#source /Users/theuns/google-cloud-sdk/path.bash.inc
# The next line enables bash completion for gcloud.
#source /Users/theuns/google-cloud-sdk/completion.bash.inc
PHP_AUTOCONF="/usr/local/bin/autoconf"
# Add environment variable NDK_ROOT for cocos2d-x
export NDK_ROOT=/Users/theuns/Library/Android/sdk/ndk-bundle
export PATH=$NDK_ROOT:$PATH
# Add environment variable ANDROID_SDK_ROOT for cocos2d-x
export ANDROID_SDK_ROOT=/Users/theuns/Library/Android/sdk
export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
# Add go to path
export PATH=$PATH:"/usr/local/go/bin"
export GPGKEY=6703D729