1 # Zshrc function definitions
4 # {{{ check for version/system
5 # check for versions (compatibility reasons)
7 [[ $ZSH_VERSION == 4.3.<9->* || $ZSH_VERSION == 4.<4->* || $ZSH_VERSION == <5->* ]] && return 0
11 #f1# are we running within an utf environment?
13 case "$LANG $CHARSET $LANGUAGE" in
20 # check for user, if not running as root set $SUDO to sudo
21 (( EUID != 0 )) && SUDO='sudo' || SUDO=''
23 # autoload wrapper - use this one instead of autoload directly
24 # We need to define this function as early as this, because autoloading
25 # 'is-at-least()' needs it.
26 function zrcautoload() {
34 for fdir in ${fpath} ; do
35 [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 ))
38 (( ffound == 0 )) && return 1
39 autoload -U ${ffile} || return 1
43 # Load is-at-least() for more precise version checks
44 # Note that this test will *always* fail, if the is-at-least
45 # function could not be marked for autoloading.
46 zrcautoload is-at-least || is-at-least() { return 1 }