Turbo-mode completions and other interactive niceties :)

This commit is contained in:
Danielle McLean 2023-11-19 14:25:27 +11:00
parent ef25e15360
commit 588a2006aa
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
2 changed files with 19 additions and 11 deletions

View file

@ -28,11 +28,11 @@ else
zinit pack:no-dir-color-swap for ls_colors zinit pack:no-dir-color-swap for ls_colors
fi fi
zinit ice silent wait:1 atload:_zsh_autosuggest_start zinit wait lucid light-mode for \
zinit $load zsh-users/zsh-autosuggestions mollifier/cd-gitroot \
atinit"dot-zsh-compinit" \
zinit ice blockf; zinit $load zsh-users/zsh-completions zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zinit ice silent wait:1; zinit $load mollifier/cd-gitroot zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zinit ice silent wait!1; zinit $load zdharma-continuum/fast-syntax-highlighting zsh-users/zsh-completions

View file

@ -1,9 +1,17 @@
# 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 source $ZDOTDIR/zinit
for f in $ZDOTDIR/interactive/^*.zwc(N); source $f for f in $ZDOTDIR/interactive/^*.zwc(N); source $f
zpcompinit && zpcdreplay
([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &!
[[ -o login ]] && for f in $ZDOTDIR/interactive+login/^*.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 # If zsh init ends with a failing command (like a conditional) the prompt will