21 lines
779 B
Bash
21 lines
779 B
Bash
# Optimised compinit taking advantage of zinit's completion handling, as well
|
|
# as compiling the resulting zcompdump file. Have zinit call this once
|
|
# everything is loaded using an atload ice.
|
|
dot-zsh-compinit() {
|
|
[[ -d $ZINIT[ZCOMPDUMP_PATH] ]] || mkdir -p ${ZINIT[ZCOMPDUMP_PATH]:h}
|
|
zicompinit || return $?
|
|
zicdreplay || return $?
|
|
([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &!
|
|
return 0
|
|
}
|
|
|
|
source $ZDOTDIR/zinit
|
|
for f in $ZDOTDIR/interactive/^*.zwc(N); source $f
|
|
|
|
[[ -o login ]] && for f in $ZDOTDIR/interactive+login/^*.zwc(N); source $f
|
|
|
|
# If zsh init ends with a failing command (like a conditional) the prompt will
|
|
# show the "error" colour on first launch. To avoid this, we simply end with a
|
|
# true command:
|
|
true
|