forked from AI21Labs/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 61
/
bash_profile.sh
83 lines (62 loc) · 2.14 KB
/
bash_profile.sh
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
# load shared shell configuration
source ~/.shprofile
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# check if this is a login and/or interactive shell
[ "$0" = "-bash" ] && export LOGIN_BASH=1
echo "$-" | grep -q "i" && export INTERACTIVE_BASH=1
# run bashrc if this is a login, interactive shell
if [ -n "$LOGIN_BASH" ] && [ -n "$INTERACTIVE_BASH" ]
then
source ~/.bashrc
fi
# Set HOST for ZSH compatibility
export HOST="$HOSTNAME"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Enable history appending instead of overwriting.
shopt -s histappend
# Save multiline commands
shopt -s cmdhist
# Correct minor directory changing spelling mistakes
shopt -s cdspell
# Bash completion
[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
[ -f "$HOMEBREW_PREFIX/etc/bash_completion" ] && source "$HOMEBREW_PREFIX/etc/bash_completion" >/dev/null
# Colorful prompt
if [ "$USER" = "root" ]
then
PS1='\[\033[01;35m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
elif [ -n "${SSH_CONNECTION}" ]
then
PS1='\[\033[01;36m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
else
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \W #\[\033[00m\] '
fi
# only set key bindings on interactive shell
if [ -n "$INTERACTIVE_BASH" ]
then
# fix delete key on macOS
[ "$MACOS" ] && bind '"\e[3~" delete-char'
# alternate mappings for Ctrl-U/V to search the history
bind '"^u" history-search-backward'
bind '"^v" history-search-forward'
fi
# Init jenv
if which jenv > /dev/null; then eval "$(jenv init -)"; fi
# Init pyenv
eval "$(pyenv init -)"
# Init pyenv-virtualenv
eval "$(pyenv virtualenv-init -)"
# Pipenv shell completions
eval "$(pipenv --completion)"
# Init nodenv
eval "$(nodenv init -)"
export PATH="/usr/local/opt/gettext/bin:$PATH"
export PATH="/usr/local/opt/node@10/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export CLOUDSDK_PYTHON=python3
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc'
source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc'