|
|
|
|
|
by bongobingo1
782 days ago
|
|
Unable to edit, but this is how I handled lazy loading the completions {
# load compinit and rebind ^I (tab) to expand-or-complete, then compile
# completions as bytecode if needed.
lazyload-compinit() {
autoload -Uz compinit
# compinit will automatically cache completions to ~/.zcompdump
compinit
bindkey "^I" expand-or-complete
{
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
# if zcompdump file exists, and we don't have a compiled version or the
# dump file is newer than the compiled file, update the bytecode.
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump"
fi
} &!
# pretend we called this directly, instead of the lazy loader
zle expand-or-complete
}
# mark the function as a zle widget
zle -N lazyload-compinit
bindkey "^I" lazyload-compinit
}
|
|