-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_profile
157 lines (125 loc) · 3.98 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
149
150
151
152
153
154
155
156
157
# options
set -o notify
shopt -s autocd cdspell checkjobs checkwinsize extglob histappend histreedit histverify
if [ "${BASH_VERSINFO[0]}" -ge "4" ] ; then
shopt -s dirspell globstar nullglob
fi
ANDROID_SDK_BASE="${HOME}/android-sdk-macosx"
if [ -d "${ANDROID_SDK_BASE}" ] ; then
export PATH="${ANDROID_SDK_BASE}/platform-tools:${ANDROID_SDK_BASE}/tools:${PATH}"
fi
export BLOCKSIZE="k"
export EDITOR="nvim"
export PAGER="less -FirSwX"
export MANPAGER="less -FiRswX"
export LESS="-iRw"
hash lesspipe &>/dev/null && eval "$(SHELL=/bin/sh lesspipe)"
export HISTIGNORE="&:[bf]g:exit:reset:clear:ls:pwd:[ ]*"
export HISTCONTROL="ignoreboth:erasedups"
export HISTSIZE=-1
export HISTFILESIZE=-1
export HISTTIMEFORMAT='%F %T '
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# PDSH
export PDSH_SSH_ARGS_APPEND="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
export PDSH_RCMD_TYPE="ssh"
# VirtualEnv
export WORKON_HOME="${HOME}/Envs"
[ -f "${HOME}/.local/bin/virtualenvwrapper.sh" ] && source "${HOME}/.local/bin/virtualenvwrapper.sh"
# aliases
ls_alias="ls -FGhp"
if ${ls_alias} -d --color &>/dev/null ; then
alias ls="${ls_alias} --color=auto"
else
alias ls="${ls_alias}"
fi
alias grep="grep --color=auto"
if [ -x /Applications/Tailscale.app/Contents/MacOS/Tailscale ]; then
alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
fi
# prompt
if hash tput &>/dev/null && tput setaf 1 &>/dev/null ; then
CLEAR="\[\e[0m\]"
RED="\[\e[01;31m\]"
CYAN="\[\e[01;36m\]"
BLUE="\[\e[01;34m\]"
if [[ ${UID} == 0 ]] ; then
PS1="${RED}\h${BLUE} \w # "
else
PS1="${CYAN}\u@\h${BLUE} \w \$ "
fi
else
CLEAR=""
if [[ ${UID} == 0 ]] ; then
PS1="\u@\h \w # "
else
PS1="\u@\h \w \$ "
fi
fi
export PROMPT_COMMAND="history -a; ${PROMPT_COMMAND}"
export PROMPT_DIRTRIM=4
export PS1=${CLEAR}${PS1}${CLEAR}
if [ -x /opt/homebrew/bin/brew ] ; then
eval "$(/opt/homebrew/bin/brew shellenv)"
if [ -f "${HOMEBREW_PREFIX}/share/bash-completion/bash_completion" ] ; then
source "${HOMEBREW_PREFIX}/share/bash-completion/bash_completion"
fi
fi
if hash nvim &>/dev/null ; then
alias vi=nvim
alias vim=nvim
fi
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ] ; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ] ; then
. /etc/bash_completion
fi
fi
if hash arc &>/dev/null ; then
source "$( cd $( dirname $( readlink $( which arc )))/.. && pwd -P )/resources/shell/bash-completion"
fi
if hash java_home &>/dev/null ; then
export JAVA_HOME=$( /usr/libexec/java_home )
fi
if hash keychain &>/dev/null ; then
eval "$( keychain --eval $HOME/.ssh/id_rsa )"
fi
# If in tmux, make sure env is up-to-date
if [ -n "${TMUX}" ] ; then
tmux_env_update='eval "$(/usr/bin/tmux show-env -s)"; /usr/bin/tmux setw -u automatic-rename; printf "\033]2;\033\\"'
# Bash >=4.4 we can pre-exec an update
if [ "${BASH_VERSINFO[0]}" -ge "4" ] && [ "${BASH_VERSINFO[1]}" -ge "4" ] ; then
export PS0="${tmux_env_update}; ${PS0}"
else
export PROMPT_COMMAND="${tmux_env_update}; ${PROMPT_COMMAND}"
fi
fi
if hash kubectl &>/dev/null ; then
eval "$( kubectl completion bash )"
fi
if hash minikube &>/dev/null ; then
source <(minikube completion bash)
fi
if hash aws &>/dev/null ; then
complete -C '~/.local/aws/bin/aws_completer' aws
fi
if hash rbenv &>/dev/null ; then
eval "$(rbenv init - bash)"
fi
if hash orb &>/dev/null ; then
source "${HOME}/.orbstack/shell/init.bash" 2>/dev/null || :
fi
if hash go &>/dev/null ; then
GOBIN="$(go env GOBIN)"
export PATH="${GOBIN:-$(go env GOPATH)/bin}:${PATH}"
fi
if hash direnv &>/dev/null ; then
eval "$(direnv hook bash)"
fi
export PATH="${HOME}/bin:${HOME}/.local/bin:${HOME}/.poetry/bin:${HOME}/.cargo/bin:${PATH}"
[[ -r "${HOME}/.bash_local" ]] && source "${HOME}/.bash_local"
# Added by OrbStack: command-line tools and integration
source ~/.orbstack/shell/init.bash 2>/dev/null || :
. "$HOME/.cargo/env"