setvar LOGCHECK 302
setvar WATCHFMT '%n %a %l from %m at %t.'
-# autoload wrapper - use this one instead of autoload directly
-# We need to define this function as early as this, because autoloading
-# 'is-at-least()' needs it.
-zrcautoload() {
- emulate -L zsh
- setopt extended_glob
- local fdir ffile
- local -i ffound
-
- ffile=$1
- (( ffound = 0 ))
- for fdir in ${fpath} ; do
- [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 ))
- done
-
- (( ffound == 0 )) && return 1
- if [[ $ZSH_VERSION == 3.1.<6-> || $ZSH_VERSION == <4->* ]] ; then
- autoload -U ${ffile} || return 1
- else
- autoload ${ffile} || return 1
- fi
- return 0
-}
-
# Some things need to be done very early
# the following helper functions have been taken from the grml zshrc
# (wherever they got them from)
function zstyle() { : }
fi
+# Now that FPATH is set correctly, do autoloaded functions.
+# autoload all functions in $FPATH - that is, all files in
+# each component of the array $fpath. If there are none, feed the list
+# it prints into /dev/null.
for paths in "$fpath[@]"; do
- for func in "$paths"/*(N:t); do
- zrcautoload $func
- done
+ autoload -U "$paths"/*(N:t) >/dev/null
done
unset paths
# a much nicer prompt setup, should zsh be recent enough to support it.
# That is, anything >= 4.3.7, the older ones keep using my old way.
if is437; then
- if zrcautoload promptinit && promptinit 2>/dev/null ; then
+ if autoload promptinit && promptinit 2>/dev/null ; then
if ! zstyle -t ':prompt:ganneff' colors; then
zstyle ':prompt:ganneff' colors ${COLORS}
fi
# gather version control information for inclusion in a prompt
# we will only be using one variable, so let the code know now.
- if is439 && zrcautoload vcs_info && vcs_info; then
+ if is439 && autoload vcs_info && vcs_info; then
zstyle ':vcs_info:*' max-exports 1
zstyle ':vcs_info:*' disable cdv darcs mtn tla hg fossil p4
zstyle ':vcs_info:*' use-prompt-escapes
## This function allows you type a file pattern,
## and see the results of the expansion at each step.
## When you hit return, they will be inserted into the command line.
-if is4 && zrcautoload insert-files && zle -N insert-files; then
+if is4 && autoload insert-files && zle -N insert-files; then
#k# Insert files and test globbing
bindkey "$key_info[Control]Xf" insert-files ## C-x-f
fi
## line doesn't match something in the history, adding a key performs
## standard completion - though editing in the middle is liable to delete
## the rest of the line.
-if is4 && zrcautoload predict-on && zle -N predict-on; then
+if is4 && autoload predict-on && zle -N predict-on; then
#zle -N predict-off
bindkey "$key_info[Control]X$key_info[Control]R" predict-on ## C-x C-r
#bindkey "^U" predict-off ## C-u
typeset WORDCHARS='|'$WORDCHARS
# press ctrl-x ctrl-e for editing command line in $EDITOR or $VISUAL
-if is4 && zrcautoload edit-command-line && zle -N edit-command-line; then
+if is4 && autoload edit-command-line && zle -N edit-command-line; then
bindkey '$key_info[Control]x$key_info[Control]e' edit-command-line
fi
# Funky run-help hooks
-zrcautoload run-help-git
-zrcautoload run-help-svn
+autoload run-help-git
+autoload run-help-svn
# escape URLs automagically
-zrcautoload -U url-quote-magic
+autoload -U url-quote-magic
zle -N self-insert url-quote-magic
## Allow known mime types to be used as 'command'
if is42; then
- zrcautoload -U zsh-mime-setup
+ autoload -U zsh-mime-setup
zsh-mime-setup
fi
local -a funcs
# is439 is not here, as its used in precmd
# is434 is used in agent()
- funcs=(zrcautoload is4 is41 is42 is425 is43 is433 isdarwin isfreebsd salias setvar )
+ funcs=(is4 is41 is42 is425 is43 is433 isdarwin isfreebsd salias setvar maybe_compile debug)
for func in $funcs ; do
[[ -n ${functions[$func]} ]] \