-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshenv
40 lines (36 loc) · 966 Bytes
/
.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
# nicer path configuration and lookup
function path {
if [[ $# -eq 0 ]]; then
echo -e ${PATH//:/\\n} | sort
elif [[ "$1" == "--save" ]]; then
path $2 && echo "\npath $2" >> $HOME/.profile
else
if [[ -d "$1" ]] ; then
if [[ -z "$PATH" ]] ; then
export PATH=$1
else
export PATH=$1:$PATH
fi
else
echo "$1 does not exist :("
return 1
fi
fi
}
# starting clean
export PATH="/usr/sbin"
# add some more common defaults
path . # no need to use ./ to execute local scripts
path /bin
path /sbin
path /usr/bin
path /usr/local/bin
path ~/bin
# in case of weird paths problems: check /etc/zprofile on OSX and do not start the path_helper
# which messes with the path and tends to reorder it - very bad!
# Ensure that all shells have a defined environment.
if [[ ! -o login && ! -o interactive ]]; then
. $HOME/.zshrc
fi
# include local, unversioned settings
[[ -e ~/.profile ]] && source ~/.profile