magic space binding
[zsh.git] / .zsh / zshenv
1 # -*- mode: sh;-*-
2 ############
3 #
4 # .zshenv
5 # Written by Joerg Jaspert <joerg@debian.org>
6 #
7 ############
8
9 # We (may) use those variables wherever, so fill them now.
10 # Avoids calling the processes all the time we need em.
11 OSNAME=`uname -s`
12 USER=${USER:-`whoami`}
13 UID=${UID:-`id -u`}
14 # :r strips "extension" (a . followed by 0 or more characters)
15 HOST=$HOST:r:r
16 HOST=${HOST:-$(hostname -s)}
17 DOMAIN=${DOMAIN:-$(hostname -d 2>&-)}
18 [ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2)
19
20 [ -f /etc/debian_version ] && DISTRI="Debian"
21
22 DEBUG=${DEBUG:-no}
23
24 # Path to search for autoloadable functions.
25 fpath=( $HOME/.zsh/functions $HOME/zsh "$fpath[@]" )
26 # Only unique entries please.
27 typeset -U fpath
28 export fpath
29
30 # Include function path in script path so that we can run them even
31 # though a subshell may not know about functions.
32 # PATH should already be exported, but in case not. . .
33 path=(
34 "$HOME/bin"
35 /usr/local/bin
36 /bin
37 /usr/bin
38 /srv/qa.debian.org/mia
39 /usr/X11/bin
40 /usr/bin/X11
41 /usr/local/X11/bin
42 /usr/local/games
43 /usr/games
44 /usr/lib/nagios/plugins
45 "$fpath[@]"
46 "$path[@]"
47 "$PATH[@]"
48 )
49 if [ "`id -u`" = "0" ] || ! [ -x /usr/bin/id ]; then
50 path=(
51 "$path[@]"
52 /usr/local/sbin
53 /usr/sbin
54 /sbin
55 )
56 fi
57
58 # Only unique entries please.
59 typeset -U path
60 # Remove entries that don't exist on this system. Just for sanity's
61 # sake more than anything.
62 path=( ${^path}(N-/) )
63
64 export PATH USER HOST DOMAIN UID
65
66 # Command to use when redirecting from/to a null command.
67 # READNULLCMD is redefined in .zshrc for interactive shells.
68 READNULLCMD=cat
69 NULLCMD=cat
70
71 # Unix groups: remember the original group ID. (For prompts.)
72 if [[ ${+ORIGGID} -eq 0 ]]; then
73 export ORIGGID="$GID"
74 fi
75