-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.shell_interactive.sh
144 lines (115 loc) · 3.62 KB
/
.shell_interactive.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
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
#!/usr/bin/env bash
#----- detect platform
PLATFORM=$(uname)
PLATFORM_FULL=$(uname -a)
MACH_TYPE=$(uname -m)
if [[ "$PLATFORM" == "Darwin" && "$MACH_TYPE" == "arm64" ]]; then
IS_MACOS_ARM=1
fi
if [[ "$PLATFORM" == "Darwin" ]]; then
if [[ -n "$IS_MACOS_ARM" ]]; then
MACOS_BREW_PREFIX="/opt/homebrew"
else
MACOS_BREW_PREFIX="/usr/local/Homebrew"
fi
fi
#----- increase history file sizes
export HISTSIZE=5000
export HISTFILESIZE=10000
#----- set preferred editor and mode(s)
export EDITOR=vim
#----- misc settings
export REPORTTIME=3
# explicitly set TERM to fix issues with tmux
export TERM=xterm-256color
source "$HOME"/.shell_aliases
if [[ "$PLATFORM" == "Linux" ]]; then
alias bat=batcat
alias cat=batcat
else
alias cat=bat
fi
#----- node config
# linuxbrew
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew";
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar";
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew";
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin${PATH+:$PATH}";
export MANPATH="/home/linuxbrew/.linuxbrew/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}";
# add yarn global bin path
if [[ -e "$HOME/.yarn/bin" ]]; then
export PATH=$HOME/.yarn/bin:$PATH
fi
#----- add android sdk paths
if [[ -e "$HOME/Android/sdk" ]]; then
export ANDROID_SDK_ROOT=$HOME/Android/sdk
elif [[ -e $HOME/Library/Android/sdk ]]; then
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
fi
if [[ -n "$ANDROID_SDK_ROOT" ]]; then
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
fi
#----- add system agnostic apps to path
export PATH=$PATH:$HOME/bin:$HOME/.local/bin
#----- add fastlane to path
if [[ -e "$HOME/.fastlane/bin" ]]; then
export PATH=$HOME/.fastlane/bin:$PATH
fi
#----- php version manager
if [[ -e "${HOME}/.php-version" ]] ; then
export PHP_VERSIONS="${HOME}/.php-version/versions"
source $HOME/.php-version/php-version.sh && php-version 5
fi
#----- ruby
#export PATH="$HOME/.rbenv/bin:$PATH"
#if command -v rbenv >/dev/null; then
# eval "$(rbenv init -)"
#fi
#
#if command -v ruby >/dev/null && command -v gem >/dev/null; then
# PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
#fi
#----- golang
export GOPATH="$HOME/work/go"
export PATH="$HOME/.local/go/bin":"$GOPATH/bin":$PATH
#----- rust
if [[ -e "$HOME/.cargo" ]]; then
source "$HOME/.cargo/env"
fi
#----- postgres
if [[ "$PLATFORM" == "Darwin" ]]; then
for pg_dir in /opt/homebrew/opt/postgresql*/bin; do
export PATH=:$pg_dir:$PATH
done
fi
#----- git-subrepo
if [[ -e $HOME/.git-subrepo/.rc ]]; then
source $HOME/.git-subrepo/.rc
fi
#----- python
if command -v register-python-argcomplete > /dev/null; then
eval "$(register-python-argcomplete pipx)"
fi
#----- deno
export PATH=$PATH:$HOME/.deno/bin
#----- volta
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
#----- kubectl krew
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
#----- homebrew gnu utils
export PATH="$MACOS_BREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
#----- keychain agent
if command -v keychain > /dev/null; then
eval "$(keychain --eval --quiet)"
fi
#----- google drive
if command -v google-drive-ocamlfuse > /dev/null && test -z "$WSL_DISTRO_NAME"; then
GDRIVE_FOLDER="Google.Drive"
mount | grep "${HOME}/${GDRIVE_FOLDER}" >/dev/null || google-drive-ocamlfuse "${HOME}/${GDRIVE_FOLDER}" &
fi
#----- source any custom shell configuration
[[ -f $HOME/.shellrc_custom.sh ]] && source $HOME/.shellrc_custom.sh