#zdep modules
### vim:ft=zsh:foldmethod=marker
###
### zsh variables
###   only exporting vars, that are needed in my environment
###
### Frank Terbeck <ft@bewatermyfriend.org>
### Last-Modified: Sun Aug 10 22:04:54 2008
###
### URI: <http://ft.bewatermyfriend.org/comp/zsh.html>
###

### $hosts/$sudo_hosts {{{

hosts=(
    ### ftp sites
    ftp.de.debian.org
    ftp.kernel.org
    ftp.ccc.de
    ftp.idsoftware.com
    sunsite.rwth-aachen.de
    ftp.{free,net,open}bsd.org
    ### http
    www.dawi.net
    www.schopppe.de
    www.bewatermyfriend.org
    www.rwth-aachen.de
    ### other
    finger.kernel.org
    ### dyndns
    hawk3ye.is-a-geek.org
    ### loopback
    127.0.0.1
    ### lan
    192.168.110.1
    192.168.110.4
    192.168.110.10
    192.168.110.100
    192.168.110.120
    192.168.110.127
    192.168.110.128
)

### hosts where I normally got sudo privileges. (see 'aliases')
### format: comma-seperated-user-list@hostname
sudo_hosts=( magnum,hawk,ft@fhm hawk@fsst magnum@earthbound )

### }}}
### prompts {{{
### simple prompt; i _love_ simplicity; (okay, it got a little colorful by now)
###   well, it looks pretty messy at first sight.
###
###   so, here we go:
###
###     %(?..[%?]-)         will display      '[return-code]-'    only if the last command returned non-zero
###     %1(j.(j:%j%)-.)     displays          '(j: job-count)-'   only if you got 1 or more background jobs running
###     (%!)-               always displays   '(history number)-'
###     %3~                 displays the last 3 dirs you're in. eg. 'src/project-x.y.z/src' when you're in '/usr/src/project-x.y.z/src'
###     %#                  '#' for root; '%' for regular users
###
###   so the prompt may look like this:
###     (12345)-/usr/src%
###     [130]-(12345)-/usr/src%
###     (j: 2)-(12345)-/usr/src%
###     [130]-(j: 2)-(12345)-/usr/src%
###
### If I'm in a git repo, my prompt tells me about the currently checked out branch.
###   (12345)-/usr/src [master]-%
###
###   coloring makes things a little hard to read (still better than escape codes!)
###     %{${fg[cyan]}%}
###     %{${bg[red]}%}
###
###   i'm including an uncolored prompt for readability
###

### define some prompts for a prompt_sw()
# colored prompts get unreadable if everything is put into one line
# see the corresponding UNCOLORED_ versions for how they look.
# So, these are the pieces that are used to setup $PS1
C_RETVAL="%(?..%{${fg[white]}%}%{${bg[red]}%}[%?]%{${reset_color}%}-)"
C_JOBNUM="%1(j.(%{${fg[cyan]}%}j: %j%{${reset_color}%}%)-.)"
C_HISTEV="(%{${fg[red]}%}%!%{${reset_color}%}%)"
C_SHPATH="%{${fg[yellow]}%}%3~%{${reset_color}%}"
# my prompt, heavily colored
COLORED_PROMPT="${C_RETVAL}${C_JOBNUM}${C_HISTEV}-${C_SHPATH}"'$(prompt_git c)'"%# "
COLORED_OLD_PROMPT="${C_RETVAL}${C_HISTEV}-${C_SHPATH}%# "
# old prompt
# my prompt, without colors
UNCOLORED_PROMPT="%(?..[%?]-)%1(j.(j: %j%)-.)(%!%)-%3~"'$(prompt_git nc)'"%# "
UNCOLORED_OLD_PROMPT="%(?..[%?]-)(%!%)-%3~%# "
# super simple
SIMPLE_PROMPT="zsh%% "

### '%j' is only available in zsh 4.1+
if zis_41 "atleast" ; then
    if (( ZHAVE_COLORS > 0 )) ; then
        PROMPT="${COLORED_PROMPT}%{${fg[cyan]}%}"
        POSTEDIT="${reset_color}"
    else
        PROMPT=${UNCOLORED_PROMPT}
    fi
else
    if (( ZHAVE_COLORS > 0 )) ; then
        PROMPT="${COLORED_OLD_PROMPT}%{${fg[cyan]}%}"
        POSTEDIT="${reset_color}"
    else
      PROMPT=${UNCOLORED_OLD_PROMPT}
    fi
fi

### right-prompt; tell me where I am, if I'm on a remote machine
if [[ -n ${SSH_CLIENT} ]] ; then
    if (( ZHAVE_COLORS > 0 )) ; then
        RPROMPT="%{${fg[red]}%}"'['"%{${fg[cyan]}%}%n%{${reset_color}%}@%{${fg[cyan]}%}%m%{${fg[red]}%}"']'"%{${fg[cyan]}%}"
    else
        RPROMPT="[%n@%m]"
    fi
fi

### spelling-correction prompt
C_WRONG=\'"%{${fg[yellow]}%}%R%{${reset_color}%}"\'
C_CORRECTED=\'"%{${fg[magenta]}%}%r%{${reset_color}%}"\'
C_CHOICES="%{${fg[yellow]}%}Y%{${fg[magenta]}%}N%{${fg[green]}%}E%{${fg[red]}%}A%{${reset_color}%}"
[[ ${ZHAVE_COLORS} -gt 0 ]] && \
    SPROMPT="zsh: correct ${C_WRONG} to ${C_CORRECTED}? (${C_CHOICES}) "

### }}}
### $VARIABLES {{{

### if the execution of a command takes longer than
### REPORTTIME (in seconds), time statistics are printed
REPORTTIME=4

### setup history
HISTSIZE=9999
HISTFILE="${HOME}/.zhistory"
SAVEHIST=6000

### dirstack
DIRSTACKSIZE=30

### pager
export PAGER="less"

### browser
export BROWSER="w3m"

### editor and visual editor settings
export EDITOR='ed'
export VISUAL='vim'

### character type
export LC_CTYPE=de_DE@euro
#export LC_CTYPE=de_DE.UTF-8

### nullcommands
NULLCMD="cat"
READNULLCMD=${PAGER:-more}

### run-help
HELPDIR="${ZRC_SOURCE_DIR}/help"

### various apps support $TMPDIR to use someting else than '/tmp'
export TMPDIR="${HOME}/tmp"

### }}}
### variables for some tools {{{

### man
export MANWIDTH=80

### slrn
export SLRNHELP="${HOME}/etc/slrn/slrnhelp"

### less
export LESS_TERMCAP_mb="${fg[cyan]}"
export LESS_TERMCAP_md="${fg_bold[blue]}"
export LESS_TERMCAP_me="${reset_color}"
export LESS_TERMCAP_se="${reset_color}"
export LESS_TERMCAP_so="${fg[yellow]}${bg[blue]}"
export LESS_TERMCAP_ue="${reset_color}"
export LESS_TERMCAP_us="${fg[magenta]}"


### these are used by my kget() function
FTP_KERNEL_ORG="ftp://ftp.de.kernel.org"
FTP_KERNEL_ORG_DL="${HOME}/src/tars"

### kmake() function
KERNEL_COMPILER="/usr/bin/gcc-4.1"
KERNEL_BUILD_DIR="${HOME}/src/kbuild"

### lookup()
X_BROWSER_REMOTE="mozilla-firefox"

### dch
export DEBFULLNAME='Frank Terbeck'
export DEBEMAIL='ft@bewatermyfriend.org'
       GRMLEMAIL='ft@grml.org'

### }}}