From 0c18fda87fad1af82913f8d6d160526ea89b935f Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:02:36 -0500 Subject: [PATCH 01/56] test(fx): pin version to 32.0.0 (#644) Signed-off-by: Vladislav Doster --- tests/gh-r.zunit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index 520745ab..022df14f 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -84,7 +84,7 @@ } @test 'broot' { # A new way to see and navigate directory trees [[ $OSTYPE =~ 'darwin*' ]] && skip " on $os_type" - run zinit lbin'!*${OSTYPE}*/* -> broot' for @Canop/broot; assert $state equals 0 + run zinit for @Canop/broot; assert $state equals 0 local broot="$ZBIN/broot"; assert "$broot" is_executable run "$broot" --version; assert $state equals 0 } @@ -233,7 +233,7 @@ run $fogg version; assert $state equals 0 } @test 'fx' { # Terminal JSON viewer - run zinit lbin'!* -> fx' for @antonmedv/fx; assert $state equals 0 + run zinit lbin'!* -> fx' ver'32.0.0' for @antonmedv/fx; assert $state equals 0 local fx="$ZBIN/fx"; assert "$fx" is_executable run $fx -v; assert $state equals 0 } From 7094330387b1e4afff6185083135871d764467c0 Mon Sep 17 00:00:00 2001 From: Kilian Tyler Date: Tue, 19 Mar 2024 18:55:18 -0400 Subject: [PATCH 02/56] fix: add `command` before instances of `git` that didn't have it (#643) Co-authored-by: vladislav doster <10052309+vladdoster@users.noreply.github.com> --- zinit-autoload.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index 9d7a8205..7dde7dd6 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -1969,7 +1969,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" [[ $1 = -q ]] && +zi-log "{pre}[self-update]{info} updating zinit repository{msg2}" \ local nl=$'\n' escape=$'\x1b[' - local current_branch=$(git -C $ZINIT[BIN_DIR] rev-parse --abbrev-ref HEAD) + local current_branch=$(command git -C $ZINIT[BIN_DIR] rev-parse --abbrev-ref HEAD) # local current_branch='main' local -a lines ( @@ -3168,7 +3168,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" } } - if [[ -d $local_dir/.git ]] && ( builtin cd -q $local_dir ; git show-ref --verify --quiet refs/heads/main ); then + if [[ -d $local_dir/.git ]] && ( builtin cd -q $local_dir ; command git show-ref --verify --quiet refs/heads/main ); then local main_branch=main else local main_branch=master @@ -3574,7 +3574,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" # # User-action entry point. zi::version() { - +zi-log "zinit{cmd} $(git --git-dir=$(realpath ${ZINIT[BIN_DIR]}/.git) describe --tags) {rst}(${OSTYPE}_${CPUTYPE})" + +zi-log "zinit{cmd} $(command git --git-dir=$(realpath ${ZINIT[BIN_DIR]}/.git) describe --tags) {rst}(${OSTYPE}_${CPUTYPE})" return $? } # ]]] From e8c3205a2fa88e26e4e8dbe34374ddf40720ae36 Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Wed, 20 Mar 2024 01:18:37 -0500 Subject: [PATCH 03/56] fix(zinit-install): simplify protocol pattern (#645) Signed-off-by: Vladislav Doster --- zinit-install.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index 1ed3c466..94069e37 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -414,7 +414,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { ) || return $? } elif [[ $tpe = github ]] { case ${ICE[proto]} in - (|https|git|http|ftp|ftps|rsync|ssh) + (|ftp(|s)|git|http(|s)|rsync|ssh) :zinit-git-clone() { command git clone --progress ${(s: :)ICE[cloneopts]---recursive} \ ${(s: :)ICE[depth]:+--depth ${ICE[depth]}} \ @@ -886,8 +886,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { ZINIT[annex-multi-flag:pull-active]=${${${(M)update:#-u}:+${ZINIT[annex-multi-flag:pull-active]}}:-2} ( - if [[ $url = (http|https|ftp|ftps|scp)://* ]] { - # URL + if [[ $url = (ftp(|s)|http(|s)|scp)://* ]] { ( () { setopt localoptions noautopushd; builtin cd -q "$local_dir"; } || return 4 From 8a219b8b4d0466c2613e1480d6c4d2ba6c664aff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:41:08 +0100 Subject: [PATCH 04/56] build(deps): bump wagoid/commitlint-github-action from 5 to 6 (#649) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index ca8acd98..9eb123ee 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -27,7 +27,7 @@ jobs: pip install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc - name: commit - uses: wagoid/commitlint-github-action@v5 + uses: wagoid/commitlint-github-action@v6 with: configFile: '.commitlintrc' # run: commitlint --from=$(git cherry origin/main | head -n 1 | awk '{print $2}') From e3302842b939c683450302a5b2db46eccc92a8a5 Mon Sep 17 00:00:00 2001 From: qadzek <84473512+qadzek@users.noreply.github.com> Date: Tue, 4 Jun 2024 08:56:06 +0200 Subject: [PATCH 05/56] docs: fix typos (#658) --- scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 16f3cac1..32219ca3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -284,7 +284,7 @@ Now to get started you can check out the following: 🧊 https://github.com/${ZINIT_REPO}#ice-modifiers - There's also an ${COLOR_BOLD_WHITE_ON_BLACK}introduction${COLOR_RESET} to Zinit on the wiki: 📚 https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/ -- The ${COLOR_BOLD_WHITE_ON_BLACK}For-Syntax${COLOR_RESET} article on the wiki, which hilights some best practises: +- The ${COLOR_BOLD_WHITE_ON_BLACK}For-Syntax${COLOR_RESET} article on the wiki, which highlights some best practices: 📖 https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/ 💁 Need help? From d05a5301150909d8b386ebb974e1d1634740d65d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:49:02 +0200 Subject: [PATCH 06/56] build(deps): bump docker/build-push-action from 5 to 6 (#661) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/containers.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index fd0c6d4d..6bc95049 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -49,7 +49,7 @@ jobs: - name: build and push id: docker_build_zsh_versions - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 timeout-minutes: 90 # compiling older zsh versions take a long time with: push: ${{ github.event.number == 0 }} @@ -91,7 +91,7 @@ jobs: - name: build & push new image id: docker_build_latest - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 if: github.ref == 'refs/heads/main' with: push: true From 0c471af3fe6aa80a5ddc0fddfb741bc5b3f96cde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:49:42 +0200 Subject: [PATCH 07/56] build(deps): bump dawidd6/action-homebrew-bump-formula from 3 to 4 (#673) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 5bb20dc4..35cd4706 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Bump Homebrew formulae - uses: dawidd6/action-homebrew-bump-formula@v3 + uses: dawidd6/action-homebrew-bump-formula@v4 with: formula: zinit # A Personal Access Token (PAT) is instead of the default From c3469496455ea8b8ba184426c558e54817825bef Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Fri, 8 Nov 2024 17:10:16 -0600 Subject: [PATCH 08/56] fix(gh-r.zunit): `alist` org name (#680) --- tests/gh-r.zunit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index 022df14f..421c2e60 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -26,7 +26,7 @@ run "$alacritty" --version; assert $state equals 0 } @test 'alist' { # A file list program that supports multiple storage, powered by Gin and React - run zinit lbin'!* -> alist' for @alist-org/alist; assert $state equals 0 + run zinit lbin'!* -> alist' for @alistgo/alist; assert $state equals 0 local alist="$ZBIN/alist"; assert "$alist" is_executable run "$alist" version; assert $state equals 0 } From 1e60350e75903b70cc4416d1a60ed84ae0fadb14 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Mon, 20 Jan 2025 15:56:30 +0800 Subject: [PATCH 09/56] docs: fix a few words (#688) --- README.md | 2 +- zinit-autoload.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 67cbb57f..d49f4b08 100644 --- a/README.md +++ b/README.md @@ -777,7 +777,7 @@ ### Others | `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in their scripts. | | `autoload` | Autoload the given functions (from their files). Equvalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. | | `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with snippets.** | -| `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. \`compile"(pure\\ | +| `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. `compile"(pure\\|async).zsh"` for `sindresorhus/pure`. | | `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. | | `service` | Make following plugin or snippet a _service_, which will be ran in background, and only in single Zshell instance. See [the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). | | `light-mode` | Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the for-syntax, where there is no `load` nor `light` subcommand | diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index 7dde7dd6..2ea7cb65 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -1602,7 +1602,7 @@ EOF —— unload ${ZINIT[col-pname]}plg-spec${ZINIT[col-rst]} – unload plugin loaded with \`zinit load ...', -q – quiet —— update [-q] ${ZINIT[col-pname]}plg-spec${ZINIT[col-rst]}|URL – Git update plugin or snippet (or all plugins and snippets if ——all passed); besides -q accepts also ——quiet, and also -r/--reset – this option causes to run git reset --hard / svn revert before pulling changes —— version – display zinit version -—— zstatus – overall Zinit statu +—— zstatus – overall Zinit status —— add-fpath|fpath ${ZINIT[col-info]}[-f|--front]${ZINIT[col-rst]} \\ ${ZINIT[col-pname]}plg-spec ${ZINIT[col-info]}[subdirectory]${ZINIT[col-rst]} – adds given plugin directory to \$fpath; if the second argument is given, it is appended to the directory path; if the option -f/--front is given, the directory path is prepended instead of appended to \$fpath. The ${ZINIT[col-pname]}plg-spec${ZINIT[col-rst]} can be absolute path —— run [-l] [plugin] {command} – runs the given command in the given plugin's directory; if the option -l will be given then the plugin should be skipped – the option will cause the previous plugin to be reused" From 50643c6e6e9e2c1e68508301f7a6f15d23b7c146 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sun, 26 Jan 2025 00:01:13 +0100 Subject: [PATCH 10/56] fix: gh-r zunit tests (#691) --- .github/workflows/tests.yaml | 45 ++++++++++++----------------- tests/gh-r.zunit | 56 ++++++++---------------------------- tests/snippets.zunit | 6 ++-- 3 files changed, 34 insertions(+), 73 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 562a3e8e..e56b08a7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,9 +26,17 @@ jobs: zunit-tests: runs-on: ${{ matrix.os }} strategy: - matrix: - os: ["macos-latest", "ubuntu-latest"] fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest] + zunit_test: + - annexes + - commands + - compile + - gh-r + - ices + - plugins + - snippets steps: - name: checkout ${{ github.repository }} @@ -46,7 +54,7 @@ jobs: sudo apt-get update --yes sudo apt-get install --no-install-recommends --yes \ autoconf automake autotools-dev \ - build-essential byacc\ + build-essential byacc \ file \ gcc gettext glibc-source grep \ libc6 libc6-dev libevent-dev libncurses5-dev libncursesw5-dev libtool libuvc0 lua5.1 \ @@ -66,27 +74,12 @@ jobs: id: install-zunit shell: zsh {0} run: | - mkdir -p "$HOME/.local/bin" && echo "$HOME/.local/bin" >> $GITHUB_PATH - git clone --depth 1 https://github.com/zdharma-continuum/zunit; cd ./zunit - ./configure --prefix=$HOME/.local && make all install - - - name: "annexes" - run: zunit run tests/annexes.zunit + mkdir -p "$HOME/.local/bin" + echo "$HOME/.local/bin" >> $GITHUB_PATH + git clone --depth 1 https://github.com/zdharma-continuum/zunit + cd ./zunit + ./configure --prefix=$HOME/.local + make all install - - name: "commands" - run: zunit run tests/commands.zunit - - - name: "compile" - run: zunit run tests/compile.zunit - - - name: "gh-r" - run: zunit run tests/gh-r.zunit - - - name: "ices" - run: zunit run tests/ices.zunit - - - name: "plugins" - run: zunit run tests/plugins.zunit - - - name: "snippets" - run: zunit run tests/snippets.zunit + - name: "run tests" + run: zunit run tests/${{ matrix.zunit_test }}.zunit diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index 421c2e60..eb01dbbc 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -15,7 +15,7 @@ run "$act" --version; assert $state equals 0 } @test 'akamai' { # Manage and configure Akamai from the Command Line. - run zinit id-as'akamai' lbin'akamai*->akamai' for @akamai/cli; assert $state equals 0 + run zinit id-as'akamai' lbin'!akamai*->akamai' for @akamai/cli; assert $state equals 0 local cli="$ZBIN/akamai"; assert "$cli" is_executable run "$cli" --version; assert $state equals 0 } @@ -41,7 +41,7 @@ run "$assh" --version; assert $state equals 0 } @test 'atuin' { # Magical shell history - run zinit for @atuinsh/atuin; assert $state equals 0 + run zinit lbin'!atuin*->atuin' bpick'^*update*' for @atuinsh/atuin; assert $state equals 0 local atuin="$ZBIN/atuin"; assert "$atuin" is_executable run "$atuin" --version; assert $state equals 0 } @@ -84,7 +84,7 @@ } @test 'broot' { # A new way to see and navigate directory trees [[ $OSTYPE =~ 'darwin*' ]] && skip " on $os_type" - run zinit for @Canop/broot; assert $state equals 0 + run zinit lbin"!*$MACHTYPE*$OSTYPE*/broot" for @Canop/broot; assert $state equals 0 local broot="$ZBIN/broot"; assert "$broot" is_executable run "$broot" --version; assert $state equals 0 } @@ -96,7 +96,7 @@ @test 'calico' { # Cloud native networking and network security run zinit lbin'!* -> calico' for @projectcalico/calico; assert $state equals 0 local calico="$ZBIN/calico"; assert "$calico" is_executable - run "$calico" version; assert $state equals 0 + run "$calico" --help; assert $state equals 0 } @test 'certificates' { # An opinionated helper for generating tls certificates run zinit lbin'!* -> certificates' for @mvmaasakkers/certificates; assert $state equals 0 @@ -242,12 +242,6 @@ local fzf="$ZBIN/fzf"; assert "$fzf" is_executable run $fzf --version; assert $state equals 0 } -@test 'gaper' { # Builds and restarts a Go project when it crashes or some watched file changes - [[ $OSTYPE =~ "linux*" ]] && skip "on $os_type" - run zinit lbin'!**/gaper' for @maxcnunes/gaper; assert $state equals 0 - local gaper="$ZBIN/gaper"; assert "$gaper" is_executable - run $gaper --version; assert $state equals 0 -} @test 'gdu' { # Fast disk usage analyzer with console interface written in Go run zinit lbin'!* -> gdu' for @dundee/gdu; assert $state equals 0 local gdu="$ZBIN/gdu"; assert "$gdu" is_executable @@ -386,11 +380,6 @@ local hexyl="$ZBIN/hexyl"; assert "$hexyl" is_executable run $hexyl --version; assert $state equals 0 } -@test 'hit-on' { # Git Workflow Helper Tool - run zinit lbin'!* -> hit' for kowainik/hit-on; assert $state equals 0 - local hit="$ZBIN/hit"; assert "$hit" is_executable - run $hit --version; assert $state equals 0 -} @test 'hoofli' { # Generate PlantUML diagrams from Chrome or Firefox network inspection run zinit lbin'!* -> hoofli' for @dnnrly/hoofli; assert $state equals 0 local hoofli="$ZBIN/hoofli"; assert "$hoofli" is_executable @@ -412,11 +401,6 @@ local hyperfine="$ZBIN/hyperfine"; assert "$hyperfine" is_executable run $hyperfine --version; assert $state equals 0 } -@test 'ignite' { # Ignite CLI is the all-in-one platform to build, launch, and maintain any crypto application on a sovereign and secured blockchain - run zinit for id-as'ignite' @ignite/cli; assert $state equals 0 - local cli="$ZBIN/ignite"; assert "$cli" is_executable - run "$cli" version; assert $state equals 0 -} @test 'igo' { # Improved Go Syntax (transpiler) run zinit for @rocketlaunchr/igo; assert $state equals 0 local igo="$ZBIN/igo"; assert "$igo" is_executable @@ -428,7 +412,7 @@ run $insect help; assert $state equals 0 } @test 'ipinfo' { # Official Command Line Interface for the IPinfo API (IP geolocation and other types of IP data) - run zinit for id-as'ipinfo' lbin'*->ipinfo' @ipinfo/cli; assert $state equals 0 + run zinit for id-as'ipinfo' lbin'!*->ipinfo' @ipinfo/cli; assert $state equals 0 local cli="$ZBIN/ipinfo"; assert "$cli" is_executable run "$cli" --version; assert $state equals 0 } @@ -469,7 +453,7 @@ run $krew version; assert $state equals 0 } @test 'kubedb' { # `kubectl` plugin for KubeDB - run zinit for lbin'kube*->kubedb' @kubedb/cli; assert $state equals 0 + run zinit for lbin'!kube*->kubedb' @kubedb/cli; assert $state equals 0 local cli="$ZBIN/kubedb"; assert "$cli" is_executable run "$cli" version; assert $state equals 0 } @@ -525,12 +509,6 @@ local mage="$ZBIN/mage"; assert "$mage" is_executable run $mage -version; assert $state equals 0 } -@test 'mas' { # Mac App Store command line interface - [[ $OSTYPE =~ 'linux*' ]] && skip "skipped on $os_type" - run zinit for @mas-cli/mas; assert $state equals 0 - local mas="$ZBIN/mas"; assert "$mas" is_executable - run $mas version; assert $state equals 0 -} @test 'mcfly' { # Fly through your shell history. Great Scott run zinit ver'v0.8.3' for @cantino/mcfly; assert $state equals 0 local mcfly="$ZBIN/mcfly"; assert "$mcfly" is_executable @@ -556,11 +534,6 @@ run "$mdbook" --version; assert $state equals 127; assert $output contains 'no such file or directory' } -@test 'mdcat' { # cat for markdown - run zinit for @swsnr/mdcat; assert $state equals 0 - local mdcat="$ZBIN/mdcat"; assert "$mdcat" is_executable - run "$mdcat" --version; assert $state equals 0 -} @test 'micro' { # A modern and intuitive terminal-based text editor run zinit for @zyedidia/micro; assert $state equals 0 local micro="$ZBIN/micro"; assert "$micro" is_executable @@ -609,7 +582,7 @@ run $moonwalk --version; assert $state equals 0 } @test 'navi' { # An interactive cheatsheet tool for the command-line - run zinit lbin'* -> navi' for @denisidoro/navi; assert $state equals 0 + run zinit lbin'!* -> navi' for @denisidoro/navi; assert $state equals 0 local navi="$ZBIN/navi"; assert "$navi" is_executable run $navi --version; assert $state equals 0 } @@ -659,8 +632,8 @@ local pulumi="$ZBIN/pulumi"; assert "$pulumi" is_executable run "$pulumi" version; assert $state equals 0 } -@test 'qsv' { # CSVs sliced, diced & analyzed. - run zinit ver'0.112.0' for @jqnatividad/qsv; assert $state equals 0 +@test 'qsv' { # Blazing-fast Data-Wrangling toolkit + run zinit for @dathere/qsv; assert $state equals 0 local qsv="$ZBIN/qsv"; assert "$qsv" is_executable run "$qsv" --version; assert $state equals 0 } @@ -737,7 +710,7 @@ run $shfmt --version; assert $state equals 0 } @test 'skim' { # Fuzzy Finder in rust - run zinit ver'v0.9.4' for @lotabout/skim; assert $state equals 0 + run zinit for @skim-rs/skim; assert $state equals 0 local skim="$ZBIN/sk"; assert "$skim" is_executable run "$skim" --version; assert $state equals 0 } @@ -762,7 +735,7 @@ run "$stern" --version; assert $state equals 0 } @test 'tealdeer' { # A very fast implementation of tldr in Rust - run zinit lbin'!tealdeer* -> tealdeer' for @dbrgn/tealdeer; assert $state equals 0 + run zinit lbin'!tealdeer* -> tealdeer' for @tealdeer-rs/tealdeer; assert $state equals 0 local tealdeer="$ZBIN/tealdeer"; assert "$tealdeer" is_executable run "$tealdeer" --version; assert $state equals 0 } @@ -786,11 +759,6 @@ local tre="$ZBIN/tre"; assert "$tre" is_executable run $tre --version; assert $state equals 0 } -@test 'tv' { # A cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment - run zinit for @uzimaru0000/tv; assert $state equals 0 - local tv="$ZBIN/tv"; assert "$tv" is_executable - run $tv --version; assert $state equals 0 -} @test 'up' { # Deploy infinitely scalable serverless apps, apis, and sites in seconds to AWS run zinit lbin'!up* -> up' for akavel/up; assert $state equals 0 local up="$ZBIN/up"; assert "$up" is_executable @@ -845,7 +813,7 @@ run $yq --version; assert $state equals 0 } @test 'zed' { # Tooling for super-structured data: a new and easier way to manipulate data - run zinit for @brimdata/zed; assert $state equals 0 + run zinit for @brimdata/super; assert $state equals 0 local zed="$ZBIN/zed"; assert "$zed" is_executable run $zed --version; assert $state equals 0 } diff --git a/tests/snippets.zunit b/tests/snippets.zunit index 37ba4f89..d721cf38 100755 --- a/tests/snippets.zunit +++ b/tests/snippets.zunit @@ -46,13 +46,13 @@ setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_fd } @test 'tldr-completion::snippet' { - run install_completion 'tldr-completion/_tldr' 'dbrgn/tealdeer/main/completion/zsh_tealdeer' + run install_completion 'tldr-completion/_tldr' 'tealdeer-rs/tealdeer/main/completion/zsh_tealdeer' setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_tldr zinit delete --yes tldr-completion/_tldr; zinit cclear } @test 'tldr-completion::gh-r' { artifact="$ZINIT[PLUGINS_DIR]/tldr-completion---gh-r" - run zinit for as"completion" from"gh-r" id-as'tldr-completion/gh-r' bpick"completions_zsh" mv"completions_zsh -> _tldr_ghr" pick"_tldr_ghr" @dbrgn/tealdeer + run zinit for as"completion" from"gh-r" id-as'tldr-completion/gh-r' bpick"completions_zsh" mv"completions_zsh -> _tldr_ghr" pick"_tldr_ghr" @tealdeer-rs/tealdeer assert $state equals 0 assert "$artifact/_tldr_ghr" is_file assert $artifact/_tldr_ghr is_readable @@ -65,7 +65,7 @@ cat<$actual alias foo=date EOF - run zinit is-snippet link id-as'mysnippet' for $actual + run zinit is-snippet link nocompile id-as'mysnippet' for $actual assert $state equals 0 assert "$output" contains "Setting up snippet" From e5fe6874899d55b8357f4fd8e5e2cc943c3d6f87 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Sun, 26 Jan 2025 00:15:44 +0100 Subject: [PATCH 11/56] Allows the user to provide multiple files in the `cp` / `mv` ICE separated by `;` (#690) Co-authored-by: Philipp Schmitt --- zinit-install.zsh | 124 +++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 67 deletions(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index 94069e37..a4a9b70a 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -2252,78 +2252,68 @@ __zinit-cmake-base-hook () { .zinit-extract plugin "$extract" "$dir" } # ]]] +# FUNCTION: ∞zinit-cp-mv-operation-hook [[[ +∞zinit-file-cp-mv-operation() { + local cmd="$1" # Either "cp" or "mv" + local ice_key="$cmd" + + [[ -z $ICE[$ice_key] ]] && return 0 + + [[ "$2" = plugin ]] && \ + local dir="${6#%}" hook="$7" subtype="$8" || \ + local dir="${5#%}" hook="$6" subtype="$7" + + # Parse and clean up the ICE directive + local -a pairs + pairs=( ${(s[;])ICE[$ice_key]} ) # Split on semicolons + pairs=( "${pairs[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" ) # Trim spaces + + local retval=0 + for pair in "${pairs[@]}"; do + if [[ $pair == *("->"|"→")* ]]; then + local from="${pair%%[[:space:]]#(->|→)*}" + local to="${pair##*(->|→)[[:space:]]#}" + else + local from="${pair%%[[:space:]]##*}" + local to="${pair##*[[:space:]]##}" + fi + + @zinit-substitute from to + + local -a cmd_args=("-f") + local -a afr + + ( + () { setopt localoptions noautopushd; builtin cd -q "$dir"; } || return 1 + afr=( ${~from}(DN) ) # Expand glob patterns + + if (( ! ${#afr} )); then + +zi-log "{warn}Warning: $ice_key ice didn't match any file. [{error}$pair{warn}]" \ + "{nl}{warn}Available files:{nl}{obj}$(ls -1)" + retval=1 + continue + fi + if (( !OPTS[opt_-q,--quiet] )); then + cmd_args+=("-v") + fi + + for file in "${afr[@]}"; do + command "$cmd" "${cmd_args[@]}" "$file" "$to" || retval=$? + # Handle .zwc files if they exist + command "$cmd" "${cmd_args[@]}" "$file.zwc" "$to.zwc" 2>/dev/null + done + ) + done + + return $retval +} # ]]] # FUNCTION: ∞zinit-mv-hook [[[ ∞zinit-mv-hook() { - [[ -z $ICE[mv] ]] && return 0 - - [[ "$1" = plugin ]] && \ - local dir="${5#%}" hook="$6" subtype="$7" || \ - local dir="${4#%}" hook="$5" subtype="$6" - - if [[ $ICE[mv] == *("->"|"→")* ]] { - local from=${ICE[mv]%%[[:space:]]#(->|→)*} to=${ICE[mv]##*(->|→)[[:space:]]#} || \ - } else { - local from=${ICE[mv]%%[[:space:]]##*} to=${ICE[mv]##*[[:space:]]##} - } - - @zinit-substitute from to - - local -a mv_args=("-f") - local -a afr - - ( - () { setopt localoptions noautopushd; builtin cd -q "$dir"; } || return 1 - afr=( ${~from}(DN) ) - - if (( ! ${#afr} )) { - +zi-log "{warn}Warning: mv ice didn't match any file. [{error}$ICE[mv]{warn}]" \ - "{nl}{warn}Available files:{nl}{obj}$(ls -1)" - return 1 - } - if (( !OPTS[opt_-q,--quiet] )) { - mv_args+=("-v") - } - - command mv "${mv_args[@]}" "${afr[1]}" "$to" - local retval=$? - command mv "${mv_args[@]}" "${afr[1]}".zwc "$to".zwc 2>/dev/null - return $retval - ) + ∞zinit-file-cp-mv-operation "mv" "$@" } # ]]] # FUNCTION: ∞zinit-cp-hook [[[ ∞zinit-cp-hook() { - [[ -z $ICE[cp] ]] && return - - [[ "$1" = plugin ]] && \ - local dir="${5#%}" hook="$6" subtype="$7" || \ - local dir="${4#%}" hook="$5" subtype="$6" - - if [[ $ICE[cp] == *("->"|"→")* ]] { - local from=${ICE[cp]%%[[:space:]]#(->|→)*} to=${ICE[cp]##*(->|→)[[:space:]]#} || \ - } else { - local from=${ICE[cp]%%[[:space:]]##*} to=${ICE[cp]##*[[:space:]]##} - } - - @zinit-substitute from to - - local -a afr retval - ( () { setopt localoptions noautopushd; builtin cd -q "$dir"; } || return 1 - afr=( ${~from}(DN) ) - if (( ${#afr} )) { - if (( !OPTS[opt_-q,--quiet] )) { - command cp -vf "${afr[1]}" "$to" - retval=$? - # ignore errors if no compiled file is found - command cp -vf "${afr[1]}".zwc "$to".zwc 2>/dev/null - } else { - command cp -f "${afr[1]}" "$to" - retval=$? - # ignore errors if no compiled file is found - command cp -f "${afr[1]}".zwc "$to".zwc 2>/dev/null - } - } - return $retval - ) + ∞zinit-file-cp-mv-operation "cp" "$@" } # ]]] # FUNCTION: ∞zinit-compile-plugin-hook [[[ ∞zinit-compile-plugin-hook () { From 9cd774edbb70ebf4f6e755984a4a35cb06d1d9ac Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sun, 26 Jan 2025 00:16:24 +0100 Subject: [PATCH 12/56] ci: Fix typo in ice zunit test for mv (#692) --- tests/ices.zunit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ices.zunit b/tests/ices.zunit index 9b1ac80b..5745a5ed 100755 --- a/tests/ices.zunit +++ b/tests/ices.zunit @@ -16,7 +16,7 @@ run zinit as"null" id-as"test/mv" mv"readme.md -> mv.md" for zdharma-continuum/null assert $state equals 0 assert "$ZPLUGINS/test---mv/mv.md" is_file - assert "$ZPLUGINS/test---mv/mv.md" is_file + assert "$ZPLUGINS/test---mv/mv.md" is_readable assert "$ZPLUGINS/test---mv/readme.md" not_exists } @test 'cp' { From 947c1ba03d0f7c2a2d66969781685ab4f63119c6 Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Sat, 25 Jan 2025 17:18:35 -0600 Subject: [PATCH 13/56] feat: check for `eza` to use in `$ZINIT[LIST_COMMAND]` option (#636) Co-authored-by: Philipp Schmitt Co-authored-by: HeroCC --- zinit.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zinit.zsh b/zinit.zsh index 5a57c6c3..4cb314d7 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -63,7 +63,9 @@ if [[ -z ${ZINIT[HOME_DIR]} ]]; then fi if [[ -z ${ZINIT[LIST_COMMAND]} ]]; then - if (( ${+commands[exa]} )); then + if (( ${+commands[eza]} )); then + ZINIT[LIST_COMMAND]='eza --color=always --tree --icons -L3' + elif (( ${+commands[exa]} )); then ZINIT[LIST_COMMAND]='exa --color=always --tree --icons -L3' elif (( ${+commands[tree]} )); then ZINIT[LIST_COMMAND]='tree -L 3 -C --charset utf-8' From 0627eb4678802ba954f838bbe5f7758434586367 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 25 Jan 2025 23:32:25 +0000 Subject: [PATCH 14/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-additional.zsh.adoc | 185 +++ doc/zsdoc/zinit-autoload.zsh.adoc | 1661 ++++++++++++++++++++++ doc/zsdoc/zinit-install.zsh.adoc | 837 ++++++++++++ doc/zsdoc/zinit-side.zsh.adoc | 285 ++++ doc/zsdoc/zinit.zsh.adoc | 1966 +++++++++++++++++++++++++++ 5 files changed, 4934 insertions(+) create mode 100644 doc/zsdoc/zinit-additional.zsh.adoc create mode 100644 doc/zsdoc/zinit-autoload.zsh.adoc create mode 100644 doc/zsdoc/zinit-install.zsh.adoc create mode 100644 doc/zsdoc/zinit-side.zsh.adoc create mode 100644 doc/zsdoc/zinit.zsh.adoc diff --git a/doc/zsdoc/zinit-additional.zsh.adoc b/doc/zsdoc/zinit-additional.zsh.adoc new file mode 100644 index 00000000..c0364f1b --- /dev/null +++ b/doc/zsdoc/zinit-additional.zsh.adoc @@ -0,0 +1,185 @@ + +NAME + +zinit-additional.zsh - a shell script + +Documentation automatically generated with `zshelldoc' + +== FUNCTIONS + +zinit-debug + .zinit-debug-clear + .zinit-debug-report + .zinit-debug-revert + .zinit-debug-start + .zinit-debug-status + .zinit-debug-stop + .zinit-service + .zinit-wrap-track-functions + :zinit-tmp-subst-source + +=== DETAILS + +==== Script Body + +Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.). + +==== +zinit-debug + +____ + + Debug command entry point + +____ + +Has 35 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_, _zmodload_, _zparseopts_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-debug-clear + +____ + + Clear latest debug report + +____ + +Has 7 line(s). Calls functions: + + .zinit-debug-clear + |-- zinit-autoload.zsh/.zinit-clear-report-for + `-- zinit.zsh/+zi-log + +Called by: + + zinit-autoload.zsh/.zinit-unload + +==== .zinit-debug-report + +____ + + Displays debug report (data recorded in interactive session). + +____ + +Has 6 line(s). Calls functions: + + .zinit-debug-report + |-- zinit-autoload.zsh/.zinit-show-report + `-- zinit.zsh/+zi-log + +Uses feature(s): _source_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-debug-revert + +____ + + Revert changes made during debug mode + +____ + +Has 7 line(s). Calls functions: + + .zinit-debug-revert + |-- zinit-autoload.zsh/.zinit-unload + `-- zinit.zsh/+zi-log + +Uses feature(s): _source_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-debug-start + +____ + + Start debug mode + +____ + +Has 13 line(s). Calls functions: + + .zinit-debug-start + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-diff + `-- zinit.zsh/.zinit-tmp-subst-on + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-debug-status + +____ + + Revert changes made during debug mode + +____ + +Has 2 line(s). Calls functions: + + .zinit-debug-status + `-- zinit.zsh/+zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-debug-stop + +____ + + Stop debug mode + +____ + +Has 14 line(s). Calls functions: + + .zinit-debug-stop + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-diff + `-- zinit.zsh/.zinit-tmp-subst-off + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-service + +____ + + Handles given service, i.e. obtains lock, runs it, or waits if no lock + + $1 - type "p" or "s" (plugin or snippet) + $2 - mode - for plugin (light or load) + $3 - id - URL or plugin ID or alias name (from id-as'') + +____ + +Has 37 line(s). Calls functions: + + .zinit-service + |-- zinit.zsh/.zinit-load + `-- zinit.zsh/.zinit-load-snippet + +Uses feature(s): _kill_, _read_, _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-wrap-track-functions + +Has 19 line(s). Doesn't call other functions. + +Uses feature(s): _eval_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-source + +Has 25 line(s). Calls functions: + + :zinit-tmp-subst-source + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + diff --git a/doc/zsdoc/zinit-autoload.zsh.adoc b/doc/zsdoc/zinit-autoload.zsh.adoc new file mode 100644 index 00000000..f198e05b --- /dev/null +++ b/doc/zsdoc/zinit-autoload.zsh.adoc @@ -0,0 +1,1661 @@ + +NAME + +zinit-autoload.zsh - a shell script + +Documentation automatically generated with `zshelldoc' + +== FUNCTIONS + .zi-check-for-git-changes + .zinit-any-to-uspl2 + .zinit-at-eval + .zinit-build-module + .zinit-cd + .zinit-cdisable + .zinit-cenable + .zinit-changes + .zinit-check-comp-consistency + .zinit-check-which-completions-are-enabled + .zinit-check-which-completions-are-installed + .zinit-clear-completions + .zinit-clear-report-for + .zinit-compile-plugin + .zinit-compile-uncompile-all + .zinit-compiled + .zinit-confirm + .zinit-create + .zinit-delete + .zinit-diff-env-compute + .zinit-diff-functions-compute + .zinit-diff-options-compute + .zinit-diff-parameter-compute + .zinit-edit + .zinit-exists-message + .zinit-find-completions-of-plugin + .zinit-format-env + .zinit-format-functions + .zinit-format-options + .zinit-format-parameter + .zinit-get-completion-owner + .zinit-get-completion-owner-uspl2col + .zinit-get-path + .zinit-glance + .zinit-help + .zinit-list-bindkeys + .zinit-list-compdef-replay + .zinit-list-plugins + .zinit-list-snippets + .zinit-module + .zinit-pager + .zinit-prepare-readlink + .zinit-prompt + .zinit-recall + .zinit-recently + .zinit-restore-extendedglob + .zinit-run-delete-hooks + .zinit-save-set-extendedglob + .zinit-search-completions + .zinit-self-update + .zinit-show-all-reports + .zinit-show-completions + .zinit-show-debug-report + .zinit-show-report + .zinit-show-times + .zinit-show-zstatus + .zinit-stress + .zinit-uncompile-plugin + .zinit-uninstall-completions + .zinit-unload + .zinit-unregister-plugin + .zinit-update-all-parallel + .zinit-update-or-status + .zinit-update-or-status-all + .zinit-update-or-status-snippet + .zinit-wait-for-update-jobs + zi::version + +=== DETAILS + +==== Script Body + +Has 5 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.). + +Uses feature(s): _source_ + +==== .zi-check-for-git-changes + +____ + + Check for Git updates + + $1 - Absolute path to Git repository" + +____ + +Has 12 line(s). Calls functions: + + .zi-check-for-git-changes + `-- zinit.zsh/+zi-log + +Called by: + + .zinit-self-update + +==== .zinit-any-to-uspl2 + +____ + + Converts given plugin-spec to format that's used in keys for hash tables. + So basically, creates string "user/plugin" (this format is called: uspl2). + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - (optional) plugin (only when $1 - i.e. user - given) + +____ + +Has 2 line(s). Calls functions: + + .zinit-any-to-uspl2 + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + .zinit-clear-report-for + .zinit-exists-message + +==== .zinit-at-eval + +Has 5 line(s). Calls functions: + + .zinit-at-eval + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-build-module + +____ + + Performs ./configure && make on the module and displays information + how to load the module in .zshrc. + +____ + +Has 39 line(s). Calls functions: + + .zinit-build-module + |-- .zinit-module + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_, _trap_ + +Called by: + + .zinit-module + +==== .zinit-cd + +____ + + Jumps to plugin's directory (in Zinit's home directory). + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 15 line(s). Calls functions: + + .zinit-cd + |-- .zinit-get-path + |   `-- zinit.zsh/.zinit-get-object-path + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-cdisable + +____ + + Enables given installed completion. + + User-action entry point. + + $1 - e.g. "_mkdir" or "mkdir" + +____ + +Has 30 line(s). Calls functions: + + .zinit-cdisable + |-- .zinit-check-comp-consistency + |-- .zinit-get-completion-owner-uspl2col + |   |-- .zinit-get-completion-owner + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + `-- .zinit-prepare-readlink + +Called by: + + zinit.zsh/zinit + +==== .zinit-cenable + +____ + + Disables given installed completion. + + User-action entry point. + + $1 - e.g. "_mkdir" or "mkdir" + +____ + +Has 31 line(s). Calls functions: + + .zinit-cenable + |-- .zinit-check-comp-consistency + |-- .zinit-get-completion-owner-uspl2col + |   |-- .zinit-get-completion-owner + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + `-- .zinit-prepare-readlink + +Called by: + + zinit.zsh/zinit + +==== .zinit-changes + +____ + + Shows `git log` of given plugin. + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 9 line(s). Calls functions: + + .zinit-changes + |-- zinit-side.zsh/.zinit-exists-physically-message + `-- zinit.zsh/.zinit-any-to-user-plugin + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-check-comp-consistency + +____ + + Zinit creates symlink for each installed completion. + This function checks whether given completion (i.e. + file like "_mkdir") is indeed a symlink. Backup file + is a completion that is disabled - has the leading "_" + removed. + + $1 - path to completion within plugin's directory + $2 - path to backup file within plugin's directory + +____ + +Has 11 line(s). Doesn't call other functions. + +Called by: + + .zinit-cdisable + .zinit-cenable + +==== .zinit-check-which-completions-are-enabled + +____ + + For each argument that each should be a path to completion + within a plugin's dir, it checks whether that completion + is disabled - returns 0 or 1 on corresponding positions + in reply. + + Uninstalled completions will be reported as "0" + - i.e. disabled + + $1, ... - path to completion within plugin's directory + +____ + +Has 11 line(s). Doesn't call other functions. + +Called by: + + .zinit-show-report + +==== .zinit-check-which-completions-are-installed + +____ + + For each argument that each should be a path to completion + within a plugin's dir, it checks whether that completion + is installed - returns 0 or 1 on corresponding positions + in reply. + + $1, ... - path to completion within plugin's directory + +____ + +Has 12 line(s). Doesn't call other functions. + +Called by: + + .zinit-show-report + +==== .zinit-clear-completions + +____ + + Delete stray and improper completions. + + Completions live even when plugin isn't loaded - if they are + installed and enabled. + + User-action entry point. + +____ + +Has 37 line(s). Calls functions: + + .zinit-clear-completions + |-- .zinit-get-completion-owner + |-- .zinit-prepare-readlink + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/.zinit-prepare-home + zinit.zsh/zinit + +==== .zinit-clear-report-for + +____ + + Clears all report data for given user/plugin. This is + done by resetting all related global ZINIT_* hashes. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - (optional) plugin (only when $1 - i.e. user - given) + +____ + +Has 23 line(s). Calls functions: + + .zinit-clear-report-for + `-- .zinit-any-to-uspl2 + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + .zinit-unload + zinit-additional.zsh/.zinit-debug-clear + +==== .zinit-compile-plugin + +____ + + Compiles given plugin (its main source file, and also an + additional "....zsh" file if it exists). + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 85 line(s). Calls functions: + + .zinit-compile-plugin + |-- zinit-side.zsh/.zinit-compute-ice + |-- zinit-side.zsh/.zinit-first + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_, _zcompile_ + +Called by: + + zinit-install.zsh/∞zinit-compile-plugin-hook + +==== .zinit-compile-uncompile-all + +____ + + Compiles or uncompiles all existing (on disk) plugins. + + User-action entry point. + +____ + +Has 24 line(s). Calls functions: + + .zinit-compile-uncompile-all + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-compiled + +____ + + Displays list of plugins that are compiled. + + User-action entry point. + +____ + +Has 21 line(s). Calls functions: + + .zinit-compiled + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-confirm + +____ + + Prints given question, waits for "y" key, evals + given expression if "y" obtained + + $1 - question + $2 - expression + +____ + +Has 17 line(s). Calls functions: + + .zinit-confirm + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_, _read_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-create + +____ + + Creates a plugin, also on Github (if not "_local/name" plugin). + + User-action entry point. + + $1 - (optional) plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - (optional) plugin (only when $1 - i.e. user - given) + +____ + +Has 102 line(s). Calls functions: + + .zinit-create + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit-side.zsh/.zinit-exists-physically + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _autoload_, _setopt_, _vared_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-delete + +____ + + Deletes a plugin or snippet and related files and hooks + + $1 - snippet url or plugin + +____ + +Has 129 line(s). Calls functions: + + .zinit-delete + |-- .zinit-prompt + |-- .zinit-run-delete-hooks + |   `-- zinit.zsh/+zi-log + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-any-to-user-plugin + `-- zinit.zsh/zinit + +Uses feature(s): _setopt_, _zmodload_, _zparseopts_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-diff-env-compute + +____ + + Computes ZINIT_PATH, ZINIT_FPATH that hold (f)path components + added by plugin. Uses data gathered earlier by .zinit-diff-env(). + + $1 - user/plugin + +____ + +Has 30 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + .zinit-unload + +==== .zinit-diff-functions-compute + +____ + + Computes FUNCTIONS that holds new functions added by plugin. + Uses data gathered earlier by .zinit-diff-functions(). + + $1 - user/plugin + +____ + +Has 19 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + .zinit-unload + +==== .zinit-diff-options-compute + +____ + + Computes OPTIONS that holds options changed by plugin. + Uses data gathered earlier by .zinit-diff-options(). + + $1 - user/plugin + +____ + +Has 17 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + .zinit-unload + +==== .zinit-diff-parameter-compute + +____ + + Computes ZINIT_PARAMETERS_PRE, ZINIT_PARAMETERS_POST that hold + parameters created or changed (their type) by plugin. Uses + data gathered earlier by .zinit-diff-parameter(). + + $1 - user/plugin + +____ + +Has 28 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + .zinit-unload + +==== .zinit-edit + +____ + + Runs $EDITOR on source of given plugin. If the variable is not + set then defaults to `vim'. + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 22 line(s). Calls functions: + + .zinit-edit + `-- zinit-side.zsh/.zinit-compute-ice + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-exists-message + +____ + + Checks if plugin is loaded. Testable. Also outputs error + message if plugin is not loaded. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - (optional) plugin (only when $1 - i.e. user - given) + +____ + +Has 7 line(s). Calls functions: + + .zinit-exists-message + |-- .zinit-any-to-uspl2 + |   `-- zinit.zsh/.zinit-any-to-user-plugin + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Called by: + + .zinit-show-report + .zinit-unload + +==== .zinit-find-completions-of-plugin + +____ + + Searches for completions owned by given plugin. + Returns them in `reply' array. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 6 line(s). Calls functions: + + .zinit-find-completions-of-plugin + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + +==== .zinit-format-env + +____ + + Creates one-column text about FPATH or PATH elements + added when given plugin was loaded. + + $1 - user/plugin (i.e. uspl2 format of plugin-spec) + $2 - if 1, then examine PATH, if 2, then examine FPATH + +____ + +Has 16 line(s). Doesn't call other functions. + +Called by: + + .zinit-show-report + +==== .zinit-format-functions + +____ + + Creates a one or two columns text with functions created + by given plugin. + + $1 - user/plugin (i.e. uspl2 format of plugin-spec) + +____ + +Has 36 line(s). Doesn't call other functions. + +Called by: + + .zinit-show-report + +==== .zinit-format-options + +____ + + Creates one-column text about options that changed when + plugin "$1" was loaded. + + $1 - user/plugin (i.e. uspl2 format of plugin-spec) + +____ + +Has 21 line(s). Calls functions: + + .zinit-format-options + |-- .zinit-restore-extendedglob + `-- .zinit-save-set-extendedglob + +Called by: + + .zinit-show-report + +==== .zinit-format-parameter + +____ + + Creates one column text that lists global parameters that + changed when the given plugin was loaded. + + $1 - user/plugin (i.e. uspl2 format of plugin-spec) + +____ + +Has 35 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-report + +==== .zinit-get-completion-owner + +____ + + Returns "user---plugin" string (uspl1 format) of plugin that + owns given completion. + + Both :A and readlink will be used, then readlink's output if + results differ. Readlink might not be available. + + :A will read the link "twice" and give the final repository + directory, possibly without username in the uspl format; + readlink will read the link "once" + + $1 - absolute path to completion file (in COMPLETIONS_DIR) + $2 - readlink command (":" or "readlink") + +____ + +Has 22 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-clear-completions + .zinit-get-completion-owner-uspl2col + .zinit-show-completions + +==== .zinit-get-completion-owner-uspl2col + +____ + + For shortening of code - returns colorized plugin name + that owns given completion. + + $1 - absolute path to completion file (in COMPLETIONS_DIR) + $2 - readlink command (":" or "readlink") + +____ + +Has 2 line(s). Calls functions: + + .zinit-get-completion-owner-uspl2col + |-- .zinit-get-completion-owner + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Called by: + + .zinit-cdisable + .zinit-cenable + +==== .zinit-get-path + +____ + + Returns path of given ID-string, which may be a plugin-spec + (like "user/plugin" or "user" "plugin"), an absolute path + ("%" "/home/..." and also "%SNIPPETS/..." etc.), or a plugin + nickname (i.e. id-as'' ice-mod), or a snippet nickname. + +____ + +Has 8 line(s). Calls functions: + + .zinit-get-path + `-- zinit.zsh/.zinit-get-object-path + +Uses feature(s): _setopt_ + +Called by: + + .zinit-cd + .zinit-uninstall-completions + +==== .zinit-glance + +____ + + Shows colorized source code of plugin. Is able to use pygmentize, + highlight, GNU source-highlight. + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 39 line(s). Calls functions: + + .zinit-glance + |-- .zinit-pager + |-- zinit-side.zsh/.zinit-exists-physically-message + |-- zinit-side.zsh/.zinit-first + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-any-to-user-plugin + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-help + +____ + + Shows usage information. + + User-action entry point. + +____ + +Has 64 line(s). Doesn't call other functions. + +Called by: + + zinit.zsh/zinit + +==== .zinit-list-bindkeys + +Has 44 line(s). Calls functions: + + .zinit-list-bindkeys + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Called by: + + zinit.zsh/zinit + +==== .zinit-list-compdef-replay + +____ + + Shows recorded compdefs (called by plugins loaded earlier). + Plugins often call `compdef' hoping for `compinit' being + already ran. Zinit solves this by recording compdefs. + + User-action entry point. + +____ + +Has 5 line(s). Doesn't call other functions. + +Called by: + + zinit.zsh/zinit + +==== .zinit-list-plugins + +____ + + Lists loaded plugins + +____ + +Has 21 line(s). Calls functions: + + .zinit-list-plugins + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-list-snippets + +Has 20 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-module + +____ + + Function that has sub-commands passed as long-options (with two dashes, --). + It's an attempt to plugin only this one function into `zinit' function + defined in zinit.zsh, to not make this file longer than it's needed. + +____ + +Has 24 line(s). Calls functions: + + .zinit-module + `-- .zinit-build-module + `-- zinit.zsh/+zi-log + +Called by: + + .zinit-build-module + zinit.zsh/Script-Body + zinit.zsh/zinit + +==== .zinit-pager + +____ + + BusyBox less lacks the -X and -i options, so it can use more + +____ + +Has 14 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-glance + .zinit-self-update + .zinit-update-or-status + +==== .zinit-prepare-readlink + +____ + + Prepares readlink command, used for establishing completion's owner. + + $REPLY = ":" or "readlink" + +____ + +Has 4 line(s). Doesn't call other functions. + +Uses feature(s): _type_ + +Called by: + + .zinit-cdisable + .zinit-cenable + .zinit-clear-completions + .zinit-show-completions + +==== .zinit-prompt + +____ + + Prompt user to confirm + + $1 - prompt + + $REPLY - 0 or 1 + +____ + +Has 4 line(s). Doesn't call other functions. + +Uses feature(s): _read_ + +Called by: + + .zinit-delete + +==== .zinit-recall + +Has 38 line(s). Calls functions: + + .zinit-recall + |-- zinit-side.zsh/.zinit-compute-ice + `-- zinit.zsh/+zinit-deploy-message + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-recently + +____ + + Shows plugins that obtained commits in specified past time. + + User-action entry point. + + $1 - time spec, e.g. "1 week" + +____ + +Has 28 line(s). Calls functions: + + .zinit-recently + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-restore-extendedglob + +____ + + Restores extendedglob-option from state saved earlier. + +____ + +Has 1 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-format-options + .zinit-unload + +==== .zinit-run-delete-hooks + +Has 33 line(s). Calls functions: + + .zinit-run-delete-hooks + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_ + +Called by: + + .zinit-delete + +==== .zinit-save-set-extendedglob + +____ + + Enables extendedglob-option first saving if it was already + enabled, for restoration of this state later. + +____ + +Has 2 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-format-options + .zinit-unload + +==== .zinit-search-completions + +____ + + While .zinit-show-completions() shows what completions are + installed, this functions searches through all plugin dirs + showing what's available in general (for installation). + + User-action entry point. + +____ + +Has 43 line(s). Calls functions: + + .zinit-search-completions + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-self-update + +____ + + Updates Zinit code (does a git pull) + +____ + +Has 44 line(s). Calls functions: + + .zinit-self-update + |-- .zi-check-for-git-changes + |   `-- zinit.zsh/+zi-log + |-- .zinit-pager + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-get-mtime-into + +Uses feature(s): _setopt_, _source_, _zcompile_ + +Called by: + + .zinit-update-or-status-all + zinit.zsh/zinit + +==== .zinit-show-all-reports + +____ + + Displays reports of all loaded plugins. + + User-action entry point. + +____ + +Has 5 line(s). Calls functions: + + .zinit-show-all-reports + `-- .zinit-show-report + |-- .zinit-check-which-completions-are-enabled + |-- .zinit-check-which-completions-are-installed + |-- .zinit-diff-env-compute + |-- .zinit-diff-functions-compute + |-- .zinit-diff-options-compute + |-- .zinit-diff-parameter-compute + |-- .zinit-exists-message + |   |-- .zinit-any-to-uspl2 + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- .zinit-find-completions-of-plugin + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-format-env + |-- .zinit-format-functions + |-- .zinit-format-options + |   |-- .zinit-restore-extendedglob + |   `-- .zinit-save-set-extendedglob + |-- .zinit-format-parameter + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + zinit.zsh/zinit + +==== .zinit-show-completions + +____ + + Display installed (enabled and disabled), completions. Detect + stray and improper ones. + + Completions live even when plugin isn't loaded - if they are + installed and enabled. + + User-action entry point. + +____ + +Has 72 line(s). Calls functions: + + .zinit-show-completions + |-- .zinit-get-completion-owner + |-- .zinit-prepare-readlink + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-show-debug-report + +____ + + Displays dtrace report (data recorded in interactive session). + + User-action entry point. + +____ + +Has 1 line(s). Calls functions: + + .zinit-show-debug-report + `-- .zinit-show-report + |-- .zinit-check-which-completions-are-enabled + |-- .zinit-check-which-completions-are-installed + |-- .zinit-diff-env-compute + |-- .zinit-diff-functions-compute + |-- .zinit-diff-options-compute + |-- .zinit-diff-parameter-compute + |-- .zinit-exists-message + |   |-- .zinit-any-to-uspl2 + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- .zinit-find-completions-of-plugin + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-format-env + |-- .zinit-format-functions + |-- .zinit-format-options + |   |-- .zinit-restore-extendedglob + |   `-- .zinit-save-set-extendedglob + |-- .zinit-format-parameter + `-- zinit.zsh/.zinit-any-to-user-plugin + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-show-report + +____ + + Displays report of the plugin given. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user (+ plugin in $2), plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 71 line(s). Calls functions: + + .zinit-show-report + |-- .zinit-check-which-completions-are-enabled + |-- .zinit-check-which-completions-are-installed + |-- .zinit-diff-env-compute + |-- .zinit-diff-functions-compute + |-- .zinit-diff-options-compute + |-- .zinit-diff-parameter-compute + |-- .zinit-exists-message + |   |-- .zinit-any-to-uspl2 + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- .zinit-find-completions-of-plugin + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-format-env + |-- .zinit-format-functions + |-- .zinit-format-options + |   |-- .zinit-restore-extendedglob + |   `-- .zinit-save-set-extendedglob + |-- .zinit-format-parameter + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + .zinit-show-all-reports + .zinit-show-debug-report + zinit-additional.zsh/.zinit-debug-report + zinit.zsh/zinit + +==== .zinit-show-times + +____ + + Shows loading times of all loaded plugins. + + User-action entry point. + +____ + +Has 65 line(s). Calls functions: + + .zinit-show-times + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-show-zstatus + +____ + + Shows Zinit status, i.e. number of loaded plugins, + of available completions, etc. + + User-action entry point. + +____ + +Has 47 line(s). Calls functions: + + .zinit-show-zstatus + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-stress + +____ + + Compiles plugin with various options on and off to see + how well the code is written. The options are: + + NO_SHORT_LOOPS, IGNORE_BRACES, IGNORE_CLOSE_BRACES, SH_GLOB, + CSH_JUNKIE_QUOTES, NO_MULTI_FUNC_DEF. + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 38 line(s). Calls functions: + + .zinit-stress + |-- zinit-side.zsh/.zinit-exists-physically-message + |-- zinit-side.zsh/.zinit-first + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_, _zcompile_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-uncompile-plugin + +____ + + Uncompiles given plugin. + + User-action entry point. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user (+ plugin in $2), plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 29 line(s). Calls functions: + + .zinit-uncompile-plugin + |-- zinit-side.zsh/.zinit-compute-ice + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-uninstall-completions + +____ + + Removes all completions of given plugin from Zshell (i.e. from FPATH). + The FPATH is typically `~/.zinit/completions/'. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 46 line(s). Calls functions: + + .zinit-uninstall-completions + |-- .zinit-get-path + |   `-- zinit.zsh/.zinit-get-object-path + |-- zinit-install.zsh/.zinit-compinit + |-- zinit-install.zsh/.zinit-forget-completion + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_, _source_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-unload + +____ + + 1. call the zsh plugin's standard *_plugin_unload function + 2. call the code provided by the zsh plugin's standard @zsh-plugin-run-at-update + 3. delete bindkeys (...) + 4. delete zstyles + 5. restore options + 6. remove aliases + 7. restore zle state + 8. unfunction functions (created by plugin) + 9. clean-up fpath and path + 10. delete created variables + 11. forget the plugin + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 385 line(s). Calls functions: + + .zinit-unload + |-- .zinit-clear-report-for + |   `-- .zinit-any-to-uspl2 + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-diff-env-compute + |-- .zinit-diff-functions-compute + |-- .zinit-diff-options-compute + |-- .zinit-diff-parameter-compute + |-- .zinit-exists-message + |   |-- .zinit-any-to-uspl2 + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- .zinit-restore-extendedglob + |-- .zinit-save-set-extendedglob + |-- .zinit-unregister-plugin + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- zinit-additional.zsh/.zinit-debug-clear + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _alias_, _bindkey_, _eval_, _setopt_, _unalias_, _unfunction_, _zle_, _zstyle_ + +Called by: + + zinit-additional.zsh/.zinit-debug-revert + zinit.zsh/.zinit-run-task + zinit.zsh/zinit + +==== .zinit-unregister-plugin + +____ + + Removes the plugin from ZINIT_REGISTERED_PLUGINS array and from the + zsh_loaded_plugins array (managed according to the plugin standard) + +____ + +Has 6 line(s). Calls functions: + + .zinit-unregister-plugin + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + .zinit-unload + +==== .zinit-update-all-parallel + +Has 84 line(s). Calls functions: + + .zinit-update-all-parallel + |-- .zinit-update-or-status + |   |-- .zinit-pager + |   |-- .zinit-update-or-status-snippet + |   |   |-- zinit-install.zsh/.zinit-update-snippet + |   |   `-- zinit-side.zsh/.zinit-compute-ice + |   |-- zinit-install.zsh/.zinit-get-latest-gh-r-url-part + |   |-- zinit-install.zsh/.zinit-setup-plugin-dir + |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |-- zinit-side.zsh/.zinit-compute-ice + |   |-- zinit-side.zsh/.zinit-exists-physically + |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |-- zinit-side.zsh/.zinit-store-ices + |   |-- zinit-side.zsh/.zinit-two-paths + |   |-- zinit.zsh/+zi-log + |   |-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit.zsh/.zinit-set-m-func + |-- .zinit-update-or-status-snippet + |   |-- zinit-install.zsh/.zinit-update-snippet + |   `-- zinit-side.zsh/.zinit-compute-ice + |-- .zinit-wait-for-update-jobs + |   `-- zinit.zsh/+zi-log + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + .zinit-update-or-status-all + +==== .zinit-update-or-status + +____ + + Updates (git pull) or does `git status' for given plugin. + + User-action entry point. + + $1 - "status" for status, other for update + $2 - plugin spec (4 formats: user---plugin, user/plugin, user (+ plugin in $2), plugin) + $3 - plugin (only when $1 - i.e. user - given) + +____ + +Has 325 line(s). Calls functions: + + .zinit-update-or-status + |-- .zinit-pager + |-- .zinit-update-or-status-snippet + |   |-- zinit-install.zsh/.zinit-update-snippet + |   `-- zinit-side.zsh/.zinit-compute-ice + |-- zinit-install.zsh/.zinit-get-latest-gh-r-url-part + |-- zinit-install.zsh/.zinit-setup-plugin-dir + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit-side.zsh/.zinit-compute-ice + |-- zinit-side.zsh/.zinit-exists-physically + |-- zinit-side.zsh/.zinit-exists-physically-message + |-- zinit-side.zsh/.zinit-store-ices + |-- zinit-side.zsh/.zinit-two-paths + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-any-to-user-plugin + `-- zinit.zsh/.zinit-set-m-func + +Uses feature(s): _kill_, _read_, _setopt_, _source_, _trap_, _wait_ + +Called by: + + .zinit-update-all-parallel + .zinit-update-or-status-all + zinit.zsh/zinit + +==== .zinit-update-or-status-all + +____ + + Updates (git pull) or does `git status` for all existing plugins. + This includes also plugins that are not loaded into Zsh (but exist + on disk). Also updates (i.e. redownloads) snippets. + + User-action entry point. + +____ + +Has 133 line(s). Calls functions: + + .zinit-update-or-status-all + |-- .zinit-self-update + |   |-- .zi-check-for-git-changes + |   |   `-- zinit.zsh/+zi-log + |   |-- .zinit-pager + |   |-- zinit.zsh/+zi-log + |   `-- zinit.zsh/.zinit-get-mtime-into + |-- .zinit-update-all-parallel + |   |-- .zinit-update-or-status + |   |   |-- .zinit-pager + |   |   |-- .zinit-update-or-status-snippet + |   |   |   |-- zinit-install.zsh/.zinit-update-snippet + |   |   |   `-- zinit-side.zsh/.zinit-compute-ice + |   |   |-- zinit-install.zsh/.zinit-get-latest-gh-r-url-part + |   |   |-- zinit-install.zsh/.zinit-setup-plugin-dir + |   |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |   |-- zinit-side.zsh/.zinit-compute-ice + |   |   |-- zinit-side.zsh/.zinit-exists-physically + |   |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |   |-- zinit-side.zsh/.zinit-store-ices + |   |   |-- zinit-side.zsh/.zinit-two-paths + |   |   |-- zinit.zsh/+zi-log + |   |   |-- zinit.zsh/.zinit-any-to-user-plugin + |   |   `-- zinit.zsh/.zinit-set-m-func + |   |-- .zinit-update-or-status-snippet + |   |   |-- zinit-install.zsh/.zinit-update-snippet + |   |   `-- zinit-side.zsh/.zinit-compute-ice + |   |-- .zinit-wait-for-update-jobs + |   |   `-- zinit.zsh/+zi-log + |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |-- zinit.zsh/+zi-log + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-update-or-status + |   |-- .zinit-pager + |   |-- .zinit-update-or-status-snippet + |   |   |-- zinit-install.zsh/.zinit-update-snippet + |   |   `-- zinit-side.zsh/.zinit-compute-ice + |   |-- zinit-install.zsh/.zinit-get-latest-gh-r-url-part + |   |-- zinit-install.zsh/.zinit-setup-plugin-dir + |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |-- zinit-side.zsh/.zinit-compute-ice + |   |-- zinit-side.zsh/.zinit-exists-physically + |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |-- zinit-side.zsh/.zinit-store-ices + |   |-- zinit-side.zsh/.zinit-two-paths + |   |-- zinit.zsh/+zi-log + |   |-- zinit.zsh/.zinit-any-to-user-plugin + |   `-- zinit.zsh/.zinit-set-m-func + |-- .zinit-update-or-status-snippet + |   |-- zinit-install.zsh/.zinit-update-snippet + |   `-- zinit-side.zsh/.zinit-compute-ice + |-- zinit-install.zsh/.zinit-compinit + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-any-to-user-plugin + `-- zinit.zsh/.zinit-get-mtime-into + +Uses feature(s): _setopt_, _source_ + +Called by: + + zinit.zsh/zinit + +==== .zinit-update-or-status-snippet + +____ + + + Implements update or status operation for snippet given by URL. + + $1 - "status" or "update" + $2 - snippet URL + +____ + +Has 34 line(s). Calls functions: + + .zinit-update-or-status-snippet + |-- zinit-install.zsh/.zinit-update-snippet + `-- zinit-side.zsh/.zinit-compute-ice + +Uses feature(s): _source_ + +Called by: + + .zinit-update-all-parallel + .zinit-update-or-status-all + .zinit-update-or-status + +==== .zinit-wait-for-update-jobs + +Has 18 line(s). Calls functions: + + .zinit-wait-for-update-jobs + `-- zinit.zsh/+zi-log + +Uses feature(s): _wait_ + +Called by: + + .zinit-update-all-parallel + +==== zi::version + +____ + + Shows usage information. + + User-action entry point. + +____ + +Has 2 line(s). Calls functions: + + zi::version + `-- zinit.zsh/+zi-log + +Called by: + + zinit.zsh/zinit + diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc new file mode 100644 index 00000000..a4791d77 --- /dev/null +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -0,0 +1,837 @@ + +NAME + +zinit-install.zsh - a shell script + +Documentation automatically generated with `zshelldoc' + +== FUNCTIONS + +zinit-cmake-hook + .zi::get-architecture + .zinit-at-eval + .zinit-compinit + .zinit-download-file-stdout + .zinit-download-snippet + .zinit-extract + .zinit-forget-completion + .zinit-get-cygwin-package + .zinit-get-latest-gh-r-url-part + .zinit-get-package + .zinit-get-url-mtime + .zinit-install-completions + .zinit-jq-check + .zinit-json-get-value + .zinit-json-to-array + .zinit-mirror-using-svn + .zinit-setup-plugin-dir + .zinit-single-line + .zinit-update-snippet + __zinit-cmake-base-hook + zicp + ziextract + zimv + ∞zinit-atclone-hook + ∞zinit-atpull-e-hook + ∞zinit-atpull-hook + ∞zinit-compile-plugin-hook + ∞zinit-configure-base-hook + ∞zinit-configure-e-hook + ∞zinit-configure-hook + ∞zinit-cp-hook + ∞zinit-extract-hook + ∞zinit-file-cp-mv-operation + ∞zinit-make-base-hook + ∞zinit-make-e-hook + ∞zinit-make-ee-hook + ∞zinit-make-hook + ∞zinit-mv-hook + ∞zinit-ps-on-update-hook + ∞zinit-reset-hook +AUTOLOAD compinit + +=== DETAILS + +==== Script Body + +Has 6 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.). + +Uses feature(s): _source_ + +==== +zinit-cmake-hook + +Has 1 line(s). Calls functions: + + +zinit-cmake-hook + `-- __zinit-cmake-base-hook + `-- zinit.zsh/+zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zi::get-architecture + +Has 39 line(s). Calls functions: + + .zi::get-architecture + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-at-eval + +Has 9 line(s). Calls functions: + + .zinit-at-eval + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_ + +Called by: + + ∞zinit-atpull-e-hook + ∞zinit-atpull-hook + +==== .zinit-compinit + +____ + + User-exposed `compinit' frontend which first ensures that all + completions managed by Zinit are forgotten by Zshell. After + that it runs normal `compinit', which should more easily detect + Zinit's completions. + + No arguments. + +____ + +Has 26 line(s). Calls functions: + + .zinit-compinit + |-- .zinit-forget-completion + |-- compinit + `-- zinit.zsh/+zi-log + +Uses feature(s): _autoload_, _compinit_, _setopt_, _unfunction_ + +Called by: + + .zinit-install-completions + zinit-autoload.zsh/.zinit-uninstall-completions + zinit-autoload.zsh/.zinit-update-or-status-all + zinit.zsh/.zinit-prepare-home + zinit.zsh/zinit + +==== .zinit-download-file-stdout + +____ + + Downloads file to stdout. Supports following backend commands: + curl, wget, lftp, lynx. Used by snippet loading. + +____ + +Has 53 line(s). Calls functions: + + .zinit-download-file-stdout + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_, _trap_, _type_ + +Called by: + + .zinit-download-snippet + .zinit-get-cygwin-package + .zinit-get-package + .zinit-setup-plugin-dir + +==== .zinit-download-snippet + +____ + + Downloads snippet + file – with curl, wget, lftp or lynx, + directory, with Subversion – when svn-ICE is active. + + Github supports Subversion protocol and allows to clone subdirectories. + This is used to provide a layer of support for Oh-My-Zsh and Prezto. + +____ + +Has 377 line(s). Calls functions: + + .zinit-download-snippet + |-- .zinit-download-file-stdout + |   `-- zinit.zsh/+zi-log + |-- .zinit-get-url-mtime + |-- .zinit-install-completions + |   |-- .zinit-compinit + |   |   |-- .zinit-forget-completion + |   |   |-- compinit + |   |   `-- zinit.zsh/+zi-log + |   |-- .zinit-forget-completion + |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |-- zinit.zsh/+zi-log + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-mirror-using-svn + |-- zinit-side.zsh/.zinit-store-ices + |-- zinit.zsh/+zi-log + `-- zinit.zsh/is-at-least + +Uses feature(s): _is-at-least_, _setopt_, _trap_, _zcompile_ + +Called by: + + .zinit-update-snippet + zinit.zsh/.zinit-load-snippet + +==== .zinit-extract + +Has 30 line(s). Calls functions: + + .zinit-extract + |-- ziextract + |   `-- zinit.zsh/+zi-log + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Called by: + + ∞zinit-extract-hook + +==== .zinit-forget-completion + +____ + + Implements alternation of Zsh state so that already initialized + completion stops being visible to Zsh. + + $1 - completion function name, e.g. "_cp"; can also be "cp" + +____ + +Has 20 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_, _unfunction_ + +Called by: + + .zinit-compinit + .zinit-install-completions + zinit-autoload.zsh/.zinit-uninstall-completions + zinit.zsh/zinit + +==== .zinit-get-cygwin-package + +Has 70 line(s). Calls functions: + + .zinit-get-cygwin-package + |-- .zinit-download-file-stdout + |   `-- zinit.zsh/+zi-log + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Called by: + + .zinit-setup-plugin-dir + +==== .zinit-get-latest-gh-r-url-part + +____ + + Gets version string of latest release of given Github + package. Connects to Github releases page. + +____ + +Has 55 line(s). Calls functions: + + .zinit-get-latest-gh-r-url-part + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_ + +Called by: + + .zinit-setup-plugin-dir + zinit-autoload.zsh/.zinit-update-or-status + +==== .zinit-get-package + +Has 195 line(s). Calls functions: + + .zinit-get-package + |-- .zinit-download-file-stdout + |   `-- zinit.zsh/+zi-log + |-- .zinit-jq-check + |   `-- zinit.zsh/+zi-log + |-- .zinit-json-to-array + |   `-- .zinit-jq-check + |   `-- zinit.zsh/+zi-log + |-- ziextract + |   `-- zinit.zsh/+zi-log + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_, _setopt_, _trap_ + +Called by: + + zinit.zsh/.zinit-load + +==== .zinit-get-url-mtime + +____ + + For the given URL returns the date in the Last-Modified + header as a time stamp + +____ + +Has 35 line(s). Doesn't call other functions. + +Uses feature(s): _read_, _setopt_, _trap_, _type_ + +Called by: + + .zinit-download-snippet + +==== .zinit-install-completions + +____ + + Installs all completions of given plugin. After that they are visible to + 'compinit'. Visible completions can be selectively disabled and enabled. User + can access completion data with 'completions' subcommand. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin if $1 (i.e., user) given + $3 - if 1, then reinstall, otherwise only install completions that are not present + +____ + +Has 62 line(s). Calls functions: + + .zinit-install-completions + |-- .zinit-compinit + |   |-- .zinit-forget-completion + |   |-- compinit + |   `-- zinit.zsh/+zi-log + |-- .zinit-forget-completion + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit-side.zsh/.zinit-exists-physically-message + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + .zinit-download-snippet + .zinit-setup-plugin-dir + zinit.zsh/zinit + +==== .zinit-jq-check + +____ + + Check if jq is available and outputs an error message with instructions if + that's not the case + +____ + +Has 8 line(s). Calls functions: + + .zinit-jq-check + `-- zinit.zsh/+zi-log + +Called by: + + .zinit-get-package + .zinit-json-get-value + .zinit-json-to-array + +==== .zinit-json-get-value + +____ + + Wrapper around jq that return the value of a property + + $1: JSON structure + $2: jq path + +____ + +Has 4 line(s). Calls functions: + + .zinit-json-get-value + `-- .zinit-jq-check + `-- zinit.zsh/+zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-json-to-array + +____ + + Wrapper around jq that sets key/values of an associative array, replicating + the structure of a given JSON object + + $1: JSON structure + $2: jq path + $3: name of the associative array to store the key/value pairs in + +____ + +Has 13 line(s). Calls functions: + + .zinit-json-to-array + `-- .zinit-jq-check + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_, _setopt_ + +Called by: + + .zinit-get-package + +==== .zinit-mirror-using-svn + +____ + + Used to clone subdirectories from Github. If in update mode + (see $2), then invokes `svn update', in normal mode invokes + `svn checkout --non-interactive -q '. In test mode only + compares remote and local revision and outputs true if update + is needed. + + $1 - URL + $2 - mode, "" - normal, "-u" - update, "-t" - test + $3 - subdirectory (not path) with working copy, needed for -t and -u + +____ + +Has 29 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-download-snippet + +==== .zinit-setup-plugin-dir + +____ + + Clones given plugin into PLUGIN_DIR. Supports multiple + sites (respecting `from' and `proto' ice modifiers). + Invokes compilation of plugin's main file. + + $1 - user + $2 - plugin + +____ + +Has 213 line(s). Calls functions: + + .zinit-setup-plugin-dir + |-- .zinit-download-file-stdout + |   `-- zinit.zsh/+zi-log + |-- .zinit-get-cygwin-package + |   |-- .zinit-download-file-stdout + |   |   `-- zinit.zsh/+zi-log + |   `-- zinit.zsh/+zi-log + |-- .zinit-get-latest-gh-r-url-part + |   `-- zinit.zsh/+zi-log + |-- .zinit-install-completions + |   |-- .zinit-compinit + |   |   |-- .zinit-forget-completion + |   |   |-- compinit + |   |   `-- zinit.zsh/+zi-log + |   |-- .zinit-forget-completion + |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |-- zinit.zsh/+zi-log + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- ziextract + |   `-- zinit.zsh/+zi-log + |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |-- zinit-side.zsh/.zinit-store-ices + |-- zinit.zsh/+zi-log + `-- zinit.zsh/.zinit-get-object-path + +Uses feature(s): _setopt_, _trap_ + +Called by: + + zinit-autoload.zsh/.zinit-update-or-status + zinit.zsh/.zinit-load + +==== .zinit-single-line + +____ + + Display cURL progress bar on a single line + +____ + +Has 20 line(s). Doesn't call other functions. + +Uses feature(s): _read_, _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-update-snippet + +Has 76 line(s). Calls functions: + + .zinit-update-snippet + |-- .zinit-download-snippet + |   |-- .zinit-download-file-stdout + |   |   `-- zinit.zsh/+zi-log + |   |-- .zinit-get-url-mtime + |   |-- .zinit-install-completions + |   |   |-- .zinit-compinit + |   |   |   |-- .zinit-forget-completion + |   |   |   |-- compinit + |   |   |   `-- zinit.zsh/+zi-log + |   |   |-- .zinit-forget-completion + |   |   |-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + |   |   |-- zinit-side.zsh/.zinit-exists-physically-message + |   |   |-- zinit.zsh/+zi-log + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   |-- .zinit-mirror-using-svn + |   |-- zinit-side.zsh/.zinit-store-ices + |   |-- zinit.zsh/+zi-log + |   `-- zinit.zsh/is-at-least + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-get-object-path + `-- zinit.zsh/.zinit-pack-ice + +Uses feature(s): _eval_, _setopt_ + +Called by: + + zinit-autoload.zsh/.zinit-update-or-status-snippet + +==== __zinit-cmake-base-hook + +____ + + FUNCTION: __zinit-cmake-base-hook [[[ + A base common implementation of the cmake ice + +____ + +Has 23 line(s). Calls functions: + + __zinit-cmake-base-hook + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_, _setopt_ + +Called by: + + +zinit-cmake-hook + +==== zicp + +Has 30 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + zimv + +==== ziextract + +____ + + If the file is an archive, it is extracted by this function. + Next stage is scanning of files with the common utility file + to detect executables. They are given +x mode. There are also + messages to the user on performed actions. + + $1 - url + $2 - file + +____ + +Has 283 line(s). Calls functions: + + ziextract + `-- zinit.zsh/+zi-log + +Uses feature(s): _setopt_, _unfunction_, _zparseopts_ + +Called by: + + .zinit-extract + .zinit-get-package + .zinit-setup-plugin-dir + +==== zimv + +Has 3 line(s). Calls functions: + + zimv + `-- zicp + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-atclone-hook + +Has 26 line(s). Calls functions: + + ∞zinit-atclone-hook + |-- zinit-side.zsh/.zinit-countdown + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_, _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-atpull-e-hook + +Has 22 line(s). Calls functions: + + ∞zinit-atpull-e-hook + |-- .zinit-at-eval + |   `-- zinit.zsh/@zinit-substitute + `-- zinit-side.zsh/.zinit-countdown + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-atpull-hook + +Has 22 line(s). Calls functions: + + ∞zinit-atpull-hook + |-- .zinit-at-eval + |   `-- zinit.zsh/@zinit-substitute + `-- zinit-side.zsh/.zinit-countdown + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-compile-plugin-hook + +Has 20 line(s). Calls functions: + + ∞zinit-compile-plugin-hook + `-- zinit-autoload.zsh/.zinit-compile-plugin + +Uses feature(s): _setopt_, _source_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-configure-base-hook + +____ + + A base common implementation of the configure ice + +____ + +Has 46 line(s). Calls functions: + + ∞zinit-configure-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_, _setopt_ + +Called by: + + ∞zinit-configure-e-hook + ∞zinit-configure-hook + +==== ∞zinit-configure-e-hook + +Has 1 line(s). Calls functions: + + ∞zinit-configure-e-hook + `-- ∞zinit-configure-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-configure-hook + +____ + + The non-! version of configure'' ice. Runs in between + of make'!' and make''. Configure script naturally runs + before make. + +____ + +Has 1 line(s). Calls functions: + + ∞zinit-configure-hook + `-- ∞zinit-configure-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-cp-hook + +Has 1 line(s). Calls functions: + + ∞zinit-cp-hook + `-- ∞zinit-file-cp-mv-operation + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-extract-hook + +Has 10 line(s). Calls functions: + + ∞zinit-extract-hook + |-- .zinit-extract + |   |-- ziextract + |   |   `-- zinit.zsh/+zi-log + |   `-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-file-cp-mv-operation + +Has 49 line(s). Calls functions: + + ∞zinit-file-cp-mv-operation + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _setopt_ + +Called by: + + ∞zinit-cp-hook + ∞zinit-mv-hook + +==== ∞zinit-make-base-hook + +____ + + A base common implementation of the make ice + +____ + +Has 57 line(s). Calls functions: + + ∞zinit-make-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Uses feature(s): _eval_, _setopt_ + +Called by: + + ∞zinit-make-e-hook + ∞zinit-make-ee-hook + ∞zinit-make-hook + +==== ∞zinit-make-e-hook + +Has 1 line(s). Calls functions: + + ∞zinit-make-e-hook + `-- ∞zinit-make-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-make-ee-hook + +Has 1 line(s). Calls functions: + + ∞zinit-make-ee-hook + `-- ∞zinit-make-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-make-hook + +Has 1 line(s). Calls functions: + + ∞zinit-make-hook + `-- ∞zinit-make-base-hook + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-mv-hook + +Has 1 line(s). Calls functions: + + ∞zinit-mv-hook + `-- ∞zinit-file-cp-mv-operation + |-- zinit.zsh/+zi-log + `-- zinit.zsh/@zinit-substitute + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-ps-on-update-hook + +Has 18 line(s). Calls functions: + + ∞zinit-ps-on-update-hook + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== ∞zinit-reset-hook + +Has 79 line(s). Calls functions: + + ∞zinit-reset-hook + `-- zinit.zsh/+zi-log + +Uses feature(s): _eval_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== compinit + +____ + + Initialisation for new style completion. This mainly contains some helper + functions and setup. Everything else is split into different files that + will automatically be made autoloaded (see the end of this file). The + names of the files that will be considered for autoloading are those that + begin with an underscores (like `_condition). + + The first line of each of these files is read and must indicate what + should be done with its contents: + + `#compdef ' + +____ + +Has 573 line(s). Doesn't call other functions. + +Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_ + +Called by: + + .zinit-compinit + diff --git a/doc/zsdoc/zinit-side.zsh.adoc b/doc/zsdoc/zinit-side.zsh.adoc new file mode 100644 index 00000000..735c2eee --- /dev/null +++ b/doc/zsdoc/zinit-side.zsh.adoc @@ -0,0 +1,285 @@ + +NAME + +zinit-side.zsh - a shell script + +Documentation automatically generated with `zshelldoc' + +== FUNCTIONS + .zinit-any-colorify-as-uspl2 + .zinit-compute-ice + .zinit-countdown + .zinit-exists-physically + .zinit-exists-physically-message + .zinit-first + .zinit-store-ices + .zinit-two-paths + +=== DETAILS + +==== Script Body + +Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.). + +==== .zinit-any-colorify-as-uspl2 + +____ + + Returns ANSI-colorified "user/plugin" string, from any supported + plugin spec (user---plugin, user/plugin, user plugin, plugin). + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + + $REPLY - ANSI-colorified "user/plugin" string + +____ + +Has 22 line(s). Calls functions: + + .zinit-any-colorify-as-uspl2 + |-- zinit.zsh/.zinit-any-to-pid + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + .zinit-exists-physically-message + zinit-autoload.zsh/.zinit-clear-completions + zinit-autoload.zsh/.zinit-compiled + zinit-autoload.zsh/.zinit-create + zinit-autoload.zsh/.zinit-exists-message + zinit-autoload.zsh/.zinit-get-completion-owner-uspl2col + zinit-autoload.zsh/.zinit-list-bindkeys + zinit-autoload.zsh/.zinit-recently + zinit-autoload.zsh/.zinit-search-completions + zinit-autoload.zsh/.zinit-show-completions + zinit-autoload.zsh/.zinit-show-times + zinit-autoload.zsh/.zinit-unload + zinit-autoload.zsh/.zinit-update-all-parallel + zinit-autoload.zsh/.zinit-update-or-status-all + zinit-autoload.zsh/.zinit-update-or-status + zinit-install.zsh/.zinit-install-completions + zinit-install.zsh/.zinit-setup-plugin-dir + zinit.zsh/.zinit-formatter-pid + +==== .zinit-compute-ice + +____ + + Computes ICE array + - input + - static + - saved + taking priorities into account. + Can also pack resulting ices into ZINIT_SICE (see $2). + Returns filepath to snippet directory and optional snippet file name (only + valid if ICE[svn] is not set). + + $1 - URL (also plugin-spec) + $2 - "pack" or "nopack" or "pack-nf" - packing means ICE + wins with static ice; "pack-nf" means that disk-ices will + be ignored (no-file?) + $3 - name of output associative array, "ICE" is the default + $4 - name of output string parameter, to hold path to directory ("local_dir") + $5 - name of output string parameter, to hold filename ("filename") + $6 - name of output string parameter, to hold is-snippet 0/1-bool ("is_snippet") + + $REPLY - snippet directory filepath + +____ + +Has 110 line(s). Calls functions: + + .zinit-compute-ice + |-- .zinit-exists-physically-message + |   |-- .zinit-any-colorify-as-uspl2 + |   |   |-- zinit.zsh/.zinit-any-to-pid + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   |-- .zinit-exists-physically + |   |   `-- zinit.zsh/.zinit-any-to-user-plugin + |   |-- zinit.zsh/+zi-log + |   |-- zinit.zsh/.zinit-any-to-pid + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-two-paths + |   |-- .zinit-first + |   |   |-- zinit.zsh/.zinit-any-to-pid + |   |   |-- zinit.zsh/.zinit-any-to-user-plugin + |   |   |-- zinit.zsh/.zinit-find-other-matches + |   |   `-- zinit.zsh/.zinit-get-object-path + |   `-- zinit.zsh/.zinit-get-object-path + |-- zinit.zsh/.zinit-any-to-user-plugin + `-- zinit.zsh/.zinit-pack-ice + +Uses feature(s): _setopt_ + +Called by: + + zinit-autoload.zsh/.zinit-compile-plugin + zinit-autoload.zsh/.zinit-edit + zinit-autoload.zsh/.zinit-recall + zinit-autoload.zsh/.zinit-uncompile-plugin + zinit-autoload.zsh/.zinit-update-or-status-snippet + zinit-autoload.zsh/.zinit-update-or-status + +==== .zinit-countdown + +____ + + Displays a countdown 5...4... etc. + + $REPLY - 1 if Ctrl-C is pressed, otherwise 0 + +____ + +Has 20 line(s). Calls functions: + + .zinit-countdown + `-- zinit.zsh/+zi-log + +Uses feature(s): _trap_ + +Called by: + + zinit-install.zsh/∞zinit-atclone-hook + zinit-install.zsh/∞zinit-atpull-e-hook + zinit-install.zsh/∞zinit-atpull-hook + +==== .zinit-exists-physically + +____ + + Checks if directory of given plugin exists in PLUGIN_DIR. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 8 line(s). Calls functions: + + .zinit-exists-physically + `-- zinit.zsh/.zinit-any-to-user-plugin + +Called by: + + .zinit-exists-physically-message + zinit-autoload.zsh/.zinit-create + zinit-autoload.zsh/.zinit-update-or-status + +==== .zinit-exists-physically-message + +____ + + Checks if directory of given plugin exists in PLUGIN_DIR, and outputs error + message if it doesn't. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 25 line(s). Calls functions: + + .zinit-exists-physically-message + |-- .zinit-any-colorify-as-uspl2 + |   |-- zinit.zsh/.zinit-any-to-pid + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- .zinit-exists-physically + |   `-- zinit.zsh/.zinit-any-to-user-plugin + |-- zinit.zsh/+zi-log + |-- zinit.zsh/.zinit-any-to-pid + `-- zinit.zsh/.zinit-any-to-user-plugin + +Uses feature(s): _setopt_ + +Called by: + + .zinit-compute-ice + zinit-autoload.zsh/.zinit-changes + zinit-autoload.zsh/.zinit-glance + zinit-autoload.zsh/.zinit-stress + zinit-autoload.zsh/.zinit-update-or-status + zinit-install.zsh/.zinit-install-completions + +==== .zinit-first + +____ + + Finds the main file of plugin. There are multiple file name formats, they are + ordered in order starting from more correct ones, and matched. + .zinit-load-plugin() has similar code parts and doesn't call .zinit-first() – + for performance. Obscure matching is done in .zinit-find-other-matches, here + and in .zinit-load(). Obscure = non-standard main-file naming convention. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + +____ + +Has 20 line(s). Calls functions: + + .zinit-first + |-- zinit.zsh/.zinit-any-to-pid + |-- zinit.zsh/.zinit-any-to-user-plugin + |-- zinit.zsh/.zinit-find-other-matches + `-- zinit.zsh/.zinit-get-object-path + +Called by: + + .zinit-two-paths + zinit-autoload.zsh/.zinit-compile-plugin + zinit-autoload.zsh/.zinit-glance + zinit-autoload.zsh/.zinit-stress + +==== .zinit-store-ices + +____ + + Saves ice mods in given hash onto disk. + + $1 - directory where to create or delete files + $2 - name of hash that holds values + $3 - additional keys of hash to store, space separated + $4 - additional keys of hash to store, empty-meaningful ices, space separated + $5 – URL, if applicable + $6 – mode, svn=1, 0=single file + +____ + +Has 30 line(s). Doesn't call other functions. + +Called by: + + zinit-autoload.zsh/.zinit-update-or-status + zinit-install.zsh/.zinit-download-snippet + zinit-install.zsh/.zinit-setup-plugin-dir + +==== .zinit-two-paths + +____ + + Obtains a snippet URL without specification if it is an SVN URL (points to + directory) or regular URL (points to file), returns 2 possible paths for + further examination + + $REPLY - two filepaths + +____ + +Has 24 line(s). Calls functions: + + .zinit-two-paths + |-- .zinit-first + |   |-- zinit.zsh/.zinit-any-to-pid + |   |-- zinit.zsh/.zinit-any-to-user-plugin + |   |-- zinit.zsh/.zinit-find-other-matches + |   `-- zinit.zsh/.zinit-get-object-path + `-- zinit.zsh/.zinit-get-object-path + +Uses feature(s): _setopt_ + +Called by: + + .zinit-compute-ice + zinit-autoload.zsh/.zinit-update-or-status + diff --git a/doc/zsdoc/zinit.zsh.adoc b/doc/zsdoc/zinit.zsh.adoc new file mode 100644 index 00000000..a4d63680 --- /dev/null +++ b/doc/zsdoc/zinit.zsh.adoc @@ -0,0 +1,1966 @@ + +NAME + +zinit.zsh - a shell script + +Documentation automatically generated with `zshelldoc' + +== FUNCTIONS + +zi-log + +zinit-deploy-message + +zinit-message + +zinit-prehelp-usage-message + -zinit_scheduler_add_sh + .zinit-add-fpath + .zinit-add-report + .zinit-any-to-pid + .zinit-any-to-user-plugin + .zinit-compdef-clear + .zinit-compdef-replay + .zinit-diff + .zinit-diff-env + .zinit-diff-functions + .zinit-diff-options + .zinit-diff-parameter + .zinit-find-other-matches + .zinit-formatter-auto + .zinit-formatter-bar + .zinit-formatter-bar-util + .zinit-formatter-pid + .zinit-formatter-th-bar + .zinit-formatter-url + .zinit-get-mtime-into + .zinit-get-object-path + .zinit-ice + .zinit-load + .zinit-load-ices + .zinit-load-object + .zinit-load-plugin + .zinit-load-snippet + .zinit-main-message-formatter + .zinit-pack-ice + .zinit-parse-opts + .zinit-prepare-home + .zinit-register-plugin + .zinit-run + .zinit-run-task + .zinit-set-m-func + .zinit-setup-params + .zinit-submit-turbo + .zinit-tmp-subst-off + .zinit-tmp-subst-on + .zinit-util-shands-path + :zinit-reload-and-run + :zinit-tmp-subst-alias + :zinit-tmp-subst-autoload + :zinit-tmp-subst-bindkey + :zinit-tmp-subst-compdef + :zinit-tmp-subst-zle + :zinit-tmp-subst-zstyle + @autoload + @zinit-register-annex + @zinit-register-hook + @zinit-substitute + @zsh-plugin-run-on-unload + @zsh-plugin-run-on-update + pmodload + zicdclear + zicdreplay + zicompdef + zicompinit + zinit + zpcdclear + zpcdreplay + zpcompdef + zpcompinit + zplugin +AUTOLOAD add-zsh-hook +AUTOLOAD colors +AUTOLOAD compinit +AUTOLOAD is-at-least +PRECMD-HOOK @zinit-scheduler + +=== DETAILS + +==== Script Body + +Has 258 line(s). Calls functions: + + Script-Body + |-- +zi-log + |-- .zinit-get-mtime-into + |-- .zinit-prepare-home + |   |-- zinit-autoload.zsh/.zinit-clear-completions + |   `-- zinit-install.zsh/.zinit-compinit + |-- @zinit-register-hook + |-- add-zsh-hook + |-- colors + |-- is-at-least + |-- zinit + |   |-- +zi-log + |   |-- +zinit-prehelp-usage-message + |   |   `-- +zi-log + |   |-- .zinit-add-fpath + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-compdef-clear + |   |   `-- +zi-log + |   |-- .zinit-compdef-replay + |   |   `-- +zi-log + |   |-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-ice + |   |   `-- +zi-log + |   |-- .zinit-load-ices + |   |   `-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-load-object + |   |   |-- .zinit-load + |   |   |   |-- +zinit-deploy-message + |   |   |   |-- .zinit-any-to-user-plugin + |   |   |   |-- .zinit-load-plugin + |   |   |   |   |-- .zinit-add-report + |   |   |   |   |-- .zinit-diff + |   |   |   |   |   |-- .zinit-diff-env + |   |   |   |   |   |-- .zinit-diff-functions + |   |   |   |   |   |-- .zinit-diff-options + |   |   |   |   |   `-- .zinit-diff-parameter + |   |   |   |   |-- .zinit-diff-env + |   |   |   |   |-- .zinit-find-other-matches + |   |   |   |   |-- .zinit-tmp-subst-off + |   |   |   |   |-- .zinit-tmp-subst-on + |   |   |   |   `-- :zinit-tmp-subst-autoload + |   |   |   |   |-- +zi-log + |   |   |   |   |-- .zinit-add-report + |   |   |   |   |-- .zinit-any-to-user-plugin + |   |   |   |   `-- is-at-least + |   |   |   |-- .zinit-load-snippet + |   |   |   |   |-- +zi-log + |   |   |   |   |-- +zinit-deploy-message + |   |   |   |   |-- .zinit-add-report + |   |   |   |   |-- .zinit-find-other-matches + |   |   |   |   |-- .zinit-get-object-path + |   |   |   |   |   `-- .zinit-any-to-user-plugin + |   |   |   |   |-- .zinit-pack-ice + |   |   |   |   |-- .zinit-set-m-func + |   |   |   |   |   `-- +zi-log + |   |   |   |   |-- .zinit-setup-params + |   |   |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |   |   |-- .zinit-pack-ice + |   |   |   |-- .zinit-register-plugin + |   |   |   |   `-- +zi-log + |   |   |   |-- .zinit-set-m-func + |   |   |   |   `-- +zi-log + |   |   |   |-- .zinit-setup-params + |   |   |   |-- zinit-install.zsh/.zinit-get-package + |   |   |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + |   |   `-- .zinit-load-snippet + |   |   |-- +zi-log + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-add-report + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-get-object-path + |   |   |   `-- .zinit-any-to-user-plugin + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |-- .zinit-parse-opts + |   |-- .zinit-run + |   |   |-- +zi-log + |   |   |-- .zinit-any-to-user-plugin + |   |   `-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-submit-turbo + |   |-- compinit + |   |-- zinit-additional.zsh/+zinit-debug + |   |-- zinit-autoload.zsh/.zinit-cdisable + |   |-- zinit-autoload.zsh/.zinit-cenable + |   |-- zinit-autoload.zsh/.zinit-clear-completions + |   |-- zinit-autoload.zsh/.zinit-compile-uncompile-all + |   |-- zinit-autoload.zsh/.zinit-compiled + |   |-- zinit-autoload.zsh/.zinit-delete + |   |-- zinit-autoload.zsh/.zinit-help + |   |-- zinit-autoload.zsh/.zinit-list-bindkeys + |   |-- zinit-autoload.zsh/.zinit-list-compdef-replay + |   |-- zinit-autoload.zsh/.zinit-list-plugins + |   |-- zinit-autoload.zsh/.zinit-list-snippets + |   |-- zinit-autoload.zsh/.zinit-module + |   |-- zinit-autoload.zsh/.zinit-recently + |   |-- zinit-autoload.zsh/.zinit-search-completions + |   |-- zinit-autoload.zsh/.zinit-self-update + |   |-- zinit-autoload.zsh/.zinit-show-all-reports + |   |-- zinit-autoload.zsh/.zinit-show-completions + |   |-- zinit-autoload.zsh/.zinit-show-report + |   |-- zinit-autoload.zsh/.zinit-show-times + |   |-- zinit-autoload.zsh/.zinit-show-zstatus + |   |-- zinit-autoload.zsh/.zinit-uninstall-completions + |   |-- zinit-autoload.zsh/.zinit-unload + |   |-- zinit-autoload.zsh/.zinit-update-or-status + |   |-- zinit-autoload.zsh/.zinit-update-or-status-all + |   |-- zinit-autoload.zsh/zi::version + |   |-- zinit-install.zsh/.zinit-compinit + |   |-- zinit-install.zsh/.zinit-forget-completion + |   `-- zinit-install.zsh/.zinit-install-completions + `-- zinit-autoload.zsh/.zinit-module + +Uses feature(s): _add-zsh-hook_, _alias_, _autoload_, _bindkey_, _colors_, _export_, _is-at-least_, _setopt_, _source_, _zle_, _zmodload_, _zstyle_ + +_Exports (environment):_ PMSPEC [big]*//* ZPFX [big]*//* ZSH_CACHE_DIR + +==== +zi-log + +____ + + Logging function + +____ + +Has 20 line(s). Doesn't call other functions. + +Called by: + + +zinit-message + +zinit-prehelp-usage-message + .zinit-compdef-clear + .zinit-compdef-replay + .zinit-ice + .zinit-load-snippet + .zinit-register-plugin + .zinit-run + .zinit-set-m-func + :zinit-tmp-subst-autoload + Script-Body + zinit + zinit-additional.zsh/.zinit-debug-clear + zinit-additional.zsh/.zinit-debug-report + zinit-additional.zsh/.zinit-debug-revert + zinit-additional.zsh/.zinit-debug-start + zinit-additional.zsh/.zinit-debug-status + zinit-additional.zsh/.zinit-debug-stop + zinit-additional.zsh/:zinit-tmp-subst-source + zinit-autoload.zsh/.zi-check-for-git-changes + zinit-autoload.zsh/.zinit-build-module + zinit-autoload.zsh/.zinit-cd + zinit-autoload.zsh/.zinit-compile-plugin + zinit-autoload.zsh/.zinit-compile-uncompile-all + zinit-autoload.zsh/.zinit-confirm + zinit-autoload.zsh/.zinit-delete + zinit-autoload.zsh/.zinit-glance + zinit-autoload.zsh/.zinit-list-plugins + zinit-autoload.zsh/.zinit-run-delete-hooks + zinit-autoload.zsh/.zinit-self-update + zinit-autoload.zsh/.zinit-show-zstatus + zinit-autoload.zsh/.zinit-uncompile-plugin + zinit-autoload.zsh/.zinit-uninstall-completions + zinit-autoload.zsh/.zinit-unload + zinit-autoload.zsh/.zinit-update-all-parallel + zinit-autoload.zsh/.zinit-update-or-status-all + zinit-autoload.zsh/.zinit-update-or-status + zinit-autoload.zsh/.zinit-wait-for-update-jobs + zinit-autoload.zsh/zi::version + zinit-install.zsh/.zi::get-architecture + zinit-install.zsh/.zinit-compinit + zinit-install.zsh/.zinit-download-file-stdout + zinit-install.zsh/.zinit-download-snippet + zinit-install.zsh/.zinit-extract + zinit-install.zsh/.zinit-get-cygwin-package + zinit-install.zsh/.zinit-get-latest-gh-r-url-part + zinit-install.zsh/.zinit-get-package + zinit-install.zsh/.zinit-install-completions + zinit-install.zsh/.zinit-jq-check + zinit-install.zsh/.zinit-setup-plugin-dir + zinit-install.zsh/.zinit-update-snippet + zinit-install.zsh/__zinit-cmake-base-hook + zinit-install.zsh/ziextract + zinit-install.zsh/∞zinit-configure-base-hook + zinit-install.zsh/∞zinit-file-cp-mv-operation + zinit-install.zsh/∞zinit-make-base-hook + zinit-install.zsh/∞zinit-ps-on-update-hook + zinit-install.zsh/∞zinit-reset-hook + zinit-side.zsh/.zinit-countdown + zinit-side.zsh/.zinit-exists-physically-message + +==== +zinit-deploy-message + +____ + + Deploys a sub-prompt message to be displayed OR a 'zle .reset-prompt' + call to be invoked + +____ + +Has 13 line(s). Doesn't call other functions. + +Uses feature(s): _read_, _zle_ + +Called by: + + .zinit-load-snippet + .zinit-load + zinit-autoload.zsh/.zinit-recall + +==== +zinit-message + +____ + + Wrapper function to maintain backward compatibility + +____ + +Has 1 line(s). Calls functions: + + +zinit-message + `-- +zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== +zinit-prehelp-usage-message + +Has 38 line(s). Calls functions: + + +zinit-prehelp-usage-message + `-- +zi-log + +Called by: + + zinit + +==== -zinit_scheduler_add_sh + +____ + + Copies task into ZINIT_RUN array, called when a task timeouts. + A small function ran from pattern in /-substitution as a math + function. + +____ + +Has 7 line(s). Doesn't call other functions. + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-add-fpath + +Has 10 line(s). Calls functions: + + .zinit-add-fpath + `-- .zinit-any-to-user-plugin + +Called by: + + zinit + +==== .zinit-add-report + +____ + + Adds a report line for given plugin. + + $1 - uspl2, i.e. user/plugin + $2 - the text + +____ + +Has 3 line(s). Doesn't call other functions. + +Called by: + + .zinit-load-plugin + .zinit-load-snippet + :zinit-tmp-subst-alias + :zinit-tmp-subst-autoload + :zinit-tmp-subst-bindkey + :zinit-tmp-subst-compdef + :zinit-tmp-subst-zle + :zinit-tmp-subst-zstyle + +==== .zinit-any-to-pid + +Has 22 line(s). Calls functions: + + .zinit-any-to-pid + `-- .zinit-util-shands-path + +Uses feature(s): _setopt_ + +Called by: + + zinit-side.zsh/.zinit-any-colorify-as-uspl2 + zinit-side.zsh/.zinit-exists-physically-message + zinit-side.zsh/.zinit-first + +==== .zinit-any-to-user-plugin + +____ + + Allows elastic plugin-spec across the code. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin (only when $1 - i.e. user - given) + + $REPLY - user and plugin + +____ + +Has 29 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-add-fpath + .zinit-get-object-path + .zinit-load + .zinit-run + :zinit-tmp-subst-autoload + zinit-autoload.zsh/.zinit-any-to-uspl2 + zinit-autoload.zsh/.zinit-changes + zinit-autoload.zsh/.zinit-compile-uncompile-all + zinit-autoload.zsh/.zinit-compiled + zinit-autoload.zsh/.zinit-create + zinit-autoload.zsh/.zinit-delete + zinit-autoload.zsh/.zinit-find-completions-of-plugin + zinit-autoload.zsh/.zinit-glance + zinit-autoload.zsh/.zinit-show-report + zinit-autoload.zsh/.zinit-stress + zinit-autoload.zsh/.zinit-unload + zinit-autoload.zsh/.zinit-unregister-plugin + zinit-autoload.zsh/.zinit-update-all-parallel + zinit-autoload.zsh/.zinit-update-or-status-all + zinit-autoload.zsh/.zinit-update-or-status + zinit-install.zsh/.zinit-install-completions + zinit-side.zsh/.zinit-any-colorify-as-uspl2 + zinit-side.zsh/.zinit-compute-ice + zinit-side.zsh/.zinit-exists-physically-message + zinit-side.zsh/.zinit-exists-physically + zinit-side.zsh/.zinit-first + +==== .zinit-compdef-clear + +____ + + Implements user-exposed functionality to clear gathered compdefs. + +____ + +Has 3 line(s). Calls functions: + + .zinit-compdef-clear + `-- +zi-log + +Called by: + + zicdclear + zinit + zpcdclear + +==== .zinit-compdef-replay + +____ + + Runs gathered compdef calls. This allows to run 'compinit' after loading plugins. + +____ + +Has 17 line(s). Calls functions: + + .zinit-compdef-replay + `-- +zi-log + +Uses feature(s): _compdef_ + +Called by: + + zicdreplay + zinit + zpcdreplay + +==== .zinit-diff + +____ + + Performs diff actions of all types + +____ + +Has 4 line(s). Calls functions: + + .zinit-diff + |-- .zinit-diff-env + |-- .zinit-diff-functions + |-- .zinit-diff-options + `-- .zinit-diff-parameter + +Called by: + + .zinit-load-plugin + zinit-additional.zsh/.zinit-debug-start + zinit-additional.zsh/.zinit-debug-stop + +==== .zinit-diff-env + +____ + + Implements detection of change in PATH and FPATH. + + $1 - user/plugin (i.e. uspl2 format) + $2 - command, can be "begin" or "end" + +____ + +Has 18 line(s). Doesn't call other functions. + +Called by: + + .zinit-diff + .zinit-load-plugin + +==== .zinit-diff-functions + +____ + + Implements detection of newly created functions. Performs + data gathering, computation is done in *-compute(). + + $1 - user/plugin (i.e. uspl2 format) + $2 - command, can be "begin" or "end" + +____ + +Has 8 line(s). Doesn't call other functions. + +Called by: + + .zinit-diff + +==== .zinit-diff-options + +____ + + Implements detection of change in option state. Performs + data gathering, computation is done in *-compute(). + + $1 - user/plugin (i.e. uspl2 format) + $2 - command, can be "begin" or "end" + +____ + +Has 7 line(s). Doesn't call other functions. + +Called by: + + .zinit-diff + +==== .zinit-diff-parameter + +____ + + Implements detection of change in any parameter's existence and type. + Performs data gathering, computation is done in *-compute(). + + $1 - user/plugin (i.e. uspl2 format) + $2 - command, can be "begin" or "end" + +____ + +Has 9 line(s). Doesn't call other functions. + +Called by: + + .zinit-diff + +==== .zinit-find-other-matches + +____ + + Plugin's main source file is in general `name.plugin.zsh'. However, + there can be different conventions, if that file is not found, then + this functions examines other conventions in the most sane order. + +____ + +Has 22 line(s). Doesn't call other functions. + +Called by: + + .zinit-load-plugin + .zinit-load-snippet + zinit-side.zsh/.zinit-first + +==== .zinit-formatter-auto + +Has 50 line(s). Calls functions: + + .zinit-formatter-auto + |-- .zinit-formatter-pid + |   `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + `-- .zinit-formatter-url + +Uses feature(s): _type_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-formatter-bar + +Has 1 line(s). Calls functions: + + .zinit-formatter-bar + `-- .zinit-formatter-bar-util + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-formatter-bar-util + +Has 7 line(s). Doesn't call other functions. + +Called by: + + .zinit-formatter-bar + .zinit-formatter-th-bar + +==== .zinit-formatter-pid + +Has 11 line(s). Calls functions: + + .zinit-formatter-pid + `-- zinit-side.zsh/.zinit-any-colorify-as-uspl2 + +Uses feature(s): _source_ + +Called by: + + .zinit-formatter-auto + +==== .zinit-formatter-th-bar + +Has 1 line(s). Calls functions: + + .zinit-formatter-th-bar + `-- .zinit-formatter-bar-util + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-formatter-url + +Has 19 line(s). Doesn't call other functions. + +Called by: + + .zinit-formatter-auto + +==== .zinit-get-mtime-into + +Has 7 line(s). Doesn't call other functions. + +Called by: + + Script-Body + zinit-autoload.zsh/.zinit-self-update + zinit-autoload.zsh/.zinit-update-or-status-all + +==== .zinit-get-object-path + +Has 28 line(s). Calls functions: + + .zinit-get-object-path + `-- .zinit-any-to-user-plugin + +Called by: + + .zinit-load-ices + .zinit-load-snippet + .zinit-run + zinit + zinit-autoload.zsh/.zinit-get-path + zinit-install.zsh/.zinit-setup-plugin-dir + zinit-install.zsh/.zinit-update-snippet + zinit-side.zsh/.zinit-first + zinit-side.zsh/.zinit-two-paths + +==== .zinit-ice + +____ + + Parses ICE specification, puts the result into ICE global hash. + The ice-spec is valid for next command only (i.e. it "melts"), but + it can then stick to plugin and activate e.g. at update. + +____ + +Has 21 line(s). Calls functions: + + .zinit-ice + `-- +zi-log + +Uses feature(s): _setopt_ + +Called by: + + zinit + +==== .zinit-load + +____ + + Implements the exposed-to-user action of loading a plugin. + + $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) + $2 - plugin name, if the third format is used + +____ + +Has 95 line(s). Calls functions: + + .zinit-load + |-- +zinit-deploy-message + |-- .zinit-any-to-user-plugin + |-- .zinit-load-plugin + |   |-- .zinit-add-report + |   |-- .zinit-diff + |   |   |-- .zinit-diff-env + |   |   |-- .zinit-diff-functions + |   |   |-- .zinit-diff-options + |   |   `-- .zinit-diff-parameter + |   |-- .zinit-diff-env + |   |-- .zinit-find-other-matches + |   |-- .zinit-tmp-subst-off + |   |-- .zinit-tmp-subst-on + |   `-- :zinit-tmp-subst-autoload + |   |-- +zi-log + |   |-- .zinit-add-report + |   |-- .zinit-any-to-user-plugin + |   `-- is-at-least + |-- .zinit-load-snippet + |   |-- +zi-log + |   |-- +zinit-deploy-message + |   |-- .zinit-add-report + |   |-- .zinit-find-other-matches + |   |-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-pack-ice + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   `-- zinit-install.zsh/.zinit-download-snippet + |-- .zinit-pack-ice + |-- .zinit-register-plugin + |   `-- +zi-log + |-- .zinit-set-m-func + |   `-- +zi-log + |-- .zinit-setup-params + |-- zinit-install.zsh/.zinit-get-package + `-- zinit-install.zsh/.zinit-setup-plugin-dir + +Uses feature(s): _eval_, _setopt_, _source_, _zle_ + +Called by: + + .zinit-load-object + .zinit-run-task + zinit-additional.zsh/.zinit-service + +==== .zinit-load-ices + +Has 22 line(s). Calls functions: + + .zinit-load-ices + `-- .zinit-get-object-path + `-- .zinit-any-to-user-plugin + +Called by: + + zinit + +==== .zinit-load-object + +Has 12 line(s). Calls functions: + + .zinit-load-object + |-- .zinit-load + |   |-- +zinit-deploy-message + |   |-- .zinit-any-to-user-plugin + |   |-- .zinit-load-plugin + |   |   |-- .zinit-add-report + |   |   |-- .zinit-diff + |   |   |   |-- .zinit-diff-env + |   |   |   |-- .zinit-diff-functions + |   |   |   |-- .zinit-diff-options + |   |   |   `-- .zinit-diff-parameter + |   |   |-- .zinit-diff-env + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-tmp-subst-off + |   |   |-- .zinit-tmp-subst-on + |   |   `-- :zinit-tmp-subst-autoload + |   |   |-- +zi-log + |   |   |-- .zinit-add-report + |   |   |-- .zinit-any-to-user-plugin + |   |   `-- is-at-least + |   |-- .zinit-load-snippet + |   |   |-- +zi-log + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-add-report + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-get-object-path + |   |   |   `-- .zinit-any-to-user-plugin + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |-- .zinit-pack-ice + |   |-- .zinit-register-plugin + |   |   `-- +zi-log + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   |-- zinit-install.zsh/.zinit-get-package + |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + `-- .zinit-load-snippet + |-- +zi-log + |-- +zinit-deploy-message + |-- .zinit-add-report + |-- .zinit-find-other-matches + |-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-pack-ice + |-- .zinit-set-m-func + |   `-- +zi-log + |-- .zinit-setup-params + `-- zinit-install.zsh/.zinit-download-snippet + +Called by: + + zinit + +==== .zinit-load-plugin + +____ + + Lower-level function for loading a plugin. + + $1 - user + $2 - plugin + $3 - mode (light or load) + +____ + +Has 128 line(s). Calls functions: + + .zinit-load-plugin + |-- .zinit-add-report + |-- .zinit-diff + |   |-- .zinit-diff-env + |   |-- .zinit-diff-functions + |   |-- .zinit-diff-options + |   `-- .zinit-diff-parameter + |-- .zinit-diff-env + |-- .zinit-find-other-matches + |-- .zinit-tmp-subst-off + |-- .zinit-tmp-subst-on + `-- :zinit-tmp-subst-autoload + |-- +zi-log + |-- .zinit-add-report + |-- .zinit-any-to-user-plugin + `-- is-at-least + +Uses feature(s): _eval_, _setopt_, _source_, _unfunction_, _zle_ + +Called by: + + .zinit-load + +==== .zinit-load-snippet + +____ + + Implements the exposed-to-user action of loading a snippet. + + $1 - url (can be local, absolute path). + +____ + +Has 203 line(s). Calls functions: + + .zinit-load-snippet + |-- +zi-log + |-- +zinit-deploy-message + |-- .zinit-add-report + |-- .zinit-find-other-matches + |-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-pack-ice + |-- .zinit-set-m-func + |   `-- +zi-log + |-- .zinit-setup-params + `-- zinit-install.zsh/.zinit-download-snippet + +Uses feature(s): _autoload_, _eval_, _setopt_, _source_, _unfunction_, _zparseopts_, _zstyle_ + +Called by: + + .zinit-load-object + .zinit-load + .zinit-run-task + pmodload + zinit-additional.zsh/.zinit-service + +==== .zinit-main-message-formatter + +Has 18 line(s). Doesn't call other functions. + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== .zinit-pack-ice + +____ + + Remembers all ice-mods, assigns them to concrete plugin. Ice spec + is in general forgotten for second-next command (i.e., ice melts quickly), however they + glue to the object (plugin or snippet) mentioned in the next command for later use with (e.g. 'zinit update ...'). + +____ + +Has 3 line(s). Doesn't call other functions. + +Called by: + + .zinit-load-snippet + .zinit-load + @zsh-plugin-run-on-unload + @zsh-plugin-run-on-update + zinit-install.zsh/.zinit-update-snippet + zinit-side.zsh/.zinit-compute-ice + +==== .zinit-parse-opts + +Has 2 line(s). Doesn't call other functions. + +Called by: + + zinit + +==== .zinit-prepare-home + +____ + + Creates all directories needed by Zinit, first checks if they + already exist. + +____ + +Has 45 line(s). Calls functions: + + .zinit-prepare-home + |-- zinit-autoload.zsh/.zinit-clear-completions + `-- zinit-install.zsh/.zinit-compinit + +Uses feature(s): _source_ + +Called by: + + Script-Body + +==== .zinit-register-plugin + +____ + + Adds the plugin to ZINIT_REGISTERED_PLUGINS array and to the + zsh_loaded_plugins array (managed according to the plugin standard: + https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html). + +____ + +Has 23 line(s). Calls functions: + + .zinit-register-plugin + `-- +zi-log + +Called by: + + .zinit-load + +==== .zinit-run + +____ + + Run code inside plugins folder + It uses the 'correct' parameter from uppers scope zinit(). + +____ + +Has 24 line(s). Calls functions: + + .zinit-run + |-- +zi-log + |-- .zinit-any-to-user-plugin + `-- .zinit-get-object-path + `-- .zinit-any-to-user-plugin + +Uses feature(s): _eval_, _setopt_ + +Called by: + + zinit + +==== .zinit-run-task + +____ + + A backend, worker function of .zinit-scheduler. It obtains the tasks + index and a few of its properties (like the type: plugin, snippet, + service plugin, service snippet) and executes it first checking for + additional conditions (like non-numeric wait'' ice). + + $1 - current pass: 1 or 2 + $2 - time assigned to the task + $3 - type: plugin, service plugin, service snippet, snippet + $4 - tasks index in the ZINIT[WAIT_ICE_...] fields + $5 - mode: load, light + $6 - details: alias name (derived from id-as''), plugin-spec, or snippet URL + +____ + +Has 47 line(s). Calls functions: + + .zinit-run-task + |-- .zinit-load + |   |-- +zinit-deploy-message + |   |-- .zinit-any-to-user-plugin + |   |-- .zinit-load-plugin + |   |   |-- .zinit-add-report + |   |   |-- .zinit-diff + |   |   |   |-- .zinit-diff-env + |   |   |   |-- .zinit-diff-functions + |   |   |   |-- .zinit-diff-options + |   |   |   `-- .zinit-diff-parameter + |   |   |-- .zinit-diff-env + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-tmp-subst-off + |   |   |-- .zinit-tmp-subst-on + |   |   `-- :zinit-tmp-subst-autoload + |   |   |-- +zi-log + |   |   |-- .zinit-add-report + |   |   |-- .zinit-any-to-user-plugin + |   |   `-- is-at-least + |   |-- .zinit-load-snippet + |   |   |-- +zi-log + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-add-report + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-get-object-path + |   |   |   `-- .zinit-any-to-user-plugin + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |-- .zinit-pack-ice + |   |-- .zinit-register-plugin + |   |   `-- +zi-log + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   |-- zinit-install.zsh/.zinit-get-package + |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + |-- .zinit-load-snippet + |   |-- +zi-log + |   |-- +zinit-deploy-message + |   |-- .zinit-add-report + |   |-- .zinit-find-other-matches + |   |-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-pack-ice + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   `-- zinit-install.zsh/.zinit-download-snippet + `-- zinit-autoload.zsh/.zinit-unload + +Uses feature(s): _eval_, _source_, _zle_, _zpty_ + +Called by: + + @zinit-scheduler + +==== .zinit-set-m-func + +____ + + Sets and withdraws the temporary, atclone/atpull time function `m`. + +____ + +Has 17 line(s). Calls functions: + + .zinit-set-m-func + `-- +zi-log + +Uses feature(s): _setopt_ + +Called by: + + .zinit-load-snippet + .zinit-load + zinit-autoload.zsh/.zinit-update-or-status + +==== .zinit-setup-params + +Has 3 line(s). Doesn't call other functions. + +Called by: + + .zinit-load-snippet + .zinit-load + +==== .zinit-submit-turbo + +____ + + If `zinit load`, `zinit light` or `zinit snippet` will be + preceded with 'wait', 'load', 'unload' or 'on-update-of'/'subscribe' + ice-mods then the plugin or snipped is to be loaded in turbo-mode, + and this function adds it to internal data structures. @zinit-scheduler uses the data to + create load or unload tasks. + +____ + +Has 16 line(s). Doesn't call other functions. + +Called by: + + zinit + +==== .zinit-tmp-subst-off + +____ + + Turn off temporary substituting of functions completely for a given mode ("load", "light", + "light-b" (i.e. the `trackbinds' mode) or "compdef"). + +____ + +Has 21 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_, _unfunction_ + +Called by: + + .zinit-load-plugin + zinit-additional.zsh/.zinit-debug-stop + +==== .zinit-tmp-subst-on + +____ + + Turn on temporary substituting of functions of builtins and functions according to passed + mode ("load", "light", "light-b" or "compdef"). The temporary substituting of functions is + to gather report data, and to hijack 'autoload', 'bindkey' and 'compdef' calls. + +____ + +Has 32 line(s). Doesn't call other functions. + +Uses feature(s): _source_ + +Called by: + + .zinit-load-plugin + zinit-additional.zsh/.zinit-debug-start + +==== .zinit-util-shands-path + +____ + + Replaces parts of path with %HOME, etc. + +____ + +Has 9 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + .zinit-any-to-pid + +==== :zinit-reload-and-run + +____ + + Marks given function ($3) for autoloading, and executes it triggering the + load. $1 is the fpath dedicated to the function, $2 are autoload options. + This function replaces "autoload -X", because using that on older Zsh + versions causes problems with traps. + + So basically one creates function stub that calls :zinit-reload-and-run() + instead of "autoload -X". + + Author: Bart Schaefer + + $1 - FPATH dedicated to function + $2 - autoload options + $3 - function name (one that needs autoloading) + +____ + +Has 11 line(s). Doesn't call other functions. + +Uses feature(s): _autoload_, _unfunction_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-alias + +____ + + Function defined to hijack plugin's calls to the `alias' builtin. + + The hijacking is to gather report data (which is used in unload). + +____ + +Has 36 line(s). Calls functions: + + :zinit-tmp-subst-alias + `-- .zinit-add-report + +Uses feature(s): _alias_, _setopt_, _zparseopts_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-autoload + +____ + + Hijack plugin's calls to the 'autoload' builtin. + + The hijacking gathers report data and runs custom `autoload' function, that doesn't need FPATH. + +____ + +Has 111 line(s). Calls functions: + + :zinit-tmp-subst-autoload + |-- +zi-log + |-- .zinit-add-report + |-- .zinit-any-to-user-plugin + `-- is-at-least + +Uses feature(s): _autoload_, _eval_, _is-at-least_, _setopt_, _zparseopts_ + +Called by: + + .zinit-load-plugin + @autoload + +==== :zinit-tmp-subst-bindkey + +____ + + Function defined to hijack plugin's calls to the `bindkey' builtin. + + The hijacking is to gather report data (which is used in unload). + +____ + +Has 120 line(s). Calls functions: + + :zinit-tmp-subst-bindkey + |-- .zinit-add-report + `-- is-at-least + +Uses feature(s): _bindkey_, _is-at-least_, _setopt_, _zparseopts_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-compdef + +____ + + Function defined to hijack plugin's calls to the `compdef' function. + The hijacking is not only for reporting, but also to save compdef + calls so that `compinit' can be called after loading plugins. + +____ + +Has 6 line(s). Calls functions: + + :zinit-tmp-subst-compdef + `-- .zinit-add-report + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-zle + +____ + + Function defined to hijack plugin's calls to the `zle' builtin. + + The hijacking is to gather report data (which is used in unload). + +____ + +Has 36 line(s). Calls functions: + + :zinit-tmp-subst-zle + `-- .zinit-add-report + +Uses feature(s): _setopt_, _zle_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== :zinit-tmp-subst-zstyle + +____ + + Function defined to hijack plugin's calls to the `zstyle' builtin. + + The hijacking is to gather report data (which is used in unload). + +____ + +Has 23 line(s). Calls functions: + + :zinit-tmp-subst-zstyle + `-- .zinit-add-report + +Uses feature(s): _setopt_, _zparseopts_, _zstyle_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== @autoload + +Has 4 line(s). Calls functions: + + @autoload + `-- :zinit-tmp-subst-autoload + |-- +zi-log + |-- .zinit-add-report + |-- .zinit-any-to-user-plugin + `-- is-at-least + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== @zinit-register-annex + +____ + + Registers the z-annex inside Zinit – i.e. an Zinit extension + +____ + +Has 11 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== @zinit-register-hook + +____ + + Registers the z-annex inside Zinit (i.e., an Zinit extension) + +____ + +Has 6 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + Script-Body + +==== @zinit-scheduler + +____ + + Searches for timeout tasks, executes them. Theres an array of tasks + waiting for execution, this scheduler manages them, detects which ones + should be run at current moment, decides to remove (or not) them from + the array after execution. + + $1 - if "following", then it is non-first (second and more) + invocation of the scheduler; this results in chain of 'sched' + invocations that results in repetitive @zinit-scheduler activity. + + if "burst", then all tasks are marked timeout and executed one + by one; this is handy if e.g. a docker image starts up and + needs to install all turbo-mode plugins without any hesitation + (delay), i.e. "burst" allows to run package installations from + script, not from prompt. + +____ + +Has 75 line(s). *Is a precmd hook*. Calls functions: + + @zinit-scheduler + |-- .zinit-run-task + |   |-- .zinit-load + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-any-to-user-plugin + |   |   |-- .zinit-load-plugin + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-diff + |   |   |   |   |-- .zinit-diff-env + |   |   |   |   |-- .zinit-diff-functions + |   |   |   |   |-- .zinit-diff-options + |   |   |   |   `-- .zinit-diff-parameter + |   |   |   |-- .zinit-diff-env + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-tmp-subst-off + |   |   |   |-- .zinit-tmp-subst-on + |   |   |   `-- :zinit-tmp-subst-autoload + |   |   |   |-- +zi-log + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-any-to-user-plugin + |   |   |   `-- is-at-least + |   |   |-- .zinit-load-snippet + |   |   |   |-- +zi-log + |   |   |   |-- +zinit-deploy-message + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-get-object-path + |   |   |   |   `-- .zinit-any-to-user-plugin + |   |   |   |-- .zinit-pack-ice + |   |   |   |-- .zinit-set-m-func + |   |   |   |   `-- +zi-log + |   |   |   |-- .zinit-setup-params + |   |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-register-plugin + |   |   |   `-- +zi-log + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   |-- zinit-install.zsh/.zinit-get-package + |   |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + |   |-- .zinit-load-snippet + |   |   |-- +zi-log + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-add-report + |   |   |-- .zinit-find-other-matches + |   |   |-- .zinit-get-object-path + |   |   |   `-- .zinit-any-to-user-plugin + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   `-- zinit-autoload.zsh/.zinit-unload + `-- add-zsh-hook + +Uses feature(s): _add-zsh-hook_, _sched_, _setopt_, _zle_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== @zinit-substitute + +Has 40 line(s). Doesn't call other functions. + +Uses feature(s): _setopt_ + +Called by: + + zinit-autoload.zsh/.zinit-at-eval + zinit-install.zsh/.zinit-at-eval + zinit-install.zsh/.zinit-get-package + zinit-install.zsh/∞zinit-atclone-hook + zinit-install.zsh/∞zinit-configure-base-hook + zinit-install.zsh/∞zinit-extract-hook + zinit-install.zsh/∞zinit-file-cp-mv-operation + zinit-install.zsh/∞zinit-make-base-hook + +==== @zsh-plugin-run-on-unload + +____ + + The Plugin Standard required mechanism, see: + https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html + +____ + +Has 2 line(s). Calls functions: + + @zsh-plugin-run-on-unload + `-- .zinit-pack-ice + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== @zsh-plugin-run-on-update + +____ + + The Plugin Standard required mechanism + +____ + +Has 2 line(s). Calls functions: + + @zsh-plugin-run-on-update + `-- .zinit-pack-ice + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== pmodload + +Has 15 line(s). Calls functions: + + pmodload + `-- .zinit-load-snippet + |-- +zi-log + |-- +zinit-deploy-message + |-- .zinit-add-report + |-- .zinit-find-other-matches + |-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-pack-ice + |-- .zinit-set-m-func + |   `-- +zi-log + |-- .zinit-setup-params + `-- zinit-install.zsh/.zinit-download-snippet + +Uses feature(s): _zstyle_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zicdclear + +____ + + A wrapper for "zinit cdclear -q" which can be called from hook + ices like the atinit"", atload"", etc. ices. + +____ + +Has 1 line(s). Calls functions: + + zicdclear + `-- .zinit-compdef-clear + `-- +zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zicdreplay + +____ + + A function that can be invoked from within "atinit", "atload", etc. + ice-mod. It works like "zinit cdreplay", which cannot be invoked from such hook ices + +____ + +Has 1 line(s). Calls functions: + + zicdreplay + `-- .zinit-compdef-replay + `-- +zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zicompdef + +____ + + Stores compdef for a replay with "zicdreplay" (turbo mode) or + with "zinit cdreplay" (normal mode). An utility functton of an undefined use case. + +____ + +Has 1 line(s). Doesn't call other functions. + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zicompinit + +____ + + A function that can be invoked from within "atinit", "atload", etc. + ice-mod. It runs "autoload compinit; compinit" and respects + ZINIT[ZCOMPDUMP_PATH] and ZINIT[COMPINIT_OPTS]. + +____ + +Has 2 line(s). Calls functions: + + zicompinit + `-- compinit + +Uses feature(s): _autoload_, _compinit_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zinit + +____ + + Entrypoint function directly exposed to user, consumes subcommands with respective arguments, + and completion. + +____ + +Has 558 line(s). Calls functions: + + zinit + |-- +zi-log + |-- +zinit-prehelp-usage-message + |   `-- +zi-log + |-- .zinit-add-fpath + |   `-- .zinit-any-to-user-plugin + |-- .zinit-compdef-clear + |   `-- +zi-log + |-- .zinit-compdef-replay + |   `-- +zi-log + |-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-ice + |   `-- +zi-log + |-- .zinit-load-ices + |   `-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-load-object + |   |-- .zinit-load + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-any-to-user-plugin + |   |   |-- .zinit-load-plugin + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-diff + |   |   |   |   |-- .zinit-diff-env + |   |   |   |   |-- .zinit-diff-functions + |   |   |   |   |-- .zinit-diff-options + |   |   |   |   `-- .zinit-diff-parameter + |   |   |   |-- .zinit-diff-env + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-tmp-subst-off + |   |   |   |-- .zinit-tmp-subst-on + |   |   |   `-- :zinit-tmp-subst-autoload + |   |   |   |-- +zi-log + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-any-to-user-plugin + |   |   |   `-- is-at-least + |   |   |-- .zinit-load-snippet + |   |   |   |-- +zi-log + |   |   |   |-- +zinit-deploy-message + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-get-object-path + |   |   |   |   `-- .zinit-any-to-user-plugin + |   |   |   |-- .zinit-pack-ice + |   |   |   |-- .zinit-set-m-func + |   |   |   |   `-- +zi-log + |   |   |   |-- .zinit-setup-params + |   |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-register-plugin + |   |   |   `-- +zi-log + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   |-- zinit-install.zsh/.zinit-get-package + |   |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + |   `-- .zinit-load-snippet + |   |-- +zi-log + |   |-- +zinit-deploy-message + |   |-- .zinit-add-report + |   |-- .zinit-find-other-matches + |   |-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-pack-ice + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   `-- zinit-install.zsh/.zinit-download-snippet + |-- .zinit-parse-opts + |-- .zinit-run + |   |-- +zi-log + |   |-- .zinit-any-to-user-plugin + |   `-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-submit-turbo + |-- compinit + |-- zinit-additional.zsh/+zinit-debug + |-- zinit-autoload.zsh/.zinit-cdisable + |-- zinit-autoload.zsh/.zinit-cenable + |-- zinit-autoload.zsh/.zinit-clear-completions + |-- zinit-autoload.zsh/.zinit-compile-uncompile-all + |-- zinit-autoload.zsh/.zinit-compiled + |-- zinit-autoload.zsh/.zinit-delete + |-- zinit-autoload.zsh/.zinit-help + |-- zinit-autoload.zsh/.zinit-list-bindkeys + |-- zinit-autoload.zsh/.zinit-list-compdef-replay + |-- zinit-autoload.zsh/.zinit-list-plugins + |-- zinit-autoload.zsh/.zinit-list-snippets + |-- zinit-autoload.zsh/.zinit-module + |-- zinit-autoload.zsh/.zinit-recently + |-- zinit-autoload.zsh/.zinit-search-completions + |-- zinit-autoload.zsh/.zinit-self-update + |-- zinit-autoload.zsh/.zinit-show-all-reports + |-- zinit-autoload.zsh/.zinit-show-completions + |-- zinit-autoload.zsh/.zinit-show-report + |-- zinit-autoload.zsh/.zinit-show-times + |-- zinit-autoload.zsh/.zinit-show-zstatus + |-- zinit-autoload.zsh/.zinit-uninstall-completions + |-- zinit-autoload.zsh/.zinit-unload + |-- zinit-autoload.zsh/.zinit-update-or-status + |-- zinit-autoload.zsh/.zinit-update-or-status-all + |-- zinit-autoload.zsh/zi::version + |-- zinit-install.zsh/.zinit-compinit + |-- zinit-install.zsh/.zinit-forget-completion + `-- zinit-install.zsh/.zinit-install-completions + +Uses feature(s): _autoload_, _compinit_, _eval_, _setopt_, _source_, _zparseopts_ + +Called by: + + Script-Body + zplugin + zinit-autoload.zsh/.zinit-delete + +==== zpcdclear + +Has 1 line(s). Calls functions: + + zpcdclear + `-- .zinit-compdef-clear + `-- +zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zpcdreplay + +Has 1 line(s). Calls functions: + + zpcdreplay + `-- .zinit-compdef-replay + `-- +zi-log + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zpcompdef + +Has 1 line(s). Doesn't call other functions. + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zpcompinit + +Has 2 line(s). Calls functions: + + zpcompinit + `-- compinit + +Uses feature(s): _autoload_, _compinit_ + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== zplugin + +Has 1 line(s). Calls functions: + + zplugin + `-- zinit + |-- +zi-log + |-- +zinit-prehelp-usage-message + |   `-- +zi-log + |-- .zinit-add-fpath + |   `-- .zinit-any-to-user-plugin + |-- .zinit-compdef-clear + |   `-- +zi-log + |-- .zinit-compdef-replay + |   `-- +zi-log + |-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-ice + |   `-- +zi-log + |-- .zinit-load-ices + |   `-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-load-object + |   |-- .zinit-load + |   |   |-- +zinit-deploy-message + |   |   |-- .zinit-any-to-user-plugin + |   |   |-- .zinit-load-plugin + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-diff + |   |   |   |   |-- .zinit-diff-env + |   |   |   |   |-- .zinit-diff-functions + |   |   |   |   |-- .zinit-diff-options + |   |   |   |   `-- .zinit-diff-parameter + |   |   |   |-- .zinit-diff-env + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-tmp-subst-off + |   |   |   |-- .zinit-tmp-subst-on + |   |   |   `-- :zinit-tmp-subst-autoload + |   |   |   |-- +zi-log + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-any-to-user-plugin + |   |   |   `-- is-at-least + |   |   |-- .zinit-load-snippet + |   |   |   |-- +zi-log + |   |   |   |-- +zinit-deploy-message + |   |   |   |-- .zinit-add-report + |   |   |   |-- .zinit-find-other-matches + |   |   |   |-- .zinit-get-object-path + |   |   |   |   `-- .zinit-any-to-user-plugin + |   |   |   |-- .zinit-pack-ice + |   |   |   |-- .zinit-set-m-func + |   |   |   |   `-- +zi-log + |   |   |   |-- .zinit-setup-params + |   |   |   `-- zinit-install.zsh/.zinit-download-snippet + |   |   |-- .zinit-pack-ice + |   |   |-- .zinit-register-plugin + |   |   |   `-- +zi-log + |   |   |-- .zinit-set-m-func + |   |   |   `-- +zi-log + |   |   |-- .zinit-setup-params + |   |   |-- zinit-install.zsh/.zinit-get-package + |   |   `-- zinit-install.zsh/.zinit-setup-plugin-dir + |   `-- .zinit-load-snippet + |   |-- +zi-log + |   |-- +zinit-deploy-message + |   |-- .zinit-add-report + |   |-- .zinit-find-other-matches + |   |-- .zinit-get-object-path + |   |   `-- .zinit-any-to-user-plugin + |   |-- .zinit-pack-ice + |   |-- .zinit-set-m-func + |   |   `-- +zi-log + |   |-- .zinit-setup-params + |   `-- zinit-install.zsh/.zinit-download-snippet + |-- .zinit-parse-opts + |-- .zinit-run + |   |-- +zi-log + |   |-- .zinit-any-to-user-plugin + |   `-- .zinit-get-object-path + |   `-- .zinit-any-to-user-plugin + |-- .zinit-submit-turbo + |-- compinit + |-- zinit-additional.zsh/+zinit-debug + |-- zinit-autoload.zsh/.zinit-cdisable + |-- zinit-autoload.zsh/.zinit-cenable + |-- zinit-autoload.zsh/.zinit-clear-completions + |-- zinit-autoload.zsh/.zinit-compile-uncompile-all + |-- zinit-autoload.zsh/.zinit-compiled + |-- zinit-autoload.zsh/.zinit-delete + |-- zinit-autoload.zsh/.zinit-help + |-- zinit-autoload.zsh/.zinit-list-bindkeys + |-- zinit-autoload.zsh/.zinit-list-compdef-replay + |-- zinit-autoload.zsh/.zinit-list-plugins + |-- zinit-autoload.zsh/.zinit-list-snippets + |-- zinit-autoload.zsh/.zinit-module + |-- zinit-autoload.zsh/.zinit-recently + |-- zinit-autoload.zsh/.zinit-search-completions + |-- zinit-autoload.zsh/.zinit-self-update + |-- zinit-autoload.zsh/.zinit-show-all-reports + |-- zinit-autoload.zsh/.zinit-show-completions + |-- zinit-autoload.zsh/.zinit-show-report + |-- zinit-autoload.zsh/.zinit-show-times + |-- zinit-autoload.zsh/.zinit-show-zstatus + |-- zinit-autoload.zsh/.zinit-uninstall-completions + |-- zinit-autoload.zsh/.zinit-unload + |-- zinit-autoload.zsh/.zinit-update-or-status + |-- zinit-autoload.zsh/.zinit-update-or-status-all + |-- zinit-autoload.zsh/zi::version + |-- zinit-install.zsh/.zinit-compinit + |-- zinit-install.zsh/.zinit-forget-completion + `-- zinit-install.zsh/.zinit-install-completions + +Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). + +==== add-zsh-hook + +____ + + Add to HOOK the given FUNCTION. + HOOK is one of chpwd, precmd, preexec, periodic, zshaddhistory, + zshexit, zsh_directory_name (the _functions subscript is not required). + + With -d, remove the function from the hook instead; delete the hook + variable if it is empty. + + -D behaves like -d, but pattern characters are active in the + function name, so any matching function will be deleted from the hook. + + +____ + +Has 93 line(s). Doesn't call other functions. + +Uses feature(s): _autoload_, _getopts_ + +Called by: + + @zinit-scheduler + Script-Body + +==== colors + +____ + + Put standard ANSI color codes in shell parameters for easy use. + Note that some terminals do not support all combinations. + +____ + +Has 120 line(s). Doesn't call other functions. + +Called by: + + Script-Body + +==== compinit + +____ + + Initialisation for new style completion. This mainly contains some helper + functions and setup. Everything else is split into different files that + will automatically be made autoloaded (see the end of this file). The + names of the files that will be considered for autoloading are those that + begin with an underscores (like `_condition). + + The first line of each of these files is read and must indicate what + should be done with its contents: + + `#compdef ' + +____ + +Has 573 line(s). Doesn't call other functions. + +Uses feature(s): _autoload_, _bindkey_, _compdef_, _compdump_, _eval_, _read_, _setopt_, _unfunction_, _zle_, _zstyle_ + +Called by: + + zicompinit + zinit + zpcompinit + +==== is-at-least + +____ + + + Test whether $ZSH_VERSION (or some value of your choice, if a second argument + is provided) is greater than or equal to x.y.z-r (in argument one). In fact, + it'll accept any dot/dash-separated string of numbers as its second argument + and compare it to the dot/dash-separated first argument. Leading non-number + parts of a segment (such as the "zefram" in 3.1.2-zefram4) are not considered + when the comparison is done; only the numbers matter. Any left-out segments + in the first argument that are present in the version string compared are + considered as zeroes, eg 3 == 3.0 == 3.0.0 == 3.0.0.0 and so on. + + +____ + +Has 56 line(s). Doesn't call other functions. + +Called by: + + :zinit-tmp-subst-autoload + :zinit-tmp-subst-bindkey + Script-Body + zinit-install.zsh/.zinit-download-snippet + From c8246d7223dbdaab521ff22ce9d8bc90f39bfca2 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sun, 26 Jan 2025 00:33:57 +0100 Subject: [PATCH 15/56] ci: Disable commit lint, and disable fail-fast for zunit tests (#693) --- .commitlintrc | 3 --- .github/workflows/linting.yaml | 6 ------ .zunit.yml | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 .commitlintrc diff --git a/.commitlintrc b/.commitlintrc deleted file mode 100644 index bf42496e..00000000 --- a/.commitlintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@commitlint/config-angular" -} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 9eb123ee..b4b64316 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -26,12 +26,6 @@ jobs: sudo apt-get install --yes zsh pip install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc - - name: commit - uses: wagoid/commitlint-github-action@v6 - with: - configFile: '.commitlintrc' - # run: commitlint --from=$(git cherry origin/main | head -n 1 | awk '{print $2}') - - name: markdown run: find . -name '*.md' ! -name 'CHANGELOG.md' -type f -print0 | xargs -0 -n1 -P4 mdformat --check --wrap 120 --number diff --git a/.zunit.yml b/.zunit.yml index 3dbb7656..d4965697 100644 --- a/.zunit.yml +++ b/.zunit.yml @@ -3,5 +3,5 @@ directories: output: tests/_output support: tests/_support tests: tests -fail_fast: true +fail_fast: false verbose: true From f654c77ef1e8252ecb1d26a364a6db39ad655382 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sun, 26 Jan 2025 10:14:29 +0100 Subject: [PATCH 16/56] lint: fmt README.md (#694) --- .github/workflows/linting.yaml | 44 ++-- README.md | 363 +++++++++++++++++++-------------- 2 files changed, 235 insertions(+), 172 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index b4b64316..93950431 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -10,33 +10,45 @@ on: workflow_dispatch: jobs: - lint: name: Lint runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + task: [markdown, zsh-noexec, zsh-zcompile] + steps: - uses: actions/checkout@v4 with: - fetch-depth: '0' + fetch-depth: 0 - uses: actions/setup-python@v5 - name: install dependencies run: | + sudo apt-get update sudo apt-get install --yes zsh pip install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc - - name: markdown - run: find . -name '*.md' ! -name 'CHANGELOG.md' -type f -print0 | xargs -0 -n1 -P4 mdformat --check --wrap 120 --number - - # - name: shell (shfmt) - # run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shfmt -bn -ci -d -i 2 -ln bash -s -sr - - # - name: shell (shellcheck) - # run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shellcheck - - - name: zsh (noexec) - run: find . -name '*.zsh' -type f -print0 | xargs -0 -n1 -P4 zsh -n - - - name: zsh (zcompile) - run: find . -name '*.zsh' -type f -exec zsh -fc "zcompile {}" \; + - name: "run lint (${{ matrix.task }})" + run: | + case "${{ matrix.task }}" in + markdown) + find . -name '*.md' ! -name 'CHANGELOG.md' -type f -print0 \ + | xargs -0 -n1 -P4 mdformat --check --wrap 120 --number + ;; + zsh-noexec) + find . -name '*.zsh' -type f -print0 \ + | xargs -0 -n1 -P4 zsh -n + ;; + zsh-zcompile) + find . -name '*.zsh' -type f \ + -exec zsh -fc "zcompile {}" \; + ;; + *) + echo "ERROR: unknown task ${{ matrix.task }}" >&2 + exit 1 + ;; + esac diff --git a/README.md b/README.md index d49f4b08..3ba0bd6c 100644 --- a/README.md +++ b/README.md @@ -692,99 +692,157 @@ ## Ice Modifiers ### Cloning Options -| Modifier | Description | -| :---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `bpick` | Used to select which release from GitHub Releases to download, e.g. `zini ice from"gh-r" as"program" bpick"*Darwin*"; zini load docker/compose`. **Does not work with snippets.** | -| `cloneopts` | Pass the contents of `cloneopts` to `git clone`. Defaults to `--recursive`. I.e.: change cloning options. Pass empty ice to disable recursive cloning. **Does not work with snippets.** | -| `depth` | Pass `--depth` to `git`, i.e. limit how much of history to download. **Does not work with snippets.** | -| `from` | Clone plugin from given site. Supported are `from"github"` (default), `..."github-rel"`, `..."gitlab"`, `..."bitbucket"`, `..."notabug"` (short names: `gh`, `gh-r`, `gl`, `bb`, `nb`). Can also be a full domain name (e.g. for GitHub enterprise). **Does not work with snippets.** | -| `proto` | Change protocol to `git`,`ftp`,`ftps`,`ssh`, `rsync`, etc. Default is `https`. **Does not work with snippets.** | -| `pullopts` | Pass the contents of `pullopts` to `git pull` used when updating plugins. **Does not work with snippets.** | -| `svn` | Use Subversion for downloading snippet. GitHub supports `SVN` protocol, this allows to clone subdirectories as snippets, e.g. `zinit ice svn; zinit snippet OMZP::git`. Other ice `pick` can be used to select file to source (default are: `*.plugin.zsh`, `init.zsh`, `*.zsh-theme`). **Does not work with plugins.** | -| `ver` | Used with `from"gh-r"` (i.e. downloading a binary release, e.g. for use with `as"program"`) – selects which version to download. Default is latest, can also be explicitly `ver"latest"`. Works also with regular plugins and packages (`pack` ice) checkouts e.g. `ver"abranch"`, i.e. a specific version. **Does not work with snippets.** | +| Modifier | Description | | :---------- | +\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `bpick` | Used to select which release from GitHub Releases to download, e.g. +`zini ice from"gh-r" as"program" bpick"*Darwin*"; zini load docker/compose`. **Does not work with snippets.** | | +`cloneopts` | Pass the contents of `cloneopts` to `git clone`. Defaults to `--recursive`. I.e.: change cloning options. +Pass empty ice to disable recursive cloning. **Does not work with snippets.** | | `depth` | Pass `--depth` to `git`, +i.e. limit how much of history to download. **Does not work with snippets.** | | `from` | Clone plugin from given site. +Supported are `from"github"` (default), `..."github-rel"`, `..."gitlab"`, `..."bitbucket"`, `..."notabug"` (short names: +`gh`, `gh-r`, `gl`, `bb`, `nb`). Can also be a full domain name (e.g. for GitHub enterprise). **Does not work with +snippets.** | | `proto` | Change protocol to `git`,`ftp`,`ftps`,`ssh`, `rsync`, etc. Default is `https`. **Does not work +with snippets.** | | `pullopts` | Pass the contents of `pullopts` to `git pull` used when updating plugins. **Does not +work with snippets.** | | `svn` | Use Subversion for downloading snippet. GitHub supports `SVN` protocol, this allows to +clone subdirectories as snippets, e.g. `zinit ice svn; zinit snippet OMZP::git`. Other ice `pick` can be used to select +file to source (default are: `*.plugin.zsh`, `init.zsh`, `*.zsh-theme`). **Does not work with plugins.** | | `ver` | +Used with `from"gh-r"` (i.e. downloading a binary release, e.g. for use with `as"program"`) – selects which version to +download. Default is latest, can also be explicitly `ver"latest"`. Works also with regular plugins and packages (`pack` +ice) checkouts e.g. `ver"abranch"`, i.e. a specific version. **Does not work with snippets.** | ### Selection of Files (To Source, …) -| Modifier | Description | -| :--------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `multisrc` | Allows to specify multiple files for sourcing, enumerated with spaces as the separators (e.g. `multisrc'misc.zsh grep.zsh'`) and also using brace-expansion syntax (e.g. `multisrc'{misc,grep}.zsh'`). Supports patterns. | -| `pick` | Select the file to source, or the file to set as command (when using `snippet --command` or the ice `as"program"`); it is a pattern, alphabetically first matched file is being chosen; e.g. `zinit ice pick"*.plugin.zsh"; zinit load …`. | -| `src` | Specify additional file to source after sourcing main file or after setting up command (via `as"program"`). It is not a pattern but a plain file name. | +| Modifier | Description | | :--------- | +\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +| | `multisrc` | Allows to specify multiple files for sourcing, enumerated with spaces as the separators (e.g. +`multisrc'misc.zsh grep.zsh'`) and also using brace-expansion syntax (e.g. `multisrc'{misc,grep}.zsh'`). Supports +patterns. | | `pick` | Select the file to source, or the file to set as command (when using `snippet --command` or the +ice `as"program"`); it is a pattern, alphabetically first matched file is being chosen; e.g. +`zinit ice pick"*.plugin.zsh"; zinit load …`. | | `src` | Specify additional file to source after sourcing main file or +after setting up command (via `as"program"`). It is not a pattern but a plain file name. | ### Conditional Loading -| Modifier | Description | -| :--------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `cloneonly` | Don't load the plugin / snippet, only download it | -| `has` | Load plugin or snippet only when given command is available (in $PATH), e.g. `zinit ice has'git' ...` | -| `if` | Load plugin or snippet only when given condition is fulfilled, for example: `zinit ice if'[[ -n "$commands[otool]" ]]'; zinit load ...`. | -| `load` | A condition to check which should cause plugin to load. It will load once, the condition can be still true, but will not trigger second load (unless plugin is unloaded earlier, see `unload` below). E.g.: `load'[[ $PWD = */github* ]]'`. | -| `subscribe` / `on-update-of` | Postpone loading of a plugin or snippet until the given file(s) get updated, e.g. `subscribe'{~/files-*,/tmp/files-*}'` | -| `trigger-load` | Creates a function that loads the associated plugin/snippet, with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command of the same name as the function. Can obtain multiple functions to create – sparate with `;`. | -| `unload` | A condition to check causing plugin to unload. It will unload once, then only if loaded again. E.g.: `unload'[[ $PWD != */github* ]]'`. | -| `wait` | Postpone loading a plugin or snippet. For `wait'1'`, loading is done `1` second after prompt. For `wait'[[ ... ]]'`, `wait'(( ... ))'`, loading is done when given condition is meet. For `wait'!...'`, prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** when `wait` is used without value, it works as `wait'0'`. | +| Modifier | Description | | :--------------------------- | +\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +| | `cloneonly` | Don't load the plugin / snippet, only download it | | `has` | Load plugin or snippet only when given +command is available (in $PATH), e.g. `zinit ice has'git' ...` | | `if` | Load plugin or snippet only when given +condition is fulfilled, for example: `zinit ice if'[[ -n "$commands[otool]" ]]'; zinit load ...`. | | `load` | A +condition to check which should cause plugin to load. It will load once, the condition can be still true, but will not +trigger second load (unless plugin is unloaded earlier, see `unload` below). E.g.: `load'[[ $PWD = */github* ]]'`. | | +`subscribe` / `on-update-of` | Postpone loading of a plugin or snippet until the given file(s) get updated, e.g. +`subscribe'{~/files-*,/tmp/files-*}'` | | `trigger-load` | Creates a function that loads the associated plugin/snippet, +with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command +of the same name as the function. Can obtain multiple functions to create – sparate with `;`. | | `unload` | A condition +to check causing plugin to unload. It will unload once, then only if loaded again. E.g.: +`unload'[[ $PWD != */github* ]]'`. | | `wait` | Postpone loading a plugin or snippet. For `wait'1'`, loading is done `1` +second after prompt. For `wait'[[ ... ]]'`, `wait'(( ... ))'`, loading is done when given condition is meet. For +`wait'!...'`, prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** +when `wait` is used without value, it works as `wait'0'`. | ### Plugin Output -| Modifier | Description | -| :------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `lucid` | Skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins (a subset of `silent`). | -| `notify` | Output given message under-prompt after successfully loading a plugin/snippet. In case of problems with the loading, output a warning message and the return code. If starts with `!` it will then always output the given message. Hint: if the message is empty, then it will just notify about problems. | -| `silent` | Mute plugin's or snippet's `stderr` & `stdout`. Also skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins, and completion-installation messages. | +| Modifier | Description | | :------- | +\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `lucid` | Skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins (a subset of `silent`). | | +`notify` | Output given message under-prompt after successfully loading a plugin/snippet. In case of problems with the +loading, output a warning message and the return code. If starts with `!` it will then always output the given message. +Hint: if the message is empty, then it will just notify about problems. | | `silent` | Mute plugin's or snippet's +`stderr` & `stdout`. Also skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins, and +completion-installation messages. | ### Completions -| Modifier | Description | -| :-------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `blockf` | Disallow plugin to modify `fpath`. Useful when a plugin wants to provide completions in traditional way. Zinit can manage completions and plugin can be blocked from exposing them. | -| `completions` | Do detect, install and manage completions for this plugin. Overwrites `as'null'` or `nocompletions`. | -| `nocompletions` | Don't detect, install and manage completions for this plugin. Completions can be installed later with `zinit creinstall {plugin-spec}`. | +| Modifier | Description | | :-------------- | +\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `blockf` | Disallow plugin to modify `fpath`. Useful when a plugin wants to provide completions in traditional way. +Zinit can manage completions and plugin can be blocked from exposing them. | | `completions` | Do detect, install and +manage completions for this plugin. Overwrites `as'null'` or `nocompletions`. | | `nocompletions` | Don't detect, +install and manage completions for this plugin. Completions can be installed later with +`zinit creinstall {plugin-spec}`. | ### Command Execution After Cloning, Updating or Loading -| Modifier | Description | -| :----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `atclone` | Run command after cloning, within plugin's directory, e.g. `zinit ice atclone"echo Cloned"`. Ran also after downloading snippet. | -| `atinit` | Run command after directory setup (cloning, checking it, etc.) of plugin/snippet but before loading. | -| `atload` | Run command after loading, within plugin's directory. Can be also used with snippets. Passed code can be preceded with `!`, it will then be investigated (if using `load`, not `light`). | -| `atpull` | Run command after updating (**only if new commits are waiting for download**), within plugin's directory. If starts with "!" then command will be ran before `mv` & `cp` ices and before `git pull` or `svn update`. Otherwise it is ran after them. Can be `atpull'%atclone'`, to repeat `atclone` Ice-mod. | -| `configure` | Runs `./configure` script and by default changes the installation directory by passing `--prefix=$ZPFX` to the script. Runs before `make''` and after `make'!'`, you can pass `'!'` too to this ice (i.e.: `configure'!'`) to make it execute earlier – before `make'!'` and after `make'!!'`. If `#` given in the ice value then also executes script `./autogen.sh` first before running `./configure`. The script is run anyway if there is no `configure` script. Also, when there exist another build-system related files, then it is run if no `configure` script is found. Currently supported systems are: CMake, scons and meson, checked-for/run in this order | -| `countdown` | Causes an interruptable (by Ctrl-C) countdown 5…4…3…2…1…0 to be displayed before executing `atclone''`,`atpull''` and `make` ices | -| `cp` | Copy file after cloning or after update (then, only if new commits were downloaded). Example: `cp "docker-c* -> dcompose"`. Ran after `mv`. | -| `make` | Run `make` command after cloning/updating and executing `mv`, `cp`, `atpull`, `atclone` Ice mods. Can obtain argument, e.g. `make"install PREFIX=/opt"`. If the value starts with `!` then `make` is ran before `atclone`/`atpull`, e.g. `make'!'`. | -| `mv` | Move file after cloning or after update (then, only if new commits were downloaded). Example: `mv "fzf-* -> fzf"`. It uses `->` as separator for old and new file names. Works also with snippets. | -| `nocd` | Don't switch the current directory into the plugin's directory when evaluating the above ice-mods `atinit''`,`atload''`, etc. | -| `reset` | Invokes `git reset --hard HEAD` for plugins or `svn revert` for SVN snippets before pulling any new changes. This way `git` or `svn` will not report conflicts if some changes were done in e.g.: `atclone''` ice. For file snippets and `gh-r` plugins it invokes `rm -rf *`. | -| `run-atpull` | Always run the atpull hook (when updating), not only when there are new commits to be downloaded. | +| Modifier | Description | | :----------- | +\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `atclone` | Run command after cloning, within plugin's directory, e.g. `zinit ice atclone"echo Cloned"`. Ran also +after downloading snippet. | | `atinit` | Run command after directory setup (cloning, checking it, etc.) of +plugin/snippet but before loading. | | `atload` | Run command after loading, within plugin's directory. Can be also used +with snippets. Passed code can be preceded with `!`, it will then be investigated (if using `load`, not `light`). | | +`atpull` | Run command after updating (**only if new commits are waiting for download**), within plugin's directory. If +starts with "!" then command will be ran before `mv` & `cp` ices and before `git pull` or `svn update`. Otherwise it is +ran after them. Can be `atpull'%atclone'`, to repeat `atclone` Ice-mod. | | `configure` | Runs `./configure` script and +by default changes the installation directory by passing `--prefix=$ZPFX` to the script. Runs before `make''` and after +`make'!'`, you can pass `'!'` too to this ice (i.e.: `configure'!'`) to make it execute earlier – before `make'!'` and +after `make'!!'`. If `#` given in the ice value then also executes script `./autogen.sh` first before running +`./configure`. The script is run anyway if there is no `configure` script. Also, when there exist another build-system +related files, then it is run if no `configure` script is found. Currently supported systems are: CMake, scons and +meson, checked-for/run in this order | | `countdown` | Causes an interruptable (by Ctrl-C) countdown 5…4…3…2…1…0 to be +displayed before executing `atclone''`,`atpull''` and `make` ices | | `cp` | Copy file after cloning or after update +(then, only if new commits were downloaded). Example: `cp "docker-c* -> dcompose"`. Ran after `mv`. | | `make` | Run +`make` command after cloning/updating and executing `mv`, `cp`, `atpull`, `atclone` Ice mods. Can obtain argument, e.g. +`make"install PREFIX=/opt"`. If the value starts with `!` then `make` is ran before `atclone`/`atpull`, e.g. `make'!'`. +| | `mv` | Move file after cloning or after update (then, only if new commits were downloaded). Example: +`mv "fzf-* -> fzf"`. It uses `->` as separator for old and new file names. Works also with snippets. | | `nocd` | Don't +switch the current directory into the plugin's directory when evaluating the above ice-mods `atinit''`,`atload''`, etc. +| | `reset` | Invokes `git reset --hard HEAD` for plugins or `svn revert` for SVN snippets before pulling any new +changes. This way `git` or `svn` will not report conflicts if some changes were done in e.g.: `atclone''` ice. For file +snippets and `gh-r` plugins it invokes `rm -rf *`. | | `run-atpull` | Always run the atpull hook (when updating), not +only when there are new commits to be downloaded. | ### Sticky-Emulation Of Other Shells -| Modifier | Description | -| :------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared within the file will get a _sticky_ emulation assigned – when invoked they'll execute also with the `sh` emulation set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. | -| `csh`/`!csh` | The same as `sh`, but emulating `csh` shell. | -| `ksh`/`!ksh` | The same as `sh`, but emulating `ksh` shell. | -| `bash`/`!bash` | The same as `sh`, but with the `SH_GLOB` option disabled, so that Bash regular expressions work. | +| Modifier | Description | | :------------- | +\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +| | `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared +within the file will get a _sticky_ emulation assigned – when invoked they'll execute also with the `sh` emulation +set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. | +| `csh`/`!csh` | The same as `sh`, but emulating `csh` shell. | | `ksh`/`!ksh` | The same as `sh`, but emulating `ksh` +shell. | | `bash`/`!bash` | The same as `sh`, but with the `SH_GLOB` option disabled, so that Bash regular expressions +work. | ### Others -| Modifier | Description | -| :------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `as` | Can be `as"program"` (also the alias: `as"command"`), and will cause to add script/program to `$PATH` instead of sourcing (see `pick`). Can also be `as"completion"` – use with plugins or snippets in whose only underscore-starting `_*` files you are interested in. The third possible value is `as"null"` – a shorthand for `pick"/dev/null" nocompletions` – i.e.: it disables the default script-file sourcing and also the installation of completions. | -| `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses relative links if realpath >= 8.23 is found. **_Does not apply to URL-based snippets. Does not work with plugins._** | -| `id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. | -| `subst` | Substitute the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. | -| `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in their scripts. | -| `autoload` | Autoload the given functions (from their files). Equvalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. | -| `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with snippets.** | -| `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. `compile"(pure\\|async).zsh"` for `sindresorhus/pure`. | -| `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. | -| `service` | Make following plugin or snippet a _service_, which will be ran in background, and only in single Zshell instance. See [the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). | -| `light-mode` | Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the for-syntax, where there is no `load` nor `light` subcommand | -| `nocompile` | Don't try to compile `pick`-pointed files. If passed the exclamation mark (i.e. `nocompile'!'`), then do compile, but after `make''` and `atclone''` (useful if Makefile installs some scripts, to point `pick''` at the location of their installation). | -| `trackbinds` | Shadow but only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow `bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the `light`-subcommand. **Does not work with snippets.** | -| `wrap-track` | Takes a `;`-separated list of function names that are to be investigated (meaning gathering report and unload data) **once** during execution. It works by wrapping the functions with a investigating-enabling and disabling snippet of code. In summary, `wrap-track` allows to extend the investigating beyond the moment of loading of a plugin. Example use is to `wrap-track` a precmd function of a prompt (like `_p9k_precmd()` of powerlevel10k) or other plugin that _postpones its initialization till the first prompt_ (like e.g.: zsh-autosuggestions). **Does not work with snippets.** | -| `reset-prompt` | Reset the prompt after loading the plugin/snippet (by issuing `zle .reset-prompt`). Note: normally it's sufficient to precede the value of `wait''` ice with `!`. | +| Modifier | Description | | :------------- | +\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `as` | Can be `as"program"` (also the alias: `as"command"`), and will cause to add script/program to `$PATH` instead +of sourcing (see `pick`). Can also be `as"completion"` – use with plugins or snippets in whose only underscore-starting +`_*` files you are interested in. The third possible value is `as"null"` – a shorthand for +`pick"/dev/null" nocompletions` – i.e.: it disables the default script-file sourcing and also the installation of +completions. | | `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses +relative links if realpath >= 8.23 is found. **_Does not apply to URL-based snippets. Does not work with plugins._** | | +`id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. | | `subst` | Substitute +the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. | +| `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in +their scripts. | | `autoload` | Autoload the given functions (from their files). Equvalent to calling +`atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: +`zinit autoload'fun → my-fun; fun2 → my-fun2'`. | | `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, +e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. +The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with +snippets.** | | `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to +compile, e.g. `compile"(pure\\|async).zsh"` for `sindresorhus/pure`. | | `extract` | Performs archive extraction +supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it +works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper +than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper +in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being +read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for +further information. | | `service` | Make following plugin or snippet a _service_, which will be ran in background, and +only in single Zshell instance. See +[the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). | | `light-mode` | +Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the +for-syntax, where there is no `load` nor `light` subcommand | | `nocompile` | Don't try to compile `pick`-pointed files. +If passed the exclamation mark (i.e. `nocompile'!'`), then do compile, but after `make''` and `atclone''` (useful if +Makefile installs some scripts, to point `pick''` at the location of their installation). | | `trackbinds` | Shadow but +only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow +`bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the +`light`-subcommand. **Does not work with snippets.** | | `wrap-track` | Takes a `;`-separated list of function names +that are to be investigated (meaning gathering report and unload data) **once** during execution. It works by wrapping +the functions with a investigating-enabling and disabling snippet of code. In summary, `wrap-track` allows to extend the +investigating beyond the moment of loading of a plugin. Example use is to `wrap-track` a precmd function of a prompt +(like `_p9k_precmd()` of powerlevel10k) or other plugin that _postpones its initialization till the first prompt_ (like +e.g.: zsh-autosuggestions). **Does not work with snippets.** | | `reset-prompt` | Reset the prompt after loading the +plugin/snippet (by issuing `zle .reset-prompt`). Note: normally it's sufficient to precede the value of `wait''` ice +with `!`. | ### Order of Execution @@ -797,59 +855,52 @@ ## Zinit Commands ### Help -| Command | Description | -| :-------- | --------------------- | -| `help` | Usage information. | -| `man` | Manual. | -| `version` | Display Zinit version | +| Command | Description | | :-------- | --------------------- | | `help` | Usage information. | | `man` | Manual. | | +`version` | Display Zinit version | ### Loading and Unloading -| Command | Description | -| :----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `load {plg-spec}` | Load plugin, can also receive absolute local path. | -| `snippet [-f] {url}` | Source local or remote file (by direct URL). `-f` – don't use cache (force redownload). The URL can use the following shorthands: `PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh My Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` (OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc. | -| `light [-b] {plg-spec}` | Light plugin load, without reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to induce the no-investigating (i.e.: _light_) loading, regardless of the command used. | -| `unload [-q] {plg-spec}` | Unload plugin loaded with `zinit load ...`. `-q` – quiet. | +| Command | Description | | :----------------------- | +\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `load {plg-spec}` | Load plugin, can also receive absolute local path. | | `snippet [-f] {url}` | Source local or +remote file (by direct URL). `-f` – don't use cache (force redownload). The URL can use the following shorthands: +`PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh My Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` +(OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc. | | `light [-b] {plg-spec}` | Light plugin load, without +reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to +induce the no-investigating (i.e.: _light_) loading, regardless of the command used. | | `unload [-q] {plg-spec}` | +Unload plugin loaded with `zinit load ...`. `-q` – quiet. | ### Completions -| Command | Description | -| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cclear` | Clear stray and improper completions. | -| `cdclear [-q]` | Clear compdef replay list. `-q` – quiet. | -| `cdisable {cname}` | Disable completion `cname`. | -| `cdlist` | Show compdef replay list. | -| `cdreplay [-q]` | Replay compdefs (to be done after compinit). `-q` – quiet. | -| `cenable {cname}` | Enable completion `cname`. | -| `completions \[*columns*\]` | List completions in use, with columns completions per line. `zpl clist 5` will for example print 5 completions per line. Default is 3. | -| `compinit` | Refresh installed completions. | -| `creinstall [-q] [-Q] {plg-spec}` | Install completions for plugin, can also receive absolute local path. `-q` – quiet. `-Q` - quiet all. | -| `csearch` | Search for available completions from any plugin. | -| `cuninstall {plg-spec}` | Uninstall completions for plugin. | +| Command | Description | | --------------------------------- | +\--------------------------------------------------------------------------------------------------------------------------------------------------- +| | `cclear` | Clear stray and improper completions. | | `cdclear [-q]` | Clear compdef replay list. `-q` – quiet. | | +`cdisable {cname}` | Disable completion `cname`. | | `cdlist` | Show compdef replay list. | | `cdreplay [-q]` | Replay +compdefs (to be done after compinit). `-q` – quiet. | | `cenable {cname}` | Enable completion `cname`. | | +`completions \[*columns*\]` | List completions in use, with columns completions per line. `zpl clist 5` +will for example print 5 completions per line. Default is 3. | | `compinit` | Refresh installed completions. | | +`creinstall [-q] [-Q] {plg-spec}` | Install completions for plugin, can also receive absolute local path. `-q` – quiet. +`-Q` - quiet all. | | `csearch` | Search for available completions from any plugin. | | `cuninstall {plg-spec}` | +Uninstall completions for plugin. | ### Tracking of the Active Session -| Command | Description | -| ---------------- | ------------------------------------------------- | -| `dclear` | Clear report of what was going on in session. | -| `dstop` | Stop investigating what's going on in session. | -| `dreport` | Report what was going on in session. | -| `dunload` | Revert changes recorded between dstart and dstop. | -| `dtrace, dstart` | Start investigating what's going on in session. | +| Command | Description | | ---------------- | ------------------------------------------------- | | `dclear` | Clear +report of what was going on in session. | | `dstop` | Stop investigating what's going on in session. | | `dreport` | +Report what was going on in session. | | `dunload` | Revert changes recorded between dstart and dstop. | | +`dtrace, dstart` | Start investigating what's going on in session. | ### Reports and Statistics -| Command | Description | -| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `bindkeys` | Lists bindkeys set up by each plugin. | -| `list-plugins [keyword]` | Show what plugins are loaded (filter with 'keyword'). | -| `list-snippets` | List snippets in formatted and colorized manner. Requires `tree` program. | -| `recently [time-spec]` | Show plugins that changed recently, argument is e.g. 1 month 2 days. | -| `report {plg-spec}` | Show plugin report. `--all` – do it for all plugins. | -| `status {plg-spec}` | Git status for plugin or svn status for snippet. `--all` – do it for all plugins and snippets. | -| `zstatus` | Display brief statistics for your Zinit installation. | -| `times [-a] [-m] [-s]` | Print load times for each plugin. `-s` – Times are printed in seconds. `-m` – Show plugin loading moments. `-a` - Times and loading moments are printed. | +| Command | Description | | ------------------------ | +\-------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `bindkeys` | Lists bindkeys set up by each plugin. | | `list-plugins [keyword]` | Show what plugins are loaded +(filter with 'keyword'). | | `list-snippets` | List snippets in formatted and colorized manner. Requires `tree` program. +| | `recently [time-spec]` | Show plugins that changed recently, argument is e.g. 1 month 2 days. | | +`report {plg-spec}` | Show plugin report. `--all` – do it for all plugins. | | `status {plg-spec}` | Git status for +plugin or svn status for snippet. `--all` – do it for all plugins and snippets. | | `zstatus` | Display brief statistics +for your Zinit installation. | | `times [-a] [-m] [-s]` | Print load times for each plugin. `-s` – Times are printed in +seconds. `-m` – Show plugin loading moments. `-a` - Times and loading moments are printed. | ### Compiling @@ -861,11 +912,8 @@ #### compile zinit [options] compile PLUGIN ``` -| Option | Description | -| ------------- | ------------------------- | -| `-a, --all` | Compile all plugins | -| `-h, --help` | Print usage | -| `-q, --quiet` | Suppress the build output | +| Option | Description | | ------------- | ------------------------- | | `-a, --all` | Compile all plugins | | +`-h, --help` | Print usage | | `-q, --quiet` | Suppress the build output | #### compiled @@ -883,32 +931,32 @@ #### uncompile zinit [options] uncompile PLUGIN ``` -| Option | Description | -| ------------- | ----------------------------------------- | -| `-a, --all` | Remove any compiled files for all plugins | -| `-h, --help` | Print usage | -| `-q, --quiet` | Suppress the output | +| Option | Description | | ------------- | ----------------------------------------- | | `-a, --all` | Remove any +compiled files for all plugins | | `-h, --help` | Print usage | | `-q, --quiet` | Suppress the output | ### Other -| Command | Description | -| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `module` | Manage binary Zsh module shipped with Zinit, see `zinit module help`. | -| `self-update` | Updates and compiles Zinit. | -| `cd {plg-spec}` | Cd into plugin's directory. Also support snippets if fed with URL. | -| `edit {plg-spec}` | Edit plugin's file with $EDITOR. | -| `changes {plg-spec}` | View plugin's git log. | -| `create {plg-spec}` | Create plugin (also together with GitHub repository). | -| `glance {plg-spec}` | Look at plugin's source (pygmentize, {,source-}highlight). | -| `stress {plg-spec}` | Test plugin for compatibility with set of options. | -| `recall {plg-spec}\|URL` | Fetch saved ice modifiers and construct `zinit ice ...` command. | -| `srv {service-id} [cmd]` | Control a service, command can be: stop,start,restart,next,quit; `next` moves the service to another Zshell. | -| `ice ` | Add ice to next command, argument is e.g. from"gitlab". | -| `env-whitelist [-v] [-h] {env..}` | Allows to specify names (also patterns) of variables left unchanged during an unload. `-v` – verbose. | -| `run` `[-l]` `[plugin]` `{command}` | Runs the given command in the given plugin's directory. If the option `-l` will be given then the plugin should be skipped – the option will cause the previous plugin to be reused. | -| `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget wrongly passed ice-mods).
`--all` – purge.
`--clean` – delete plugins and snippets that are not loaded. | -| `update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.
`--all` – update all plugins and snippets.
`-q` – quiet.
`-r` \| `--reset` – run `git reset --hard` / `svn revert` before pulling changes. | -| `add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to `$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's possible to also add regular directories. | +| Command | Description | | ---------------------------------------------------------------- | +\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | `module` | Manage binary Zsh module shipped with Zinit, see `zinit module help`. | | `self-update` | Updates and +compiles Zinit. | | `cd {plg-spec}` | Cd into plugin's directory. Also support snippets if fed with URL. | | +`edit {plg-spec}` | Edit plugin's file with $EDITOR. | | `changes {plg-spec}` | View plugin's git log. | | +`create {plg-spec}` | Create plugin (also together with GitHub repository). | | `glance {plg-spec}` | Look at plugin's +source (pygmentize, {,source-}highlight). | | `stress {plg-spec}` | Test plugin for compatibility with set of options. | +| `recall {plg-spec}\|URL` | Fetch saved ice modifiers and construct `zinit ice ...` command. | | +`srv {service-id} [cmd]` | Control a service, command can be: stop,start,restart,next,quit; `next` moves the service to +another Zshell. | | `ice ` | Add ice to next command, argument is e.g. from"gitlab". | | +`env-whitelist [-v] [-h] {env..}` | Allows to specify names (also patterns) of variables left unchanged during an +unload. `-v` – verbose. | | `run` `[-l]` `[plugin]` `{command}` | Runs the given command in the given plugin's +directory. If the option `-l` will be given then the plugin should be skipped – the option will cause the previous +plugin to be reused. | | `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget +wrongly passed ice-mods).
`--all` – purge.
`--clean` – delete plugins and snippets that are not loaded. | | +`update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.
`--all` – update all plugins and +snippets.
`-q` – quiet.
`-r` | `--reset` – run `git reset --hard` / `svn revert` before pulling changes. | | +`add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to +`$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, +the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's +possible to also add regular directories. | ## Updating Zinit and Plugins @@ -1109,20 +1157,23 @@ ### Customizing Paths declare -A ZINIT # initial Zinit's hash definition, if configuring before loading Zinit, and then: ``` -| Hash Field | Description | -| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ZINIT\[BIN_DIR\] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | -| ZINIT\[HOME_DIR\] | Where Zinit should create all working directories, e.g.: "~/.local/share/zinit" | -| ZINIT\[MAN_DIR\] | Directory where plugins can store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not necessarily be used by `man` (See #8). Default: `$ZPFX/man` | -| ZINIT\[PLUGINS_DIR\] | Override single working directory – for plugins, e.g. "/opt/zsh/zinit/plugins" | -| ZINIT\[COMPLETIONS_DIR\] | As above, but for completion files, e.g. "/opt/zsh/zinit/root_completions" | -| ZINIT\[SNIPPETS_DIR\] | As above, but for snippets | -| ZINIT\[LIST_COMMAND\] | Command to use for displaying a directory tree (e.g., `ls --tree`, `tree`, etc.) | -| ZINIT\[ZCOMPDUMP_PATH\] | Path to `.zcompdump` file, with the file included (i.e. its name can be different) | -| ZINIT\[COMPINIT_OPTS\] | Options for `compinit` call (i.e. done by `zicompinit`), use to pass -C to speed up loading | -| ZINIT\[MUTE_WARNINGS\] | If set to `1`, then mutes some of the Zinit warnings, specifically the `plugin already registered` warning | -| ZINIT\[OPTIMIZE_OUT_DISK_ACCESSES\] | If set to `1`, then Zinit will skip checking if a Turbo-loaded object exists on the disk. By default Zinit skips Turbo for non-existing objects (plugins or snippets) to install them before the first prompt – without any delays, during the normal processing of `zshrc`. This option can give a performance gain of about 10 ms out of 150 ms (i.e.: Zsh will start up in 140 ms instead of 150 ms). | -| ZINIT\[NO_ALIASES\] | If set to `1`, then Zinit will not set aliases such as `zi` or `zini` | +| Hash Field | Description | | ----------------------------------- | +\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +| | ZINIT[BIN_DIR] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | | ZINIT[HOME_DIR] | Where Zinit +should create all working directories, e.g.: "~/.local/share/zinit" | | ZINIT[MAN_DIR] | Directory where plugins can +store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not +necessarily be used by `man` (See #8). Default: `$ZPFX/man` | | ZINIT[PLUGINS_DIR] | Override single working directory – +for plugins, e.g. "/opt/zsh/zinit/plugins" | | ZINIT[COMPLETIONS_DIR] | As above, but for completion files, e.g. +"/opt/zsh/zinit/root_completions" | | ZINIT[SNIPPETS_DIR] | As above, but for snippets | | ZINIT[LIST_COMMAND] | Command +to use for displaying a directory tree (e.g., `ls --tree`, `tree`, etc.) | | ZINIT[ZCOMPDUMP_PATH] | Path to +`.zcompdump` file, with the file included (i.e. its name can be different) | | ZINIT[COMPINIT_OPTS] | Options for +`compinit` call (i.e. done by `zicompinit`), use to pass -C to speed up loading | | ZINIT[MUTE_WARNINGS] | If set to +`1`, then mutes some of the Zinit warnings, specifically the `plugin already registered` warning | | +ZINIT[OPTIMIZE_OUT_DISK_ACCESSES] | If set to `1`, then Zinit will skip checking if a Turbo-loaded object exists on the +disk. By default Zinit skips Turbo for non-existing objects (plugins or snippets) to install them before the first +prompt – without any delays, during the normal processing of `zshrc`. This option can give a performance gain of about +10 ms out of 150 ms (i.e.: Zsh will start up in 140 ms instead of 150 ms). | | ZINIT[NO_ALIASES] | If set to `1`, then +Zinit will not set aliases such as `zi` or `zini` | There is also `$ZPFX`, set by default to `~/.local/share/zinit/polaris` – a directory where software with `Makefile`, etc. can be pointed to, by e.g. `atclone'./configure --prefix=$ZPFX'`. @@ -1172,7 +1223,7 @@ ## Support Zinit is a personal, free-time project with no funding and a huge [feature request backlog](https://github.com/zdharma-continuum/zinit/issues). If you love it, consider supporting its -development via GitHub Sponsors \[pending\]. Any help counts! +development via GitHub Sponsors [pending]. Any help counts! ## Getting Help and Community From b096d6ef53301c0ed057dcc51d3d98d6d34274ed Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Tue, 28 Jan 2025 18:01:31 +0100 Subject: [PATCH 17/56] Fix tables in README - Revert "lint: fmt README.md (#694)" (#695) - Switch to markdownlint - Fix markdown linting issues --- .github/workflows/linting.yaml | 38 +++- README.md | 379 ++++++++++++++------------------- doc/HACKING.md | 130 +++++------ 3 files changed, 260 insertions(+), 287 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 93950431..fac9ee60 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -10,14 +10,41 @@ on: workflow_dispatch: jobs: - lint: - name: Lint + mdlint: + name: Markdown Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: xt0rted/markdownlint-problem-matcher@v3 + + - run: npm install -g markdownlint-cli + + # disabled checks: + # - MD013/line-length + # - MD033/no-inline-html + # - MD034/no-bare-urls + # - MD036/no-emphasis-as-heading + # - MD041/first-line-heading/first-line-h1 + - run: | + markdownlint --version + + # List files to lint + ls *.md **/*.md + + markdownlint \ + --ignore '**/CHANGELOG.md' \ + --disable MD013 MD033 MD034 MD036 MD041 -- \ + *.md **/*.md + + zshlint: + name: ZSH Lint runs-on: ubuntu-latest strategy: fail-fast: false matrix: - task: [markdown, zsh-noexec, zsh-zcompile] + task: [zsh-noexec, zsh-zcompile] steps: - uses: actions/checkout@v4 @@ -30,15 +57,10 @@ jobs: run: | sudo apt-get update sudo apt-get install --yes zsh - pip install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc - name: "run lint (${{ matrix.task }})" run: | case "${{ matrix.task }}" in - markdown) - find . -name '*.md' ! -name 'CHANGELOG.md' -type f -print0 \ - | xargs -0 -n1 -P4 mdformat --check --wrap 120 --number - ;; zsh-noexec) find . -name '*.zsh' -type f -print0 \ | xargs -0 -n1 -P4 zsh -n diff --git a/README.md b/README.md index 3ba0bd6c..c9efafb0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- + zinit logo

@@ -63,7 +63,7 @@ # Zinit

- +startup times graph

@@ -692,157 +692,99 @@ ## Ice Modifiers ### Cloning Options -| Modifier | Description | | :---------- | -\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `bpick` | Used to select which release from GitHub Releases to download, e.g. -`zini ice from"gh-r" as"program" bpick"*Darwin*"; zini load docker/compose`. **Does not work with snippets.** | | -`cloneopts` | Pass the contents of `cloneopts` to `git clone`. Defaults to `--recursive`. I.e.: change cloning options. -Pass empty ice to disable recursive cloning. **Does not work with snippets.** | | `depth` | Pass `--depth` to `git`, -i.e. limit how much of history to download. **Does not work with snippets.** | | `from` | Clone plugin from given site. -Supported are `from"github"` (default), `..."github-rel"`, `..."gitlab"`, `..."bitbucket"`, `..."notabug"` (short names: -`gh`, `gh-r`, `gl`, `bb`, `nb`). Can also be a full domain name (e.g. for GitHub enterprise). **Does not work with -snippets.** | | `proto` | Change protocol to `git`,`ftp`,`ftps`,`ssh`, `rsync`, etc. Default is `https`. **Does not work -with snippets.** | | `pullopts` | Pass the contents of `pullopts` to `git pull` used when updating plugins. **Does not -work with snippets.** | | `svn` | Use Subversion for downloading snippet. GitHub supports `SVN` protocol, this allows to -clone subdirectories as snippets, e.g. `zinit ice svn; zinit snippet OMZP::git`. Other ice `pick` can be used to select -file to source (default are: `*.plugin.zsh`, `init.zsh`, `*.zsh-theme`). **Does not work with plugins.** | | `ver` | -Used with `from"gh-r"` (i.e. downloading a binary release, e.g. for use with `as"program"`) – selects which version to -download. Default is latest, can also be explicitly `ver"latest"`. Works also with regular plugins and packages (`pack` -ice) checkouts e.g. `ver"abranch"`, i.e. a specific version. **Does not work with snippets.** | +| Modifier | Description | +| :---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bpick` | Used to select which release from GitHub Releases to download, e.g. `zini ice from"gh-r" as"program" bpick"*Darwin*"; zini load docker/compose`. **Does not work with snippets.** | +| `cloneopts` | Pass the contents of `cloneopts` to `git clone`. Defaults to `--recursive`. I.e.: change cloning options. Pass empty ice to disable recursive cloning. **Does not work with snippets.** | +| `depth` | Pass `--depth` to `git`, i.e. limit how much of history to download. **Does not work with snippets.** | +| `from` | Clone plugin from given site. Supported are `from"github"` (default), `..."github-rel"`, `..."gitlab"`, `..."bitbucket"`, `..."notabug"` (short names: `gh`, `gh-r`, `gl`, `bb`, `nb`). Can also be a full domain name (e.g. for GitHub enterprise). **Does not work with snippets.** | +| `proto` | Change protocol to `git`,`ftp`,`ftps`,`ssh`, `rsync`, etc. Default is `https`. **Does not work with snippets.** | +| `pullopts` | Pass the contents of `pullopts` to `git pull` used when updating plugins. **Does not work with snippets.** | +| `svn` | Use Subversion for downloading snippet. GitHub supports `SVN` protocol, this allows to clone subdirectories as snippets, e.g. `zinit ice svn; zinit snippet OMZP::git`. Other ice `pick` can be used to select file to source (default are: `*.plugin.zsh`, `init.zsh`, `*.zsh-theme`). **Does not work with plugins.** | +| `ver` | Used with `from"gh-r"` (i.e. downloading a binary release, e.g. for use with `as"program"`) – selects which version to download. Default is latest, can also be explicitly `ver"latest"`. Works also with regular plugins and packages (`pack` ice) checkouts e.g. `ver"abranch"`, i.e. a specific version. **Does not work with snippets.** | ### Selection of Files (To Source, …) -| Modifier | Description | | :--------- | -\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -| | `multisrc` | Allows to specify multiple files for sourcing, enumerated with spaces as the separators (e.g. -`multisrc'misc.zsh grep.zsh'`) and also using brace-expansion syntax (e.g. `multisrc'{misc,grep}.zsh'`). Supports -patterns. | | `pick` | Select the file to source, or the file to set as command (when using `snippet --command` or the -ice `as"program"`); it is a pattern, alphabetically first matched file is being chosen; e.g. -`zinit ice pick"*.plugin.zsh"; zinit load …`. | | `src` | Specify additional file to source after sourcing main file or -after setting up command (via `as"program"`). It is not a pattern but a plain file name. | +| Modifier | Description | +| :--------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `multisrc` | Allows to specify multiple files for sourcing, enumerated with spaces as the separators (e.g. `multisrc'misc.zsh grep.zsh'`) and also using brace-expansion syntax (e.g. `multisrc'{misc,grep}.zsh'`). Supports patterns. | +| `pick` | Select the file to source, or the file to set as command (when using `snippet --command` or the ice `as"program"`); it is a pattern, alphabetically first matched file is being chosen; e.g. `zinit ice pick"*.plugin.zsh"; zinit load …`. | +| `src` | Specify additional file to source after sourcing main file or after setting up command (via `as"program"`). It is not a pattern but a plain file name. | ### Conditional Loading -| Modifier | Description | | :--------------------------- | -\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -| | `cloneonly` | Don't load the plugin / snippet, only download it | | `has` | Load plugin or snippet only when given -command is available (in $PATH), e.g. `zinit ice has'git' ...` | | `if` | Load plugin or snippet only when given -condition is fulfilled, for example: `zinit ice if'[[ -n "$commands[otool]" ]]'; zinit load ...`. | | `load` | A -condition to check which should cause plugin to load. It will load once, the condition can be still true, but will not -trigger second load (unless plugin is unloaded earlier, see `unload` below). E.g.: `load'[[ $PWD = */github* ]]'`. | | -`subscribe` / `on-update-of` | Postpone loading of a plugin or snippet until the given file(s) get updated, e.g. -`subscribe'{~/files-*,/tmp/files-*}'` | | `trigger-load` | Creates a function that loads the associated plugin/snippet, -with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command -of the same name as the function. Can obtain multiple functions to create – sparate with `;`. | | `unload` | A condition -to check causing plugin to unload. It will unload once, then only if loaded again. E.g.: -`unload'[[ $PWD != */github* ]]'`. | | `wait` | Postpone loading a plugin or snippet. For `wait'1'`, loading is done `1` -second after prompt. For `wait'[[ ... ]]'`, `wait'(( ... ))'`, loading is done when given condition is meet. For -`wait'!...'`, prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** -when `wait` is used without value, it works as `wait'0'`. | +| Modifier | Description | +| :--------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cloneonly` | Don't load the plugin / snippet, only download it | +| `has` | Load plugin or snippet only when given command is available (in $PATH), e.g. `zinit ice has'git' ...` | +| `if` | Load plugin or snippet only when given condition is fulfilled, for example: `zinit ice if'[[ -n "$commands[otool]" ]]'; zinit load ...`. | +| `load` | A condition to check which should cause plugin to load. It will load once, the condition can be still true, but will not trigger second load (unless plugin is unloaded earlier, see `unload` below). E.g.: `load'[[ $PWD = */github* ]]'`. | +| `subscribe` / `on-update-of` | Postpone loading of a plugin or snippet until the given file(s) get updated, e.g. `subscribe'{~/files-*,/tmp/files-*}'` | +| `trigger-load` | Creates a function that loads the associated plugin/snippet, with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command of the same name as the function. Can obtain multiple functions to create – sparate with `;`. | +| `unload` | A condition to check causing plugin to unload. It will unload once, then only if loaded again. E.g.: `unload'[[ $PWD != */github* ]]'`. | +| `wait` | Postpone loading a plugin or snippet. For `wait'1'`, loading is done `1` second after prompt. For `wait'[[ ... ]]'`, `wait'(( ... ))'`, loading is done when given condition is meet. For `wait'!...'`, prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** when `wait` is used without value, it works as `wait'0'`. | ### Plugin Output -| Modifier | Description | | :------- | -\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `lucid` | Skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins (a subset of `silent`). | | -`notify` | Output given message under-prompt after successfully loading a plugin/snippet. In case of problems with the -loading, output a warning message and the return code. If starts with `!` it will then always output the given message. -Hint: if the message is empty, then it will just notify about problems. | | `silent` | Mute plugin's or snippet's -`stderr` & `stdout`. Also skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins, and -completion-installation messages. | +| Modifier | Description | +| :------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `lucid` | Skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins (a subset of `silent`). | +| `notify` | Output given message under-prompt after successfully loading a plugin/snippet. In case of problems with the loading, output a warning message and the return code. If starts with `!` it will then always output the given message. Hint: if the message is empty, then it will just notify about problems. | +| `silent` | Mute plugin's or snippet's `stderr` & `stdout`. Also skip `Loaded ...` message under prompt for `wait`, etc. loaded plugins, and completion-installation messages. | ### Completions -| Modifier | Description | | :-------------- | -\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `blockf` | Disallow plugin to modify `fpath`. Useful when a plugin wants to provide completions in traditional way. -Zinit can manage completions and plugin can be blocked from exposing them. | | `completions` | Do detect, install and -manage completions for this plugin. Overwrites `as'null'` or `nocompletions`. | | `nocompletions` | Don't detect, -install and manage completions for this plugin. Completions can be installed later with -`zinit creinstall {plugin-spec}`. | +| Modifier | Description | +| :-------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `blockf` | Disallow plugin to modify `fpath`. Useful when a plugin wants to provide completions in traditional way. Zinit can manage completions and plugin can be blocked from exposing them. | +| `completions` | Do detect, install and manage completions for this plugin. Overwrites `as'null'` or `nocompletions`. | +| `nocompletions` | Don't detect, install and manage completions for this plugin. Completions can be installed later with `zinit creinstall {plugin-spec}`. | ### Command Execution After Cloning, Updating or Loading -| Modifier | Description | | :----------- | -\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `atclone` | Run command after cloning, within plugin's directory, e.g. `zinit ice atclone"echo Cloned"`. Ran also -after downloading snippet. | | `atinit` | Run command after directory setup (cloning, checking it, etc.) of -plugin/snippet but before loading. | | `atload` | Run command after loading, within plugin's directory. Can be also used -with snippets. Passed code can be preceded with `!`, it will then be investigated (if using `load`, not `light`). | | -`atpull` | Run command after updating (**only if new commits are waiting for download**), within plugin's directory. If -starts with "!" then command will be ran before `mv` & `cp` ices and before `git pull` or `svn update`. Otherwise it is -ran after them. Can be `atpull'%atclone'`, to repeat `atclone` Ice-mod. | | `configure` | Runs `./configure` script and -by default changes the installation directory by passing `--prefix=$ZPFX` to the script. Runs before `make''` and after -`make'!'`, you can pass `'!'` too to this ice (i.e.: `configure'!'`) to make it execute earlier – before `make'!'` and -after `make'!!'`. If `#` given in the ice value then also executes script `./autogen.sh` first before running -`./configure`. The script is run anyway if there is no `configure` script. Also, when there exist another build-system -related files, then it is run if no `configure` script is found. Currently supported systems are: CMake, scons and -meson, checked-for/run in this order | | `countdown` | Causes an interruptable (by Ctrl-C) countdown 5…4…3…2…1…0 to be -displayed before executing `atclone''`,`atpull''` and `make` ices | | `cp` | Copy file after cloning or after update -(then, only if new commits were downloaded). Example: `cp "docker-c* -> dcompose"`. Ran after `mv`. | | `make` | Run -`make` command after cloning/updating and executing `mv`, `cp`, `atpull`, `atclone` Ice mods. Can obtain argument, e.g. -`make"install PREFIX=/opt"`. If the value starts with `!` then `make` is ran before `atclone`/`atpull`, e.g. `make'!'`. -| | `mv` | Move file after cloning or after update (then, only if new commits were downloaded). Example: -`mv "fzf-* -> fzf"`. It uses `->` as separator for old and new file names. Works also with snippets. | | `nocd` | Don't -switch the current directory into the plugin's directory when evaluating the above ice-mods `atinit''`,`atload''`, etc. -| | `reset` | Invokes `git reset --hard HEAD` for plugins or `svn revert` for SVN snippets before pulling any new -changes. This way `git` or `svn` will not report conflicts if some changes were done in e.g.: `atclone''` ice. For file -snippets and `gh-r` plugins it invokes `rm -rf *`. | | `run-atpull` | Always run the atpull hook (when updating), not -only when there are new commits to be downloaded. | +| Modifier | Description | +| :----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `atclone` | Run command after cloning, within plugin's directory, e.g. `zinit ice atclone"echo Cloned"`. Ran also after downloading snippet. | +| `atinit` | Run command after directory setup (cloning, checking it, etc.) of plugin/snippet but before loading. | +| `atload` | Run command after loading, within plugin's directory. Can be also used with snippets. Passed code can be preceded with `!`, it will then be investigated (if using `load`, not `light`). | +| `atpull` | Run command after updating (**only if new commits are waiting for download**), within plugin's directory. If starts with "!" then command will be ran before `mv` & `cp` ices and before `git pull` or `svn update`. Otherwise it is ran after them. Can be `atpull'%atclone'`, to repeat `atclone` Ice-mod. | +| `configure` | Runs `./configure` script and by default changes the installation directory by passing `--prefix=$ZPFX` to the script. Runs before `make''` and after `make'!'`, you can pass `'!'` too to this ice (i.e.: `configure'!'`) to make it execute earlier – before `make'!'` and after `make'!!'`. If `#` given in the ice value then also executes script `./autogen.sh` first before running `./configure`. The script is run anyway if there is no `configure` script. Also, when there exist another build-system related files, then it is run if no `configure` script is found. Currently supported systems are: CMake, scons and meson, checked-for/run in this order | +| `countdown` | Causes an interruptable (by Ctrl-C) countdown 5…4…3…2…1…0 to be displayed before executing `atclone''`,`atpull''` and `make` ices | +| `cp` | Copy file after cloning or after update (then, only if new commits were downloaded). Example: `cp "docker-c* -> dcompose"`. Ran after `mv`. | +| `make` | Run `make` command after cloning/updating and executing `mv`, `cp`, `atpull`, `atclone` Ice mods. Can obtain argument, e.g. `make"install PREFIX=/opt"`. If the value starts with `!` then `make` is ran before `atclone`/`atpull`, e.g. `make'!'`. | +| `mv` | Move file after cloning or after update (then, only if new commits were downloaded). Example: `mv "fzf-* -> fzf"`. It uses `->` as separator for old and new file names. Works also with snippets. | +| `nocd` | Don't switch the current directory into the plugin's directory when evaluating the above ice-mods `atinit''`,`atload''`, etc. | +| `reset` | Invokes `git reset --hard HEAD` for plugins or `svn revert` for SVN snippets before pulling any new changes. This way `git` or `svn` will not report conflicts if some changes were done in e.g.: `atclone''` ice. For file snippets and `gh-r` plugins it invokes `rm -rf *`. | +| `run-atpull` | Always run the atpull hook (when updating), not only when there are new commits to be downloaded. | ### Sticky-Emulation Of Other Shells -| Modifier | Description | | :------------- | -\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -| | `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared -within the file will get a _sticky_ emulation assigned – when invoked they'll execute also with the `sh` emulation -set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. | -| `csh`/`!csh` | The same as `sh`, but emulating `csh` shell. | | `ksh`/`!ksh` | The same as `sh`, but emulating `ksh` -shell. | | `bash`/`!bash` | The same as `sh`, but with the `SH_GLOB` option disabled, so that Bash regular expressions -work. | +| Modifier | Description | +| :------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `sh`/`!sh` | Source the plugin's (or snippet's) script with `sh` emulation so that also all functions declared within the file will get a _sticky_ emulation assigned – when invoked they'll execute also with the `sh` emulation set-up. The `!sh` version switches additional options that are rather not important from the portability perspective. | +| `csh`/`!csh` | The same as `sh`, but emulating `csh` shell. | +| `ksh`/`!ksh` | The same as `sh`, but emulating `ksh` shell. | +| `bash`/`!bash` | The same as `sh`, but with the `SH_GLOB` option disabled, so that Bash regular expressions work. | ### Others -| Modifier | Description | | :------------- | -\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `as` | Can be `as"program"` (also the alias: `as"command"`), and will cause to add script/program to `$PATH` instead -of sourcing (see `pick`). Can also be `as"completion"` – use with plugins or snippets in whose only underscore-starting -`_*` files you are interested in. The third possible value is `as"null"` – a shorthand for -`pick"/dev/null" nocompletions` – i.e.: it disables the default script-file sourcing and also the installation of -completions. | | `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses -relative links if realpath >= 8.23 is found. **_Does not apply to URL-based snippets. Does not work with plugins._** | | -`id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. | | `subst` | Substitute -the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. | -| `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in -their scripts. | | `autoload` | Autoload the given functions (from their files). Equvalent to calling -`atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: -`zinit autoload'fun → my-fun; fun2 → my-fun2'`. | | `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, -e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. -The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with -snippets.** | | `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to -compile, e.g. `compile"(pure\\|async).zsh"` for `sindresorhus/pure`. | | `extract` | Performs archive extraction -supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it -works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper -than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper -in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being -read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for -further information. | | `service` | Make following plugin or snippet a _service_, which will be ran in background, and -only in single Zshell instance. See -[the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). | | `light-mode` | -Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the -for-syntax, where there is no `load` nor `light` subcommand | | `nocompile` | Don't try to compile `pick`-pointed files. -If passed the exclamation mark (i.e. `nocompile'!'`), then do compile, but after `make''` and `atclone''` (useful if -Makefile installs some scripts, to point `pick''` at the location of their installation). | | `trackbinds` | Shadow but -only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow -`bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the -`light`-subcommand. **Does not work with snippets.** | | `wrap-track` | Takes a `;`-separated list of function names -that are to be investigated (meaning gathering report and unload data) **once** during execution. It works by wrapping -the functions with a investigating-enabling and disabling snippet of code. In summary, `wrap-track` allows to extend the -investigating beyond the moment of loading of a plugin. Example use is to `wrap-track` a precmd function of a prompt -(like `_p9k_precmd()` of powerlevel10k) or other plugin that _postpones its initialization till the first prompt_ (like -e.g.: zsh-autosuggestions). **Does not work with snippets.** | | `reset-prompt` | Reset the prompt after loading the -plugin/snippet (by issuing `zle .reset-prompt`). Note: normally it's sufficient to precede the value of `wait''` ice -with `!`. | +| Modifier | Description | +| :------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `as` | Can be `as"program"` (also the alias: `as"command"`), and will cause to add script/program to `$PATH` instead of sourcing (see `pick`). Can also be `as"completion"` – use with plugins or snippets in whose only underscore-starting `_*` files you are interested in. The third possible value is `as"null"` – a shorthand for `pick"/dev/null" nocompletions` – i.e.: it disables the default script-file sourcing and also the installation of completions. | +| `link` | Use a symlink to cache a local snippet instead of copying into the snippets directory. Uses relative links if realpath >= 8.23 is found. **_Does not apply to URL-based snippets. Does not work with plugins._** | +| `id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. | +| `subst` | Substitute the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. | +| `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in their scripts. | +| `autoload` | Autoload the given functions (from their files). Equvalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. | +| `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with snippets.** | +| `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. `compile'*.zsh'`. | +| `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. | +| `service` | Make following plugin or snippet a _service_, which will be ran in background, and only in single Zshell instance. See [the zservice-\* repositories](https://github.com/orgs/zdharma-continuum/repositories?q=zservice-). | +| `light-mode` | Load the plugin without the investigating, i.e.: as if it would be loaded with the `light` command. Useful for the for-syntax, where there is no `load` nor `light` subcommand | +| `nocompile` | Don't try to compile `pick`-pointed files. If passed the exclamation mark (i.e. `nocompile'!'`), then do compile, but after `make''` and `atclone''` (useful if Makefile installs some scripts, to point `pick''` at the location of their installation). | +| `trackbinds` | Shadow but only `bindkey` calls even with `zinit light ...`, i.e. even with investigating disabled (fast loading), to allow `bindmap` to remap the key-binds. The same effect has `zinit light -b ...`, i.e. additional `-b` option to the `light`-subcommand. **Does not work with snippets.** | +| `wrap-track` | Takes a `;`-separated list of function names that are to be investigated (meaning gathering report and unload data) **once** during execution. It works by wrapping the functions with a investigating-enabling and disabling snippet of code. In summary, `wrap-track` allows to extend the investigating beyond the moment of loading of a plugin. Example use is to `wrap-track` a precmd function of a prompt (like `_p9k_precmd()` of powerlevel10k) or other plugin that _postpones its initialization till the first prompt_ (like e.g.: zsh-autosuggestions). **Does not work with snippets.** | +| `reset-prompt` | Reset the prompt after loading the plugin/snippet (by issuing `zle .reset-prompt`). Note: normally it's sufficient to precede the value of `wait''` ice with `!`. | ### Order of Execution @@ -855,52 +797,59 @@ ## Zinit Commands ### Help -| Command | Description | | :-------- | --------------------- | | `help` | Usage information. | | `man` | Manual. | | -`version` | Display Zinit version | +| Command | Description | +| :-------- | --------------------- | +| `help` | Usage information. | +| `man` | Manual. | +| `version` | Display Zinit version | ### Loading and Unloading -| Command | Description | | :----------------------- | -\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `load {plg-spec}` | Load plugin, can also receive absolute local path. | | `snippet [-f] {url}` | Source local or -remote file (by direct URL). `-f` – don't use cache (force redownload). The URL can use the following shorthands: -`PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh My Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` -(OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc. | | `light [-b] {plg-spec}` | Light plugin load, without -reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to -induce the no-investigating (i.e.: _light_) loading, regardless of the command used. | | `unload [-q] {plg-spec}` | -Unload plugin loaded with `zinit load ...`. `-q` – quiet. | +| Command | Description | +| :----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `load {plg-spec}` | Load plugin, can also receive absolute local path. | +| `snippet [-f] {url}` | Source local or remote file (by direct URL). `-f` – don't use cache (force redownload). The URL can use the following shorthands: `PZT::` (Prezto), `PZTM::` (Prezto module), `OMZ::` (Oh My Zsh), `OMZP::` (OMZ plugin), `OMZL::` (OMZ library), `OMZT::` (OMZ theme), e.g.: `PZTM::environment`, `OMZP::git`, etc. | +| `light [-b] {plg-spec}` | Light plugin load, without reporting/investigating. `-b` – investigate `bindkey`-calls only. There's also `light-mode` ice which can be used to induce the no-investigating (i.e.: _light_) loading, regardless of the command used. | +| `unload [-q] {plg-spec}` | Unload plugin loaded with `zinit load ...`. `-q` – quiet. | ### Completions -| Command | Description | | --------------------------------- | -\--------------------------------------------------------------------------------------------------------------------------------------------------- -| | `cclear` | Clear stray and improper completions. | | `cdclear [-q]` | Clear compdef replay list. `-q` – quiet. | | -`cdisable {cname}` | Disable completion `cname`. | | `cdlist` | Show compdef replay list. | | `cdreplay [-q]` | Replay -compdefs (to be done after compinit). `-q` – quiet. | | `cenable {cname}` | Enable completion `cname`. | | -`completions \[*columns*\]` | List completions in use, with columns completions per line. `zpl clist 5` -will for example print 5 completions per line. Default is 3. | | `compinit` | Refresh installed completions. | | -`creinstall [-q] [-Q] {plg-spec}` | Install completions for plugin, can also receive absolute local path. `-q` – quiet. -`-Q` - quiet all. | | `csearch` | Search for available completions from any plugin. | | `cuninstall {plg-spec}` | -Uninstall completions for plugin. | +| Command | Description | +| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cclear` | Clear stray and improper completions. | +| `cdclear [-q]` | Clear compdef replay list. `-q` – quiet. | +| `cdisable {cname}` | Disable completion `cname`. | +| `cdlist` | Show compdef replay list. | +| `cdreplay [-q]` | Replay compdefs (to be done after compinit). `-q` – quiet. | +| `cenable {cname}` | Enable completion `cname`. | +| `completions \[*columns*\]` | List completions in use, with columns completions per line. `zpl clist 5` will for example print 5 completions per line. Default is 3. | +| `compinit` | Refresh installed completions. | +| `creinstall [-q] [-Q] {plg-spec}` | Install completions for plugin, can also receive absolute local path. `-q` – quiet. `-Q` - quiet all. | +| `csearch` | Search for available completions from any plugin. | +| `cuninstall {plg-spec}` | Uninstall completions for plugin. | ### Tracking of the Active Session -| Command | Description | | ---------------- | ------------------------------------------------- | | `dclear` | Clear -report of what was going on in session. | | `dstop` | Stop investigating what's going on in session. | | `dreport` | -Report what was going on in session. | | `dunload` | Revert changes recorded between dstart and dstop. | | -`dtrace, dstart` | Start investigating what's going on in session. | +| Command | Description | +| ---------------- | ------------------------------------------------- | +| `dclear` | Clear report of what was going on in session. | +| `dstop` | Stop investigating what's going on in session. | +| `dreport` | Report what was going on in session. | +| `dunload` | Revert changes recorded between dstart and dstop. | +| `dtrace, dstart` | Start investigating what's going on in session. | ### Reports and Statistics -| Command | Description | | ------------------------ | -\-------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `bindkeys` | Lists bindkeys set up by each plugin. | | `list-plugins [keyword]` | Show what plugins are loaded -(filter with 'keyword'). | | `list-snippets` | List snippets in formatted and colorized manner. Requires `tree` program. -| | `recently [time-spec]` | Show plugins that changed recently, argument is e.g. 1 month 2 days. | | -`report {plg-spec}` | Show plugin report. `--all` – do it for all plugins. | | `status {plg-spec}` | Git status for -plugin or svn status for snippet. `--all` – do it for all plugins and snippets. | | `zstatus` | Display brief statistics -for your Zinit installation. | | `times [-a] [-m] [-s]` | Print load times for each plugin. `-s` – Times are printed in -seconds. `-m` – Show plugin loading moments. `-a` - Times and loading moments are printed. | +| Command | Description | +| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bindkeys` | Lists bindkeys set up by each plugin. | +| `list-plugins [keyword]` | Show what plugins are loaded (filter with 'keyword'). | +| `list-snippets` | List snippets in formatted and colorized manner. Requires `tree` program. | +| `recently [time-spec]` | Show plugins that changed recently, argument is e.g. 1 month 2 days. | +| `report {plg-spec}` | Show plugin report. `--all` – do it for all plugins. | +| `status {plg-spec}` | Git status for plugin or svn status for snippet. `--all` – do it for all plugins and snippets. | +| `zstatus` | Display brief statistics for your Zinit installation. | +| `times [-a] [-m] [-s]` | Print load times for each plugin. `-s` – Times are printed in seconds. `-m` – Show plugin loading moments. `-a` - Times and loading moments are printed. | ### Compiling @@ -912,8 +861,11 @@ #### compile zinit [options] compile PLUGIN ``` -| Option | Description | | ------------- | ------------------------- | | `-a, --all` | Compile all plugins | | -`-h, --help` | Print usage | | `-q, --quiet` | Suppress the build output | +| Option | Description | +| ------------- | ------------------------- | +| `-a, --all` | Compile all plugins | +| `-h, --help` | Print usage | +| `-q, --quiet` | Suppress the build output | #### compiled @@ -931,32 +883,32 @@ #### uncompile zinit [options] uncompile PLUGIN ``` -| Option | Description | | ------------- | ----------------------------------------- | | `-a, --all` | Remove any -compiled files for all plugins | | `-h, --help` | Print usage | | `-q, --quiet` | Suppress the output | +| Option | Description | +| ------------- | ----------------------------------------- | +| `-a, --all` | Remove any compiled files for all plugins | +| `-h, --help` | Print usage | +| `-q, --quiet` | Suppress the output | ### Other -| Command | Description | | ---------------------------------------------------------------- | -\------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | `module` | Manage binary Zsh module shipped with Zinit, see `zinit module help`. | | `self-update` | Updates and -compiles Zinit. | | `cd {plg-spec}` | Cd into plugin's directory. Also support snippets if fed with URL. | | -`edit {plg-spec}` | Edit plugin's file with $EDITOR. | | `changes {plg-spec}` | View plugin's git log. | | -`create {plg-spec}` | Create plugin (also together with GitHub repository). | | `glance {plg-spec}` | Look at plugin's -source (pygmentize, {,source-}highlight). | | `stress {plg-spec}` | Test plugin for compatibility with set of options. | -| `recall {plg-spec}\|URL` | Fetch saved ice modifiers and construct `zinit ice ...` command. | | -`srv {service-id} [cmd]` | Control a service, command can be: stop,start,restart,next,quit; `next` moves the service to -another Zshell. | | `ice ` | Add ice to next command, argument is e.g. from"gitlab". | | -`env-whitelist [-v] [-h] {env..}` | Allows to specify names (also patterns) of variables left unchanged during an -unload. `-v` – verbose. | | `run` `[-l]` `[plugin]` `{command}` | Runs the given command in the given plugin's -directory. If the option `-l` will be given then the plugin should be skipped – the option will cause the previous -plugin to be reused. | | `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget -wrongly passed ice-mods).
`--all` – purge.
`--clean` – delete plugins and snippets that are not loaded. | | -`update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.
`--all` – update all plugins and -snippets.
`-q` – quiet.
`-r` | `--reset` – run `git reset --hard` / `svn revert` before pulling changes. | | -`add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to -`$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, -the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's -possible to also add regular directories. | +| Command | Description | +| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `module` | Manage binary Zsh module shipped with Zinit, see `zinit module help`. | +| `self-update` | Updates and compiles Zinit. | +| `cd {plg-spec}` | Cd into plugin's directory. Also support snippets if fed with URL. | +| `edit {plg-spec}` | Edit plugin's file with $EDITOR. | +| `changes {plg-spec}` | View plugin's git log. | +| `create {plg-spec}` | Create plugin (also together with GitHub repository). | +| `glance {plg-spec}` | Look at plugin's source (pygmentize, {,source-}highlight). | +| `stress {plg-spec}` | Test plugin for compatibility with set of options. | +| `recall {plg-spec}\|URL` | Fetch saved ice modifiers and construct `zinit ice ...` command. | +| `srv {service-id} [cmd]` | Control a service, command can be: stop,start,restart,next,quit; `next` moves the service to another Zshell. | +| `ice ` | Add ice to next command, argument is e.g. from"gitlab". | +| `env-whitelist [-v] [-h] {env..}` | Allows to specify names (also patterns) of variables left unchanged during an unload. `-v` – verbose. | +| `run` `[-l]` `[plugin]` `{command}` | Runs the given command in the given plugin's directory. If the option `-l` will be given then the plugin should be skipped – the option will cause the previous plugin to be reused. | +| `delete {plg-spec}\|URL\|--clean\|--all` | Remove plugin or snippet from disk (good to forget wrongly passed ice-mods).
`--all` – purge.
`--clean` – delete plugins and snippets that are not loaded. | +| `update [-q] [-r] {plg-spec}\|URL\|--all` | Git update plugin or snippet.
`--all` – update all plugins and snippets.
`-q` – quiet.
`-r` \| `--reset` – run `git reset --hard` / `svn revert` before pulling changes. | +| `add-fpath\|fpath` `[-f\|--front]` `{plg-spec}` `[subdirectory]` | Adds given plugin (not yet snippet) directory to `$fpath`. If the second argument is given, it is appended to the directory path. If the option `-f`/`--front` is given, the directory path is prepended instead of appended to `$fpath`. The `{plg-spec}` can be absolute path, i.e.: it's possible to also add regular directories. | ## Updating Zinit and Plugins @@ -966,7 +918,7 @@ ## Updating Zinit and Plugins issue `zinit update NAME_OF_PLUGIN`. A list of commits will be shown:

- +screenshot displaying zinit update tj/git-extras and its output

Some plugins require performing an action each time they're updated. One way you can do this is by using the `atpull` @@ -1117,10 +1069,10 @@ ### Using ZPFX variable Typical use cases when working with `$ZPFX` are, e.g.: ```zsh -$ ls $ZPFX -$ cd $ZPFX -$ cd $ZPFX/bin # note: $ZPFX/bin is automatically prepended to $PATH -$ cd $ZPFX/share +ls $ZPFX +cd $ZPFX +cd $ZPFX/bin # note: $ZPFX/bin is automatically prepended to $PATH +cd $ZPFX/share ``` Before the `configure''` ice appeared one would use `$ZPFX` as follows: @@ -1141,7 +1093,7 @@ # (supported are: configure, cmake, scons and meson) To set ZPFX, one should do (in `.zshrc` before loading `zinit`): ```zsh -$ export ZPFX=$HOME/my-software # or: ZPFX=$HOME/.local, etc. +export ZPFX=$HOME/my-software # or: ZPFX=$HOME/.local, etc. ``` We encourage people to install compiled software with use of `$ZPFX` and `configure''` and `make''` ices, to have a @@ -1157,23 +1109,20 @@ ### Customizing Paths declare -A ZINIT # initial Zinit's hash definition, if configuring before loading Zinit, and then: ``` -| Hash Field | Description | | ----------------------------------- | -\-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| | ZINIT[BIN_DIR] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | | ZINIT[HOME_DIR] | Where Zinit -should create all working directories, e.g.: "~/.local/share/zinit" | | ZINIT[MAN_DIR] | Directory where plugins can -store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not -necessarily be used by `man` (See #8). Default: `$ZPFX/man` | | ZINIT[PLUGINS_DIR] | Override single working directory – -for plugins, e.g. "/opt/zsh/zinit/plugins" | | ZINIT[COMPLETIONS_DIR] | As above, but for completion files, e.g. -"/opt/zsh/zinit/root_completions" | | ZINIT[SNIPPETS_DIR] | As above, but for snippets | | ZINIT[LIST_COMMAND] | Command -to use for displaying a directory tree (e.g., `ls --tree`, `tree`, etc.) | | ZINIT[ZCOMPDUMP_PATH] | Path to -`.zcompdump` file, with the file included (i.e. its name can be different) | | ZINIT[COMPINIT_OPTS] | Options for -`compinit` call (i.e. done by `zicompinit`), use to pass -C to speed up loading | | ZINIT[MUTE_WARNINGS] | If set to -`1`, then mutes some of the Zinit warnings, specifically the `plugin already registered` warning | | -ZINIT[OPTIMIZE_OUT_DISK_ACCESSES] | If set to `1`, then Zinit will skip checking if a Turbo-loaded object exists on the -disk. By default Zinit skips Turbo for non-existing objects (plugins or snippets) to install them before the first -prompt – without any delays, during the normal processing of `zshrc`. This option can give a performance gain of about -10 ms out of 150 ms (i.e.: Zsh will start up in 140 ms instead of 150 ms). | | ZINIT[NO_ALIASES] | If set to `1`, then -Zinit will not set aliases such as `zi` or `zini` | +| Hash Field | Description | +| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ZINIT\[BIN_DIR\] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | +| ZINIT\[HOME_DIR\] | Where Zinit should create all working directories, e.g.: "~/.local/share/zinit" | +| ZINIT\[MAN_DIR\] | Directory where plugins can store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not necessarily be used by `man` (See #8). Default: `$ZPFX/man` | +| ZINIT\[PLUGINS_DIR\] | Override single working directory – for plugins, e.g. "/opt/zsh/zinit/plugins" | +| ZINIT\[COMPLETIONS_DIR\] | As above, but for completion files, e.g. "/opt/zsh/zinit/root_completions" | +| ZINIT\[SNIPPETS_DIR\] | As above, but for snippets | +| ZINIT\[LIST_COMMAND\] | Command to use for displaying a directory tree (e.g., `ls --tree`, `tree`, etc.) | +| ZINIT\[ZCOMPDUMP_PATH\] | Path to `.zcompdump` file, with the file included (i.e. its name can be different) | +| ZINIT\[COMPINIT_OPTS\] | Options for `compinit` call (i.e. done by `zicompinit`), use to pass -C to speed up loading | +| ZINIT\[MUTE_WARNINGS\] | If set to `1`, then mutes some of the Zinit warnings, specifically the `plugin already registered` warning | +| ZINIT\[OPTIMIZE_OUT_DISK_ACCESSES\] | If set to `1`, then Zinit will skip checking if a Turbo-loaded object exists on the disk. By default Zinit skips Turbo for non-existing objects (plugins or snippets) to install them before the first prompt – without any delays, during the normal processing of `zshrc`. This option can give a performance gain of about 10 ms out of 150 ms (i.e.: Zsh will start up in 140 ms instead of 150 ms). | +| ZINIT\[NO_ALIASES\] | If set to `1`, then Zinit will not set aliases such as `zi` or `zini` | There is also `$ZPFX`, set by default to `~/.local/share/zinit/polaris` – a directory where software with `Makefile`, etc. can be pointed to, by e.g. `atclone'./configure --prefix=$ZPFX'`. @@ -1223,7 +1172,7 @@ ## Support Zinit is a personal, free-time project with no funding and a huge [feature request backlog](https://github.com/zdharma-continuum/zinit/issues). If you love it, consider supporting its -development via GitHub Sponsors [pending]. Any help counts! +development via GitHub Sponsors \[pending\]. Any help counts! ## Getting Help and Community diff --git a/doc/HACKING.md b/doc/HACKING.md index 8413a87c..a05446c9 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -1,22 +1,24 @@ -# Documentation +# HACKING.md -## README: Update the table of content +## Documentation + +### README: Update the table of content 1. Install [doctoc](https://github.com/thlorenz/doctoc) 2. To update the TOC run the following command: -```zsh -doctoc --github README.md -``` + ```zsh + doctoc --github README.md + ``` -## Update asciidoc and/or zshelldoc +### Update asciidoc and/or zshelldoc 1. Make sure you have [docker](https://www.docker.com/) or [podman](https://podman.io/) installed. 2. From the root of the repo, run: -```zsh -make doc-container -``` + ```zsh + make doc-container + ``` If for some reason you want to build the zshelldocs or the PDF manually, you'll need: @@ -25,23 +27,23 @@ ## Update asciidoc and/or zshelldoc 3. [asciidoc](https://asciidoc.org/) 4. `make doc` -## Generate the manpage (doc/zinit.1) +### Generate the manpage (doc/zinit.1) 1. Install [pandoc](https://pandoc.org/) 2. From the root of the repo run: -```zsh -pandoc --standalone --to man README.md -o doc/zinit.1 -``` + ```zsh + pandoc --standalone --to man README.md -o doc/zinit.1 + ``` -## Updating the gh-pages (zdharma-continuum.github.io) +### Updating the gh-pages (zdharma-continuum.github.io) 1. Check out the [documentation branch](https://github.com/zdharma-continuum/zinit/tree/documentation) -```shell -git fetch origin documentation -git checkout documentation -``` + ```shell + git fetch origin documentation + git checkout documentation + ``` 2. Do your modifications and push your changes 3. Keep an eye on [the CI logs](https://github.com/zdharma-continuum/zinit/actions/workflows/gh-pages.yaml) @@ -50,77 +52,77 @@ ## Updating the gh-pages (zdharma-continuum.github.io) **NOTE:** If you really **need** to push directly, without CI please refer to \[the README in the documentation\]https://github.com/zdharma-continuum/zinit/blob/documentation/README.md -# Testing +## Testing -We run out tests with [zunit](https://zunit.xyz). +We run our tests with [zunit](https://zunit.xyz). To add a new test case: 1. Install [zunit](https://zunit.xyz) and [revolver](https://github.com/molovo/revolver): -```zsh -zinit for \ - as"program" \ - atclone"ln -sfv revolver.zsh-completion _revolver" \ - atpull"%atclone" \ - pick"revolver" \ - @molovo/revolver \ - as"completion" \ - atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \ - atpull"%atclone" \ - sbin"zunit" \ - @zunit-zsh/zunit -``` + ```zsh + zinit for \ + as"program" \ + atclone"ln -sfv revolver.zsh-completion _revolver" \ + atpull"%atclone" \ + pick"revolver" \ + @molovo/revolver \ + as"completion" \ + atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \ + atpull"%atclone" \ + sbin"zunit" \ + @zunit-zsh/zunit + ``` 2. Create a new `.zunit` file in the `tests/` dir. Here's a template: -```zsh -#!/usr/bin/env zunit + ```zsh + #!/usr/bin/env zunit -@setup { - load setup - setup -} + @setup { + load setup + setup + } -@teardown { - load teardown - teardown -} + @teardown { + load teardown + teardown + } -@test 'zinit-annex-bin-gem-node installation' { - # This spawns the official zinit container, and executesa single zinit command - # inside it - run ./scripts/docker-run.sh --wrap --debug --zunit \ - zinit light as"null" for zdharma-continuum/null + @test 'zinit-annex-bin-gem-node installation' { + # This spawns the official zinit container, and executes a single zinit command + # inside it + run ./scripts/docker-run.sh --wrap --debug --zunit \ + zinit light as"null" for zdharma-continuum/null - # Verify exit code of the command above - assert $state equals 0 - assert "$output" contains "Downloading" + # Verify exit code of the command above + assert $state equals 0 + assert "$output" contains "Downloading" - local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md" - # Check if we downloaded the file correctly and if it is readable - assert "$artifact" is_file - assert "$artifact" is_readable -} -``` + local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md" + # Check if we downloaded the file correctly and if it is readable + assert "$artifact" is_file + assert "$artifact" is_readable + } + ``` -You should of course also check out the existing tests ;) + You should of course also check out the existing tests ;) 3. To run your new test: -```zsh -zunit --verbose tests/your_test.zunit -``` + ```zsh + zunit --verbose tests/your_test.zunit + ``` -## Debugging tests +### Debugging tests If you ever need to inspect the `ZINIT[HOME_DIR]` dir, where zinit's internal data is stored you can do so by commenting out the `@teardown` section in your test. Then you can re-run said test and head over to `${TMPDIR:-/tmp}/zunit-zinit`. Good luck! -# Misc +## Misc -## Get the list of supported ices +### Get the list of supported ices To get the list in a quick-and-dirty fashion you issue: From 773852f5888bb534452495edae41dc7516383b4a Mon Sep 17 00:00:00 2001 From: NICHOLAS85 <15698885+NICHOLAS85@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:45:31 -0800 Subject: [PATCH 18/56] =?UTF-8?q?fix:=20global=20variable=20in=20=E2=88=9E?= =?UTF-8?q?zinit-file-cp-mv-operation=20(#699)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zinit-install.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index a4a9b70a..2ea0124e 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -2268,7 +2268,7 @@ __zinit-cmake-base-hook () { pairs=( ${(s[;])ICE[$ice_key]} ) # Split on semicolons pairs=( "${pairs[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" ) # Trim spaces - local retval=0 + local pair retval=0 for pair in "${pairs[@]}"; do if [[ $pair == *("->"|"→")* ]]; then local from="${pair%%[[:space:]]#(->|→)*}" From 3186c6834608ea02b8266583543cba17771134b7 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Wed, 19 Feb 2025 00:03:06 +0800 Subject: [PATCH 19/56] fix completions in zinit update (#701) --- _zinit | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/_zinit b/_zinit index 197bf19e..7fe790fc 100644 --- a/_zinit +++ b/_zinit @@ -98,7 +98,7 @@ __zinit_installed_plugins(){ __zinit_installed_snippets(){ # [[ -prefix '-' ]] && return 0 typeset -a snippets - local expl snippet + local expl snippets=( "${ZINIT[SNIPPETS_DIR]}"/**/._zinit(D/:h) ) snippets=( ${(Q)snippets[@]#${ZINIT[SNIPPETS_DIR]}/} ) # formulae=( ${(qq)formulae[@]/(#b)(http|https|ftp|ftps|scp)--/${match[1]}://} ) @@ -320,13 +320,15 @@ _zinit_unload(){ # FUNCTION: _zinit_update [[[ _zinit_update(){ _arguments \ - '--help[Show this help message]' \ - '--no-pager[Don'\''t automatically install dependencies]' \ - '--quiet[Turn off messages from the operation]' \ - '--reset[Reset repository or delete downloadremove single-file snippets and gh-r plugins)]' \ - '--urge[Cause all the hooks like: atpull'', cp'', etc. to execute even when there aren'\''t any new commits / any new version of the gh-r file / etc.… available for download↔ simulate a non-empty update]' \ + '(-h --help)'{-h,--help}'[Show this help message]' \ + '(-n --no-pager)'{-n,--no-pager}'[Disable the use of the pager]' \ + '(-q --quiet)'{-q,--quiet}'[Turn off almost-all messages from the update operation FOR the objects which don'\''t have any new version available]' \ + '(-r --reset)'{-r,--reset}'[Reset the repository before updating (or remove the files for single-file snippets and gh-r plugins)]' \ + '(-s --snippets)'{-s,--snippets}'[Update only snippets (i.e.: skip updating plugins)]' \ + '(-u --urge)'{-u,--urge}'[Cause all the hooks like: atpull'\'\'', cp'\'\'', etc. to execute even when there aren'\''t any new commits / any new version of the gh-r file / etc.… available for download↔ simulate a non-empty update]' \ + '(-v --verbose)'{-v,--verbose}'[Turn on more messages from the operation]' \ - set1 \ - '--parallel[Turn on concurrent, multi-thread update (of all objects)]' \ + '(-p --parallel)'{-p,--parallel}'[Turn on concurrent, multi-thread update (of all objects)]' \ '(-a --all)'{-a,--all}'[Update all plugins and snippets]' \ - set2 \ '1:installed:__zinit_installed' From 091ddfeee5e1ad821eff0fca86ac71b18f376cd5 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Tue, 18 Feb 2025 17:50:58 +0100 Subject: [PATCH 20/56] ci: disable navi gh-r test on mac os (#702) --- tests/gh-r.zunit | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index eb01dbbc..d012a781 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -582,6 +582,7 @@ run $moonwalk --version; assert $state equals 0 } @test 'navi' { # An interactive cheatsheet tool for the command-line + [[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type" run zinit lbin'!* -> navi' for @denisidoro/navi; assert $state equals 0 local navi="$ZBIN/navi"; assert "$navi" is_executable run $navi --version; assert $state equals 0 From 8a7257a8e51ca2f505c80d5b213d25cf2f1a57d0 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Tue, 18 Feb 2025 17:51:33 +0100 Subject: [PATCH 21/56] installer: Set min zsh version to 5.8 (#696) --- scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 32219ca3..88233c4a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -58,7 +58,7 @@ echo_error() { } check_dependencies() { - zsh_min_version=5.5 + zsh_min_version=5.8 if ! zsh -sfc \ 'autoload is-at-least; is-at-least $1 $ZSH_VERSION' "$zsh_min_version"; then From 5c0c0454deeb9eac95e08ef214b5d7ba6859db14 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Tue, 18 Feb 2025 17:57:53 +0100 Subject: [PATCH 22/56] ci: disable container builds for old versions of zsh (#704) --- .github/workflows/containers.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 6bc95049..5b79884a 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -15,12 +15,6 @@ jobs: fail-fast: false matrix: zsh_version: - - 5.2.4 - - 5.3.1 - - 5.4.2 - - 5.5.1 - - 5.6.2 - - 5.7.1 - 5.8 - 5.9 steps: From 25c18b5b2a1c5e9d453cfaca56834864f68ad4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Richter?= <2268851+x3rAx@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:47:14 +0200 Subject: [PATCH 23/56] docs: Add instructions for how to disable global compinit on NixOS (#717) --- README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c9efafb0..3d78d802 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,9 @@ # Zinit - [Calling `compinit` Without Turbo Mode](#calling-compinit-without-turbo-mode) - [Calling `compinit` With Turbo Mode](#calling-compinit-with-turbo-mode) - [Ignoring Compdefs](#ignoring-compdefs) - - [Disabling System-Wide `compinit` Call (Ubuntu)](#disabling-system-wide-compinit-call-ubuntu) + - [Disabling System-Wide `compinit` Call](#disabling-system-wide-compinit-call) + - [Ubuntu](#disabling-system-wide-compinit-call-ubuntu) + - [NixOS](#disabling-system-wide-compinit-call-nixos) - [Zinit Module](#zinit-module) - [Hints and Tips](#hints-and-tips) - [Using ZPFX variable](#using-zpfx-variable) @@ -1031,11 +1033,16 @@ ### Ignoring Compdefs The `cdreplay` is important if you use plugins like `OMZP::kubectl` or `asdf-vm/asdf`, because these plugins call `compdef`. -### Disabling System-Wide `compinit` Call (Ubuntu) +### Disabling System-Wide `compinit` Call -On Ubuntu users might get surprised that e.g. their completions work while they didn't call `compinit` in their -`.zshrc`. That's because the function is being called in `/etc/zshrc`. To disable this call – what is needed to avoid -the slowdown and if user loads any completion-equipped plugins, i.e. almost on 100% – add the following lines to +On some systems, users might be surprised to see that completions work even though they didn’t call `compinit` in their +`~/.zshrc`. This happens because `compinit` is being called from `/etc/zshrc`. To disable this behavior -- which is +recommended to avoid slow startup, especially if you load plugins that bring their own completions (which is almost +always the case) -- follow the instructions for your system below: + +#### Ubuntu + +On Ubuntu, the global `compinit` call can be disabled on a per-user basis by adding the following lines to a users `~/.zshenv`: ```zsh @@ -1043,6 +1050,19 @@ # Skip the not really helping Ubuntu global compinit skip_global_compinit=1 ``` +#### NixOS + +On NixOS, the global `compinit` call can be disabled system-wide by setting the following option in your +`/etc/nixos/configuration.nix`: + +``` +# Disable global completion init to speed up `compinit` call in `~/.zshrc`. +programs.zsh.enableGlobalCompInit = false; +``` + +Don't forget to add the `compinit` call to every user's `~/.zshrc`! Otherwise completions for system packages might not +work. + ## Zinit Module The module is now hosted [in its own repository](https://github.com/zdharma-continuum/zinit-module) From 6a51ac7125f031b7c1e9abfd3756d1590002d94e Mon Sep 17 00:00:00 2001 From: Kartik Yadav Date: Sat, 24 May 2025 10:22:57 +0530 Subject: [PATCH 24/56] Changes to create $ZSH_CACHE_DIR/completions directory (#708) --- zinit.zsh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zinit.zsh b/zinit.zsh index 4cb314d7..b2376389 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -149,6 +149,12 @@ typeset -g ZPFX ZINIT[PLUGINS_DIR]=${~ZINIT[PLUGINS_DIR]} ZINIT[COMPLETIONS_DIR]=${~ZINIT[COMPLETIONS_DIR]} ZINIT[SNIPPETS_DIR]=${~ZINIT[SNIPPETS_DIR]} ZINIT[SERVICES_DIR]=${~ZINIT[SERVICES_DIR]} + +# Make sure $ZSH_CACHE_DIR is writable, otherwise use a directory in $HOME +if [[ ! -w "$ZSH_CACHE_DIR" ]]; then + ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/zinit" +fi + export ZPFX=${~ZPFX} ZSH_CACHE_DIR="${ZSH_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/zinit}" \ PMSPEC=0uUpiPsf [[ -z ${path[(re)$ZPFX/bin]} ]] && [[ -d "$ZPFX/bin" ]] && path=( "$ZPFX/bin" "${path[@]}" ) @@ -165,6 +171,11 @@ hash -d zpfx=${ZINIT[HOME_DIR]}/polaris [[ ! -d $ZSH_CACHE_DIR ]] && command mkdir -p "$ZSH_CACHE_DIR" [[ -n ${ZINIT[ZCOMPDUMP_PATH]} ]] && ZINIT[ZCOMPDUMP_PATH]=${~ZINIT[ZCOMPDUMP_PATH]} +# Create "$ZSH_CACHE_DIR/completions" directory +[[ ! -d "$ZSH_CACHE_DIR/completions" ]] && command mkdir -p "$ZSH_CACHE_DIR/completions" +# Add "$ZSH_CACHE_DIR/completions" diretory to fpath +[[ -z ${fpath[(re)$ZSH_CACHE_DIR/completions]} ]] && fpath=( "$ZSH_CACHE_DIR/completions" "${fpath[@]}" ) + ZINIT[UPAR]=";:^[[A;:^[OA;:\\e[A;:\\eOA;:${termcap[ku]/$'\e'/^\[};:${terminfo[kcuu1]/$'\e'/^\[};:" ZINIT[DOWNAR]=";:^[[B;:^[OB;:\\e[B;:\\eOB;:${termcap[kd]/$'\e'/^\[};:${terminfo[kcud1]/$'\e'/^\[};:" ZINIT[RIGHTAR]=";:^[[C;:^[OC;:\\e[C;:\\eOC;:${termcap[kr]/$'\e'/^\[};:${terminfo[kcuf1]/$'\e'/^\[};:" From 9a3e5c97975accfdde54e4a5810150212a41b898 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 24 May 2025 04:55:31 +0000 Subject: [PATCH 25/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit.zsh.adoc b/doc/zsdoc/zinit.zsh.adoc index a4d63680..f4f08a59 100644 --- a/doc/zsdoc/zinit.zsh.adoc +++ b/doc/zsdoc/zinit.zsh.adoc @@ -84,7 +84,7 @@ PRECMD-HOOK @zinit-scheduler ==== Script Body -Has 258 line(s). Calls functions: +Has 264 line(s). Calls functions: Script-Body |-- +zi-log From 991e4a816efc426bb1c2c0b13a01acff298b8005 Mon Sep 17 00:00:00 2001 From: sienks <69677088+sienks@users.noreply.github.com> Date: Thu, 5 Jun 2025 19:53:41 +1000 Subject: [PATCH 26/56] fix: correct SSH URL format for private repos (#721) Co-authored-by: sienks --- zinit-install.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index 2ea0124e..94e51ca6 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -416,9 +416,15 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { case ${ICE[proto]} in (|ftp(|s)|git|http(|s)|rsync|ssh) :zinit-git-clone() { + local clone_url + if [[ ${ICE[proto]} == "ssh" ]]; then + clone_url="git@${site:-${ICE[from]:-github.com}}:$remote_url_path" + else + clone_url="${ICE[proto]:-https}://${site:-${ICE[from]:-github.com}}/$remote_url_path" + fi command git clone --progress ${(s: :)ICE[cloneopts]---recursive} \ ${(s: :)ICE[depth]:+--depth ${ICE[depth]}} \ - "${ICE[proto]:-https}://${site:-${ICE[from]:-github.com}}/$remote_url_path" \ + "$clone_url" \ "$local_path" \ --config transfer.fsckobjects=false \ --config receive.fsckobjects=false \ From 610551726b028816c7f68170c917a6f7418a1abd Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 5 Jun 2025 09:56:18 +0000 Subject: [PATCH 27/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-install.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc index a4791d77..d8a496fc 100644 --- a/doc/zsdoc/zinit-install.zsh.adoc +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -435,7 +435,7 @@ ____ ____ -Has 213 line(s). Calls functions: +Has 219 line(s). Calls functions: .zinit-setup-plugin-dir |-- .zinit-download-file-stdout From 2daaac2de245a640ca8a88330313e5f37113563e Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sat, 7 Jun 2025 15:22:07 +0200 Subject: [PATCH 28/56] Fix #719 (#722) --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 4 ++-- README.md | 8 ++++---- doc/zinit.1 | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index c6407aef..054cfb5a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -14,7 +14,7 @@ body: ## Self Check - Look for similar errors in existing [GitHub Issues](https://github.com/zdharma-continuum/zinit/issues?q=is%3Aissue) (open or closed). - - Try reaching out on the [Gitter server](https://gitter.im/zdharma-continuum/community/) for help. + - Try reaching out on the [Gitter server](https://matrix.to/#/#zdharma-continuum_community:gitter.im) for help. - type: textarea id: what-happened diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index db419f12..8b805668 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,6 +3,6 @@ contact_links: - name: Support url: https://github.com/zdharma-continuum/zinit/discussions about: Ask the community for support - - name: Get help on Gitter - url: https://gitter.im/zdharma-continuum/community/ + - name: Get help on Matrix + url: https://matrix.to/#/#zdharma-continuum_community:gitter.im about: Have a quick question? Join the Gitter community and ask your question. diff --git a/README.md b/README.md index 3d78d802..4156df18 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Zinit [![MIT License][mit-badge]][mit-link] [![zinit version][ver-badge]][ver-link] [![zunit tests][tests-badge]][tests-link] -[![Join the chat at https://gitter.im/zdharma-continuum/zinit][gitter-badge]][gitter-link] +[![Join the chat at https://matrix.to/#/#zdharma-continuum_community:gitter.im][gitter-badge]][gitter-link] @@ -1200,11 +1200,11 @@ ## Getting Help and Community - [Open a discussion](https://github.com/zdharma-continuum/zinit/discussions). -- Or via reach out via Gitter - [![Join the chat at https://gitter.im/zdharma-continuum/community][gitter-badge]][gitter-link] +- Or via reach out via Matrix + [![Join the chat at https://matrix.to/#/#zdharma-continuum_community:gitter.im][gitter-badge]][gitter-link] [gitter-badge]: https://badges.gitter.im/zdharma-continuum/zinit.svg -[gitter-link]: https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +[gitter-link]: https://matrix.to/#/#zdharma-continuum_community:gitter.im [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-link]: ./LICENSE [tests-badge]: https://github.com/zdharma-continuum/zinit/actions/workflows/tests.yaml/badge.svg diff --git a/doc/zinit.1 b/doc/zinit.1 index cf0147b2..a8f3d81b 100644 --- a/doc/zinit.1 +++ b/doc/zinit.1 @@ -7,7 +7,7 @@ [IMAGE: MIT License (https://img.shields.io/badge/license-MIT-blue.svg)] [IMAGE: image (https://img.shields.io/github/tag/zdharma-continuum/zinit.svg)] (https://github.com/zdharma-continuum/zinit/releases) [IMAGE: Join the chat at -https://gitter.im/zdharma-continuum/zinit (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +https://matrix.to/#/#zdharma-continuum_community:gitter.im (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) .RS .PP \f[B]Note\f[R]: The original author (https://github.com/psprint) of @@ -1750,5 +1750,5 @@ Do you need help or wish to get in touch with other Zinit users? Open a discussion (https://github.com/zdharma-continuum/zinit/discussions). .IP \[bu] 2 -Or via reach out via Gitter [IMAGE: Join the chat at -https://gitter.im/zdharma-continuum/community (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +Or via reach out via Matrix [IMAGE: Join the chat at +https://matrix.to/#/#zdharma-continuum_community:gitter.im (https://badges.gitter.im/zdharma-continuum/zinit.svg)] (https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) From f38e079f67c5a98d9ecf0e40f7971c7dc2c87003 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:02:19 +0200 Subject: [PATCH 29/56] build(deps): bump dawidd6/action-homebrew-bump-formula from 4 to 5 (#723) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 35cd4706..72d0ef58 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Bump Homebrew formulae - uses: dawidd6/action-homebrew-bump-formula@v4 + uses: dawidd6/action-homebrew-bump-formula@v5 with: formula: zinit # A Personal Access Token (PAT) is instead of the default From c84533b4ce0db4df04941a32b5f3ea6a665e3b56 Mon Sep 17 00:00:00 2001 From: Junior Nascimento Date: Wed, 23 Jul 2025 05:46:11 -0300 Subject: [PATCH 30/56] docs: Add async_prompt.zsh to OMZ theme migration guide (#727) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4156df18..fb77c857 100644 --- a/README.md +++ b/README.md @@ -338,6 +338,9 @@ ## Zinit Setting # Must Load OMZ Git library zi snippet OMZL::git.zsh +# Must Load OMZ Async prompt library +zi snippet OMZL::async_prompt.zsh  + # Load Git plugin from OMZ zi snippet OMZP::git zi cdclear -q # <- forget completions provided up to this moment From c1537885607afa782c25918fb6ee4fc42ffb6cf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:36:52 +0200 Subject: [PATCH 31/56] build(deps): bump actions/checkout from 4 to 5 (#730) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- .github/workflows/containers.yaml | 4 ++-- .github/workflows/documentation.yaml | 2 +- .github/workflows/linting.yaml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/tests.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 72d0ef58..5e33eddb 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Bump Homebrew formulae uses: dawidd6/action-homebrew-bump-formula@v5 diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 5b79884a..9596f1da 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -19,7 +19,7 @@ jobs: - 5.9 steps: - name: check out repository code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Grab git slugs (short commit id, branch etc.) uses: rlespinasse/github-slug-action@v3.x @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: get vcs details uses: rlespinasse/github-slug-action@v3.x diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 269147ee..93240151 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index fac9ee60..bbdbdf0e 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -14,7 +14,7 @@ jobs: name: Markdown Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: xt0rted/markdownlint-problem-matcher@v3 @@ -47,7 +47,7 @@ jobs: task: [zsh-noexec, zsh-zcompile] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42841c81..052060d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: name: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: actions/setup-node@v4 with: node-version: '20' diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e56b08a7..c92783f4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,7 +40,7 @@ jobs: steps: - name: checkout ${{ github.repository }} - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 From 2167408db27720031983d1067c156837cf522ff3 Mon Sep 17 00:00:00 2001 From: Nick Sherron Date: Tue, 12 Aug 2025 12:39:35 -0600 Subject: [PATCH 32/56] fix: prevent "permission denied" errors from empty hook handlers (#729) Co-authored-by: Philipp Schmitt --- tests/hook-handler.zunit | 64 ++++++++++++++++++++++++++++++++++++++++ zinit.zsh | 12 +++++--- 2 files changed, 72 insertions(+), 4 deletions(-) create mode 100755 tests/hook-handler.zunit diff --git a/tests/hook-handler.zunit b/tests/hook-handler.zunit new file mode 100755 index 00000000..23013bc4 --- /dev/null +++ b/tests/hook-handler.zunit @@ -0,0 +1,64 @@ +#!/usr/bin/env zunit + +# Tests for issue #728: Empty hook handlers cause "permission denied" errors +# https://github.com/zdharma-continuum/zinit/issues/728 + +@setup { + # Set up minimal zinit environment + HOME="$zi_test_dir" + typeset -gA ZINIT ZINIT_EXTS ZINIT_EXTS2 ICE + ZINIT[BIN_DIR]="${PWD}" + ZINIT[PLUGINS_DIR]="$zi_test_dir/plugins" + ZINIT[SNIPPETS_DIR]="$zi_test_dir/snippets" + ZINIT[HOME_DIR]="$zi_test_dir" + + # Source zinit + source "${PWD}/zinit.zsh" +} + +@test 'empty hook handler error is prevented by fix' { + # This test verifies the fix for issue #728 + # Without the fix, empty hook handlers cause "permission denied:" errors + + # Register extension with empty handler (the exact pattern that triggers the bug) + ZINIT_EXTS["zinit hook:preinit-pre 10"]="10 z-annex-data: test-annex hook:preinit-pre '' '' ''" + + # Test the hook processing logic directly + # This simulates what happens in .zinit-load at line 1648-1652 + local output="" + local error_code=0 + + # Get the hook keys (simulating the reply array) + local -a test_keys + test_keys=( "zinit hook:preinit-pre 10" ) + + # Process hooks + for ___key in "${test_keys[@]}"; do + local -a ___arr + ___arr=( "${(Q)${(z@)ZINIT_EXTS[$___key]:-$ZINIT_EXTS2[$___key]}[@]}" ) + + # With our fix, this checks if handler is non-empty before executing + if [[ -n "${___arr[5]:-}" ]]; then + output="would execute handler" + else + output="skipped empty handler" + fi + done + + # Verify the fix prevented execution of empty handler + assert "$output" same_as "skipped empty handler" +} + +@test 'direct test of empty command execution fails' { + # This demonstrates the underlying issue reported in #728 + local empty_var="" + + # Executing an empty variable causes "permission denied:" + run zsh -c 'empty_var=""; "${empty_var}"' + + # Verify it fails with permission denied + assert $state equals 126 # 126 is the error code for permission denied + assert "$output" contains "permission denied:" +} + +# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker \ No newline at end of file diff --git a/zinit.zsh b/zinit.zsh index b2376389..635fdd82 100644 --- a/zinit.zsh +++ b/zinit.zsh @@ -1443,8 +1443,10 @@ builtin setopt noaliases ) for key in "${reply[@]}"; do arr=( "${(Q)${(z@)ZINIT_EXTS[$key]:-$ZINIT_EXTS2[$key]}[@]}" ) - "${arr[5]}" snippet "$save_url" "$id_as" "$local_dir/$dirname" "${${key##(zinit|z-annex) hook:}%% <->}" load || \ - return $(( 10 - $? )) + if [[ -n "${arr[5]:-}" ]]; then + "${arr[5]}" snippet "$save_url" "$id_as" "$local_dir/$dirname" "${${key##(zinit|z-annex) hook:}%% <->}" load || \ + return $(( 10 - $? )) + fi done # Download or copy the file. @@ -1647,8 +1649,10 @@ builtin setopt noaliases ) for ___key in "${reply[@]}"; do ___arr=( "${(Q)${(z@)ZINIT_EXTS[$___key]:-$ZINIT_EXTS2[$___key]}[@]}" ) - "${___arr[5]}" plugin "$___user" "$___plugin" "$___id_as" "$___pdir_orig" "${${___key##(zinit|z-annex) hook:}%% <->}" load || \ - return $(( 10 - $? )) + if [[ -n "${___arr[5]:-}" ]]; then + "${___arr[5]}" plugin "$___user" "$___plugin" "$___id_as" "$___pdir_orig" "${${___key##(zinit|z-annex) hook:}%% <->}" load || \ + return $(( 10 - $? )) + fi done if [[ $___user != % && ! -d ${ZINIT[PLUGINS_DIR]}/${___id_as//\//---} ]] { From 04034e62f63b8b37440b22a22a7e4aef9f59b952 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 12 Aug 2025 18:42:07 +0000 Subject: [PATCH 33/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit.zsh.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/zsdoc/zinit.zsh.adoc b/doc/zsdoc/zinit.zsh.adoc index f4f08a59..d9b6a616 100644 --- a/doc/zsdoc/zinit.zsh.adoc +++ b/doc/zsdoc/zinit.zsh.adoc @@ -710,7 +710,7 @@ ____ ____ -Has 95 line(s). Calls functions: +Has 97 line(s). Calls functions: .zinit-load |-- +zinit-deploy-message @@ -880,7 +880,7 @@ ____ ____ -Has 203 line(s). Calls functions: +Has 205 line(s). Calls functions: .zinit-load-snippet |-- +zi-log From c5b6c5e3e7e0883b28df792b337e8ed624b23a77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:44:59 +0200 Subject: [PATCH 34/56] build(deps): bump actions/setup-python from 5 to 6 (#738) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/linting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index bbdbdf0e..d26fa450 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -51,7 +51,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 - name: install dependencies run: | From 342deb8a2491dd373efa6efcfce58041cab42787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:45:08 +0200 Subject: [PATCH 35/56] build(deps): bump actions/setup-node from 4 to 5 (#739) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 052060d2..1e2fbb3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: node-version: '20' From c6dd2a69c56a1186e409bc47b026d011dc64e301 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:03:39 +0200 Subject: [PATCH 36/56] build(deps): bump actions/labeler from 5 to 6 (#740) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/labeler.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml index 0d997612..e0a93658 100644 --- a/.github/workflows/labeler.yaml +++ b/.github/workflows/labeler.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v5 + - uses: actions/labeler@v6 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true From f1e503dc3b6ac689331180e577b4e7da79e17b02 Mon Sep 17 00:00:00 2001 From: Xie Zejian Date: Fri, 5 Sep 2025 20:27:03 +0800 Subject: [PATCH 37/56] fix: impl gh-r version detection using GitHub API (#731) --- zinit-install.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index 94e51ca6..ae85357c 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -1442,8 +1442,14 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { if [[ -z $urlpart ]]; then local tag_version=${ICE[ver]} if [[ -z $tag_version ]]; then - local releases_url=https://github.com/$user/$plugin/releases/latest - tag_version="$( { .zinit-download-file-stdout $releases_url || .zinit-download-file-stdout $releases_url 1; } 2>/dev/null | command grep -m1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+' )" + # Try GitHub API first, fallback to HTML parsing + local api_url=https://api.github.com/repos/$user/$plugin/releases/latest + tag_version="$( { .zinit-download-file-stdout $api_url || .zinit-download-file-stdout $api_url 1; } 2>/dev/null | command grep -o '"tag_name"[[:space:]]*:[[:space:]]*"[^"]\+"' | command grep -o '"[^"]*"$' | tr -d '"' )" + # Fallback to original method if API fails + if [[ -z $tag_version ]]; then + local releases_url=https://github.com/$user/$plugin/releases/latest + tag_version="$( { .zinit-download-file-stdout $releases_url || .zinit-download-file-stdout $releases_url 1; } 2>/dev/null | command grep -m1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+' )" + fi tag_version=${tag_version##*/} fi local url=https://github.com/$user/$plugin/releases/expanded_assets/$tag_version From 84d21fb7f2702fc570038d1b57b9a41cc07d9b78 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 5 Sep 2025 12:29:32 +0000 Subject: [PATCH 38/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-install.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc index d8a496fc..a636590e 100644 --- a/doc/zsdoc/zinit-install.zsh.adoc +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -247,7 +247,7 @@ ____ ____ -Has 55 line(s). Calls functions: +Has 59 line(s). Calls functions: .zinit-get-latest-gh-r-url-part `-- zinit.zsh/+zi-log From 5784ef17f4f6c3fbd13cdb0ac44b6a4948f82a7b Mon Sep 17 00:00:00 2001 From: Douglas de Campos Held Date: Wed, 10 Sep 2025 04:27:45 -0300 Subject: [PATCH 39/56] Fix: Timeout on downloading from GH releases (#741) --- .github/workflows/tests.yaml | 2 +- tests/gh-r.zunit | 8 +++++--- zinit-install.zsh | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c92783f4..008b9da5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -67,7 +67,7 @@ jobs: - name: "install dependencies" id: install-deps run: | - brew install --force --overwrite autoconf automake binutils byacc cmake coreutils curl gettext gnu-sed libevent libtool libuv lua lua@5.4 make ncurses ninja parallel pkg-config texinfo unzip xz zsh + brew install --force --overwrite autoconf automake binutils byacc coreutils curl gettext gnu-sed libevent libtool libuv lua lua@5.4 make ncurses ninja parallel pkg-config texinfo unzip xz zsh brew link --force --overwrite ncurses - name: "install zunit" diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index d012a781..dccc65b6 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -6,6 +6,7 @@ HOME="$zi_test_dir" # Stops programs creating directories in user home typeset -gx ZBIN="$zi_test_dir/polaris/bin" os_type="${OSTYPE//[0-9\.]*/}" [[ ! -d $ZBIN ]] && mkdir -p "$ZBIN" + arch=$(uname -m) zinit default-ice --quiet from'gh-r' lbin'!' null } @@ -104,7 +105,7 @@ run "$certificates" --version; assert $state equals 0 } @test 'checkmake' { # experimental linter/analyzer for Makefiles - run zinit lbin'!checkmake* -> checkmake' for @mrtazz/checkmake; assert $state equals 0 + run zinit lbin'!checkmake* -> checkmake' for @checkmake/checkmake; assert $state equals 0 local checkmake="$ZBIN/checkmake"; assert "$checkmake" is_executable run $checkmake --version; assert $state equals 0 } @@ -197,7 +198,7 @@ } @test 'dysk' { # A linux utility to get information on filesystems, like df but better [[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type" - run zinit lbin'!**/x86_64-linux/* -> dysk' for @Canop/dysk; assert $state equals 0 + run zinit lbin"!**/$arch*$os_type/* -> dysk" for @Canop/dysk; assert $state equals 0 local dysk="$ZBIN/dysk"; assert "$dysk" is_executable run $dysk --version; assert $state equals 0 } @@ -298,7 +299,7 @@ run "$git_sizer" --version; assert $state equals 0 } @test 'gitui' { # Blazing fast terminal-ui for git written in rust - run zinit for @extrawurst/gitui; assert $state equals 0 + run zinit for @gitui-org/gitui; assert $state equals 0 local gitui="$ZBIN/gitui"; assert "$gitui" is_executable run "$gitui" --version; assert $state equals 0 } @@ -814,6 +815,7 @@ run $yq --version; assert $state equals 0 } @test 'zed' { # Tooling for super-structured data: a new and easier way to manipulate data + skip "Official Doc: SuperDB is still under development so there's not yet a GA release." run zinit for @brimdata/super; assert $state equals 0 local zed="$ZBIN/zed"; assert "$zed" is_executable run $zed --version; assert $state equals 0 diff --git a/zinit-install.zsh b/zinit-install.zsh index ae85357c..5c5af77c 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -356,7 +356,8 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { if [[ $site = */releases ]] { local tag_version=${ICE[ver]} if [[ -z $tag_version ]]; then - tag_version="$({.zinit-download-file-stdout $site/latest || .zinit-download-file-stdout $site/latest 1;} 2>/dev/null | command grep -i -m 1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+')" + local url="https://$site/latest" + tag_version="$({.zinit-download-file-stdout $url || .zinit-download-file-stdout $url 1;} 2>/dev/null | command grep -i -m 1 -o 'href=./'$user'/'$plugin'/releases/tag/[^"]\+')" tag_version=${tag_version##*/} fi local url=$site/expanded_assets/$tag_version From eb472d1fcf9753000faa4544c585310c1adef1db Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 10 Sep 2025 07:30:16 +0000 Subject: [PATCH 40/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-install.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc index a636590e..55c261bc 100644 --- a/doc/zsdoc/zinit-install.zsh.adoc +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -435,7 +435,7 @@ ____ ____ -Has 219 line(s). Calls functions: +Has 220 line(s). Calls functions: .zinit-setup-plugin-dir |-- .zinit-download-file-stdout From 9f3703176a9c09b818d7a436fd2e1290683e416f Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Thu, 2 Oct 2025 22:34:41 -0500 Subject: [PATCH 41/56] docs(README.md): fix typos --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fb77c857..479b1d5a 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ ### Manual source "${ZINIT_HOME}/zinit.zsh" ``` -[compinit](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization)): +[compinit](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization): If you source `zinit.zsh` after `compinit`, add the following snippet after sourcing `zinit.zsh`: @@ -725,7 +725,7 @@ ### Conditional Loading | `if` | Load plugin or snippet only when given condition is fulfilled, for example: `zinit ice if'[[ -n "$commands[otool]" ]]'; zinit load ...`. | | `load` | A condition to check which should cause plugin to load. It will load once, the condition can be still true, but will not trigger second load (unless plugin is unloaded earlier, see `unload` below). E.g.: `load'[[ $PWD = */github* ]]'`. | | `subscribe` / `on-update-of` | Postpone loading of a plugin or snippet until the given file(s) get updated, e.g. `subscribe'{~/files-*,/tmp/files-*}'` | -| `trigger-load` | Creates a function that loads the associated plugin/snippet, with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command of the same name as the function. Can obtain multiple functions to create – sparate with `;`. | +| `trigger-load` | Creates a function that loads the associated plugin/snippet, with an option (to use it, precede the ice content with `!`) to automatically forward the call afterwards, to a command of the same name as the function. Can obtain multiple functions to create – separate with `;`. | | `unload` | A condition to check causing plugin to unload. It will unload once, then only if loaded again. E.g.: `unload'[[ $PWD != */github* ]]'`. | | `wait` | Postpone loading a plugin or snippet. For `wait'1'`, loading is done `1` second after prompt. For `wait'[[ ... ]]'`, `wait'(( ... ))'`, loading is done when given condition is meet. For `wait'!...'`, prompt is reset after load. Zsh can start 80% (i.e.: 5x) faster thanks to postponed loading. **Fact:** when `wait` is used without value, it works as `wait'0'`. | @@ -780,7 +780,7 @@ ### Others | `id-as` | Nickname a plugin or snippet, to e.g. create a short handler for long-url snippet. | | `subst` | Substitute the given string into another string when sourcing the plugin script, e.g.: `zinit subst'autoload → autoload -Uz' …`. | | `aliases` | Load the plugin with the aliases mechanism enabled. Use with plugins that define **and use** aliases in their scripts. | -| `autoload` | Autoload the given functions (from their files). Equvalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. | +| `autoload` | Autoload the given functions (from their files). Equivalent to calling `atinit'autoload the-function'`. Supports renaming of the function – pass `'… → new-name'` or `'… -> new-name'`, e.g.: `zinit autoload'fun → my-fun; fun2 → my-fun2'`. | | `bindmap` | To hold `;`-separated strings like `Key(s)A -> Key(s)B`, e.g. `^R -> ^T; ^A -> ^B`. In general, `bindmap''`changes bindings (done with the `bindkey` builtin) the plugin does. The example would cause the plugin to map Ctrl-T instead of Ctrl-R, and Ctrl-B instead of Ctrl-A. **Does not work with snippets.** | | `compile` | Pattern (+ possible `{...}` expansion, like `{a/*,b*}`) to select additional files to compile, e.g. `compile'*.zsh'`. | | `extract` | Performs archive extraction supporting multiple formats like `zip`, `tar.gz`, etc. and also notably OS X `dmg` images. If it has no value, then it works in the _auto_ mode – it automatically extracts all files of known archive extensions IF they aren't located deeper than in a sub-directory (this is to prevent extraction of some helper archive files, typically located somewhere deeper in the tree). If no such files will be found, then it extracts all found files of known **type** – the type is being read by the `file` Unix command. If not empty, then takes names of the files to extract. Refer to the Wiki page for further information. | @@ -941,7 +941,7 @@ ### Calling `compinit` Without Turbo Mode Date: Tue, 14 Oct 2025 14:33:59 +0200 Subject: [PATCH 43/56] build(deps): bump actions/setup-node from 5 to 6 (#744) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e2fbb3a..ae20bdcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: '20' From a42dba233d1a908b367e2888c04b107712f4381b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:35:40 +0100 Subject: [PATCH 44/56] build(deps): bump dawidd6/action-homebrew-bump-formula from 5 to 6 (#747) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 5e33eddb..1a241048 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v5 - name: Bump Homebrew formulae - uses: dawidd6/action-homebrew-bump-formula@v5 + uses: dawidd6/action-homebrew-bump-formula@v6 with: formula: zinit # A Personal Access Token (PAT) is instead of the default From 2c04ceb788a4190f54e1a33068966c1c6f2eb098 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:54:18 +0100 Subject: [PATCH 45/56] build(deps): bump actions/checkout from 5 to 6 (#748) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- .github/workflows/containers.yaml | 4 ++-- .github/workflows/documentation.yaml | 2 +- .github/workflows/linting.yaml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/tests.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 1a241048..5f90cfc6 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Bump Homebrew formulae uses: dawidd6/action-homebrew-bump-formula@v6 diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 9596f1da..da3d1032 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -19,7 +19,7 @@ jobs: - 5.9 steps: - name: check out repository code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Grab git slugs (short commit id, branch etc.) uses: rlespinasse/github-slug-action@v3.x @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: get vcs details uses: rlespinasse/github-slug-action@v3.x diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 93240151..4ae12511 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index d26fa450..66b0758d 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -14,7 +14,7 @@ jobs: name: Markdown Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: xt0rted/markdownlint-problem-matcher@v3 @@ -47,7 +47,7 @@ jobs: task: [zsh-noexec, zsh-zcompile] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae20bdcf..f91595f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: name: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version: '20' diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 008b9da5..d53dc26f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,7 +40,7 @@ jobs: steps: - name: checkout ${{ github.repository }} - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 From f8fb19458a3f275542a1594da1c97acb0d43e709 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:34:18 +0100 Subject: [PATCH 46/56] build(deps): bump dawidd6/action-homebrew-bump-formula from 6 to 7 (#749) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/bump-homebrew-formula.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-homebrew-formula.yml b/.github/workflows/bump-homebrew-formula.yml index 5f90cfc6..39c16804 100644 --- a/.github/workflows/bump-homebrew-formula.yml +++ b/.github/workflows/bump-homebrew-formula.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v6 - name: Bump Homebrew formulae - uses: dawidd6/action-homebrew-bump-formula@v6 + uses: dawidd6/action-homebrew-bump-formula@v7 with: formula: zinit # A Personal Access Token (PAT) is instead of the default From 893146b58682e36b99607fcadc020e29109cf3a7 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Thu, 1 Jan 2026 12:14:33 +0100 Subject: [PATCH 47/56] Refactor: Improve clarity and readability of `run-atpull` log message (#752) --- zinit-autoload.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index 2ea7cb65..b839e6ef 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -3264,10 +3264,11 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" fi if [[ -n ${(v)ice[(I)(mv|cp|atpull|ps-on-update|cargo)]} || $+ice[sbin]$+ice[make]$+ice[extract]$+ice[configure] -ne 0 ]] { if (( !OPTS[opt_-q,--quiet] && ZINIT[annex-multi-flag:pull-active] == 1 )) { - +zi-log -n "{pre}[update]{msg3} Continuing with the update because " - (( ${+ice[run-atpull]} )) && \ - +zi-log "{ice}run-atpull{apo}''{msg3} ice given.{rst}" || \ - +zi-log "{opt}-u{msg3}/{opt}--urge{msg3} given.{rst}" + if (( ${+ice[run-atpull]} )); then + +zi-log "{info}[{pre}update{info}]{rst} No new commits found, but running post-update hooks as requested by the {ice}run-atpull{apo}{rst} ice." + else + +zi-log "{info}[{pre}update{info}]{rst} No new commits found, but running post-update hooks as requested by the {opt}-u{rst}/{opt}--urge{rst} option." + fi } } From 31a63c8cb5d3bd85a952b3eb7152c581249a1348 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 1 Jan 2026 11:17:04 +0000 Subject: [PATCH 48/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-autoload.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit-autoload.zsh.adoc b/doc/zsdoc/zinit-autoload.zsh.adoc index f198e05b..5a6a35fb 100644 --- a/doc/zsdoc/zinit-autoload.zsh.adoc +++ b/doc/zsdoc/zinit-autoload.zsh.adoc @@ -1497,7 +1497,7 @@ ____ ____ -Has 325 line(s). Calls functions: +Has 326 line(s). Calls functions: .zinit-update-or-status |-- .zinit-pager From c720e72ee9bedce5811d3546195b66c9c7988414 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Thu, 1 Jan 2026 12:39:01 +0100 Subject: [PATCH 49/56] Feature: Add configurable non-interactive pager for updates (#753) --- zinit-autoload.zsh | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index b839e6ef..52969592 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -691,20 +691,40 @@ ZINIT[EXTENDED_GLOB]="" # BusyBox less lacks the -X and -i options, so it can use more .zinit-pager() { setopt LOCAL_OPTIONS EQUALS - # Quiet mode ? → no pager. - if (( OPTS[opt_-n,--no-pager] )) { - cat + + # Check if a non-interactive mode has been requested, either via a flag or a global setting. + if (( OPTS[opt_-n,--no-pager] )) || [[ ${ZINIT[NO_PAGER]} = (1|true|on|yes) ]]; then + # NON-INTERACTIVE MODE + local max_lines=${ZINIT[NO_PAGER_MAX_LINES]} + + # Check if a line limit is explicitly set and is a valid non-negative integer. + if [[ $max_lines =~ ^[0-9]+$ ]]; then + if (( max_lines > 0 )); then + # A positive number means limit the output to that many lines. + head -n "$max_lines" + else + # A value of 0 means suppress all output from the pager completely. + # `cat > /dev/null` is the most robust way to achieve this. + cat > /dev/null + fi + else + # No valid line limit is set, so show the full output without interaction. + cat + fi return 0 - } - if [[ ${${:-=less}:A:t} = busybox* ]] { - more 2>/dev/null - (( ${+commands[more]} )) - } else { - less -FRXi 2>/dev/null - (( ${+commands[less]} )) - } - (( $? )) && cat - return 0 + else + # INTERACTIVE MODE (Original Behavior) + # Fall back to the default interactive pager if no non-interactive mode is set. + if [[ ${${:-=less}:A:t} = busybox* ]] { + more 2>/dev/null + (( ${+commands[more]} )) + } else { + less -FRXi 2>/dev/null + (( ${+commands[less]} )) + } + (( $? )) && cat + return 0 + fi } # ]]] # FUNCTION: .zinit-build-module [[[ From c756fe2e71e70cf2533ccc6e61afbecc17872f53 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 1 Jan 2026 11:41:35 +0000 Subject: [PATCH 50/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-autoload.zsh.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zsdoc/zinit-autoload.zsh.adoc b/doc/zsdoc/zinit-autoload.zsh.adoc index 5a6a35fb..ad815cd3 100644 --- a/doc/zsdoc/zinit-autoload.zsh.adoc +++ b/doc/zsdoc/zinit-autoload.zsh.adoc @@ -931,7 +931,7 @@ ____ ____ -Has 14 line(s). Doesn't call other functions. +Has 24 line(s). Doesn't call other functions. Uses feature(s): _setopt_ From 55d19f86f627c9995db9885d0971d9b6701fe0d3 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Sat, 3 Jan 2026 14:38:58 +0100 Subject: [PATCH 51/56] Fix(self-update): Honor current branch instead of hardcoding 'main' (#751) --- zinit-autoload.zsh | 14 ++++++++++---- zinit-install.zsh | 9 +++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index 52969592..6a7f7a2a 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -1989,14 +1989,19 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" [[ $1 = -q ]] && +zi-log "{pre}[self-update]{info} updating zinit repository{msg2}" \ local nl=$'\n' escape=$'\x1b[' + # Dynamically get the current branch name for logging and pulling local current_branch=$(command git -C $ZINIT[BIN_DIR] rev-parse --abbrev-ref HEAD) - # local current_branch='main' + # Warn if user is not on main (requested by maintainer) + if [[ -n $current_branch && $current_branch != main ]]; then + +zi-log "{pre}[self-update]{warn} non-{obj}main{warn} branch detected: {obj}${current_branch}{warn}. Self-update will pull from the branch’s configured upstream.{rst}" + fi local -a lines ( builtin cd -q "$ZINIT[BIN_DIR]" \ && +zi-log -n "{pre}[self-update]{info} fetching latest changes from {obj}$current_branch{info} branch$nl{rst}" \ && command git fetch --quiet \ - && lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..origin/HEAD)"} ) + && lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..@\{u\})"} ) + # Use '..@{u}' which refers to the configured upstream branch, instead of '..origin/HEAD' if (( ${#lines} > 0 )); then # Remove the (origin/main ...) segments, to expect only tags to appear lines=( "${(S)lines[@]//\(([,[:blank:]]#(origin|HEAD|master|main)[^a-zA-Z]##(HEAD|origin|master|main)[,[:blank:]]#)#\)/}" ) @@ -2012,10 +2017,11 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" builtin print -rl -- "${lines[@]}" | .zinit-pager builtin print fi + # Do not use hardcoded 'origin main' to let git use the configured upstream if [[ $1 != -q ]] { - command git pull --no-stat --ff-only origin main + command git pull --no-stat --ff-only } else { - command git pull --no-stat --quiet --ff-only origin main + command git pull --no-stat --quiet --ff-only } ) if [[ $1 != -q ]] { diff --git a/zinit-install.zsh b/zinit-install.zsh index 5c5af77c..813550e7 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -1457,6 +1457,15 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || { else local url=https://$urlpart fi + if [[ "${ICE[bpick]}" == "src" ]]; then + +zi-log "{dbg} {b}gh-r{rst}: bpick\"src\" detected, targeting source code tarball for tag: {version}$tag_version{rst}" + # Construct the URL path for the auto-generated source code archive + reply=( "/$user/$plugin/archive/refs/tags/$tag_version.tar.gz" ) + # Ensure the reply isn't empty if tag_version was somehow missed + [[ -n "$tag_version" ]] && return 0 + +zi-log "{e} {b}gh-r{rst}: Could not determine tag version, cannot use bpick\"src\"." + return 1 + fi init_list=( ${(@f)"$( { .zinit-download-file-stdout $url || .zinit-download-file-stdout $url 1; } 2>/dev/null | command grep -i -o 'href=./'$user'/'$plugin'/releases/download/[^"]\+')"} ) init_list=(${(L)init_list[@]#href=?}) bpicks=(${(s.;.)ICE[bpick]}) From 89e1858b72a3e1b7b7b7b867509cca85271a576c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 3 Jan 2026 13:41:34 +0000 Subject: [PATCH 52/56] docs: generate Signed-off-by: GitHub Actions --- doc/zsdoc/zinit-autoload.zsh.adoc | 2 +- doc/zsdoc/zinit-install.zsh.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/zsdoc/zinit-autoload.zsh.adoc b/doc/zsdoc/zinit-autoload.zsh.adoc index ad815cd3..2fd5a355 100644 --- a/doc/zsdoc/zinit-autoload.zsh.adoc +++ b/doc/zsdoc/zinit-autoload.zsh.adoc @@ -1096,7 +1096,7 @@ ____ ____ -Has 44 line(s). Calls functions: +Has 47 line(s). Calls functions: .zinit-self-update |-- .zi-check-for-git-changes diff --git a/doc/zsdoc/zinit-install.zsh.adoc b/doc/zsdoc/zinit-install.zsh.adoc index 55c261bc..c7d634d0 100644 --- a/doc/zsdoc/zinit-install.zsh.adoc +++ b/doc/zsdoc/zinit-install.zsh.adoc @@ -247,7 +247,7 @@ ____ ____ -Has 59 line(s). Calls functions: +Has 66 line(s). Calls functions: .zinit-get-latest-gh-r-url-part `-- zinit.zsh/+zi-log From 01eb65f8cea521779dd0eb23ac1d92239e36d8d6 Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Sun, 1 Feb 2026 02:43:27 -0600 Subject: [PATCH 53/56] fix: Update various tools in gh-r tests (#759) --- tests/gh-r.zunit | 22 +++++++++++----------- tests/plugins.zunit | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index dccc65b6..c415f11a 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -97,7 +97,7 @@ @test 'calico' { # Cloud native networking and network security run zinit lbin'!* -> calico' for @projectcalico/calico; assert $state equals 0 local calico="$ZBIN/calico"; assert "$calico" is_executable - run "$calico" --help; assert $state equals 0 + run "$calico" version; assert $state equals 0 } @test 'certificates' { # An opinionated helper for generating tls certificates run zinit lbin'!* -> certificates' for @mvmaasakkers/certificates; assert $state equals 0 @@ -216,7 +216,7 @@ [[ $OSTYPE =~ 'darwin*' ]] && skip "on $os_type" run zinit ver'v0.31.0' for @pkolaczk/fclones; assert $state equals 0 local fclones="$ZBIN/fclones"; assert "$fclones" is_executable - run "$fclones" --help; assert $state equals 0 + run "$fclones" --version; assert $state equals 0 } @test 'fd' { # A fast, simple, and user-friendly alternative to find run zinit for @sharkdp/fd; assert $state equals 0 @@ -453,11 +453,6 @@ local krew="$ZBIN/krew"; assert "$krew" is_executable run $krew version; assert $state equals 0 } -@test 'kubedb' { # `kubectl` plugin for KubeDB - run zinit for lbin'!kube*->kubedb' @kubedb/cli; assert $state equals 0 - local cli="$ZBIN/kubedb"; assert "$cli" is_executable - run "$cli" version; assert $state equals 0 -} @test 'kubectl-plugins' { # Faster way to switch between clusters and namespaces in kubectl [[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type" load_bin_gem_node @@ -468,6 +463,11 @@ run "$prog" --help; assert $state equals 0 done } +@test 'kubedb' { # `kubectl` plugin for KubeDB + run zinit for lbin'!kube*->kubedb' @kubedb/cli; assert $state equals 0 + local cli="$ZBIN/kubedb"; assert "$cli" is_executable + run "$cli" version; assert $state equals 0 +} @test 'lazygit' { # simple terminal UI for git commands run zinit for @jesseduffield/lazygit; assert $state equals 0 local lazygit="$ZBIN/lazygit"; assert "$lazygit" is_executable @@ -536,7 +536,7 @@ assert $state equals 127; assert $output contains 'no such file or directory' } @test 'micro' { # A modern and intuitive terminal-based text editor - run zinit for @zyedidia/micro; assert $state equals 0 + run zinit for @micro-editor/micro; assert $state equals 0 local micro="$ZBIN/micro"; assert "$micro" is_executable run $micro --version; assert $state equals 0 } @@ -544,7 +544,7 @@ [[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type" run zinit lbin'!* -> miniserve' for @svenstaro/miniserve; assert $state equals 0 local miniserve="$ZBIN/miniserve"; assert "$miniserve" is_executable - run $miniserve --help; assert $state equals 0 + run $miniserve --version; assert $state equals 0 } @test 'mkcert' { # A simple zero-config tool to make locally trusted development certificates run zinit lbin'!* -> mkcert' for @FiloSottile/mkcert; assert $state equals 0 @@ -712,7 +712,7 @@ run $shfmt --version; assert $state equals 0 } @test 'skim' { # Fuzzy Finder in rust - run zinit for @skim-rs/skim; assert $state equals 0 + run zinit for lbin'!sk->sk' @skim-rs/skim; assert $state equals 0 local skim="$ZBIN/sk"; assert "$skim" is_executable run "$skim" --version; assert $state equals 0 } @@ -805,7 +805,7 @@ } @test 'yabai' { # A tiling window manager for macOS based on binary space partitioning [[ $OSTYPE =~ 'linux*' ]] && skip 'Yabai skipped on Linux' - run zinit for @koekeishiya/yabai; assert $state equals 0 + run zinit for @asmvik/yabai; assert $state equals 0 local yabai="$ZBIN/yabai"; assert "$yabai" is_executable run $yabai --version; assert $state equals 0 } diff --git a/tests/plugins.zunit b/tests/plugins.zunit index 495fb279..9e205973 100755 --- a/tests/plugins.zunit +++ b/tests/plugins.zunit @@ -24,7 +24,7 @@ run "$htop" --version; assert $state equals 0 } @test 'bash' { - run zinit build for @bminor/bash; assert $state equals 0 + run zinit build for @tianon/mirror-bash; assert $state equals 0 local bash="$ZBIN/bash"; assert $bash is_executable run "$bash" --version; assert $state equals 0 } From 507b4e5722ecfde21c42cc4e6502b0049e3ef192 Mon Sep 17 00:00:00 2001 From: Vladislav Doster Date: Mon, 2 Feb 2026 10:50:22 -0600 Subject: [PATCH 54/56] fix: add markdownlint exceptions to linting Disabled following checks: - MD024/no-duplicate-heading - MD059/descriptive-link-text - MD060/table-column-style Signed-off-by: Vladislav Doster --- .github/workflows/linting.yaml | 18 +++++---- README.md | 8 ++-- doc/HACKING.md | 74 +++++++++++++++++----------------- 3 files changed, 51 insertions(+), 49 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 66b0758d..4820e4df 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -19,13 +19,15 @@ jobs: - uses: xt0rted/markdownlint-problem-matcher@v3 - run: npm install -g markdownlint-cli - # disabled checks: - # - MD013/line-length - # - MD033/no-inline-html - # - MD034/no-bare-urls - # - MD036/no-emphasis-as-heading - # - MD041/first-line-heading/first-line-h1 + # MD013/line-length + # MD024/no-duplicate-heading + # MD033/no-inline-html + # MD034/no-bare-urls + # MD036/no-emphasis-as-heading + # MD041/first-line-heading/first-line-h1 + # MD059/descriptive-link-text + # MD060/table-column-style - run: | markdownlint --version @@ -33,9 +35,9 @@ jobs: ls *.md **/*.md markdownlint \ + --disable MD013 MD024 MD029 MD033 MD034 MD036 MD041 MD059 MD060 \ --ignore '**/CHANGELOG.md' \ - --disable MD013 MD033 MD034 MD036 MD041 -- \ - *.md **/*.md + -- *.md **/*.md zshlint: name: ZSH Lint diff --git a/README.md b/README.md index 479b1d5a..11798785 100644 --- a/README.md +++ b/README.md @@ -677,9 +677,9 @@ # make'!...' -> run make before atclone & atpull You can also check out the [Gallery of Zinit Invocations](https://zdharma-continuum.github.io/zinit/wiki/GALLERY/) for some additional examples. -Also, two articles on the Wiki present an example setup -[here](https://zdharma-continuum.github.io/zinit/wiki/Example-Minimal-Setup/) and -[here](https://zdharma-continuum.github.io/zinit/wiki/Example-Oh-My-Zsh-setup/). +Also, two articles on the Wiki present a +[Minimal Setup](https://zdharma-continuum.github.io/zinit/wiki/Example-Minimal-Setup/) and +[Oh-My-Zsh Setup](https://zdharma-continuum.github.io/zinit/wiki/Example-Oh-My-Zsh-setup/). # How to Use @@ -1058,7 +1058,7 @@ #### NixOS On NixOS, the global `compinit` call can be disabled system-wide by setting the following option in your `/etc/nixos/configuration.nix`: -``` +```nix # Disable global completion init to speed up `compinit` call in `~/.zshrc`. programs.zsh.enableGlobalCompInit = false; ``` diff --git a/doc/HACKING.md b/doc/HACKING.md index a5f5d901..46db75ee 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -63,51 +63,51 @@ ## Testing 1. Install [zunit](https://zunit.xyz) and [revolver](https://github.com/molovo/revolver): - ```zsh - zinit for \ - as"program" \ - atclone"ln -sfv revolver.zsh-completion _revolver" \ - atpull"%atclone" \ - pick"revolver" \ - @molovo/revolver \ - as"completion" \ - atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \ - atpull"%atclone" \ - sbin"zunit" \ - @zunit-zsh/zunit - ``` +```zsh +zinit for \ + as"program" \ + atclone"ln -sfv revolver.zsh-completion _revolver" \ + atpull"%atclone" \ + pick"revolver" \ + @molovo/revolver \ + as"completion" \ + atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \ + atpull"%atclone" \ + sbin"zunit" \ + @zunit-zsh/zunit +``` 2. Create a new `.zunit` file in the `tests/` dir. Here's a template: - ```zsh - #!/usr/bin/env zunit +```zsh +#!/usr/bin/env zunit - @setup { - load setup - setup - } +@setup { + load setup + setup +} - @teardown { - load teardown - teardown - } +@teardown { + load teardown + teardown +} - @test 'zinit-annex-bin-gem-node installation' { - # This spawns the official zinit container and executes a single zinit command - # inside it - run ./scripts/docker-run.sh --wrap --debug --zunit \ - zinit light as"null" for zdharma-continuum/null +@test 'zinit-annex-bin-gem-node installation' { + # This spawns the official zinit container and executes a single zinit command + # inside it + run ./scripts/docker-run.sh --wrap --debug --zunit \ + zinit light as"null" for zdharma-continuum/null - # Verify the exit code of the command above - assert $state equals 0 - assert "$output" contains "Downloading" + # Verify the exit code of the command above + assert $state equals 0 + assert "$output" contains "Downloading" - local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md" - # Check if we downloaded the file correctly and if it is readable - assert "$artifact" is_file - assert "$artifact" is_readable - } - ``` + local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md" + # Check if we downloaded the file correctly and if it is readable + assert "$artifact" is_file + assert "$artifact" is_readable +} +``` You should, of course, also check out the existing tests ;) From 34a18112e8866a7a7570b0ee1da44298677cc8d2 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Sun, 15 Feb 2026 20:51:37 +0100 Subject: [PATCH 55/56] fix: resolves a bug with github action trying to push updated docs back to external forks (#763) --- .github/workflows/documentation.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 4ae12511..a96eae0e 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -9,6 +9,8 @@ on: push: branches: - main + paths: + - 'zinit*.zsh' workflow_dispatch: jobs: @@ -19,15 +21,16 @@ jobs: - name: checkout repository uses: actions/checkout@v6 with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event.pull_request.head.ref || github.ref }} - name: re-generate documentation run: | make doc/container sudo chown -R "$(id -u):$(id -g)" . - - name: commit changes to the current branch + - name: commit and push updated docs + if: github.event_name != 'pull_request' uses: EndBug/add-and-commit@v9 with: add: 'doc' From 18fc2cc5b903450d17f340898e4abbbb48ad975c Mon Sep 17 00:00:00 2001 From: vladislav doster Date: Tue, 17 Feb 2026 06:10:09 -0600 Subject: [PATCH 56/56] fix: update `git-chglog` to `git-cliff` in gh-r tests git-chglog was archived and git-cliff is actively maintained fork --- tests/gh-r.zunit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/gh-r.zunit b/tests/gh-r.zunit index c415f11a..196c7136 100755 --- a/tests/gh-r.zunit +++ b/tests/gh-r.zunit @@ -283,10 +283,10 @@ local git_absorb="$ZBIN/git-absorb"; assert "$git_absorb" is_executable run "$git_absorb" --version; assert $state equals 0 } -@test 'git-chglog' { # CHANGELOG generator implemented in Go (Golang). - run zinit for @git-chglog/git-chglog; assert $state equals 0 - local git_chglog="$ZBIN/git-chglog"; assert "$git_chglog" is_executable - run "$git_chglog" --version; assert $state equals 0 +@test 'git-cliff' { # CHANGELOG generator implemented in Go (Golang). + run zinit for @orhun/git-cliff; assert $state equals 0 + local git_cliff="$ZBIN/git-cliff"; assert "$git_cliff" is_executable + run "$git_cliff" --version; assert $state equals 0 } @test 'git-mkver' { # Automatic Semantic Versioning for git based software development run zinit ver'v1.2.2' for @idc101/git-mkver; assert $state equals 0