-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot.zshrc.darwin
107 lines (91 loc) · 1.98 KB
/
dot.zshrc.darwin
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
#
# .zshrc for macOS
#
path=( /usr/libexec $path )
#
# Boxen
#
[ -r "/opt/boxen/env.sh" ] && source /opt/boxen/env.sh
# mysql
if [ -S "$BOXEN_HOME/data/mysql/socket" ]; then
if [ ! -h "/tmp/mysql.sock" ]; then
ln -s $BOXEN_HOME/data/mysql/socket /tmp/mysql.sock
fi
fi
#
# Homebrew
#
export HOMEBREW_NO_AUTO_UPDATE=1
if [ -d "/opt/boxen/homebrew" ]; then
BREW_ROOT=/opt/boxen/homebrew
elif [ -d "/opt/homebrew" ]; then
BREW_ROOT=/opt/homebrew
else
BREW_ROOT=/usr/local
fi
ANYENV_ROOT=$HOME/.anyenv
BIN_PATH=$BREW_ROOT/bin
if [ -d "$ANYENV_ROOT" ]; then
export PATH="$ANYENV_ROOT/bin:$PATH"
for D in `command ls $ANYENV_ROOT/envs`
do
export PATH="$ANYENV_ROOT/envs/$D/shims:$PATH"
done
fi
function anyenv_init() {
eval "$(anyenv init - --no-rehash)"
}
function anyenv_unset() {
unset -f goenv
unset -f nodenv
unset -f phpenv
unset -f pyenv
unset -f rbenv
}
function goenv() {
anyenv_unset
anyenv_init
goenv "$@"
}
function nodenv() {
anyenv_unset
anyenv_init
nodenv "$@"
}
function phpenv() {
anyenv_unset
anyenv_init
phpenv "$@"
}
function pyenv() {
anyenv_unset
anyenv_init
pyenv "$@"
}
function rbenv() {
anyenv_unset
anyenv_init
rbenv "$@"
}
# curl
[ -x "$BREW_ROOT/opt/curl/bin/curl" ] \
&& path=( $BREW_ROOT/opt/curl/bin $path )
# gnu coreutils
[ -d "$BREW_ROOT/opt/coreutils/libexec/gnubin" ] \
&& path=( $BREW_ROOT/opt/coreutils/libexec/gnubin $path )
# google-cloud-sdk
if [ -d "$BREW_ROOT/Caskroom/google-cloud-sdk" ]; then
source $BREW_ROOT/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
fi
# java
[ -d /Library/Java/Home ] \
&& export JAVA_HOME=/Library/Java/Home
# zsh-completions
if [ -d "$BREW_ROOT/opt/zsh-completions/share/zsh-completions" ]; then
fpath=( $BREW_ROOT/opt/zsh-completions/share/zsh-completions $fpath )
fi
#
# iTerm2 Shell Integration
#
[ -d "$HOME/.iterm2" ] && path=( $HOME/.iterm2 $path )
test -e "$HOME/.iterm2/shell_integration.zsh" && source "$HOME/.iterm2/shell_integration.zsh"