]> arthur.barton.de Git - ax-zsh.git/blob - core/40_path/40_path.zprofile
40_path: Add user-local ~/sbin and ~/bin directories
[ax-zsh.git] / core / 40_path / 40_path.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 40_path.zprofile: Setup PATH environment
3
4 # Set default PATH
5 if [[ -x /usr/libexec/path_helper ]]; then
6         eval "$(/usr/libexec/path_helper)"
7 else
8         PATH="/usr/sbin:/usr/bin:/sbin:/bin"
9 fi
10 typeset -Ux PATH
11
12 # Prepend additional search paths
13 for d (
14         /Developer/usr/bin
15         /usr/ucb
16         /usr/pkg/bin
17         /usr/local/bin
18         /usr/local/sbin
19         /opt/*/bin(NOn)
20         /opt/*/sbin(NOn)
21         ~/.gem/ruby/*/bin(NOn)
22         ~/.local/bin
23         ~/bin
24         ~/sbin
25         ~/Applications
26 ); do
27         [ -d "$d" ] && path=("$d" $path)
28 done
29
30 # Append additional search paths
31 for d (
32         /usr/X11/bin
33         /usr/local/games
34         /usr/games
35 ); do
36         [ -d "$d" ] && path=($path "$d")
37 done
38
39 # Set default MANPATH
40 MANPATH="$(manpath -q)" 2>/dev/null
41 if [[ $? -ne 0 ]]; then
42         MANPATH="/usr/share/man"
43         for d (/usr/local/share/man /opt/*/man(N)); do
44                 [ -d "$d" ] && manpath=($manpath "$d")
45         done
46 fi
47 typeset -Ux MANPATH