-# ~/.zsh
-# ~/.zsh/env
-# ~/.zsh/env.local
-# ~/.zsh/rc
-# ~/.zsh/rc.local
-# ~/.zsh/host/rc.marvin
-# ~/.zsh/os/rc.Darwin
-#
-# To load additional rc files from within ~/.zsh/rc use the following:
-#
-# source_config ~/.zsh os rc $os # loads os/rc.Darwin
-# source_config ~/.zsh host rc $hostname # loads host/rc.marvin
-#
-# To load additional env files from within ~/.zsh/env use the following (note
-# nolocal to prevent loading env.local two times if os and host files don't
-# exist):
-#
-# source_config zsh os env $os nolocal # loads os/rc.Darwin
-# source_config zsh host env $hostname # loads env.local
-#
-# Doesn't fit perfectly in this file, but this is the best place to make it
-# available everywhere.
-function source_config() {
- # Path to the file to source and its local counterpart.
- local source_file=$1/$2/$3.$4
- local source_file_local=$1/$3.local
-
- # Additional debug output.
- if [ x$DEBUG != x ]; then
- echo "source_config(): checking if $source_file exists"
- echo "source_config(): checking if $source_file_local exists"
- fi
-
- # If the file does exist then source it.
- if [ -f $source_file ]; then
- if [ x$DEBUG != x ]; then
- echo "source_config(): sourcing $source_file"
- fi
- source $source_file
-
- # Otherwise load the .local file if it exists and .local files are
- # allowed.
- elif [ -f $source_file_local -a x$5 != xnolocal ]; then
- if [ x$DEBUG != x ]; then
- echo "source_config(): sourcing $source_file_local"
- fi
- source $source_file_local
- fi
-}
+# Color bold strings in bold blue.
+LESS_TERMCAP_md="${escape}[01;34m"
+LESS_TERMCAP_me="${escape}[0m"
+export LESS_TERMCAP_md LESS_TERMCAP_me
+# Color underlined strings in bold yellow and underlined.
+LESS_TERMCAP_us="${escape}[01;4;33m"
+LESS_TERMCAP_ue="${escape}[0m"
+export LESS_TERMCAP_us LESS_TERMCAP_ue
+# Color standout mode in bold black with yellow background.
+LESS_TERMCAP_so="${escape}[01;30;43m"
+LESS_TERMCAP_se="${escape}[0m"
+export LESS_TERMCAP_so LESS_TERMCAP_se
+
+# Use ~/.tmp as directory for temporary files if available to reduce security
+# problems on multi-user systems.
+if test -O "$HOME/.tmp" && test -d "$HOME/.tmp"; then
+ TMP=$HOME/.tmp
+ TEMP=$TMP
+ TMPDIR=$TMP
+ export TMP TEMP TMPDIR
+# Also try ~/tmp as fallback.
+elif test -O "$HOME/tmp" && test -d "$HOME/tmp"; then
+ TMP=$HOME/tmp
+ TEMP=$TMP
+ TMPDIR=$TMP
+ export TMP TEMP TMPDIR
+fi
+
+# Change rlwrap's home directory to prevent cluttering ~/.
+RLWRAP_HOME="$HOME/.shell/rlwrap"
+export RLWRAP_HOME
+
+# Set colors for GNU ls (and Zsh completions).
+if test -f "$HOME/.shell/dircolors"; then
+ . "$HOME/.shell/dircolors"
+fi
+# Set the same colors for non GNU ls, except for special cases which aren't
+# supported.
+LSCOLORS='ExgxxxxxBxxxxxBdBdExEb'
+# ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
+# | | | | | | | | | | |
+# | | | | | | | | | | *- directory writable to others, without sticky bit
+# | | | | | | | | | *--- directory writable to others, with sticky bit
+# | | | | | | | | *----- executable with setgid bit set
+# | | | | | | | *------- executable with setuid bit set
+# | | | | | | *--------- character special
+# | | | | | *----------- block special
+# | | | | *------------- executable
+# | | | *--------------- pipe
+# | | *----------------- socket
+# | *------------------- symbolic link
+# *--------------------- directory
+export LSCOLORS
+
+
+source_debug ". ~/.shell/env (done)"
+
+# vim: ft=sh