From fcff4a8f17b7ed1fcbd0c835d3787c4ecfdb801f Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Sun, 10 May 2020 13:29:28 +0200 Subject: [PATCH] =?UTF-8?q?zinit:=20FEATURE=20=E2=80=93=20a=20new=20ice=20?= =?UTF-8?q?autoload''=20which=20invokes=20`autoload=20-Uz=20=E2=80=A6'=20o?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the given files/functions. Example – a plugin that converts cd ... into cd ../..: zinit autoload'manydots-magic' atload'manydots-magic' for \ knu/zsh-manydots-magic --- zinit.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zinit.zsh b/zinit.zsh index 203c447c..a8d3a53e 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -59,7 +59,7 @@ service|trackbinds|multisrc|compile|nocompile|nocompletions|\ reset-prompt|wrap-track|reset|sh|\!sh|bash|\!bash|ksh|\!ksh|csh|\ \!csh|aliases|countdown|ps-on-unload|ps-on-update|trigger-load|\ light-mode|is-snippet|atdelete|pack|git|verbose|on-update-of|\ -subscribe|extract|param|opts" +subscribe|extract|param|opts|autoload" ZINIT[nval-ice-list]="blockf|silent|lucid|trackbinds|cloneonly|nocd|run-atpull|\ nocompletions|sh|\!sh|bash|\!bash|ksh|\!ksh|csh|\!csh|\ aliases|countdown|light-mode|is-snippet|git|verbose|cloneopts" @@ -1209,6 +1209,10 @@ function $f { [[ $___user = % ]] && local ___pdir_path="$___plugin" || local ___pdir_path="${ZINIT[PLUGINS_DIR]}/${___id_as//\//---}" local ___pdir_orig="$___pdir_path" ___key + if [[ -n ${ZINIT_ICE[autoload]} ]] { + :zinit-shade-autoload -Uz -- ${(s.;.)ZINIT_ICE[autoload]} + } + if [[ ${ZINIT_ICE[as]} = command ]]; then [[ ${+ZINIT_ICE[pick]} = 1 && -z ${ZINIT_ICE[pick]} ]] && \ ZINIT_ICE[pick]="${___id_as:t}"