Enable the Zinit binary module, which efficiently zcompiles ALL sourced files

This commit is contained in:
Danielle McLean 2020-01-20 12:44:50 +11:00
parent d2a5ca19a2
commit 89b24e14ee
Signed by: 00dani
GPG key ID: FF6F9216852288FF
4 changed files with 9 additions and 3 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.zwc

View file

@ -4,6 +4,11 @@ ZINIT_HOME=$XDG_CACHE_HOME/zsh/zinit
ZINIT[HOME_DIR]=$ZINIT_HOME ZINIT[HOME_DIR]=$ZINIT_HOME
ZINIT[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump ZINIT[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump
if [[ -d $ZINIT_HOME/bin/zmodules/Src/zdharma ]]; then
module_path+=( $ZINIT_HOME/bin/zmodules/Src )
zmodload zdharma/zplugin
fi
if [[ ! -f $ZINIT_HOME/bin/zinit.zsh ]]; then if [[ ! -f $ZINIT_HOME/bin/zinit.zsh ]]; then
git clone https://github.com/zdharma/zinit $ZINIT_HOME/bin git clone https://github.com/zdharma/zinit $ZINIT_HOME/bin
zcompile $ZINIT_HOME/bin/zinit.zsh zcompile $ZINIT_HOME/bin/zinit.zsh

View file

@ -1,2 +1,2 @@
#! zsh #! zsh
for f in $ZDOTDIR/logout/*(N); source $f for f in $ZDOTDIR/logout/^*.zwc(N); source $f

View file

@ -1,10 +1,10 @@
source $ZDOTDIR/zinit source $ZDOTDIR/zinit
for f in $ZDOTDIR/interactive/*(N); source $f for f in $ZDOTDIR/interactive/^*.zwc(N); source $f
zpcompinit && zpcdreplay zpcompinit && zpcdreplay
([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &! ([[ $ZINIT[ZCOMPDUMP_PATH].zwc -nt $ZINIT[ZCOMPDUMP_PATH] ]] || zcompile $ZINIT[ZCOMPDUMP_PATH]) &!
[[ -o login ]] && for f in $ZDOTDIR/interactive+login/*(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
# show the "error" colour on first launch. To avoid this, we simply end with a # show the "error" colour on first launch. To avoid this, we simply end with a