2 ZSH=$XDG_CONFIG_HOME/zsh
 
   3 ZSH_DATA=$XDG_DATA_HOME/zsh
 
   4 ZSH_CACHE=$XDG_CACHE_HOME/zsh
 
   5 [[ ! -d "$ZSH" ]]       && echo "Missing config dir: '$ZSH'"      && return
 
   6 [[ ! -d "$ZSH_CACHE" ]] && echo "Missing cache dir: '$ZSH_CACHE'" && return
 
   7 [[ ! -d "$ZSH_DATA" ]]  && echo "Missing data dir: '$ZSH_DATA'"   && return
 
   9 # Load all of the config files in $ZSH/lib that end in .zsh
 
  10 for config_file ($ZSH/lib/*.zsh); do
 
  14 # Set name of the theme to load.
 
  17 [[ -f "$ZSH/themes/${ZSH_THEME}.zsh-theme" ]] && source "$ZSH/themes/${ZSH_THEME}.zsh-theme"
 
  20 typeset -U fpath    # make fpath a unique array
 
  21 [[ -d $ZSH/functions ]] && fpath=($ZSH/functions $fpath)
 
  22 autoload -U ${fpath[1]}/*(:t)   # loads all functions in the first element of fpath
 
  24 # initialise completion
 
  25 autoload -U compinit; compinit -d "$ZSH_CACHE/zcompdump"
 
  27 # miscelaneous options
 
  29 setopt nonomatch    # if glob does not match, pass it to the command
 
  30 setopt numeric_glob_sort # sort numerically not lexically
 
  31 setopt noclobber    # don't allow overwriting files with '>', use '>!' instead
 
  33 setopt rcquotes     # echo 'don''t'; prints don't
 
  34 setopt dvorak       # correct_all uses dvorak
 
  35 setopt rematch_pcre # use perl regexp
 
  37 # disable flow control
 
  42 typeset -U path     # make path a unique array
 
  43 [[ -d ~/.local/bin ]] && path=(~/.local/bin $path)
 
  44 [[ -d ~/bin ]] && path=(~/bin $path)
 
  45 [[ -d /opt/android-sdk ]] && path=($path /opt/android-sdk/platform-tools)
 
  46 # osx gnu utils (installed via brew)
 
  47 [[ -d /usr/local/opt/coreutils/libexec/gnubin ]] && path=(/usr/local/opt/coreutils/libexec/gnubin $path)
 
  48 [[ -d /usr/local/opt/findutils/libexec/gnubin ]] && path=(/usr/local/opt/findutils/libexec/gnubin $path)
 
  51 [[ -f $XDG_CONFIG_HOME/aliases ]] && source $XDG_CONFIG_HOME/aliases
 
  52 for alias_file ($ZSH/aliases/*.zsh); do
 
  56 # set up a few named directories
 
  57 hash -d fook=/mnt/fook
 
  60 hash -d chroot_testing=/buildsystem/testing/buildroot
 
  61 hash -d chroot_master=/buildsystem/master/buildroot
 
  62 hash -d chroot_lib32=/buildsystem/lib32/buildroot
 
  63 hash -d wineprefixes=/mnt/data/wineprefixes