-
Notifications
You must be signed in to change notification settings - Fork 20
/
.zshenv
69 lines (61 loc) · 2.01 KB
/
.zshenv
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
source $HOME/.commonenv
source $HOME/.commonfuncs
# from http://zsh.dotsrc.org/Contrib/startup/users/debbiep/dot.zshenv
# rationalize-path()
# Later we'll need to trim down the paths that follow because the ones
# given here are for all my accounts, some of which have unusual
# paths in them. rationalize-path will remove
# nonexistent directories from an array.
rationalize-path () {
# Note that this works only on arrays, not colon-delimited strings.
# Not that this is a problem now that there is typeset -T.
local element
local build
build=()
# Evil quoting to survive an eval and to make sure that
# this works even with variables containing IFS characters, if I'm
# crazy enough to setopt shwordsplit.
eval '
foreach element in "$'"$1"'[@]"
do
if [[ -d "$element" ]]
then
build=("$build[@]" "$element")
fi
done
'"$1"'=( "$build[@]" )
'
}
# Take care of setting an FPATH for all occasions.
# Something seems very wrong about all of this
# look for /usr/share version
if [ -d /usr/share/zsh/$ZSH_VERSION ]; then
fpath+=(/usr/share/zsh/$ZSH_VERSION*/**/*(/))
fi
# look for /usr/local/share
if [ -d /usr/local/share/zsh/$ZSH_VERSION ]; then
fpath+=(/usr/local/share/zsh/$ZSH_VERSION*/**/*(/))
fi
# look for /opt/local/share
if [ -d /opt/local/share/zsh/$ZSH_VERSION ]; then
fpath+=(/opt/local/share/zsh/$ZSH_VERSION*/**/*(/))
fi
# Set the lowest common options
fpath+=(
/opt/zsh/zsh-completions/src
/opt/zsh/other-completions
/usr/local/share/zsh/functions
/usr/local/share/zsh/site-functions
/opt/homebrew/share/zsh/site-functions
/usr/share/zsh/site-functions
/usr/share/zsh/functions
"$fpath[@]"
)
export FPATH
# Only unique entries please.
typeset -U fpath
# Remove entries that don't exist on this system. Just for sanity's
# sake more than anything.
rationalize-path fpath
# extra per environment settings (for things like GITHUB_PACKAGE_AUTH, BUNDLE_ENTERPRISE__CONTRIBSYS__COM, and OBJC_DISABLE_INITIALIZE_FORK_SAFETY)
source $HOME/.zshenv_extras