initial
[zsh.git] / .zsh / 10_Environment.zsh
1 # -*- mode: sh;-*-
2
3 export SHELL=`which zsh`
4
5 ## Colors
6 c_='\e['$color[none]";"
7 _c=m
8 C_="%{$c_"
9 _C="$_c%}"
10
11 unset has_termcaps
12 [ $TERM = "urxvt" -o $TERM = "screen" -o $TERM = "rxvt-unicode" ] && has_termcaps="true"
13 T_=${has_termcaps:+$termcap[as]}
14 _T=${has_termcaps:+$termcap[ae]}
15 _t_q=${${has_termcaps:+q}:--}
16 _t_j=${${has_termcaps:+j}:-[}
17 _t_k=${${has_termcaps:+k}:-[}
18 _t_l=${${has_termcaps:+l}:-]}
19 _t_m=${${has_termcaps:+m}:-]}
20 _t_t=${${has_termcaps:+t}:-]}
21 _t_u=${${has_termcaps:+u}:-[}
22
23 # I hate kik00l0l colorized prompts, so I'm using a way to
24 # give a dominant color for each part of the prompt, each of
25 # these remain still configurable one by one.
26 # Take a look to set_prompt_colors for these colorizations.
27 #
28 # To set the dominant color I'm using this :
29 #
30 # - PS1_ROOT when we are root
31 # - PS1_USER for normal usage
32 #
33 # I'm storing the resulting dominant color in $prompt_colors[generic]
34
35 PS1_ROOT=${PS1_ROOT:-$color[red]}
36 PS1_USER=${PS1_USER:-$color[blue]}
37 PS1_YEAH="38;5;82"
38
39 export PATH=$PATH:~/sbin:~/local/bin
40 PATH=/sbin:/usr/sbin:$PATH
41 export MANPATH=~/man:~/local/share/man:/usr/local/share/man:$MANPATH
42 export INFOPATH=~/info:~/local/share/info:/usr/local/share/info:$INFOPATH
43 typeset -gU MANPATH INFOPATH
44
45 if [ -w $ZDOTDIR ]; then
46 mkdir -p ${ZDOTDIR}/var
47 HISTFILE=$ZDOTDIR/var/history.$USER.$HOST
48 else
49 HISTFILE=~$HOME/.zsh_history.$HOST
50 fi
51
52 # Size of history
53 SAVEHIST=50000
54 HISTSIZE=$(( $SAVEHIST * 1.10 ))
55
56 ## maximum size of the directory stack.
57 DIRSTACKSIZE=20
58 # $zdirstore is the file used to persist the stack
59 zdirstore=${ZDOTDIR}/var/.zdirstore
60 dirpersistrestore
61
62 export GPG_TTY=$(tty)
63
64 export PAGER="$(which less)"
65 (( ${+DEBFULLNAME} )) || export DEBFULLNAME='Joerg Jaspert'
66 (( ${+DEBNAME} )) || export DEBNAME='Joerg Jaspert'
67 (( ${+DEBEMAIL} )) || export DEBEMAIL='joerg@debian.org'
68 export LESS='-X -R -f -j 3'
69 (( ${+TMPDIR} )) || export TMPDIR="$HOME/tmp"
70 export GREP_OPTIONS='--color=auto'
71
72 READNULLCMD=${PAGER}
73 NULLCMD=${PAGER}
74
75 # If its installed - use lesspipe
76 [ -x /bin/lesspipe ] && eval $(lesspipe)