]> arthur.barton.de Git - ax-zsh.git/blob - core/30_path/30_path.zprofile
Set "path" and "manpath" as "unique" type (-U), too!
[ax-zsh.git] / core / 30_path / 30_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 typeset -U path
12
13 # Prepend additional search paths
14 for d (
15         /Developer/usr/bin
16         /usr/ucb
17         /usr/pkg/bin
18         /usr/local/bin
19         /usr/local/sbin
20         /opt/*/bin(NOn)
21         /opt/*/sbin(NOn)
22         /home/linuxbrew/.linuxbrew/bin
23         /home/linuxbrew/.linuxbrew/sbin
24         ~/.linuxbrew/bin
25         ~/.linuxbrew/sbin
26         ~/.gem/ruby/*/bin(NOn)
27         ~/.go/bin
28         ~/.cargo/bin
29         ~/.local/bin
30         ~/bin
31         ~/sbin
32         ~/Applications
33 ); do
34         [[ -d "$d" ]] && path=("$d" $path)
35 done
36
37 # Append additional search paths
38 for d (
39         /usr/X11/bin
40         /usr/local/games
41         /usr/games
42 ); do
43         [[ -d "$d" ]] && path=($path "$d")
44 done
45
46 # Set default MANPATH
47 MANPATH="$(manpath -q)" 2>/dev/null
48 if [[ $? -ne 0 ]]; then
49         for d (
50                 ~/share/man
51                 ~/man
52                 ~/.linuxbrew/share/man
53                 /home/linuxbrew/.linuxbrew/share/man
54                 /opt/*/share/man(NOn)
55                 /opt/*/man(NOn)
56                 /usr/share/man
57                 /usr/local/share/man
58         ); do
59                 [[ -d "$d" ]] && manpath=($manpath "$d")
60         done
61 fi
62 typeset -Ux MANPATH
63 typeset -U manpath