5 # Written by Joerg Jaspert <joerg@debian.org>
8 # This assumes that $HOME/.zshenv is a symlink to
9 # $ZDOTDIR/zshenv.home (as is my default).
10 if zp=$(readlink -f ${HOME}/.zshenv 2>/dev/null); then
12 elif zp=$(greadlink -f ${HOME}/.zshenv 2>/dev/null); then
13 # MacOS readlink isn't up to the task, user needs to
14 # install the gnu coreutils for it
17 # If both fail, use the "traditional" way of hardcoding
20 ZDOTDIR=${ZDOTDIR:-$zp}
21 # In case the user did not symlink us, but copy, we fallback to
22 # the traditional way too.
23 if [[ ${HOME} == ${ZDOTDIR} ]]; then
24 ZDOTDIR="${HOME}/.zsh"
27 [ -r "${ZDOTDIR}/zshenv" ] && source "${ZDOTDIR}/zshenv"
29 # If you want to "profile" the shell initialization, enable
30 # the following lines.
31 # Don't have this enabled for normal use, its pretty distracting and
32 # also changes some initialization behaviour (re prompts)
34 ## Set the trace prompt to be like
35 ## YYYY-MM-DD HH:MM:SS scriptname(function):line>
36 #PS4='%D{%Y-%m-%d %H:%M:%S} %x(%N):%i> '
37 ## save file stderr to file descriptor 3 and redirect stderr (including trace
38 ## output) to a tempfile
39 #INITLOG=$(mktemp --tmpdir=/tmp zshlog.XXXXX.${USER}.$(date +%s))
40 #exec 3>&2 2>${INITLOG}
41 ## set options to turn on tracing and expansion of commands contained in the prompt
42 #setopt xtrace prompt_subst
44 # Store "starttime" of shell in case user wants to see how long loading took
45 _start_time=$(( $(( $(date +%s) * 1000000000 )) + $(date +%N) ))
46 # Variable is removed on end of shell load
48 # Don't do anything more in here, do everything inside