Source

dotfiles / .zshenv

Full commit
#!/usr/bin/env zsh

setopt NO_global_rcs

export DOTROOT=$HOME/srv/hg.gomaa.us/dotfiles
ZDOTDIR="$HOME/.zsh"

if [[ -z "$LANG" ]]
then
    export LANG='en_US.UTF-8'
elif [[ "$LANG" != "*.UTF-8" ]]
then
    export LANG="${LANG%.*}.UTF-8"
fi

if [[ -n "$(command -v locale)" ]]
then
    locale -a 2> /dev/null | grep -iq "^${LANG/-/-\?}\$" || \
        export LANG="${LANG%.*}"
    locale -a 2> /dev/null | grep -iq "^${LANG/-/-\?}\$" || \
        export LANG=C
fi

[[ -d /usr/local/bin ]] && path=(/usr/local/bin $path)
[[ -d /usr/local/sbin ]] && path=(/usr/local/sbin $path)
[[ -d /usr/local/mysql/bin ]] && path=(/usr/local/mysql/bin $path)
[[ -d /opt/local/bin ]] && path=(/opt/local/bin $path)
[[ -d /opt/local/sbin ]] && path=(/opt/local/sbin $path)
[[ -d "$HOME/bin" ]] && path=("$HOME/bin" $path)
[[ -d "$HOME/.bin" ]] && path=("$HOME/.bin" $path)
[[ -d "$HOME/.local/bin" ]] && path=("$HOME/.local/bin" $path)
[[ -d "$HOME/.cabal/bin" ]] && path=("$HOME/.cabal/bin" $path)
[[ -d "$DOTROOT/bin" ]] && path=("$DOTROOT/bin" $path)
[[ -d /usr/X11R6/bin ]] && path=($path /usr/X11R6/bin)
[[ -d /usr/local/X11R6/bin ]] && path=($path /usr/local/X11R6/bin)

[[ -d /usr/X11/man ]] && manpath=($manpath /usr/X11/man)
[[ -d /usr/X11R6/man ]] && manpath=($manpath /usr/X11R6/man)
[[ -d /usr/share/man ]] && manpath=(/usr/share/man $manpath)
[[ -d /usr/local/share/man ]] && manpath=(/usr/local/share/man $manpath)
[[ -d /usr/local/man ]] && manpath=(/usr/local/man $manpath)
[[ -d /opt/local/share/man ]] && manpath=(/opt/local/share/man $manpath)

[[ -d "$ZDOTDIR/functions" ]] && fpath=("$ZDOTDIR/functions" $fpath)