Compare commits

..

No commits in common. "main" and "v1.2" have entirely different histories.
main ... v1.2

96 changed files with 4399 additions and 25110 deletions

View file

@ -1,10 +0,0 @@
.git/
.github/
.git*
doc/
scripts/
test/
tests/
*.zwc
Makefile

16
.gitattributes vendored
View file

@ -1,16 +0,0 @@
# By default, everything is text
* text=auto
# These must be unix EOLs
*.sh eol=lf
*.zsh diff=zsh eol=lf
*.zunit diff=zsh eol=lf
Makefile eol=lf
# Use the markdown differ.
*.md diff=markdown
# Binary files
*.png binary
# EOF

3
.github/CODEOWNERS vendored
View file

@ -1,3 +0,0 @@
* @alichtman @pschmitt @vladdoster
# Should consider adding @psprint as well

View file

@ -1,99 +0,0 @@
name: Bug Report
description: File a bug report
title: "[bug]: "
labels: ["bug", "triage"]
assignees:
- vladdoster
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
## 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://matrix.to/#/#zdharma-continuum_community:gitter.im) for help.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
validations:
required: true
attributes:
label: Steps to reproduce
description: |
Steps to reproduce the problem
placeholder: |
1. Enable plugin 'foo'
2. Run 'foo bar' or try to complete command 'foo --widget'
3. See error
- type: textarea
id: logs
attributes:
label: Relevant output
description: Please copy and paste any relevant output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: textarea
attributes:
label: Screenshots and recordings
description: |
If applicable, add screenshots or [asciinema](https://asciinema.org) session to explain your problem
- type: input
validations:
required: true
attributes:
label: Operating System & Version
description: |
Output of
```
echo "OS: ${OSTYPE:-N/A} | Vendor: ${VENDOR:-N/A} | Machine: ${MACHTYPE:-N/A} | CPU: ${CPUTYPE:-N/A} | Processor: ${$(uname -p 2>/dev/null):-N/A} | Hardware: ${$(uname -m 2>/dev/null):-N/A}"
```
- type: input
validations:
required: true
attributes:
label: Zsh version
description: Output of `zsh --version`
- type: input
validations:
required: true
attributes:
label: Terminal emulator
description: Terminal name & output of `echo "${TERM}"`
- type: dropdown
attributes:
label: If using WSL on Windows, which version of WSL
description: Output `wsl -l -v`
options:
- 'WSL 1'
- 'WSL 2'
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem. This can be themes, plugins, custom settings, etc.
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](../../CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true

View file

@ -1,8 +0,0 @@
blank_issues_enabled: true
contact_links:
- name: Support
url: https://github.com/zdharma-continuum/zinit/discussions
about: Ask the community for support
- 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.

View file

@ -1,32 +0,0 @@
name: Documentation
description: Create a report to help us improve the documentation
labels: [documentation]
title: "[doc]: "
body:
- type: input
id: link
attributes:
label: Documentation Link
description: |
Link to any documentation or examples that you are referencing.
Suggested improvements should be based on the development version of the docs: https://zdharma-continuum.github.io/zinit/wiki/
placeholder: https://zdharma-continuum.github.io/zinit/wiki/...
- type: textarea
id: problem
attributes:
label: Problem
description: What is missing, unclear, or wrong in the documentation?
placeholder: |
* I found [...] to be unclear because [...]
* [...] made me think that [...] when really it should be [...]
* There is no example showing how to do [...]
validations:
required: true
- type: textarea
id: improvement
attributes:
label: Suggested improvement
placeholder: |
* This line should be be changed to say [...]
* Include a paragraph explaining [...]
* Add a figure showing [...]

View file

@ -1,38 +0,0 @@
name: Feature request
description: Suggest a feature for Zinit
labels: ["feature"]
title: "[feat]: "
body:
- type: markdown
attributes:
value: |
## Self Check
- Look for similar features in existing [GitHub Issues](https://github.com/zdharma-continuum/zinit/issues?q=is%3Aissue) (open or closed).
- type: input
attributes:
label: If the feature request is for a plugin or theme, specify it here.
description: The name of the plugin or theme that you would like us to improve.
placeholder: e.g. Git plugin, Agnoster theme
- type: textarea
attributes:
label: If the feature solves a problem you have, specify it here.
description: A description of what the problem is.
placeholder: Ex. I'm always frustrated when...
- type: textarea
attributes:
label: Describe the proposed feature.
description: A description of what you want to happen. Be as specific as possible.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A description of any alternative solutions or features you've considered. This can also include other plugins or themes.
- type: textarea
attributes:
label: Additional context
description: Add any other context, screenshots or Gitter conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
- type: textarea
attributes:
label: Related Issues
description: Is there any open or closed issues that is related to this feature request? If so please link them below!

View file

@ -1,17 +0,0 @@
name: Maintenance
description: Help improve performance, usability and/or consistency.
title: "[maint]: "
labels: [Maintenance]
body:
- type: textarea
id: summary
attributes:
label: Summary
description: Please provide 1-2 short sentences that succinctly describes what could be improved.
validations:
required: true
- type: textarea
id: fix
attributes:
label: Proposed fix
description: Please describe how you think this could be improved.

View file

@ -1,7 +0,0 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

41
.github/labeler.yml vendored
View file

@ -1,41 +0,0 @@
ci/cd:
- changed-files:
- any-glob-to-any-file: '.github/**'
docker:
- changed-files:
- any-glob-to-any-file: 'docker/**'
scripts:
- changed-files:
- any-glob-to-any-file: 'docker/**'
tests:
- changed-files:
- any-glob-to-any-file: ['.zunit.yml', 'tests/**/*']
completion:
- changed-files:
- any-glob-to-any-file: '_zinit'
# Add 'Documentation' label to any file changes within 'docs' folder
docs:
- changed-files:
- any-glob-to-any-file: 'doc/**'
- any-glob-to-any-file: '**/*.md'
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
zinit:
- changed-files:
- any-glob-to-any-file: 'zinit*.zsh*'
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch: ['^feat']
fix:
- head-branch: ['^fix']
# Add 'release' label to any PR that is opened against the `main` branch
release:
- base-branch: 'main'

38
.github/stale.yml vendored
View file

@ -1,38 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 180
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
daysUntilClose: 7
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone
exemptMilestones: false
# Set to true to ignore issues with an assignee
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
# configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 30
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
unmarkComment: >
This pull request has been automatically marked as not stale anymore due to the recent activity.
closeComment: >
This pull request has been automatically closed because it had not recent activity during the stale period.
issues:
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
unmarkComment: >
This issue has been automatically marked as not stale anymore due to the recent activity.
closeComment: >
This issue has been automatically closed because it had not recent activity during the stale period.

View file

@ -1,24 +0,0 @@
name: Bump Homebrew Formula
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
bump-homebrew-formula:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Bump Homebrew formulae
uses: dawidd6/action-homebrew-bump-formula@v8
with:
formula: zinit
# A Personal Access Token (PAT) is instead of the default
# GITHUB_TOKEN because brew bump-formula-pr creates a fork of the
# formula's tap repository (if needed) and then creates a pull
# request.
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}

View file

@ -1,99 +0,0 @@
name: Container images
on:
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch:
jobs:
build-containers-with-zsh:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
zsh_version:
- 5.8
- 5.9
steps:
- name: check out repository code
uses: actions/checkout@v7
- name: Grab git slugs (short commit id, branch etc.)
uses: rlespinasse/github-slug-action@v3.x
- name: set up qemu
uses: docker/setup-qemu-action@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v4
with:
install: true
use: true
- name: login to github container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
id: docker_build_zsh_versions
uses: docker/build-push-action@v7
timeout-minutes: 90 # compiling older zsh versions take a long time
with:
push: ${{ github.event.number == 0 }}
file: ./docker/Dockerfile
build-args: |
ZINIT_ZSH_VERSION=${{ matrix.zsh_version }}-tcsetpgrp
tags: |
ghcr.io/${{ github.repository }}:zsh-${{ matrix.zsh_version }}
ghcr.io/${{ github.repository }}:zsh-${{ matrix.zsh_version }}-${{ env.GITHUB_SHA_SHORT }}
platforms: linux/amd64,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
build-container-latest:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v7
- name: get vcs details
uses: rlespinasse/github-slug-action@v3.x
- name: setup docker qemu
uses: docker/setup-qemu-action@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v4
with:
install: true
use: true
- name: github container registry authentication
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build & push new image
id: docker_build_latest
uses: docker/build-push-action@v7
if: github.ref == 'refs/heads/main'
with:
push: true
file: ./docker/Dockerfile
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.GITHUB_SHA_SHORT }}
ghcr.io/${{ github.repository }}:${{ env.GITHUB_REF_SLUG }}
platforms: linux/amd64,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -1,41 +0,0 @@
name: Documentation
on:
pull_request:
branches:
- main
paths:
- 'zinit*.zsh'
push:
branches:
- main
paths:
- 'zinit*.zsh'
workflow_dispatch:
jobs:
zshelldoc:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v7
with:
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 and push updated docs
if: github.event_name != 'pull_request'
uses: EndBug/add-and-commit@v11
with:
add: 'doc'
author_name: GitHub Actions
author_email: actions@github.com
commit: --signoff
message: 'docs: generate'
push: true

View file

@ -1,67 +0,0 @@
# name: Installer
# concurrency:
# cancel-in-progress: true
# group: ${{ github.workflow }}-${{ github.ref }}
# defaults:
# run:
# shell: bash
# env:
# NO_INPUT: true
# TERM: xterm
# ZINIT_BRANCH: ${{ github.ref_name }}
# ZINIT_COMMIT: ${{ github.sha }}
# ZINIT_REPO: ${{ github.repository }}
# on:
# pull_request:
# branches:
# - main
# paths:
# - .github/workflows/installer.yaml
# - scripts/**
# - share/**
# - zinit*.zsh
# push:
# branches:
# - main
# workflow_dispatch:
# jobs:
# zinit-installer:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# annexes: ["with annexes", "no annexes"]
# os: [macos-latest, ubuntu-latest, windows-latest]
# steps:
# - name: check out repository
# uses: actions/checkout@v3
# - name: windows dependencies
# if: runner.os == 'Windows'
# uses: egor-tensin/setup-cygwin@v3
# with:
# platform: x64
# packages: curl git zsh
# - name: remove \r
# if: runner.os == 'Windows'
# run: sed -i 's/\r$//' scripts/*.sh
# - name: linux/macos dependencies
# if: runner.os != 'Windows'
# run: brew install --force curl subversion unzip xz zsh
# - name: install
# run: ./scripts/install.sh
# - name: verify install
# run: zsh -silc 'zinit --help'

View file

@ -1,19 +0,0 @@
name: label
on:
pull_request_target: # https://securitylab.github.com/research/github-actions-preventing-pwn-requests
jobs:
label-pull-requests:
name: "pull requests"
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v7
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

View file

@ -1,82 +0,0 @@
name: lint
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
jobs:
commit:
name: "commit convention"
uses: zdharma-continuum/.github/.github/workflows/commit-job.yml@main
mdlint:
name: markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: xt0rted/markdownlint-problem-matcher@v3
- run: npm install -g markdownlint-cli@0.44.0
# disabled checks:
# 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
# List files to lint
ls *.md **/*.md
markdownlint \
--disable MD013 MD024 MD029 MD033 MD034 MD036 MD041 MD059 MD060 \
--ignore '**/CHANGELOG.md' \
-- *.md **/*.md
zshlint:
name: zsh
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [noexec, zcompile]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes zsh
- name: "run lint (${{ matrix.task }})"
run: |
case "${{ matrix.task }}" in
noexec)
find . -name '*.zsh' -type f -print0 \
| xargs -0 -n1 -P4 zsh -n
;;
zcompile)
find . -name '*.zsh' -type f \
-exec zsh -fc "zcompile {}" \;
;;
*)
echo "ERROR: unknown task ${{ matrix.task }}" >&2
exit 1
;;
esac

View file

@ -1,32 +0,0 @@
name: Release
on:
workflow_dispatch:
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '20'
- name: Fetch dependencies
run: |
npm install --no-package-lock \
@semantic-release/changelog @semantic-release-plus/docker @semantic-release/exec @semantic-release/git \
conventional-changelog-eslint @google/semantic-release-replace-plugin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Generate release
run: npx semantic-release --ci --
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_EMAIL: 'mvdoster@gmail.com'
GIT_AUTHOR_NAME: 'Vladislav Doster'
GIT_COMMITTER_EMAIL: 'mvdoster@gmail.com'
GIT_COMMITTER_NAME: 'Vladislav Doster'

View file

@ -1,105 +0,0 @@
name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 0
HOMEBREW_NO_REQUIRE_TAP_TRUST: 1
TERM: xterm-256color
# TERM: dumb
on:
pull_request:
branches:
- main
paths:
- "tests/**"
- "share/**"
- "zinit*.zsh"
- ".github/workflows/tests.yaml"
push:
branches:
- main
workflow_dispatch:
jobs:
zunit-tests:
name: "${{ matrix.zunit_test }} | ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
zunit_test:
- annexes
- commands
- compile
- config-zstyle
- gh-r
- hook-handler
- ice-validation
- ices
- plugins
- snippets
os: [macos, ubuntu]
include:
- zunit_test: gh-r
zunit_flag: --slice
- zunit_test: plugins
zunit_flag: --slice
steps:
- name: "checkout ${{ github.repository }}"
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: "install homebrew"
id: setup-homebrew
uses: Homebrew/actions/setup-homebrew@f8d4222eb633e65c2a0157383cf80861fc7fae7f
- name: "install ${{ runner.os }} dependencies"
if: runner.os == 'Linux'
run: |
sudo apt-get update --yes
sudo apt-get install --no-install-recommends --yes \
autoconf automake autotools-dev \
build-essential byacc \
file \
gcc gettext glibc-source grep \
libc6 libc6-dev libevent-dev libncurses5-dev libncursesw5-dev libtool libuvc0 lua5.1 \
m4 \
ninja-build \
pkg-config \
xz-utils \
zsh \
zstd
- name: "install dependencies via brew"
id: install-deps
run: |
brew install --quiet --force --overwrite autoconf automake binutils byacc coreutils curl gettext gnu-sed jemalloc libevent libtool libuv lua lua@5.4 make ninja parallel pkg-config texinfo unzip xz zsh zstd
brew unlink ncurses && brew link --force ncurses
- name: "checkout zdharma-continuum/zunit"
uses: actions/checkout@v7
with:
repository: "zdharma-continuum/zunit"
path: zunit
ref: "feat/run-tests-in-parallel-support"
- name: "install zunit"
id: install-zunit
shell: zsh {0}
working-directory: zunit
run: |
mkdir -p "${HOME}/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
./configure --prefix=${HOME}/.local
make all install
- name: "run ${{ matrix.zunit_test }} tests"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: zunit run ${{ matrix.zunit_flag }} tests/${{ matrix.zunit_test }}.zunit

24
.gitignore vendored
View file

@ -1,24 +0,0 @@
*.[aos]
*.bundle
*.dll
*.orig
*.txt
*.zini
*.zwc
*deploy*key*
*~
.*.sw?
.project
TAGS
TODO*
\#*
doc/zsdoc/data
other
site*/
tags
test/
txt/
zmodules/
tests/_output/
tests/_support/tmp*
.idea

View file

@ -1,47 +0,0 @@
{
"repositoryUrl": "https://github.com/zdharma-continuum/zinit.git",
"branches": [
"main"
],
"plugins": [
[ "@semantic-release/commit-analyzer", { } ],
[
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": [
"VERSION"
],
"from": "^([0-9]).+([0-9]).+([0-9])$",
"to": "${nextRelease.version}",
"results": [
{
"file": "VERSION",
"hasChanged": true
}
]
}
]
}
],
[ "@semantic-release/release-notes-generator", { } ],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"VERSION"
],
"message": "release: v${lastRelease.version} → v${nextRelease.version}\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}

View file

@ -1,14 +0,0 @@
allow_risky: false
directories:
output: tests/_output
support: tests/_support
tests: tests
fail_fast: false
# Both parallel keys stay false, and the flags stay on the command line.
# zunit's config booleans are one-way -- there is no --no-parallel or
# --no-verbose -- so a `true' here could never be turned off again, not even
# for `zunit run tests/commands.zunit@"help"'. parallel_slice additionally
# implies parallel, and only does anything for a run that queues one file.
parallel: false
parallel_slice: false
verbose: false

View file

@ -1,278 +0,0 @@
# [3.17.0](https://github.com/zdharma-continuum/zinit/compare/v3.16.0...v3.17.0) (2026-09-02)
### Features
* **ziextract:** support zst archive format ([b8855c7](https://github.com/zdharma-continuum/zinit/commit/b8855c7887e26f79934b6122232b141cdd3106bf))
# [3.16.0](https://github.com/zdharma-continuum/zinit/compare/v3.15.3...v3.16.0) (2026-08-31)
### Bug Fixes
* **self-update:** honor -q in changelog display ([a85e9dc](https://github.com/zdharma-continuum/zinit/commit/a85e9dcc3ee2beebf3947ef6091ccd540d94f6f3))
### Features
* **self-update:** support -n/--no-pager ([cc3baf3](https://github.com/zdharma-continuum/zinit/commit/cc3baf395fa51de11e7d76b11104e36d8d142601)), closes [#632](https://github.com/zdharma-continuum/zinit/issues/632)
## [3.15.3](https://github.com/zdharma-continuum/zinit/compare/v3.15.2...v3.15.3) (2026-08-28)
### Bug Fixes
* **install:** retry and auth github api downloads ([eaa1056](https://github.com/zdharma-continuum/zinit/commit/eaa10566992e8371a27fbb1300e6fdc2e4161f17)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
## [3.15.2](https://github.com/zdharma-continuum/zinit/compare/v3.15.1...v3.15.2) (2026-08-28)
### Bug Fixes
* **install:** treat non-archive single file gracefully in ziextract. ([981cb15](https://github.com/zdharma-continuum/zinit/commit/981cb1582ece95dfad9d6c53d34a601f6b25391f)), closes [#771](https://github.com/zdharma-continuum/zinit/issues/771) [#r](https://github.com/zdharma-continuum/zinit/issues/r) [Pre-#771](https://github.com/Pre-/issues/771)
## [3.15.1](https://github.com/zdharma-continuum/zinit/compare/v3.15.0...v3.15.1) (2026-08-27)
### Bug Fixes
* **ices:** expand the atinit'!' ice correctly ([ed80701](https://github.com/zdharma-continuum/zinit/commit/ed807014262aca939d24d9e0e9356aa64ad5ae73))
* **ices:** restore $OLDPWD around plugin directory hooks ([712cac1](https://github.com/zdharma-continuum/zinit/commit/712cac1952fb4d35861082748068ae33c757f125))
* **ices:** restore cwd even when the ice body cds ([264526a](https://github.com/zdharma-continuum/zinit/commit/264526ab26715e54fdc7fa36d5b23b881459e19f))
* **install:** restore cwd after the configure hook ([d875651](https://github.com/zdharma-continuum/zinit/commit/d875651d5986f42b6ba8b37ca07f66d45d083749))
* **install:** restore cwd on early atclone return ([736403c](https://github.com/zdharma-continuum/zinit/commit/736403cb39e66ec7da7c4c373fdb99961bde5a83))
# [3.15.0](https://github.com/zdharma-continuum/zinit/compare/v3.14.0...v3.15.0) (2026-07-01)
### Bug Fixes
* .zi-check-for-git-changes runs git fetch before checking for changes ([1107460](https://github.com/zdharma-continuum/zinit/commit/1107460bcd533c1a9003d1cf3db2918425f11c4a))
* add markdownlint exceptions to linting ([507b4e5](https://github.com/zdharma-continuum/zinit/commit/507b4e5722ecfde21c42cc4e6502b0049e3ef192))
* avoid apostrophe that breaks typeset -f round-trip of :zinit-tmp-subst-autoload ([#783](https://github.com/zdharma-continuum/zinit/issues/783)) ([d2d4237](https://github.com/zdharma-continuum/zinit/commit/d2d4237715081ea138eb1a9d4a7d1634eec7a36e))
* correct SSH URL format for private repos ([#721](https://github.com/zdharma-continuum/zinit/issues/721)) ([991e4a8](https://github.com/zdharma-continuum/zinit/commit/991e4a816efc426bb1c2c0b13a01acff298b8005))
* corrected print-out message in self-update routine ([bb37f3b](https://github.com/zdharma-continuum/zinit/commit/bb37f3bbd829485b006ef95ca24edbb462347731))
* impl gh-r version detection using GitHub API ([#731](https://github.com/zdharma-continuum/zinit/issues/731)) ([f1e503d](https://github.com/zdharma-continuum/zinit/commit/f1e503dc3b6ac689331180e577b4e7da79e17b02)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* prevent "permission denied" errors from empty hook handlers ([#729](https://github.com/zdharma-continuum/zinit/issues/729)) ([2167408](https://github.com/zdharma-continuum/zinit/commit/2167408db27720031983d1067c156837cf522ff3))
* prevent double extraction when exclamation mark modifier is used in extract'!' ([4fd38b3](https://github.com/zdharma-continuum/zinit/commit/4fd38b34e76fb97fb20d2345256e80526a4921c8)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r) [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* remove `local -A OPTS` that shadows caller's parallel flag ([#774](https://github.com/zdharma-continuum/zinit/issues/774)) ([e88ed77](https://github.com/zdharma-continuum/zinit/commit/e88ed77319c9a2e0187b964f9ad99f17a33d5999))
* resolve a bug where the `-q` option for quiet mode was never dispatched ([6cf2f29](https://github.com/zdharma-continuum/zinit/commit/6cf2f2990d45d72f58d88433c9831b2ea64e8d76))
* resolve a second issue where `git -C <path>` had to be used instead of `git --work-tree <path>` ([2e83176](https://github.com/zdharma-continuum/zinit/commit/2e83176b23d7be5db48c8bfcdea67197692d2569))
* resolves a bug with github action trying to push updated docs back to external forks ([#763](https://github.com/zdharma-continuum/zinit/issues/763)) ([34a1811](https://github.com/zdharma-continuum/zinit/commit/34a18112e8866a7a7570b0ee1da44298677cc8d2))
* silenced `zinit self-update` when in quiet mode (`-q`) ([8d154b0](https://github.com/zdharma-continuum/zinit/commit/8d154b0609e1dbb0387fb15cd93507c794ee9ec2))
* trust archive permissions instead of `file(1)` heuristics in `ziextract` ([#771](https://github.com/zdharma-continuum/zinit/issues/771)) ([1334994](https://github.com/zdharma-continuum/zinit/commit/1334994f20d58e7279d308401dea2b680c0cade1))
* update `git-chglog` to `git-cliff` in gh-r tests ([18fc2cc](https://github.com/zdharma-continuum/zinit/commit/18fc2cc5b903450d17f340898e4abbbb48ad975c)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
* Update various tools in gh-r tests ([#759](https://github.com/zdharma-continuum/zinit/issues/759)) ([01eb65f](https://github.com/zdharma-continuum/zinit/commit/01eb65f8cea521779dd0eb23ac1d92239e36d8d6)), closes [#r](https://github.com/zdharma-continuum/zinit/issues/r)
### Features
* validate ice arguments ([#778](https://github.com/zdharma-continuum/zinit/issues/778)) ([424b241](https://github.com/zdharma-continuum/zinit/commit/424b241bc7112bde7bfb906f8726b43bed0ecd1f))
* **zsh:** allow configuring settings like HOME_DIR/BIN_DIR via zstyle ([8f89f88](https://github.com/zdharma-continuum/zinit/commit/8f89f88cfdda42afbf5e1f7a3f2d510caff7354d))
## [3.13.1](https://github.com/zdharma-continuum/zinit/compare/v3.13.0...v3.13.1) (2024-01-22)
### Bug Fixes
* `plugins` command correctly handles keyword argument ([#626](https://github.com/zdharma-continuum/zinit/issues/626)) ([f26d387](https://github.com/zdharma-continuum/zinit/commit/f26d387e51c9103f2ba7142a8c1a25ba1d62e065))
# [3.13.0](https://github.com/zdharma-continuum/zinit/compare/v3.12.1...v3.13.0) (2024-01-18)
### Bug Fixes
* **ci:** remove duplicate gh-r zunit job ([#623](https://github.com/zdharma-continuum/zinit/issues/623)) ([70cefc0](https://github.com/zdharma-continuum/zinit/commit/70cefc086a8b2277476e7f4fa3e00e0f7d4fd4cf))
* debug logging logic and format ([#592](https://github.com/zdharma-continuum/zinit/issues/592)) ([3c7e5be](https://github.com/zdharma-continuum/zinit/commit/3c7e5be07d79b8f1a7fbd5dfd150a09a6309e461))
* handle zinit --help ([#597](https://github.com/zdharma-continuum/zinit/issues/597)) ([8cf9104](https://github.com/zdharma-continuum/zinit/commit/8cf9104ac08da3f7f108a32e0a3b117e22681d46))
* link ice check in .zinit-download-snippet function ([#608](https://github.com/zdharma-continuum/zinit/issues/608)) ([358ef03](https://github.com/zdharma-continuum/zinit/commit/358ef03785a18e694e94fd4560e0582c4024bcc3))
* pin dua gh-r test to v2.20.3 ([#605](https://github.com/zdharma-continuum/zinit/issues/605)) ([0ba778a](https://github.com/zdharma-continuum/zinit/commit/0ba778ac734e33c960fe08bbd56a351b1b86dcd4))
* silence unzip command in ziextract ([#614](https://github.com/zdharma-continuum/zinit/issues/614)) ([71764bf](https://github.com/zdharma-continuum/zinit/commit/71764bf2caa553f52435ed374bb48b74b0a8ad96))
* tar permissions when `ziextract` ran as root user ([#557](https://github.com/zdharma-continuum/zinit/issues/557)) ([e2d477c](https://github.com/zdharma-continuum/zinit/commit/e2d477cde4e87d13ebc6b99e7f95022f75ca075e))
* update labeler config to v5 ([#604](https://github.com/zdharma-continuum/zinit/issues/604)) ([794723c](https://github.com/zdharma-continuum/zinit/commit/794723cc4829e0f9293fc441100913ac7f02566a))
### Features
* configure, make, cmake, and build ices ([#613](https://github.com/zdharma-continuum/zinit/issues/613)) ([#616](https://github.com/zdharma-continuum/zinit/issues/616)) ([22e66db](https://github.com/zdharma-continuum/zinit/commit/22e66db478716005d6fec52cd412fad3fc94a9a2))
* **delete:** fix unsetting plugin state & add `--debug` / `--quiet` flags ([#622](https://github.com/zdharma-continuum/zinit/issues/622)) ([3f4b685](https://github.com/zdharma-continuum/zinit/commit/3f4b68562265e6b06f55124e34fab0fe58c53adf))
* remove zpextract and use ziextract ([#611](https://github.com/zdharma-continuum/zinit/issues/611)) ([2ccac85](https://github.com/zdharma-continuum/zinit/commit/2ccac85e376965a6e6d9fe1dc3f1470b706e9fac))
## [3.12.1](https://github.com/zdharma-continuum/zinit/compare/v3.12.0...v3.12.1) (2023-11-20)
### Bug Fixes
* container zshelldoc install ([#591](https://github.com/zdharma-continuum/zinit/issues/591)) ([8170753](https://github.com/zdharma-continuum/zinit/commit/8170753a5d21f2e54ba30901cdb0afb6399a7b51))
* from'gh-r' skips compile by default ([#590](https://github.com/zdharma-continuum/zinit/issues/590)) ([1f52eee](https://github.com/zdharma-continuum/zinit/commit/1f52eee1b1ef4a76b779d2017f2e7d2151516544))
* respect delete flags after positional arguments ([#587](https://github.com/zdharma-continuum/zinit/issues/587)) ([e18f9a7](https://github.com/zdharma-continuum/zinit/commit/e18f9a7da273fa44079b16a90e89df76664fcbee))
* set home dir to test env in gh-r tests ([#582](https://github.com/zdharma-continuum/zinit/issues/582)) ([9b33288](https://github.com/zdharma-continuum/zinit/commit/9b33288b4aa88a1d41786eacfe31eb966b6c0455))
* use $MACHTYPE instead of arch command ([#588](https://github.com/zdharma-continuum/zinit/issues/588)) ([bcf70e8](https://github.com/zdharma-continuum/zinit/commit/bcf70e8268dd09737d262919dcba0ff3301a705d))
# [3.12.0](https://github.com/zdharma-continuum/zinit/compare/v3.11.0...v3.12.0) (2023-08-30)
### Bug Fixes
* build container for tagged releases ([f933dc0](https://github.com/zdharma-continuum/zinit/commit/f933dc028e9968ed434c21775c2bfc85a722ee04))
* gh-r linux regex & gh-r zunit tests ([#564](https://github.com/zdharma-continuum/zinit/issues/564)) ([207ab9f](https://github.com/zdharma-continuum/zinit/commit/207ab9f281214bc07da82e7e542126745bf878dd))
* gh-r zunit tests ([#561](https://github.com/zdharma-continuum/zinit/issues/561)) ([97b087e](https://github.com/zdharma-continuum/zinit/commit/97b087e68ae0c87cc31bcc9172cedf1cf5fcab68))
* Ignore .yaml and .py files when installing completions ([#528](https://github.com/zdharma-continuum/zinit/issues/528)) ([113cfc4](https://github.com/zdharma-continuum/zinit/commit/113cfc47fb6ec1ed753222b7ba4542ef48ca2fde))
* jq has moved from stedolan/jq to jqlang/jq ([#530](https://github.com/zdharma-continuum/zinit/issues/530)) ([de85908](https://github.com/zdharma-continuum/zinit/commit/de85908f8d0b89ff6327adfa285ca5a0c4302f2d))
* math expression in plugins command ([#559](https://github.com/zdharma-continuum/zinit/issues/559)) ([68a6b42](https://github.com/zdharma-continuum/zinit/commit/68a6b42caf224b2ca2c172d58daf9faf5c86beb9))
* pin fclones version to v0.31.0 ([497d519](https://github.com/zdharma-continuum/zinit/commit/497d519d99c3d3cdb8e71dfdf4583cadef9220a0))
* quote parens so that they aren't used as globs ([#549](https://github.com/zdharma-continuum/zinit/issues/549)) ([1375adf](https://github.com/zdharma-continuum/zinit/commit/1375adf8f8edadbdcfc18445d852c7f08e723887))
* self-update check for updates ([#562](https://github.com/zdharma-continuum/zinit/issues/562)) ([b456a2d](https://github.com/zdharma-continuum/zinit/commit/b456a2dba65673f4cf5a9a8c2bc16d7d0dcb3ace))
* update gomi repo owner ([#568](https://github.com/zdharma-continuum/zinit/issues/568)) ([19ca2dc](https://github.com/zdharma-continuum/zinit/commit/19ca2dc361f9995a3e6a8a8aed0ade435168cd3d))
### Features
* build container with zsh 5.9 ([#525](https://github.com/zdharma-continuum/zinit/issues/525)) ([238e843](https://github.com/zdharma-continuum/zinit/commit/238e843d60de27b8f3deaf2d0b5e6657b293c9eb))
# [3.11.0](https://github.com/zdharma-continuum/zinit/compare/v3.10.0...v3.11.0) (2023-05-04)
### Bug Fixes
* add `.gitignore` with '*' pattern in a plugins `._zinit/` directory ([#397](https://github.com/zdharma-continuum/zinit/issues/397)) ([fccb508](https://github.com/zdharma-continuum/zinit/commit/fccb5080ab4b1df83f01906082eea444f218776f)), closes [#395](https://github.com/zdharma-continuum/zinit/issues/395)
* broken update command ([336ca85](https://github.com/zdharma-continuum/zinit/commit/336ca85ade5d4c5c99bd903610baf9961753192b))
* cleanup style, naming, and completion ([6c82d67](https://github.com/zdharma-continuum/zinit/commit/6c82d6788dec6a60c4c217d03c45c327bc0e59a1))
* compile and completion log messages ([c4446da](https://github.com/zdharma-continuum/zinit/commit/c4446da57e5375f4a89ea94e1e8c04eacfc4e494))
* csearch ignores lua files ([4d1840b](https://github.com/zdharma-continuum/zinit/commit/4d1840b883e86cc46df2050c01bd0731e29023aa))
* makefile clean target less verbose ([3396f5e](https://github.com/zdharma-continuum/zinit/commit/3396f5e3aa1fb81d128d4f34b9ff868011d68981))
* pin git-mkver gh-r test to v.1.2.2 ([a05cc1a](https://github.com/zdharma-continuum/zinit/commit/a05cc1ab59db5b82c5a0f7ee0b6bbef84f0e8b0e))
* pin git-mkver unit test to v1.2.2 ([08f02e0](https://github.com/zdharma-continuum/zinit/commit/08f02e00d0fbc86b10d44d18f5b774c9c00806cc))
* regenerate docs ([e0177e2](https://github.com/zdharma-continuum/zinit/commit/e0177e20382d8336d55bc2637a6f2c515d25ce19))
### Features
* expand gh-r zunit tests ([c323116](https://github.com/zdharma-continuum/zinit/commit/c3231164836c8ca3ca9ebded8d95c31c0a186567))
* refactor debug commands ([930b25e](https://github.com/zdharma-continuum/zinit/commit/930b25ee3c6cc66931eda0030c422fddd69ef9c4))
* refactor ls, list, and loaded commands ([a865907](https://github.com/zdharma-continuum/zinit/commit/a86590762ac2bb5244db5d3cd7d99d32a9dc11fe))
# [3.10.0](https://github.com/zdharma-continuum/zinit/compare/v3.9.0...v3.10.0) (2023-04-02)
### Bug Fixes
* absolute path support in the symbol browser ([d29a8ba](https://github.com/zdharma-continuum/zinit/commit/d29a8ba2b757b936663c16d12e46d3638f44027a))
* assign to functions hash to make %x work ([bd65a01](https://github.com/zdharma-continuum/zinit/commit/bd65a017345ac891b6b14eb5feb4182bc9c74ace))
* broken symbolic link after `creinstall .` ([da0d6b7](https://github.com/zdharma-continuum/zinit/commit/da0d6b712c6466d11165ac9e27a6cd7de856e537))
* bump node version in release workflow ([938f483](https://github.com/zdharma-continuum/zinit/commit/938f48375b20545078b63d6c1dba0a905599afe4))
* change prefix `~zi::` to `__zi::` ([0e45493](https://github.com/zdharma-continuum/zinit/commit/0e45493e36ff350c79c164895bd4718103e2cf7a))
* container build & shell make targets ([a72fb83](https://github.com/zdharma-continuum/zinit/commit/a72fb83f0999a7fa4a26c6e1bb71d6cab3858b4f))
* container build & shell make targets ([14b2cda](https://github.com/zdharma-continuum/zinit/commit/14b2cda0397c343b1bfdc041cba7c4ab216e3803))
* container build & shell make targets ([370808d](https://github.com/zdharma-continuum/zinit/commit/370808dd5186f4b9c8a214e7ef6f4350df243b5b))
* container build & shell make targets ([47bd74f](https://github.com/zdharma-continuum/zinit/commit/47bd74f8a7c74761e9b03943d3c40fc523df585f))
* container build & shell make targets ([f8eb967](https://github.com/zdharma-continuum/zinit/commit/f8eb967b0e98f135b43cb5065aceb8a4f058aa09))
* container build & shell make targets ([3af321e](https://github.com/zdharma-continuum/zinit/commit/3af321e8e4975a07634df08acda383e4cf53e99c))
* do not run `make docs` ([3802893](https://github.com/zdharma-continuum/zinit/commit/3802893c74988fc03bad086601c905a1046a9fc1))
* failing zunit tests & bootstrap script ([d618467](https://github.com/zdharma-continuum/zinit/commit/d618467ff090a6dbfb327ca0a29141d0c9312b24))
* file modelines ([75bb735](https://github.com/zdharma-continuum/zinit/commit/75bb73547ed24ab6d25e1aed03684caebba39f5e))
* gh-r & bpick ice log format and content ([ad88a89](https://github.com/zdharma-continuum/zinit/commit/ad88a890ad25505acb764f9551ee00d5264daa9a))
* gh-r parsing logic for arm64 & logging style ([7e48651](https://github.com/zdharma-continuum/zinit/commit/7e486519d7aad48a8b6009ae5075f0efec2409f9))
* gh-r pattern for 64bit linux-gnu systems ([b5a31c0](https://github.com/zdharma-continuum/zinit/commit/b5a31c07f2bd2d823ce9e99b98228ec68db523bd))
* lsd repo owner changed to lsd-rs organization ([#489](https://github.com/zdharma-continuum/zinit/issues/489)) ([824d9d3](https://github.com/zdharma-continuum/zinit/commit/824d9d36177dac00a81333205e2b3dfbc35cb758))
* make gh-r release search case-insensitive ([3eb75b7](https://github.com/zdharma-continuum/zinit/commit/3eb75b7ee9db4dd01455811cf4ca4539dd07246b))
* make target docker cmd flags ([dd04896](https://github.com/zdharma-continuum/zinit/commit/dd048964491b9a63f4622b591b9a227d5e981408))
* pin `ggsrun` version in gh-r z-unit test ([9f67798](https://github.com/zdharma-continuum/zinit/commit/9f677989e8386469bc2d5dcb0d2cb5d62d489e34))
* the starship example does not work properly ([4933b62](https://github.com/zdharma-continuum/zinit/commit/4933b62f400a1b6b29b82a9ff233911b336a33c5))
* update pygmentize flags in glance subcommand ([#488](https://github.com/zdharma-continuum/zinit/issues/488)) ([b773763](https://github.com/zdharma-continuum/zinit/commit/b773763bdc37d414a5d954ccb00877374177f0ec))
* use correct return code in zinit-confirm ([d467738](https://github.com/zdharma-continuum/zinit/commit/d467738c1b1c834e938b4b4bb6e83cab5bfdc429))
* vim modelines & zsdoc pdf rendering ([2b460a7](https://github.com/zdharma-continuum/zinit/commit/2b460a74f236178cd8d06b55069049381d79256e))
### Features
* delete subcommand refactor ([9eee215](https://github.com/zdharma-continuum/zinit/commit/9eee215e3f8ee7d8404e4e54f8ef57a57a21fde2)), closes [#57](https://github.com/zdharma-continuum/zinit/issues/57) [#239](https://github.com/zdharma-continuum/zinit/issues/239)
* zinit completion improvements ([b8d12e5](https://github.com/zdharma-continuum/zinit/commit/b8d12e555d4cadff7769ef67c5d4c0d403f0b11e))
### Reverts
* "Merge branch 'refactor/zinit-function-names' into main" ([515688b](https://github.com/zdharma-continuum/zinit/commit/515688bc976e793422d21ba9debfdd1a982c611e))
# [3.9.0](https://github.com/zdharma-continuum/zinit/compare/v3.8.0...v3.9.0) (2022-12-17)
### Bug Fixes
* remove broken gh-r zunit test for "warp" ([#430](https://github.com/zdharma-continuum/zinit/issues/430)) ([64fa4ae](https://github.com/zdharma-continuum/zinit/commit/64fa4aef3ae517afe5444b24df9603e9d1a77a55))
### Features
* add `completions` ice ([#417](https://github.com/zdharma-continuum/zinit/issues/417)) ([59975d7](https://github.com/zdharma-continuum/zinit/commit/59975d70d7101651b0bb01f4e22c23db0dae8133))
* display version via `version` sub command ([bfb01e6](https://github.com/zdharma-continuum/zinit/commit/bfb01e65d7b9a98c643f3ee0a92f2df06372f52e))
### Performance Improvements
* reduce scheduler task check to 10 second interval ([#429](https://github.com/zdharma-continuum/zinit/issues/429)) ([1681ce4](https://github.com/zdharma-continuum/zinit/commit/1681ce40ebf98e5bf48b78ac5d6c060c1ecada99))
### Reverts
* "perf: reduce scheduler task check to 10 second interval ([#429](https://github.com/zdharma-continuum/zinit/issues/429))" ([#432](https://github.com/zdharma-continuum/zinit/issues/432)) ([cfd3261](https://github.com/zdharma-continuum/zinit/commit/cfd32618921ce0626a6deadc794da962750a845d))
# [3.8.0](https://github.com/zdharma-continuum/zinit/compare/v3.7.0...v3.8.0) (2022-11-07)
### Bug Fixes
* account for systems where musl is present ([#269](https://github.com/zdharma-continuum/zinit/issues/269)) ([8620574](https://github.com/zdharma-continuum/zinit/commit/8620574a5533695525260fd88df8d249c701217f))
* alist repository for gh-r test ([#305](https://github.com/zdharma-continuum/zinit/issues/305)) ([fb3c082](https://github.com/zdharma-continuum/zinit/commit/fb3c082551ee9f48676c3183d5a4e9e842d3d874))
* allow zinit to be run from non-interactive scripts ([#227](https://github.com/zdharma-continuum/zinit/issues/227)) ([c3d1bb5](https://github.com/zdharma-continuum/zinit/commit/c3d1bb586c77a98566c552358fd9aee084e30da8)), closes [#199](https://github.com/zdharma-continuum/zinit/issues/199)
* broken yaml syntax in issue template ([#355](https://github.com/zdharma-continuum/zinit/issues/355)) ([f729e06](https://github.com/zdharma-continuum/zinit/commit/f729e065db88a5cd0daa8a6f2bd2f8ee0439545a))
* calico gh-r zunit test ([#356](https://github.com/zdharma-continuum/zinit/issues/356)) ([56fb9e0](https://github.com/zdharma-continuum/zinit/commit/56fb9e0b1df21de809a2efc935882b49e9161618))
* change ctags symbols browser key binding from `ctrl-k` to `alt-Q` ([#387](https://github.com/zdharma-continuum/zinit/issues/387)) ([7f6dc7d](https://github.com/zdharma-continuum/zinit/commit/7f6dc7da6c824b30c0e8e30ae0ecbda5be118e68)), closes [#386](https://github.com/zdharma-continuum/zinit/issues/386)
* Do not try to escape exclamation marks ([#399](https://github.com/zdharma-continuum/zinit/issues/399)) ([0e55b2e](https://github.com/zdharma-continuum/zinit/commit/0e55b2ea673915c462af752ee7d46fff55e6f436))
* docs workflow should fail if out-of-date ([#278](https://github.com/zdharma-continuum/zinit/issues/278)) ([07cde66](https://github.com/zdharma-continuum/zinit/commit/07cde660081c91382ce73b60485839710154c7c6))
* Don't error if $OPTS is not yet defined in .zinit-compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e))
* filter by runtime detected CPU before compiled CPU ([#304](https://github.com/zdharma-continuum/zinit/issues/304)) ([a4dc13f](https://github.com/zdharma-continuum/zinit/commit/a4dc13f66a65c4fa52953104c13e44a7d7c0a945)), closes [#287](https://github.com/zdharma-continuum/zinit/issues/287)
* gh-r & plugin zunit tests ([dd12fce](https://github.com/zdharma-continuum/zinit/commit/dd12fce3f49db284de7cf18a03ef891cc46bc7cc))
* gh-r filters i686 (32 bit) for x86_64 ([#226](https://github.com/zdharma-continuum/zinit/issues/226)) ([57f0d82](https://github.com/zdharma-continuum/zinit/commit/57f0d82118ed626f04d4b9b8b26de48c9d7e0956)), closes [#225](https://github.com/zdharma-continuum/zinit/issues/225)
* gh-r logic ignores [36]86 assets ([#235](https://github.com/zdharma-continuum/zinit/issues/235)) ([d60638f](https://github.com/zdharma-continuum/zinit/commit/d60638f2217875056a061b3411c4bcc678dce5f6)), closes [#225](https://github.com/zdharma-continuum/zinit/issues/225) [#246](https://github.com/zdharma-continuum/zinit/issues/246) [#247](https://github.com/zdharma-continuum/zinit/issues/247)
* gh-r removes linux32 assets on 64 bit OS ([1864c0b](https://github.com/zdharma-continuum/zinit/commit/1864c0be09faa0e4d9a7c549cafed7d296d7517e))
* gh-r retrieves release data GH REST API ([#373](https://github.com/zdharma-continuum/zinit/issues/373)) ([4a2a120](https://github.com/zdharma-continuum/zinit/commit/4a2a120b341793b1abaef5f12fbb4808277d8570)), closes [#374](https://github.com/zdharma-continuum/zinit/issues/374)
* modify regex in gh-r for assets to not consider for selection ([#244](https://github.com/zdharma-continuum/zinit/issues/244)) ([6ef8439](https://github.com/zdharma-continuum/zinit/commit/6ef84398b2c92073d88f440dfbfd554cb8e75343))
* more cleaning up urls ([672ae51](https://github.com/zdharma-continuum/zinit/commit/672ae514142b433708ea10486556fe3f0ba54e3e)), closes [#47](https://github.com/zdharma-continuum/zinit/issues/47)
* names of ctag Make target deps ([#407](https://github.com/zdharma-continuum/zinit/issues/407)) ([9987d5c](https://github.com/zdharma-continuum/zinit/commit/9987d5c781d4a95698ed649dc59b11c34006b1c1))
* package are broken again ([24f10f6](https://github.com/zdharma-continuum/zinit/commit/24f10f6367cbab6039bd0c1ca07dd9449bbc3557))
* permissions for PR labeler GH action workflow ([#236](https://github.com/zdharma-continuum/zinit/issues/236)) ([8a0d567](https://github.com/zdharma-continuum/zinit/commit/8a0d5678d1ee0eeed91d2c3a094578a2cd39ba04))
* read without -r is generally bad. ([00c70a4](https://github.com/zdharma-continuum/zinit/commit/00c70a434d50a1591bcdc73185150b2fdce96c77))
* remove curl option "--tcp-fastopen" which is not always available ([#299](https://github.com/zdharma-continuum/zinit/issues/299)) ([308c9d4](https://github.com/zdharma-continuum/zinit/commit/308c9d4cd82f3e41d2ae21ff31fba0dc4a7c6cb5))
* remove macOS 10.5 & 11 from test matrix ([c613193](https://github.com/zdharma-continuum/zinit/commit/c61319378df5b0deae68fc467b9a2449fcf67336))
* remove use less line ([4f87076](https://github.com/zdharma-continuum/zinit/commit/4f870766011d36c871d8afd07afe56733c8de76d))
* rename `docs` to `doc` to match doc dir ([#212](https://github.com/zdharma-continuum/zinit/issues/212)) ([3a7dc95](https://github.com/zdharma-continuum/zinit/commit/3a7dc95f02340fb56693ca0f304e31be8c8a9652))
* rm linux32 assets in aarch64/arm64 gh-r regex ([#414](https://github.com/zdharma-continuum/zinit/issues/414)) ([529aa20](https://github.com/zdharma-continuum/zinit/commit/529aa20f42a249f609b9e8248d6fd00d609a35ce))
* syntax error when checking for `realpath` command ([#259](https://github.com/zdharma-continuum/zinit/issues/259)) ([05559eb](https://github.com/zdharma-continuum/zinit/commit/05559ebdbcda77622daaf3935d20fdf9b9c09c6c)), closes [#257](https://github.com/zdharma-continuum/zinit/issues/257)
* trigger for PR labeler GH action workflow ([#237](https://github.com/zdharma-continuum/zinit/issues/237)) ([49af866](https://github.com/zdharma-continuum/zinit/commit/49af86688bc8c5882744a679f9c0094e2f4c7fa6))
* typo & triggers in documentation workflow ([#308](https://github.com/zdharma-continuum/zinit/issues/308)) ([161d7c1](https://github.com/zdharma-continuum/zinit/commit/161d7c1ee1fc2bbb43442cd90b48e502bf62603f))
* unmatched "(" in windows gh-r patterns ([#280](https://github.com/zdharma-continuum/zinit/issues/280)) ([1f4ba5a](https://github.com/zdharma-continuum/zinit/commit/1f4ba5ae0ccf928d1914dc3a11d00393e0fd94a8))
* update `zdharma` to `zdharma-continuum` ([66b1700](https://github.com/zdharma-continuum/zinit/commit/66b17007523321f9afee91dbe75b487de5db4fec))
* update docs for new jq-check ([6207427](https://github.com/zdharma-continuum/zinit/commit/62074272563f88a32a701f56f914297930a9da19))
* use [*] inside arbitrary strings. ([73a8c92](https://github.com/zdharma-continuum/zinit/commit/73a8c92d43f57bca514e44b9fed14e941168c61f))
* workflow pkg mgmt due to base OS changes ([195f72d](https://github.com/zdharma-continuum/zinit/commit/195f72d54b80051fc71d1f73909f5dabe6745649))
* ziextract execs discovery regex ([#410](https://github.com/zdharma-continuum/zinit/issues/410)) ([105b38a](https://github.com/zdharma-continuum/zinit/commit/105b38a195e2a67eaba9d7a69bcef7738c57d12d))
* zunit install in GH workflow ([#412](https://github.com/zdharma-continuum/zinit/issues/412)) ([f4787dc](https://github.com/zdharma-continuum/zinit/commit/f4787dcac803ed9055c4032c516dba66737beebf))
### Features
* ability to set program for `zinit ls` to use ([#221](https://github.com/zdharma-continuum/zinit/issues/221)) ([bad7af3](https://github.com/zdharma-continuum/zinit/commit/bad7af3ae2d8aab18feb11a0251987fe3c08c31b)), closes [#170](https://github.com/zdharma-continuum/zinit/issues/170)
* add `-a` (actual time) to `zinit times` cmd ([#223](https://github.com/zdharma-continuum/zinit/issues/223)) ([450d3c1](https://github.com/zdharma-continuum/zinit/commit/450d3c10a8f6728ee8c76bfb99f777658b8d3f35))
* add `krew` and `prebuilt-ripgrep` gh-r zunit tests ([#267](https://github.com/zdharma-continuum/zinit/issues/267)) ([f25b4ae](https://github.com/zdharma-continuum/zinit/commit/f25b4ae2b9951bf0d1306a17ef512a1868211b78))
* add compile vim from source zunit test ([#232](https://github.com/zdharma-continuum/zinit/issues/232)) ([126528c](https://github.com/zdharma-continuum/zinit/commit/126528ccd50e98c0e71f06971ae16aceb571fb97))
* add configure"" ice ([#334](https://github.com/zdharma-continuum/zinit/issues/334)) ([40a46c6](https://github.com/zdharma-continuum/zinit/commit/40a46c6d2250af7e01d91b2f8ec3e01cf392c3d1))
* add GH action to remove old workflow logs ([#248](https://github.com/zdharma-continuum/zinit/issues/248)) ([6647bdc](https://github.com/zdharma-continuum/zinit/commit/6647bdc31c5b82378195ce71055099a7b36734a1))
* add PR labeler to show what parts of Zinit are changed ([#211](https://github.com/zdharma-continuum/zinit/issues/211)) ([42e83d7](https://github.com/zdharma-continuum/zinit/commit/42e83d7f99254c16e408f52848b914f7aa264372))
* add releases via semantic-release ([73542b4](https://github.com/zdharma-continuum/zinit/commit/73542b490981e43adca4a09b64c327fe811d01e1))
* add releases via semantic-release ([#415](https://github.com/zdharma-continuum/zinit/issues/415)) ([cfa2f0e](https://github.com/zdharma-continuum/zinit/commit/cfa2f0ebcd674706d5cb91533cf362f6f4ddd7ee))
* expand linted file types to markdown and shell ([96fe03f](https://github.com/zdharma-continuum/zinit/commit/96fe03f85baf8eae33270a09a5ca82f108f6cc25))
* **git-process-output:** simplify progress-bar ([#204](https://github.com/zdharma-continuum/zinit/issues/204)) ([c888917](https://github.com/zdharma-continuum/zinit/commit/c888917edbafa3772870ad1f320da7a5f169cc6f))
* update output messaging to be more informative ([047320a](https://github.com/zdharma-continuum/zinit/commit/047320a9234be4de8299ff4796e28e2363e77984))
# [v3.7.0](https://github.com/zdharma-continuum/zinit/compare/v3.1...v3.7.0)

View file

@ -1,101 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for
moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
for enforcement at . All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
period of time. No public or private interaction with the people involved, including unsolicited interaction with those
enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
Translations are available at https://www.contributor-covenant.org/translations.
[homepage]: https://www.contributor-covenant.org

14
LICENSE
View file

@ -1,7 +1,7 @@
MIT License
This software is licensed under MIT.
Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
Copyright (c) 2021-2022 zdharma-continuum
MIT License
-----------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -10,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -1,54 +0,0 @@
.EXPORT_ALL_VARIABLES:
ZSH := $(shell command -v zsh 2> /dev/null)
SRC := zinit{'','-additional','-autoload','-install','-side'}.zsh
DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))
.PHONY: all clean container doc doc/container tags tags/emacs tags/vim test zwc
clean:
rm -rf *.zwc doc/zsdoc/zinit{'','-additional','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/
container:
docker build --tag=ghcr.io/zdharma-continuum/zinit:latest --file=docker/Dockerfile .
doc: clean
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\:\∞\.\+\@\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC)"
doc/container: container
./scripts/docker-run.sh --docs --debug
# Run ctags to generate Emacs and Vim's format tag file.
tags: tags/emacs tags/vim
tags/emacs: ## Build Emacs-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags -e -R --options=share/zsh.ctags --languages=zsh \
--pattern-length-limit=250 --maxdepth=1; \
else \
ctags -e -R --languages=sh --langmap=sh:.zsh; \
fi; \
printf "Created the Emacs \`TAGS\` file.\\n"; \
else \
printf 'Error: Please install a Ctags (e.g.: either the Exuberant or Universal %b' \
'version) utility first.\n'; \
fi
tags/vim: ## Build the Vim-style ctags file
@if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags --languages=zsh --maxdepth=1 --options=share/zsh.ctags --pattern-length-limit=250 -R; \
else \
ctags -R --languages=sh --langmap=sh:.zsh; \
fi; \
printf "Created the Vim's style \`tags\` file.\\n"; \
else \
printf 'Error: Please install a ctags first.\n'; \
fi
test:
zunit run
zwc:
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'

1336
README.md

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
3.17.0

376
_zinit
View file

@ -1,376 +0,0 @@
#compdef zinit
#autoload
#
# Zinit ZSH completion function
# Copyright (c) 2016-2020 Sebastian Gniazdowski
# Copyright (c) 2016-2023 zdharma-continuum
# Homepage: https://github.com/zdharma-continuum/zinit
# License: MIT License
#
# FUNCTION: __zinit_commands [[[
__zinit_commands(){
local -a commands
commands=(
'add-fpath:Add plugin folder to $FPATH'
'bindkeys:List of plugin defined key bindings'
'cclear:Clear completions list'
'cd:Go to a plugin or snippet direcorty'
'cdclear:Clear the compdef replay list'
'cdisable:Disable completions'
'cdreplay:Replay compdef list'
'cenable:Enable completions'
'changes:View plugins git log'
'compile:Compile plugin (or all plugins if --all passed)'
'compiled:List of compiled plugins'
'compinit:Refresh installed completions'
'completions:List status of all installed completions'
'create:Generate Zsh plugin boilerplate'
'creinstall:Install completions for plugin'
'csearch:Search for available completions from any plugin'
'cuninstall:Uninstall completions for plugin'
'debug:Functions for debugging Zinit'
'delete:Uninstall a plugin or snippet'
'edit:Edit a plugins or snippet with \$EDITOR'
'env-whitelist:Specify names (also patterns) of parameters to be left unchanged during an unload'
'glance:Look at plugins source'
'help:Usage information'
'load:Load plugin'
'man:Display Zinit'\''s manpage'
'module:Manage binary Zsh module shipped with Zinit'
'plugins:List status of all installed plugins'
'recall:Fetch saved ice modifiers and construct '
'recently:Show plugins that changed recently'
'report:Show plugins report'
'run:Run a command inside plugins folder'
'self-update:Fetch the newest version of Zinit from GitHub using `git`(1) and recompile'
'snippet:Source a local or remote file'
'snippets:List status of all installed snippets'
'srv:Control a service, command'
'status:Git status for plugin'
'stress:Test plugin for compatibility with set of options'
'times:Display brief statistics for your Zinit installation'
'uncompile:Remove compiled plugin'
'uninstall:Uninstall a formula or cask'
'unload:Unload a plugin or snippet'
'update:Upgrade outdated plugins and snippets using the same options they were originally installed with'
'version:Print the version numbers of Zinit to standard output'
'zstatus:Overall Zinit status'
)
_describe -t commands 'zinit commands' commands
} # ]]]
###
# Commands in the debug context
###
_zinit_debug_commands=(
'clear:Clear report of debug tracing session'
'report:Show report of debug tracing session'
'revert:Revert changes detected during debug tracing session'
'start:Start debug tracing session'
'status:Show current state of debug mode'
'stop:Stop debug tracing session'
)
# FUNCTION: __zinit_completion_caching_policy [[[
__zinit_completion_caching_policy(){
local -a tmp
(( $#tmp )) || return 0
tmp=( $ZINIT[BIN_DIR]/*.git/index(om[1]N) )
[[ -z $tmp || $tmp -nt $1 ]]
} # ]]]
# FUNCTION: __zinit_installed [[[
__zinit_installed() {
_alternative \
'plugins:installed:__zinit_installed_plugins' \
'snippets:installed:__zinit_installed_snippets'
} # ]]]
# FUNCTION: __zinit_installed_plugins [[[
__zinit_installed_plugins(){
# [[ -prefix '-' ]] && return 0
typeset -a list
local expl
list=( "${ZINIT[PLUGINS_DIR]}"/*(N:t) )
list=( "${list[@]//---//}" )
list=( "${list[@]:#_local/zinit}" )
list=( "${list[@]:#custom}" )
_wanted list expl 'plugins' compadd -a - list
} # ]]]
# FUNCTION: __zinit_installed_snippets [[[
__zinit_installed_snippets(){
# [[ -prefix '-' ]] && return 0
typeset -a snippets
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]}://} )
# formulae=( ${formulae[@]/--//} )
#
_wanted snippets expl 'snippets' compadd -a - snippets
} # ]]]
# FUNCTION: __zinit_list_aliases [[[
__zinit_list_aliases(){
local -a aliases
aliases=( ls list uninstall delete )
builtin print -- "$aliases"
} # ]]]
# FUNCTION: _zinit_add_fpath [[[
_zinit_add_fpath(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' && ret=0
} # ]]]
# FUNCTION: _zinit_bindkeys [[[
_zinit_bindkeys(){
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit_cclear [[[
_zinit_cclear(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Turn off messages from the operation]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_cd [[[
_zinit_cd(){
_arguments - plugin '1::plugin:__zinit_installed_plugins' && ret=0
} # ]]]
# FUNCTION: _zinit_cdclear [[[
_zinit_cdclear(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Turn off messages from the operation]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_cdisable [[[
_zinit_cdisable(){
_message 'Press enter to disable completions' && ret=0
} # ]]]
# FUNCTION: _zinit_cdlist [[[
_zinit_cdlist(){
_message 'List of compdef replays' && ret=0
} # ]]]
# FUNCTION: _zinit_cdreplay [[[
_zinit_cdreplay(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Turn off messages from the operation]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_cenable [[[
_zinit_cenable(){
_message 'Hit enter to enable completions' && ret=0
} # ]]]
# FUNCTION: _zinit_changes [[[
_zinit_changes(){
_message 'View git log of a plugin' && ret=0
} # ]]]
# FUNCTION: _zinit_compiled [[[
_zinit_compiled(){
_message 'Hit enter to get list of compiled plugins and snippets'
} # ]]]
# FUNCTION: _zinit_compinit [[[
_zinit_compinit(){
_message "Refresh completions" && ret=0
} # ]]]
# FUNCTION: _zinit_completions [[[
_zinit_completions(){
_message "Display a list of completions" && ret=0
} # ]]]
# FUNCTION: _zinit_create [[[
_zinit_compile(){
_arguments \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Make some output more quiet]' \
+ '(operation)' \
'(-a --all)'{-a,--all}'[Compile all plugins]' \
'*::installed:__zinit_installed' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_create [[[
_zinit_create(){
_arguments \
'1:Plugin Name' && ret=0
} # ]]]
# FUNCTION: _zinit_creinstall [[[
_zinit_creinstall(){
_arguments - plugin '1::plugin:__zinit_installed_plugins' && ret=0
} # ]]]
# FUNCTION: _zinit_csearch [[[
_zinit_csearch(){
ret=0
} # ]]]
# FUNCTION: _zinit_cunistall [[[
_zinit_cunistall(){
_arguments - installed '*::installed:__zinit_installed' && ret=0
} # ]]]
# FUNCTION: _zinit_delete [[[
_zinit_delete(){
_arguments \
{-d,--debug}'[Enable xtrace]' \
{-h,--help}'[Show this help message]' \
{-q,--quiet}'[Make some output more quiet]' \
{-y,--yes}'[Automatically confirm any yes/no prompts]' \
+ '(operation)' \
'*::installed:__zinit_installed' \
{-a,--all}'[Delete all plugins and snippets]' \
{-c,--clean}'[Delete only the currently-not loaded plugins and snippets]' \
&& ret=0
} # ]]]
_zinit_debug(){
_arguments \
'1: :_zinit_debug_cmds'
} # ]]]
# FUNCTION: _zinit_edit [[[
_zinit_edit(){
_arguments \
- installed '*::plugin:__zinit_installed_plugins' \
- snippet '*::snippet:__zinit_installed_snippets' && ret=0
} # ]]]
# FUNCTION: _zinit_env_whitelist [[[
_zinit_env_whitelist(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-v --verbose)'{-v,--verbose}'[Make some output more verbose]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_glance [[[
_zinit_glance(){
_arguments - installed '1:installed:__zinit_installed' && ret=0
} # ]]]
# FUNCTION: _zinit_list [[[
_zinit_list(){
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit_loaded [[[
_zinit_loaded(){
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit_man [[[
_zinit_man(){
_message "Hit enter to view the Zinit man page" && ret=0
} # ]]]
# FUNCTION: _zinit_module [[[
_zinit_module(){
_arguments \
- subcommand '*::subcommand:(build help info)' && ret=0
} # ]]]
# FUNCTION: _zinit_recall [[[
_zinit_recall(){
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit_recently [[[
_zinit_recently(){
ret=0
} # ]]]
# FUNCTION: _zinit_report [[[
_zinit_report(){
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit_run [[[
_zinit_run(){
_arguments \
- installed '1:installed:__zinit_installed' \
'2:command to run:' && ret=0
} # ]]]
# FUNCTION: _zinit_self_update [[[
_zinit_self_update(){
_arguments -A \
'(-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 messages from the operation]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_snippet [[[
_zinit_snippet(){
_arguments -A \
'(-c --command)'{-c,--command}'[Load the snippet as a command (i.e., make executable and apend to $PATH])' \
'(-f --force)'{-f,--force}'[Force new download of the snippet file]' \
'(-h --help)'{-h,--help}'[Show this help message]'
_arguments - snippet '*::snippet:__zinit_installed_snippets' && ret=0
} # ]]]
# FUNCTION: _zinit_status [[[
_zinit_status(){
_message 'Display current status of Zinit' && ret=0
} # ]]]
# FUNCTION: _zinit_stress [[[
_zinit_stress(){
_message 'Stress' && ret=0
} # ]]]
# FUNCTION: _zinit_times [[[
_zinit_times(){
_arguments \
'--help[Show this help message]' \
+ '(operation)' \
'(-a --all)'{-a,--all}'[show both load times and loading moments]' \
'(-m --moments)'{-m,--moments}'[Display loading moments]' \
'(-s --seconds)'{-s,--seconds}'[Load times displayed in seconds]' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_uncompile [[[
_zinit_uncompile(){
_arguments \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Make some output more quiet]' \
+ '(operation)' \
'(-a --all)'{-a,--all}'[Uncompile all plugins]' \
'*::installed:__zinit_installed' \
&& ret=0
} # ]]]
# FUNCTION: _zinit_unload [[[
_zinit_unload(){
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]' \
'(-q --quiet)'{-q,--quiet}'[Turn off messages from the operation]' \
- installed '*:installed:__zinit_installed'
} # ]]]
# FUNCTION: _zinit_update [[[
_zinit_update(){
_arguments \
'(-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 \
'(-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'
} # ]]]
# FUNCTION: _zunit_load [[[
_zinit_load() {
_message 'Hit enter to list the defined key bindings replay' && ret=0
} # ]]]
# FUNCTION: _zinit [[[
_zinit(){
local curcontext="$curcontext" state state_descr line expl
local tmp ret=1
_arguments -A \
'(-h --help)'{-h,--help}'[Show this help message]'
_arguments -C \
"1: :->cmds" \
"*::arg:->args"
case "$state" in
cmds)
__zinit_commands && return 0
;;
args)
local cmd="${line[1]}"
curcontext="${curcontext%:*}-${cmd}:${curcontext##*:}"
local completion_func="_zinit_${cmd//-/_}"
_call_function ret "${completion_func}" && return ret
_message "a completion function is not defined for command or alias: ${cmd}"
return 1
;;
esac
} # ]]]
(( $+functions[_zinit_debug_cmds] )) || _zinit_debug_cmds() {
_describe -t commands 'commands' _zinit_debug_commands "$@"
}
_zinit "$@"
#vim: filetype=zsh foldmarker=[[[,]]] foldmethod=marker shiftwidth=2 softtabstop=2 tabstop=2:

170
_zplugin Normal file
View file

@ -0,0 +1,170 @@
#compdef zplugin zpl zplg
local context state state_descr line ret=1
typeset -A opt_args
typeset -a commands
commands=(
zstatus:'overall Zplugin status'
self-update:'updates Zplugin'
help:'usage information'
load:'load plugin'
unload:'unload plugin'
snippet:'source file given via url'
update:'update plugin (Git)'
update-all:'update all plugins (Git)'
status:'status for plugin (Git)'
status-all:'status for all plugins (Git)'
report:'show plugin'"'"'s report'
all-reports:'show all plugin reports'
loaded:'show what plugins are loaded'
list:'show what plugins are loaded'
clist:'list completions in use'
completions:'list completions in use'
cdisable:'disable completion'
cenable:'enable completion'
creinstall:'install completions for plugin'
cuninstall:'uninstall completions for plugin'
csearch:'search for available completions from any plugin'
compinit:'refresh installed completions'
dtrace:"start tracking what's going on in session"
dstart:"start tracking what's going on in session"
dstop:"stop tracking what's going on in session"
dunload:'revert changes recorded between dstart and dstop'
dreport:"report what was going on in session"
dclear:'clear report of what was going on in session'
)
_arguments \
'1: :->command'\
'*: :->argument' && ret=0
case $state in
command)
_describe -t commands "Zplugin command" commands && ret=0
;;
argument)
case $words[2] in
help)
_message "Hit enter to get usage information" && ret=0
;;
zstatus)
_message "Hit enter to get overall status information" && ret=0
;;
load|light|update|status)
typeset -a plugins
plugins=( "$ZPLG_PLUGINS_DIR"/*(N:t) )
plugins=( "${plugins[@]/---//}" )
plugins=( "${plugins[@]:#_local/zplugin}" )
plugins=( "${plugins[@]:#custom}" )
_wanted plugins expl "Plugins" \
compadd "$@" -a - plugins && ret=0
;;
unload)
typeset -a plugins
plugins=( "${ZPLG_REGISTERED_PLUGINS[@]:#_local/zplugin}" )
_wanted plugins expl "Plugins" \
compadd "$@" -a - plugins && ret=0
;;
report)
typeset -a plugins
plugins=( "${ZPLG_REGISTERED_PLUGINS[@]:#_local/zplugin}" )
_wanted plugins expl "Plugins" \
compadd "$@" -a - plugins && ret=0
;;
all-reports)
_message "Hit enter to get all reports (for all loaded plugins)" && ret=0
;;
loaded|list)
_message "Hit enter or give part of plugin name" && ret=0
;;
clist|completions)
_message "Hit enter to get list of completions" && ret=0
;;
cdisable)
# Find enabled completions
typeset -a completions
completions=( "$ZPLG_COMPLETIONS_DIR"/_*(N:t) )
completions=( "${completions[@]#_}" )
compadd "$@" -a - completions && ret=0
;;
cenable)
# Find disabled
typeset -a completions
completions=( "$ZPLG_COMPLETIONS_DIR"/[^_]*(N:t) )
compadd "$@" -a - completions && ret=0
;;
creinstall)
# Complete only plugins that have any completions
# We must iterate each plugin to check
# for completions that can be installed
typeset -a plugins completions
local p c user plugin
for p in "${ZPLG_PLUGINS_DIR[@]}"/*; do
completions=( "$p"/_*(N) )
for c in "${completions[@]}"; do
p="${p:t}"
user="${p%%---*}"
plugin="${p#*---}"
plugins+=( "$user/$plugin" )
break
done
done
_wanted plugins expl "Plugins" \
compadd "$@" -a - plugins && ret=0
;;
cuninstall)
# We must iterate each plugin and check if
# it has completions that are installed
typeset -a plugins completions
local p c user plugin
for p in "${ZPLG_PLUGINS_DIR[@]}"/*; do
completions=( "$p"/_*(N) )
for c in "${completions[@]}"; do
cfile="${c:t}"
bkpfile="${cfile#_}"
# Completion installed, either enabled or disabled?
if [[ -e "$ZPLG_COMPLETIONS_DIR"/"$cfile" || -e "$ZPLG_COMPLETIONS_DIR"/"$bkpfile" ]]; then
p="${p:t}"
user="${p%%---*}"
plugin="${p#*---}"
plugins+=( "$user/$plugin" )
break
fi
done
done
_wanted plugins expl "Plugins" \
compadd "$@" -a - plugins && ret=0
;;
compinit)
_message "Hit enter to refresh completion system" && ret=0
;;
snippet)
typeset -a list
list=( "-f" )
_wanted plugins expl "Options" \
compadd "$@" -a - list && ret=0
;;
dstart|dtrace)
_message "Hit enter to start tracking this session" && ret=0
;;
dstop)
_message "Hit enter to stop tracking this session" && ret=0
;;
dunload)
_message "Hit enter to revert changes recorded between dstart and dstop" && ret=0
;;
dreport)
_message "Hit enter to show report of what was going on in session" && ret=0
;;
dclear)
_message "Hit enter to clear report of what was going on in session" && ret=0
;;
*)
ret=1
;;
esac
esac
return "$ret"

View file

@ -1,735 +0,0 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Changelog](#changelog)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# Changelog
All notable changes to this project will be documented in this file.
- 29-11-2021
- zinit calls no longer silently fail when ices such as `atclone`, `atpull` or `compile` fail. Any hook returning with
!= 0 will log a warning to stdout at runtime:
```zsh
zinit null atclone'echo "intentional failure"; return 69' \
for zdharma-continuum/null
echo $?
69
```
- 28-11-2021
- **‼️ BREAKING CHANGE** zinit now requires [jq](https://github.com/stedolan/jq) for JSON parsing. This only affects
the `pack` ice. Users who do not have jq installed will be greeted with a warning when they try to install packages.
To install jq with zinit, you can follow
[these instructions in the wiki](https://github.com/zdharma-continuum/zinit/wiki/%F0%9F%A7%8A-Recommended-ices#jq)
- `zinit pack` now better supports installation from local files (previously only relative paths worked), and **custom
repositories!** By default, zinit uses
[zhdarma-continuum/zinit-packages](https://github.com/p/zdharma-continuum/zinit-packages).
To use a custom repo you can set `ZINIT[PACKAGES_REPO]=github_org/repo`.
For installing from a specific branch you can:
1. Leverage the `ver` ice (eg: `ver"my-branch`)
1. Override zinit's default branch with `ZINIT[PACKAGES_BRANCH]=my-branch`
zinit package repos that are not hosted on GitHub can be installed from the local filesystem like so:
`zinit pack"local/path/to/package.json:profile" for mypackage`
- 22-11-2021
- We updated zinit's main branch from `master` to `main`. `zinit self-update` will try to update the branch locally.
If it fails please try to:
```zsh
cd ${ZINIT[BIN_DIR]}
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
```
- 21-11-2021
- [(z)unit tests](https://github.com/zdharma-continuum/zinit/actions/workflows/tests.yaml) have been added to our dear
repository. This should help us to sniff out some bugs and improve the overall quality of zinit. Stay tuned! More
information available [here](https://github.com/zdharma-continuum/zinit/pull/96).
- 20-11-2021
- zinit is now [XDG compliant](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). This
means that the default value of `ZINIT[HOME_DIR]` is now `XDG_DATA_HOME/zinit`, ie `HOME/.local/share/zinit`, we
won't clutter your `HOME` anymore! Fear not though: if you update zinit without moving your config to the new
default location it will still fall back to `HOME/.zinit` if this directory exists. In the same spirit, if you
overrode `ZINIT[HOME_DIR]` yourself in your `zshrc` we will use that value instead. NOTE: Since its rewrite the
installer has been installing zinit's repo to `XDG_DATA_HOME/zinit/zinit.git` (see 16-11-2021 entry)
- 18-11-2021
- The packages (`zinit pack`) have all been migrated to
[a new repository](https://github.com/zdharma-continuum/zinit-packages). Nothing fundamentally changes for users,
the original repos have only been archived and not deleted, so that older zinit versions can still use these.
For more information, please refer to [this issue](https://github.com/zdharma-continuum/zinit/issues/69) and/or to
[the corresponding PR](https://github.com/zdharma-continuum/zinit/pull/75)
- The zinit module has been relocated to [its own repository](https://github.com/zdharma-continuum/zinit-module)
* 17-11-2021
- Containers! If you want to try out zinit inside a container, you can now. Several versions of zsh are available, as
well as arm64. Check out the available tags on
[ghcr](https://github.com/zdharma-continuum/zinit/pkgs/container/zinit).
```shell
docker run -it --rm ghcr.io/zdharma-continuum/zinit:latest
```
- 16-11-2021
- A brand-new installer has been developed. A few new features have been added. There are a bunch of new env vars you
can set:
- `NO_INPUT=1`: non-interactive mode (`NO_INPUT=1`)
- `NO_EDIT=1`: do not modify `.zshrc`
- `ZSHRC=/home/user01/.config/zsh/zshrc`: custom path to your `.zshrc`
- `ZINIT_REPO=zdharma-continuum/zinit`: Install zinit from a custom GitHub repo
- `ZINIT_BRANCH=master`: zinit branch to install
- `ZINIT_COMMIT=master`: zinit commit to install (takes precedence over `ZINIT_BRANCH`)
- `ZINIT_INSTALL_DIR=~/.local/share/zinit/zinit.git`: Where to install the zinit repo
⚠️ Please note that the download URL for the installer has changed. It is now:
https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh
For more details check out [PR #61](https://github.com/zdharma-continuum/zinit/pull/61)
- 11-11-2021
- The annexes repos have been renamed to improve discoverability. They used to be called `z-a-${name}` and have been
renamed to `zinit-annex-${name}`. You don't *need* to update your configs right away since GitHub redirects to the
new URLs.
- 06-11-2021
- 🚧 zinit has a new home: https://github.com/zdharma-continuum/zinit
- The migration from @zdharma, @Zsh-Packages and @zinit-zsh is still in progress. If you are interested in helping
or want to let us know that a particular project is missing, please head to
[I_WANT_TO_HELP](https://github.com/zdharma-continuum/I_WANT_TO_HELP/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
- 📚 zinit now ensures that the man dirs under `$ZPFX/man` are created on startup. Please note that these directories
will not necessarily be part of your `manpath`. You may need to set `$MANPATH`. See #8 (and #7) for more details.
- 21-01-2020
- A few tips for the project rename following the field reports (the issues created by users):
- the `ZPLGM` hash is now `ZINIT`,
- the annexes are moved under [zinit-zsh](https://github.com/zinit-zsh) organization (it needs a logo, could you
create one, if you're skilled in graphics?).
- 19-01-2020
- The name has been changed to **Zinit** based on the results of the
[poll](https://web.archive.org/web/20201008014128/https://github.com/zdharma/zinit/issues/235)
- In general, you don't have to do anything after the name change.
- Only a run of `zinit update --all` might be necessary.
- You might also want to rename your `zplugin` calls in `zshrc` to `zinit`.
- Zinit will reuse `~/.zplugin` directory if it exists, otherwise it'll create `~/.zinit`.
- 15-01-2020
- There's a new function, `zpextract`, which unpacks the given file. It supports many formats (notably also `dmg`
images) if there's a format that's unsupported please don't hesitate to
[make a request](https://github.com/zdharma-continuum/zinit/issues/new?assignees=&labels=%F0%9F%8E%81+feature+request%2C%F0%9F%8E%B2+triage&template=feature-request.yml&title=%F0%9F%8E%81+Feature+request%3A+)
for it to be added. A few facts:
- the function is available only at the time of the plugin/snippet installation,
- it's to be used within `atclone` and `atpull` ices,
- it has an optional `--move` option which moves all the files from a subdirectory up one level,
- one other option `--norm` prevents the archive from being deleted upon unpacking.
- snippets now aren't re-downloaded unless they're newer on the HTTP server; use this with the `--norm` option of
`zpextract` to prevent unnecessary updates; for example, the
[firefox-dev package](https://github.com/zdharma-continuum/zsh-package-firefox-dev) uses this option for this
purpose,
- GitHub doesn't report proper `Last-Modified` HTTP server for the files in the repositories so the feature doesn't
yet work with such files.
- 13-12-2019
- The packages have been disconnected from NPM registry and now live only on Zsh Packages organization. Publishing to
NPM isn't needed.
- There are two interesting packages, [any-gem](https://github.com/zdharma-continuum/zsh-package-any-gem) and
[any-node](https://github.com/zdharma-continuum/zsh-package-any-node). They allow to install any Gem(s) or Node
module(s) locally in a newly created plugin directory. For example:
```zsh
zinit pack param='GEM -> rails' for any-gem
zinit pack param='MOD -> doctoc' for any-node
# To have the command in zshrc, add an id-as'' ice so that
# Zinit knows that the package is already installed
# (also: the Unicode arrow is allowed)
zinit id-as=jekyll pack param='GEM → jekyll' for any-gem
```
The binaries will be exposed without altering the PATH via shims
([Bin-Gem-Node](https://github.com/zinit-zsh/zinit-annex-bin-gem-node) annex is needed). Shims are correctly removed
when deleting a plugin with `zinit delete …`.
- 11-12-2019
- Zinit now supports installing special-Zsh NPM packages! Bye-bye the long and complex ice-lists! Check out the
[Wiki](https://zdharma-continuum.github.io/zinit/wiki/NPM-Packages/) for an introductory document on the feature.
- 25-11-2019
- A new subcommand `run` that executes a command in the given plugin's directory. It has an `-l` option that will
reuse the previously provided plugin. So that it's possible to do:
```zsh
zplg run my/plugin ls
zplg run -l cat \*.plugin.zsh
zplg run -l pwd
```
- 07-11-2019
- Added a prefix-char: `@` that can be used before plugins if their name collides with one of the ice-names. For
example `sharkdp/fd` collides with the `sh` ice (which causes the plugin to be loaded with the POSIX `sh` emulation
applied). To load it, do e.g.:
```zsh
zinit as"null" wait"2" lucid from"gh-r" for \
mv"exa* -> exa" sbin"exa" ogham/exa \
mv"fd* -> fd" sbin"fd/fd" @sharkdp/fd \
sbin"fzf" junegunn/fzf-bin
```
i.e.: precede the plugin name with `@`. Note: `sbin''` is an ice added by the
[zinit-annex-bin-gem-node](https://github.com/zinit/zinit-annex-bin-gem-node) annex, it provides the command to the
command line without altering `$PATH`.
See the [Zinit Wiki](https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/) for more information on the
for-syntax.
- 06-11-2019
- A new syntax, called for-syntax. Example:
```zsh
zinit as"program" atload'print Hi!' for \
atinit'print First!' zdharma/null \
atinit'print Second!' svn OMZ::plugins/git
```
The output:
```
First!
Hi!
Second!
Hi!
```
And also:
```zsh
% print -rl $path | egrep -i '(/git|null)'
/root/.zinit/snippets/OMZ::plugins/git
/root/.zinit/plugins/zdharma---null
```
To load in light mode, use a new `light-mode` ice. More examples and information can be found on the
[Zinit Wiki](https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/).
- 03-11-2019
- A new value for the `as''` ice `null`. Specifying `as"null"` is like specifying `pick"/dev/null" nocompletions`,
i.e.: it disables the sourcing of the default script file of a plugin or snippet and also disables the installation
of completions.
- 30-10-2019
- A new ice `trigger-load''` create a function that loads given plugin/snippet, with an option (to use it, precede
the ice content with `!`) to automatically forward the call afterwards. Example use:
```zsh
# Invoking the command `crasis' will load the plugin that
# provides the function `crasis', and it will be then
# immediately invoked with the same arguments
zinit ice trigger-load'!crasis'
zinit load zdharma/zinit-crasis
```
- 22-10-2019
- A new ice `countdown` causes an interruptable (by Ctrl-C) countdown 5…4…3…2…1…0 to be displayed before running the
`atclone''`, `atpull''` and `make` ices.
- 21-10-2019
- The `times` command has a new option `-m` it shows the **moments** of the plugin load times i.e.: how late after
loading Zinit a plugin has been loaded.
- 20-10-2019
- The `zinit` completion now completes also snippets! The command `snippet`, but also `delete`, `recall`, `edit`,
`cd`, etc. all receive such completing.
- The `ice` subcommand can now be skipped just pass in the ices, e.g.:
```zsh
zinit atload"zicompinit; zicdreplay" blockf
zinit light zsh-users/zsh-completions
```
- The `compile` command is able to compile snippets.
- The plugins that add their subdirectories into `$fpath` can be now `blockf`-ed the functions located in the dirs
will be correctly auto-loaded.
- 12-10-2019
- Special value for the `id-as''` ice `auto`. It sets the plugin/snippet ID automatically to the last component of
its spec, e.g.:
```zsh
zinit ice id-as"auto"
zinit load robobenklein/zinc
```
will load the plugin as `id-as'zinc'`.
- 14-09-2019
- There's a Vim plugin which extends syntax highlighting of zsh scripts with coloring of the Zinit commands.
[Project homepage](https://github.com/zinit/zinit-vim-syntax).
- 13-09-2019
- New ice `aliases` which loads plugin with the aliases mechanism enabled. Use for plugins that define **and use**
aliases in their scripts.
- 11-09-2019
- New ice-mods `sh`,`bash`,`ksh`,`csh` that load plugins (and snippets) with the **sticky emulation** feature of Zsh
all functions defined within the plugin will automatically switch to the desired emulation mode before executing and
switch back thereafter. In other words it is now possible to load e.g. bash plugins with Zinit, provided that the
emulation level done by Zsh is sufficient, e.g.:
```zsh
zinit ice bash pick"bash_it.sh" \
atinit"BASH_IT=${ZINIT[PLUGINS_DIR]}/Bash-it---bash-it" \
atclone"yes n | ./install.sh"
zinit load Bash-it/bash-it
```
This script loads correctly thanks to the emulation, however it isn't functional because it uses `type -t …` to
check if a function exists.
- 10-09-2019
- A new ice-mod `reset''` that ivokes `git reset --hard` (or the provided command) before `git pull` and `atpull''`
ice. It can be used it to implement altering (i.e. patching) of the plugin's files inside the `atpull''` ice `git`
will report no conflicts when doing `pull`, and the changes can be then again introduced by the `atpull''` ice..
- Three new Zplugin annexes (i.e. [extensions](https://zdharma-continuum.github.io/zplugin/wiki/Annexes/)):
- [zinit-annex-man](https://github.com/zplugin/zinit-annex-man)
Generates man pages and code-documentation man pages from plugin's README.md and source files (the code
documentation is obtained from [Zshelldoc](https://github.com/zdharma/zshelldoc)).
- [zinit-annex-test](https://github.com/zplugin/zinit-annex-test)
Runs tests (if detected `test' target in a `Makefile`or any`\*.zunit\` files) on plugin installation and non-empty
update.
- [zinit-annex-patch-dl](https://github.com/zplugin/zinit-annex-patch-dl)
Allows easy download and applying of patches, to e.g. aid building a binary program equipped in the plugin.
- A new variable is being recognized by the installation script: `$ZPLG_BIN_DIR_NAME`. It configures the directory
within `$ZPLG_HOME` to which Zplugin should be cloned.
- 09-08-2019
- A new ice-mod `wrap-track''` which gets `;`-separated list of functions that are to be tracked **once** when
executing. In other words you can extend the tracking beyond the moment of loading of a plugin.
- The unloading of Zle widgets is now more smart it takes into account the chains of plugins that can overload the
Zle widgets, and solves the interactions that result out of it.
- 29-07-2019
- `delete` now supports following options:
- `--all` deletes all plugins and snippets (a purge, similar to
`rm -rf ${ZPLGM[PLUGINS_DIR]} ${ZPLGM[SNIPPETS_DIR]}`)
- `--clean` deletes only plugins and snippets that are **currently not loaded** in the current session.
- 09-07-2019
- Zplugin can now have **its own plugins**, called **z-plugins**! Check out an example but fully functional z-plugin
[zdharma/z-p-submods](https://github.com/zdharma/z-p-submods) and a document that explains on how to implement your
own z-plugin ([here](../../wiki/Z-PLUGINS)).
- 08-07-2019
- You can now do `zplugin ice wait ...` and it will work as `zplugin ice wait'0' ...` :) I.e. when there's no value to
the `wait''` ice then a value of `0` is being substituted.
- 02-07-2019
- [Cooperation of Fast-Syntax-Highlighting and Zplugin](https://asciinema.org/a/254630) a new precise highlighting
for Zplugin in F-Sy-H.
- 01-07-2019
- `atclone''`, `atpull''` & `make''` get run in the same subshell, thus an e.g. export done in `atclone''` will be
visible during the `make`.
- 26-06-2019
- `notify''` contents gets evaluated, i.e. can contain active code like `$(tail -1 /var/log/messages)`, etc.
- 23-06-2019
- New ice mod `subscribe''`/`on-update-of''` which works like the `wait''` ice-mod, i.e. defers loading of a plugin,
but it **looks at modification time of the given file(s)**, and when it changes, it then triggers loading of the
plugin/snippet:
```zsh
% zplugin ice on-update-of'{~/files-*,/tmp/files-*}' lucid \
atload"echo I have been loaded" \
notify"Yes that's true :)"
% zplugin load zdharma/null
% touch ~/files-1
The plugin has been loaded
%
Yes that's true :)
```
The plugin/snippet will be sourced as many times as the file gets updated.
- 22-06-2019
- New ice mod `reset-prompt` that will issue `zle .reset-prompt` after loading the plugin or snippet, causing the
prompt to be recomputed. Useful with themes & turbo-mode.
- New ice-mod `notify''` which will cause to display an under-prompt notification when the plugin or snippet gets
loaded. E.g.:
```zsh
% zplugin ice wait"0" lucid notify"zdharma/null has been loaded"
% zplugin light zdharma/null
%
zdharma/null has been loaded
```
In case of problems with the loading a warning message will be output:
```
% zplugin ice notify atload'return 7'
% zplugin light zdharma/null
%
notify: Plugin not loaded / loaded with problem, the return code: 7
```
Refer to [Ice Modifiers](#ice-modifiers) section for a complete description.
- 29-05-2019
- Turbo-Mode, i.e. the `wait''` ice-mode now supports a suffix the letter `a`, `b` or `c`. The meaning is
illustrated by the following example:
```zsh
zplugin ice wait"0b" as"command" pick"wd.sh" atinit"echo Firing 1" lucid
zplugin light mfaerevaag/wd
zplugin ice wait"0a" as"command" pick"wd.sh" atinit"echo Firing 2" lucid
zplugin light mfaerevaag/wd
# The output
Firing 2
Firing 1
```
As it can be seen, the second plugin has been loaded first. That's because there are now three sub-slots (the `a`,
`b` and `c`) in which the plugin/snippet loadings can be put into. Plugins from the same time-slot with suffix `a`
will be loaded before plugins with suffix `b`, etc.
In other words, instead of `wait'1'` you can enter `wait'1a'`, `wait'1b'` and `wait'1c'` to this way **impose
order** on the loadings **regardless of the order of `zplugin` commands**.
- 26-05-2019
- Turbo-Mode now divides the scheduled events (i.e. loadings of plugins or snippets) into packs of 5. In other words,
after loading each series of 5 plugins or snippets the prompt is activated, i.e. it is feed an amount of CPU time.
This will help to deliver the promise of background loading without interferences visible to the user. If you have
some two slow-loading plugins and/or snippets, you can put them into some separate blocks of 5 events.
- 18-05-2019
- New ice-mod `nocd` it prevents changing current directory into the plugin's directory before evaluating
`atinit''`, `atload''` etc. ice-mods.
- 12-03-2019
- Finally reorganizing the `README.md`. Went on asciidoc path, the side-documents are written in it and the
`README.md` will also be converted (example page: [Introduction](doc/INTRODUCTION.adoc))
- 12-10-2018
- New `id-as''` ice-mod. You can nickname a plugin or snippet, to e.g. load it twice, with different `pick''` ice-mod,
or from Github binary releases and regular Github repository at the same time. More information in
[blog post](https://zdharma-continuum.github.io/2018-10-12/Nickname-a-plugin-or-snippet).
- 30-08-2018
- New `as''` ice-mod value: `completion`. Can be used to install completion-only "plugins", even single files:
```zsh
zplugin ice as"completion" mv"hub* -> _hub"
zplugin snippet https://github.com/github/hub/blob/master/etc/hub.zsh_completion
```
- Uplift of Git-output, it now has an animated progress-bar:
![image](https://raw.githubusercontent.com/zdharma/zplugin/images/zplg-progress-bar.gif)
- 15-08-2018
- New `$ZPLGM` field `COMPINIT_OPTS` (also see [Customizing Paths](#customizing-paths--other)). You can pass `-C` or
`-i` there to mute the `insecure directories` messages. Typical use case could be:
```zsh
zplugin ice wait"5" atinit"ZPLGM[COMPINIT_OPTS]=-C; zpcompinit; zpcdreplay" lucid
zplugin light zdharma/fast-syntax-highlighting
```
- 13-08-2018
- `self-update` (subcommand used to update Zplugin) now lists new commits downloaded by the update:
![image](https://raw.githubusercontent.com/zdharma/zplugin/images/zplg-self-update.png)
- New subcommand `bindkeys` that lists what bindkeys each plugin has set up.
- 25-07-2018
- If you encountered a problem with loading Turbo-Mode plugins, it is fixed now. This occurred in versions available
between `10` and `23` of July. Issue `zplugin self-update` if you installed/updated in this period.
- New bug-fix release `v2.07`.
- 13-07-2018
- New `multisrc''` ice, it allows to specify multiple files for sourcing and it uses brace expansion syntax, so for
example you can:
```zsh
zplugin ice depth"1" multisrc="lib/{functions,misc}.zsh" pick"/dev/null"; zplugin load robbyrussell/oh-my-zsh
zplugin ice svn multisrc"{functions,misc}.zsh" pick"/dev/null"; zplugin snippet OMZ::lib
array=( {functions,misc}.zsh ); zplg ice svn multisrc"\${array[@]}" pick"/dev/null"; zplugin snippet OMZ::lib
array=( {functions,misc}.zsh ); zplg ice svn multisrc"${array[@]}" pick"/dev/null"; zplugin snippet OMZ::lib
array=( {functions,misc}.zsh ); zplg ice svn multisrc"\$array" pick"/dev/null"; zplugin snippet OMZ::lib
array=( {functions,misc}.zsh ); zplg ice svn multisrc"$array" pick"/dev/null"; zplugin snippet OMZ::lib
zplugin ice svn multisrc"misc.zsh functions.zsh" pick"/dev/null"; zplugin snippet OMZ::lib
```
- 12-07-2018
- For docker and new machine provisioning, there's a trick that allows to install all
[turbo-mode](#turbo-mode-zsh--53) plugins by scripting:
```zsh
zsh -i -c -- '-zplg-scheduler burst'
```
- 10-07-2018
- Ice `wait'0'` now means actually short time you can load plugins and snippets **very quickly** after prompt.
- 02-03-2018
- Zplugin exports `$ZPFX` parameter. Its default value is `~/.zplugin/polaris` (user can override it before sourcing
Zplugin). This directory is like `/usr/local`, a prefix for installed software, so it's possible to use ice like
`make"PREFIX=$ZPFX"` or `atclone"./configure --prefix=$ZPFX"`. Zplugin also setups `$MANPATH` pointing to the
`polaris` directory. Checkout [gallery](GALLERY.md) for examples.
- [New README section](#hint-extending-git) about extending Git with Zplugin.
- 05-02-2018
- I work much on this README however multi-file Wiki might be better to read it
[just has been created](https://github.com/zdharma/zplugin/wiki).
- 16-01-2018
- New ice-mod `compile` which takes pattern to select additional files to compile, e.g.
`zplugin ice compile"(hsmw-*|history-*)"` (for `zdharma/history-search-multi-word` plugin). See
[Ice Modifiers](#ice-modifiers).
- 14-01-2018
- Two functions have been exposed: `zpcdreplay` and `zpcompinit`. First one invokes compdef-replay, second one is
equal to `autoload compinit; compinit` (it also respects `$ZPLGM[ZCOMPDUMP_PATH]`). You can use e.g.
`atinit'zpcompinit'` ice-mod in a syntax-highlighting plugin, to initialize completion right-before setting up
syntax highlighting (because that should be done at the end).
- 13-01-2018
- New customizable path `$ZPLGM[ZCOMPDUMP_PATH]` that allows to point zplugin to non-standard `.zcompdump` location.
- Tilde-expansion is now performed on the [customizable paths](#customizing-paths--other) you can assign paths like
`~/.zplugin`, there's no need to use `$HOME/.zplugin`.
- 31-12-2017
- For the new year there's a new feature: user-services spawned by Zshell :) Check out
[available services](https://github.com/zservices). They are configured like their READMEs say, and controlled via:
```
% zplugin srv redis next # current serving shell will drop the service, next Zshell will pick it up
% zplugin srv redis quit # the serving shell will quit managing the service, next Zshell will pick it up
% zplugin srv redis stop # stop serving, do not pass it to any shell, just hold the service
% zplugin srv redis start # start stopped service, without changing the serving shell
% zplugin srv redis restart # restart service, without changing the serving shell
```
This feature allows to configure everything in `.zshrc`, without the the need to deal with `systemd` or `launchd`,
and can be useful e.g. to configure shared-variables (across Zshells), stored in `redis` database (details on
[zservices/redis](https://github.com/zservices/redis)).
- 24-12-2017
- Xmas present [fast-syntax-highlighting](https://github.com/zdharma/fast-syntax-highlighting) now highlights the
quoted part in `atinit"echo Initializing"`, i.e. it supports ICE syntax :)
- 08-12-2017
- SVN snippets are compiled on install and update
- Resolved how should ice-mods be remembered general rule is that using `zplugin ice ...` makes memory-saved and
disk-saved ice-mods not used, and replaced on update. Calling e.g. `zplugin update ...` without preceding `ice` uses
memory, then disk-saved ices.
- 07-12-2017
- New subcommand `delete` that obtains plugin-spec or URL and deletes plugin or snippet from disk. It's good to forget
wrongly passed Ice-mods (which are storred on disk e.g. for `update --all`).
- 04-12-2017
- It's possible to set plugin loading and unloading on condition. ZPlugin supports plugin unloading, so it's possible
to e.g. **unload prompt and load another one**, on e.g. directory change. Checkout
[full story](#automatic-loadunload-on-condition) and [Asciinema video](https://asciinema.org/a/150825).
- 29-11-2017
- **[Turbo Mode](https://github.com/zdharma/zplugin#turbo-mode-zsh--53)** **39-50% or more faster Zsh startup!**
- Subcommand `update` can update snippets, via given URL (up to this point snippets were updated via
`zplugin update --all`).
- Completion management is enabled for snippets (not only plugins).
- 13-11-2017
- New ice modifier `make`. It causes the `make`-command to be executed after cloning or updating plugins and
snippets. For example there's `Zshelldoc` that uses `Makefile` to build final scripts:
```SystemVerilog
zplugin ice as"program" pick"build/zsd*" make; zplugin light zdharma/zshelldoc
```
The above doesn't trigger the `install` target, but this does:
```SystemVerilog
zplugin ice as"program" pick"build/zsd*" make"install PREFIX=/tmp"; zplugin light zdharma/zshelldoc
```
- Fixed problem with binary-release selection (`from"gh-r"`) by adding Ice-mod `bpick`, which should be used for this
purpose instead of `pick`, which selects file within plugin tree.
- 06-11-2017
- The subcommand `completions` now prints `3` completions per line (not `1`). This makes large amount of completions to look
better. Argument can be given, e.g. `6`, to increase the grouping.
- New Ice-mod `silent` that mutes `stderr` & `stdout` of a plugin or snippet.
- 04-11-2017
- New subcommand `ls` which lists snippets-directory in a formatted and colorized manner. Example:
![zplugin-ls](https://raw.githubusercontent.com/zdharma/zplugin/images/zplg-ls.png)
- 29-10-2017
- Subversion protocol (supported by Github) can be used to clone **subdirectories** when using snippets. This allows
to load multi-file snippets. For example:
```SystemVerilog
zstyle ':prezto:module:prompt' theme smiley
zplugin ice svn silent; zplugin snippet PZT::modules/prompt
```
- Snippets support `Prezto` modules (with dependencies), and can use **PZT::** URL-shorthand, like in the example
above. One can load `Prezto` module as single file snippet, or use Subversion to download whole directory (see also
description of [Ice Modifiers](#ice-modifiers)):
```zsh
# Single file snippet, URL points to file
zplg snippet PZT::modules/helper/init.zsh
# Multi-file snippet, URL points to directory to clone with Subversion
# The file to source (init.zsh) is automatically detected
zplugin ice svn; zplugin snippet PZT::modules/prompt
# Use of Subversion to load an OMZ plugin
zplugin ice svn; zplugin snippet OMZ::plugins/git
```
- Fixed a bug with `cURL` usage (snippets) for downloading, it will now be properly used
- 13-10-2017
- Snippets can use "**OMZ::**" prefix to easily point to `Oh-My-Zsh` plugins and libraries, e.g.:
```SystemVerilog
zplugin snippet OMZ::lib/git.zsh
zplugin snippet OMZ::plugins/git/git.plugin.zsh
```
- 12-10-2017
- The `cd` subcommand can now obtain URL and move session to **snippet** directory
- The `times` subcommand now includes statistics on snippets. Also, entries are displayed in order of loading:
```zsh
% zplugin times
Plugin loading times:
0.010 sec - OMZ::lib/git.zsh
0.001 sec - OMZ::plugins/git/git.plugin.zsh
0.003 sec - zdharma/history-search-multi-word
0.003 sec - rimraf/k
0.003 sec - zsh-users/zsh-autosuggestions
```
- 24-09-2017
- **[Code documentation](zsdoc)** for contributors and interested people.
- 13-06-2017
- Plugins can now be absolute paths:
```SystemVerilog
zplugin load %HOME/github/{directory}
zplugin load /Users/sgniazdowski/github/{directory}
zplugin load %/Users/sgniazdowski/github/{directory}
```
Completions are not automatically installed, but user can run `zplg creinstall %HOME/github/{directory}`, etc.
- 23-05-2017
- New `ice` modifier: `if`, to which you can provide a conditional expression:
```SystemVerilog
% zplugin ice if"(( 0 ))"
% zplugin snippet --command https://github.com/b4b4r07/httpstat/blob/master/httpstat.sh
% zplugin ice if"(( 1 ))"
% zplugin snippet --command https://github.com/b4b4r07/httpstat/blob/master/httpstat.sh
Setting up snippet httpstat.sh
Downloading httpstat.sh...
```

View file

@ -1,138 +0,0 @@
# HACKING.md
## Documentation
### README: Update the table of contents
1. Install [doctoc](https://github.com/thlorenz/doctoc)
2. To update the TOC, run the following command:
```zsh
doctoc --github README.md
```
### Update asciidoc and/or zshelldoc
> [!IMPORTANT]
> Make sure you have [docker](https://www.docker.com/) or [podman](https://podman.io/) installed.
1. From the root of the repo, run:
```zsh
make doc-container
```
If, for some reason, you want to build the zshelldocs or the PDF manually, you'll need:
1. Patience, zsd is very finicky about locales. You have been warned.
2. [zshelldoc (zsd)](https://github.com/zdharma-continuum/zshelldoc)
3. [asciidoc](https://asciidoc.org/)
4. `make doc`
### 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
```
### 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
```
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)
4. If all went well, head to https://zdharma-continuum.github.io/ to see your changes live.
> [!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
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
```
2. Create a new `.zunit` file in the `tests/` dir. Here's a template:
```zsh
#!/usr/bin/env zunit
@setup {
load setup
setup
}
@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
# 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
}
```
You should, of course, also check out the existing tests ;)
3. To run your new test:
```zsh
zunit --verbose tests/your_test.zunit
```
### 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
### Get the list of supported ices
To get the list in a quick-and-dirty fashion, you issue:
```zsh
zinit --help | tail -1
```
See
[zinit-autoload.zsh](https://github.com/zdharma-continuum/zinit/blob/2feb41cf70d2f782386bbaa6fda691e3bdc7f1ac/zinit-autoload.zsh#L3445-L3447)
for implementation details.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -23,14 +23,14 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.6203867"
inkscape:cx="74.072107"
inkscape:cy="160.22828"
inkscape:zoom="2"
inkscape:cx="68.859287"
inkscape:cy="119.81791"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1753"
inkscape:window-height="930"
inkscape:window-width="1280"
inkscape:window-height="671"
inkscape:window-x="3"
inkscape:window-y="0"
inkscape:window-maximized="0"
@ -42,10 +42,10 @@
id="defs4">
<inkscape:perspective
id="perspective3566"
inkscape:persp3d-origin="113.33288 : 244.41054 : 1"
inkscape:vp_z="451.81196 : 405.61434 : 1"
inkscape:persp3d-origin="113.33288 : 1113.1731 : 1"
inkscape:vp_z="451.81196 : 1274.3769 : 1"
inkscape:vp_y="0 : 919.09669 : 0"
inkscape:vp_x="-225.1462 : 405.61434 : 1"
inkscape:vp_x="-225.1462 : 1274.3769 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3536"
@ -77,106 +77,113 @@
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
inkscape:label="Layer 1"
transform="translate(-0.0114958,0.0035898)">
<g
inkscape:corner7="0.21153939 : -0.3592929 : 0.25 : 1"
inkscape:corner0="0.50329785 : -0.24812166 : 0 : 1"
inkscape:perspectiveID="#perspective3566"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="g3552"
sodipodi:type="inkscape:box3d">
<path
points="54.244639,183.61774 122.2515,114.23484 64.444513,58.282564 0.022991595,104.89478 "
d="M 0.0229916,104.89478 54.244639,183.61774 122.2515,114.23484 64.444513,58.282564 Z"
inkscape:box3dsidetype="13"
style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3562"
sodipodi:type="inkscape:box3dside" />
<path
points="0.022991595,104.89478 64.444513,58.282564 64.444513,0.0054627577 0.022991595,36.92614 "
d="m 0.0229916,36.92614 0,67.96864 64.4215214,-46.612216 0,-58.27710124 z"
inkscape:box3dsidetype="6"
style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3554"
sodipodi:type="inkscape:box3dside" />
<path
points="122.2515,44.324225 122.2515,114.23484 64.444513,58.282564 64.444513,0.0054627577 "
d="M 64.444513,0.00546276 122.2515,44.324225 l 0,69.910615 -57.806987,-55.952276 z"
inkscape:box3dsidetype="11"
style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3564"
sodipodi:type="inkscape:box3dside" />
<path
points="54.244639,99.281138 122.2515,44.324225 64.444513,0.0054627577 0.022991595,36.92614 "
d="M 0.0229916,36.92614 54.244639,99.281138 122.2515,44.324225 64.444513,0.00546276 Z"
inkscape:box3dsidetype="5"
style="fill:#4d8c9f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3556"
sodipodi:type="inkscape:box3dside" />
<path
points="54.244639,183.61774 122.2515,114.23484 122.2515,44.324225 54.244639,99.281138 "
d="m 54.244639,99.281138 0,84.336602 68.006861,-69.3829 0,-69.910615 z"
inkscape:box3dsidetype="14"
style="fill:#d7f6ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3560"
sodipodi:type="inkscape:box3dside" />
<path
points="54.244639,99.281138 54.244639,183.61774 0.022991595,104.89478 0.022991595,36.92614 "
d="m 0.0229916,36.92614 54.2216474,62.354998 0,84.336602 -54.2216474,-78.72296 z"
inkscape:box3dsidetype="3"
style="fill:#6fadbf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
id="path3558"
sodipodi:type="inkscape:box3dside" />
</g>
<g
id="text3574"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#73c2c6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="matrix(0.7058806,0,0,0.7058806,-112.65399,-453.95225)">
<path
id="path3579"
d="m 307.08638,707.39511 c 0,0 -66.67007,55.55839 -66.67007,55.55839 0,0 -8.16931,-9.30394 -8.16931,-9.30394 0,0 11.47893,-77.7946 11.47893,-77.7946 0,0 -50.32953,29.67193 -50.32953,29.67193 0,0 -5.30931,-5.9558 -5.30931,-5.9558 0,0 60.90107,-34.52658 60.90107,-34.52658 0,0 5.82389,4.40872 5.82389,4.40872 0,0 -7.5004,72.95898 -7.5004,72.95898 0,0 51.85675,-40.97311 51.85675,-40.97311 0,0 7.91798,5.95601 7.91798,5.95601 0,0 0,0 0,0"
inkscape:connector-curvature="0"
style="fill:#73c2c6;fill-opacity:1" />
</g>
<g
transform="matrix(0.74206687,0,0,0.74206687,-136.33469,-513.94264)"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text3661">
<path
inkscape:connector-curvature="0"
d="m 209.15469,820.22268 c -0.047,3.30097 -0.32618,6.01318 -0.83617,8.13007 -0.50782,2.08517 -1.19914,3.49484 -2.07085,4.23084 -0.80555,0.71547 -1.74071,0.84011 -2.80234,0.38029 -1.04065,-0.4637 -2.1282,-1.48119 -3.26106,-3.04409 -0.97678,-1.34758 -1.85346,-2.78249 -2.63214,-4.30533 -0.76246,-1.4975 -1.53256,-3.24911 -2.31003,-5.2518 0,0 -0.24146,16.11216 -0.24146,16.11216 0,0 -3.00564,-4.32587 -3.00564,-4.32587 0,0 0.78544,-51.83948 0.78544,-51.83948 0,0 3.00754,3.62854 3.00754,3.62854 0,0 -0.0601,4.00967 -0.0601,4.00967 0.83485,-0.44913 1.77056,-0.54012 2.80955,-0.26887 1.05959,0.26382 2.18884,1.11279 3.3898,2.5561 2.32287,2.79161 4.13366,6.826 5.40883,12.10673 1.30222,5.3322 1.91223,11.30688 1.81862,17.88104 0,0 0,0 0,0 m -3.47982,-4.30311 c 0.0697,-4.82983 -0.28395,-8.94743 -1.05682,-12.33685 -0.7675,-3.36584 -1.97185,-6.05089 -3.60014,-8.05187 -0.91244,-1.12129 -1.82943,-1.83469 -2.75091,-2.14488 -0.91441,-0.30781 -1.78754,-0.31362 -2.6203,-0.0207 0,0 -0.32575,21.73611 -0.32575,21.73611 0.85506,1.99442 1.59458,3.56825 2.21618,4.71473 0.63606,1.16769 1.36145,2.30367 2.17777,3.40881 1.77511,2.40317 3.19722,3.04793 4.25263,1.89977 1.0642,-1.15773 1.63555,-4.22918 1.70734,-9.20509 0,0 0,0 0,0"
id="path3666"
style="fill:#000000;fill-opacity:1" />
<path
inkscape:connector-curvature="0"
d="m 217.96783,853.60503 c 0,0 -3.62571,-4.98985 -3.62571,-4.98985 0,0 0.80683,-57.88822 0.80683,-57.88822 0,0 3.62598,4.13428 3.62598,4.13428 0,0 -0.8071,58.74379 -0.8071,58.74379 0,0 0,0 0,0"
id="path3668"
style="fill:#000000;fill-opacity:1" />
<path
inkscape:connector-curvature="0"
d="m 246.25038,892.52874 c 0,0 -4.47535,-6.15917 -4.47535,-6.15917 0,0 0.064,-5.14617 0.064,-5.14617 -1.50149,0.0605 -2.92018,-0.27481 -4.25814,-1.0002 -1.32523,-0.7185 -2.76465,-2.15446 -4.31422,-4.29438 -2.55781,-3.53227 -4.49675,-7.64523 -5.8423,-12.35078 -1.33075,-4.68108 -1.95476,-9.70422 -1.88274,-15.10466 0,0 0.37588,-28.18457 0.37588,-28.18457 0,0 3.95481,4.77141 3.95481,4.77141 0,0 -0.32935,25.10202 -0.32935,25.10202 -0.0294,2.23983 0.002,4.23903 0.0952,5.99854 0.0934,1.73493 0.31834,3.41902 0.67567,5.05451 0.37242,1.68613 0.86554,3.21444 1.48069,4.58592 0.61807,1.37796 1.52826,2.88167 2.73649,4.5172 1.08481,1.46848 2.28277,2.56553 3.59655,3.28735 1.34163,0.74933 2.6069,1.0923 3.79344,1.02308 0,0 0.42932,-34.51404 0.42932,-34.51404 0,0 4.47336,5.39704 4.47336,5.39704 0,0 -0.57337,47.0169 -0.57337,47.0169 0,0 0,0 0,0"
id="path3670"
style="fill:#000000;fill-opacity:1" />
</g>
<g
id="text3760"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="matrix(0.78129273,0,0,0.78129273,-286.46824,-545.67855)">
<path
id="path3765"
d="m 473.34182,861.0411 c -0.0214,7.67785 -1.09576,14.35657 -3.23951,20.08959 -2.16591,5.79232 -5.5358,11.02404 -10.17343,15.73194 -1.5644,1.5881 -3.1054,2.97044 -4.6224,4.14433 -1.51061,1.19285 -3.01444,2.22051 -4.5113,3.08101 0,0 0.003,-8.19904 0.003,-8.19904 0,0 0.27496,-0.27221 0.27496,-0.27221 0.8406,-0.3209 2.16742,-1.01333 3.97078,-2.07106 1.78703,-1.02008 3.55843,-2.40833 5.31463,-4.16003 1.67148,-1.66719 3.04561,-3.35503 4.12856,-5.06711 1.07717,-1.70295 1.9118,-3.40846 2.50693,-5.11976 0.59337,-1.65178 1.01734,-3.35249 1.27299,-5.1043 0.25541,-1.75012 0.38514,-3.55412 0.38939,-5.41383 0,0 0.01,-4.18712 0.01,-4.18712 -1.43666,3.23587 -2.82281,5.96852 -4.15752,8.19198 -1.32623,2.19375 -3.03438,4.30548 -5.1345,6.34044 -3.55009,3.43995 -6.41668,4.17332 -8.57059,2.13646 -2.16033,-2.1068 -3.24986,-6.96377 -3.24986,-14.562 0,-4.16555 0.374,-8.08912 1.12032,-11.75964 0.76266,-3.7047 1.79084,-7.21323 3.08063,-10.51951 1.19091,-3.06511 2.629,-5.87341 4.30886,-8.42179 1.66638,-2.55626 3.30984,-4.5192 4.93047,-5.89576 1.69448,-1.43929 3.09792,-2.35238 4.21625,-2.74674 1.12898,-0.43441 2.31012,-0.62621 3.5423,-0.57755 0,0 0.30782,-2.24649 0.30782,-2.24649 0,0 4.39432,-3.74701 4.39432,-3.74701 0,0 -0.11254,40.3552 -0.11254,40.3552 0,0 0,0 0,0 m -4.66141,-2.91763 c 0,0 0.0573,-25.11334 0.0573,-25.11334 -1.26565,0.16769 -2.45505,0.53979 -3.56661,1.11793 -1.10068,0.5386 -2.20799,1.2901 -3.32193,2.25627 -2.72405,2.3627 -4.89614,5.72118 -6.49681,10.07479 -1.61245,4.38565 -2.42478,9.42157 -2.42807,15.07832 -0.003,5.36468 0.59414,8.86704 1.78591,10.50372 1.18406,1.62608 3.13522,1.14038 5.83165,-1.42302 1.43024,-1.35967 2.85096,-3.13965 4.26245,-5.33575 1.41877,-2.22451 2.70996,-4.61053 3.87606,-7.15892 0,0 0,0 0,0"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:1" />
<path
id="path3767"
d="m 487.1056,801.67265 c 0,0 -4.93739,4.11188 -4.93739,4.11188 0,0 0.0291,-7.82842 0.0291,-7.82842 0,0 4.9411,-4.01232 4.9411,-4.01232 0,0 -0.0328,7.72886 -0.0328,7.72886 0,0 0,0 0,0 m -0.49289,51.62315 c 0,0 -4.35649,4.22911 -4.35649,4.22911 0,0 0.16688,-44.48659 0.16688,-44.48659 0,0 4.37524,-3.73074 4.37524,-3.73074 0,0 -0.18563,43.98822 -0.18563,43.98822 0,0 0,0 0,0"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:1" />
<path
id="path3769"
d="m 514.33397,826.38508 c 0,0 -3.72687,3.61789 -3.72687,3.61789 0,0 0.15925,-23.43413 0.15925,-23.43413 0.0129,-1.8966 -0.0353,-3.61691 -0.14473,-5.16156 -0.10936,-1.57097 -0.32209,-2.68444 -0.63857,-3.3402 -0.32997,-0.74435 -0.81122,-1.08789 -1.44499,-1.02925 -0.636,0.0339 -1.46771,0.49629 -2.49784,1.39087 -1.06391,0.92391 -2.18598,2.37406 -3.36705,4.35579 -1.18868,1.9945 -2.3368,4.22487 -3.44341,6.69216 0,0 -0.17639,31.74224 -0.17639,31.74224 0,0 -4.06779,3.94885 -4.06779,3.94885 0,0 0.22032,-43.02923 0.22032,-43.02923 0,0 4.08399,-3.48239 4.08399,-3.48239 0,0 -0.0264,4.74426 -0.0264,4.74426 1.26568,-2.94188 2.56302,-5.49521 3.89106,-7.66278 1.3185,-2.15201 2.65888,-3.80379 4.02027,-4.96015 2.46197,-2.0912 4.30672,-2.32081 5.55269,-0.72029 1.2362,1.58798 1.83266,4.88033 1.79667,9.88235 0,0 -0.19025,26.44557 -0.19025,26.44557 0,0 0,0 0,0"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:1" />
id="g6632"
inkscape:export-xdpi="98.032669"
inkscape:export-ydpi="98.032669"
transform="translate(-298.99365,-727.33213)">
<g
sodipodi:type="inkscape:box3d"
id="g3552"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:perspectiveID="#perspective3566"
inkscape:corner0="0.50329785 : -0.24812166 : 0 : 1"
inkscape:corner7="0.21153939 : -0.3592929 : 0.25 : 1">
<path
sodipodi:type="inkscape:box3dside"
id="path3562"
style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="13"
d="m 299.01664,832.21427 54.22165,78.72296 68.00686,-69.3829 -57.80699,-55.95228 z"
points="353.23829,910.93723 421.24515,841.55433 363.43816,785.60205 299.01664,832.21427 " />
<path
sodipodi:type="inkscape:box3dside"
id="path3554"
style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="6"
d="m 299.01664,764.24563 0,67.96864 64.42152,-46.61222 0,-58.2771 z"
points="299.01664,832.21427 363.43816,785.60205 363.43816,727.32495 299.01664,764.24563 " />
<path
sodipodi:type="inkscape:box3dside"
id="path3564"
style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="11"
d="m 363.43816,727.32495 57.80699,44.31876 0,69.91062 -57.80699,-55.95228 z"
points="421.24515,771.64371 421.24515,841.55433 363.43816,785.60205 363.43816,727.32495 " />
<path
sodipodi:type="inkscape:box3dside"
id="path3556"
style="fill:#4d8c9f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="5"
d="m 299.01664,764.24563 54.22165,62.355 68.00686,-54.95692 -57.80699,-44.31876 z"
points="353.23829,826.60063 421.24515,771.64371 363.43816,727.32495 299.01664,764.24563 " />
<path
sodipodi:type="inkscape:box3dside"
id="path3560"
style="fill:#d7f6ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="14"
d="m 353.23829,826.60063 0,84.3366 68.00686,-69.3829 0,-69.91062 z"
points="353.23829,910.93723 421.24515,841.55433 421.24515,771.64371 353.23829,826.60063 " />
<path
sodipodi:type="inkscape:box3dside"
id="path3558"
style="fill:#6fadbf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
inkscape:box3dsidetype="3"
d="m 299.01664,764.24563 54.22165,62.355 0,84.3366 -54.22165,-78.72296 z"
points="353.23829,826.60063 353.23829,910.93723 299.01664,832.21427 299.01664,764.24563 " />
</g>
<g
transform="matrix(0.7058806,0,0,0.7058806,186.33966,273.37988)"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#73c2c6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text3574">
<path
style="fill:#73c2c6;fill-opacity:1"
inkscape:connector-curvature="0"
d="m 307.08638,707.39511 c 0,0 -66.67007,55.55839 -66.67007,55.55839 0,0 -8.16931,-9.30394 -8.16931,-9.30394 0,0 11.47893,-77.7946 11.47893,-77.7946 0,0 -50.32953,29.67193 -50.32953,29.67193 0,0 -5.30931,-5.9558 -5.30931,-5.9558 0,0 60.90107,-34.52658 60.90107,-34.52658 0,0 5.82389,4.40872 5.82389,4.40872 0,0 -7.5004,72.95898 -7.5004,72.95898 0,0 51.85675,-40.97311 51.85675,-40.97311 0,0 7.91798,5.95601 7.91798,5.95601 0,0 0,0 0,0"
id="path3579" />
</g>
<g
id="text3661"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
transform="matrix(0.74206687,0,0,0.74206687,162.65896,213.38949)">
<path
style="fill:#000000;fill-opacity:1"
id="path3666"
d="m 209.15469,820.22268 c -0.047,3.30097 -0.32618,6.01318 -0.83617,8.13007 -0.50782,2.08517 -1.19914,3.49484 -2.07085,4.23084 -0.80555,0.71547 -1.74071,0.84011 -2.80234,0.38029 -1.04065,-0.4637 -2.1282,-1.48119 -3.26106,-3.04409 -0.97678,-1.34758 -1.85346,-2.78249 -2.63214,-4.30533 -0.76246,-1.4975 -1.53256,-3.24911 -2.31003,-5.2518 0,0 -0.24146,16.11216 -0.24146,16.11216 0,0 -3.00564,-4.32587 -3.00564,-4.32587 0,0 0.78544,-51.83948 0.78544,-51.83948 0,0 3.00754,3.62854 3.00754,3.62854 0,0 -0.0601,4.00967 -0.0601,4.00967 0.83485,-0.44913 1.77056,-0.54012 2.80955,-0.26887 1.05959,0.26382 2.18884,1.11279 3.3898,2.5561 2.32287,2.79161 4.13366,6.826 5.40883,12.10673 1.30222,5.3322 1.91223,11.30688 1.81862,17.88104 0,0 0,0 0,0 m -3.47982,-4.30311 c 0.0697,-4.82983 -0.28395,-8.94743 -1.05682,-12.33685 -0.7675,-3.36584 -1.97185,-6.05089 -3.60014,-8.05187 -0.91244,-1.12129 -1.82943,-1.83469 -2.75091,-2.14488 -0.91441,-0.30781 -1.78754,-0.31362 -2.6203,-0.0207 0,0 -0.32575,21.73611 -0.32575,21.73611 0.85506,1.99442 1.59458,3.56825 2.21618,4.71473 0.63606,1.16769 1.36145,2.30367 2.17777,3.40881 1.77511,2.40317 3.19722,3.04793 4.25263,1.89977 1.0642,-1.15773 1.63555,-4.22918 1.70734,-9.20509 0,0 0,0 0,0"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;fill-opacity:1"
id="path3668"
d="m 217.96783,853.60503 c 0,0 -3.62571,-4.98985 -3.62571,-4.98985 0,0 0.80683,-57.88822 0.80683,-57.88822 0,0 3.62598,4.13428 3.62598,4.13428 0,0 -0.8071,58.74379 -0.8071,58.74379 0,0 0,0 0,0"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;fill-opacity:1"
id="path3670"
d="m 246.25038,892.52874 c 0,0 -4.47535,-6.15917 -4.47535,-6.15917 0,0 0.064,-5.14617 0.064,-5.14617 -1.50149,0.0605 -2.92018,-0.27481 -4.25814,-1.0002 -1.32523,-0.7185 -2.76465,-2.15446 -4.31422,-4.29438 -2.55781,-3.53227 -4.49675,-7.64523 -5.8423,-12.35078 -1.33075,-4.68108 -1.95476,-9.70422 -1.88274,-15.10466 0,0 0.37588,-28.18457 0.37588,-28.18457 0,0 3.95481,4.77141 3.95481,4.77141 0,0 -0.32935,25.10202 -0.32935,25.10202 -0.0294,2.23983 0.002,4.23903 0.0952,5.99854 0.0934,1.73493 0.31834,3.41902 0.67567,5.05451 0.37242,1.68613 0.86554,3.21444 1.48069,4.58592 0.61807,1.37796 1.52826,2.88167 2.73649,4.5172 1.08481,1.46848 2.28277,2.56553 3.59655,3.28735 1.34163,0.74933 2.6069,1.0923 3.79344,1.02308 0,0 0.42932,-34.51404 0.42932,-34.51404 0,0 4.47336,5.39704 4.47336,5.39704 0,0 -0.57337,47.0169 -0.57337,47.0169 0,0 0,0 0,0"
inkscape:connector-curvature="0" />
</g>
<g
transform="matrix(0.78129273,0,0,0.78129273,12.525411,181.65358)"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text3760">
<path
style="fill:#000000;fill-opacity:1"
inkscape:connector-curvature="0"
d="m 473.34182,861.0411 c -0.0214,7.67785 -1.09576,14.35657 -3.23951,20.08959 -2.16591,5.79232 -5.5358,11.02404 -10.17343,15.73194 -1.5644,1.5881 -3.1054,2.97044 -4.6224,4.14433 -1.51061,1.19285 -3.01444,2.22051 -4.5113,3.08101 0,0 0.003,-8.19904 0.003,-8.19904 0,0 0.27496,-0.27221 0.27496,-0.27221 0.8406,-0.3209 2.16742,-1.01333 3.97078,-2.07106 1.78703,-1.02008 3.55843,-2.40833 5.31463,-4.16003 1.67148,-1.66719 3.04561,-3.35503 4.12856,-5.06711 1.07717,-1.70295 1.9118,-3.40846 2.50693,-5.11976 0.59337,-1.65178 1.01734,-3.35249 1.27299,-5.1043 0.25541,-1.75012 0.38514,-3.55412 0.38939,-5.41383 0,0 0.01,-4.18712 0.01,-4.18712 -1.43666,3.23587 -2.82281,5.96852 -4.15752,8.19198 -1.32623,2.19375 -3.03438,4.30548 -5.1345,6.34044 -3.55009,3.43995 -6.41668,4.17332 -8.57059,2.13646 -2.16033,-2.1068 -3.24986,-6.96377 -3.24986,-14.562 0,-4.16555 0.374,-8.08912 1.12032,-11.75964 0.76266,-3.7047 1.79084,-7.21323 3.08063,-10.51951 1.19091,-3.06511 2.629,-5.87341 4.30886,-8.42179 1.66638,-2.55626 3.30984,-4.5192 4.93047,-5.89576 1.69448,-1.43929 3.09792,-2.35238 4.21625,-2.74674 1.12898,-0.43441 2.31012,-0.62621 3.5423,-0.57755 0,0 0.30782,-2.24649 0.30782,-2.24649 0,0 4.39432,-3.74701 4.39432,-3.74701 0,0 -0.11254,40.3552 -0.11254,40.3552 0,0 0,0 0,0 m -4.66141,-2.91763 c 0,0 0.0573,-25.11334 0.0573,-25.11334 -1.26565,0.16769 -2.45505,0.53979 -3.56661,1.11793 -1.10068,0.5386 -2.20799,1.2901 -3.32193,2.25627 -2.72405,2.3627 -4.89614,5.72118 -6.49681,10.07479 -1.61245,4.38565 -2.42478,9.42157 -2.42807,15.07832 -0.003,5.36468 0.59414,8.86704 1.78591,10.50372 1.18406,1.62608 3.13522,1.14038 5.83165,-1.42302 1.43024,-1.35967 2.85096,-3.13965 4.26245,-5.33575 1.41877,-2.22451 2.70996,-4.61053 3.87606,-7.15892 0,0 0,0 0,0"
id="path3765" />
<path
style="fill:#000000;fill-opacity:1"
inkscape:connector-curvature="0"
d="m 487.1056,801.67265 c 0,0 -4.93739,4.11188 -4.93739,4.11188 0,0 0.0291,-7.82842 0.0291,-7.82842 0,0 4.9411,-4.01232 4.9411,-4.01232 0,0 -0.0328,7.72886 -0.0328,7.72886 0,0 0,0 0,0 m -0.49289,51.62315 c 0,0 -4.35649,4.22911 -4.35649,4.22911 0,0 0.16688,-44.48659 0.16688,-44.48659 0,0 4.37524,-3.73074 4.37524,-3.73074 0,0 -0.18563,43.98822 -0.18563,43.98822 0,0 0,0 0,0"
id="path3767" />
<path
style="fill:#000000;fill-opacity:1"
inkscape:connector-curvature="0"
d="m 514.33397,826.38508 c 0,0 -3.72687,3.61789 -3.72687,3.61789 0,0 0.15925,-23.43413 0.15925,-23.43413 0.0129,-1.8966 -0.0353,-3.61691 -0.14473,-5.16156 -0.10936,-1.57097 -0.32209,-2.68444 -0.63857,-3.3402 -0.32997,-0.74435 -0.81122,-1.08789 -1.44499,-1.02925 -0.636,0.0339 -1.46771,0.49629 -2.49784,1.39087 -1.06391,0.92391 -2.18598,2.37406 -3.36705,4.35579 -1.18868,1.9945 -2.3368,4.22487 -3.44341,6.69216 0,0 -0.17639,31.74224 -0.17639,31.74224 0,0 -4.06779,3.94885 -4.06779,3.94885 0,0 0.22032,-43.02923 0.22032,-43.02923 0,0 4.08399,-3.48239 4.08399,-3.48239 0,0 -0.0264,4.74426 -0.0264,4.74426 1.26568,-2.94188 2.56302,-5.49521 3.89106,-7.66278 1.3185,-2.15201 2.65888,-3.80379 4.02027,-4.96015 2.46197,-2.0912 4.30672,-2.32081 5.55269,-0.72029 1.2362,1.58798 1.83266,4.88033 1.79667,9.88235 0,0 -0.19025,26.44557 -0.19025,26.44557 0,0 0,0 0,0"
id="path3769" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

36
doc/install.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/sh
#
# Clone or pull
#
ZPLG_HOME="${ZDOTDIR:-$HOME}/.zplugin"
if ! test -d "$ZPLG_HOME"; then
mkdir "$ZPLG_HOME"
chmod g-rwX "$ZPLG_HOME"
fi
echo ">>> Downloading zplugin to $ZPLG_HOME/bin"
if test -d "$ZPLG_HOME/bin/.git"; then
cd "$ZPLG_HOME/bin"
git pull origin master
else
cd "$ZPLG_HOME"
git clone https://github.com/psprint/zplugin.git bin
fi
echo ">>> Done"
#
# Modify .zshrc
#
echo ">>> Updating .zshrc (with one line)"
if ! grep zplugin "$ZPLG_HOME/../.zshrc" >/dev/null 2>&1; then
echo >> "$ZPLG_HOME/../.zshrc"
echo "### Added by Zplugin installer" >> "$ZPLG_HOME/../.zshrc"
echo "source '$ZPLG_HOME/bin/zplugin.zsh'" >> "$ZPLG_HOME/../.zshrc"
echo ">>> Done"
else
echo ">>> .zshrc already updated, not making changes"
fi

357
doc/options.txt Normal file
View file

@ -0,0 +1,357 @@
Remembered state of Zsh during loading of a sophisticated plugin first
with no problem second one with slight (extendedglob) recognized problem
RESULT: prefix ||, option/MATCH: |noksharrays|
noaliases off
allexport off
noalwayslastprompt off
alwaystoend off
noappendhistory off
autocd on
autocontinue off
noautolist off
noautomenu on
autonamedirs off
noautoparamkeys off
noautoparamslash off
autopushd on
noautoremoveslash off
autoresume off
nobadpattern off
nobanghist off
nobareglobqual off
bashautolist off
bashrematch off
nobeep off
nobgnice off
braceccl off
bsdecho off
nocaseglob off
nocasematch off
cbases on
cdablevars off
chasedots off
chaselinks off
nocheckjobs off
noclobber off
combiningchars off
completealiases off
completeinword on
continueonerror off
correct off
correctall off
cprecedences off
cshjunkiehistory off
cshjunkieloops off
cshjunkiequotes off
cshnullcmd off
cshnullglob off
nodebugbeforecmd off
dvorak off
emacs off
noequals off
errexit off
errreturn off
noevallineno off
noexec off
extendedglob on
extendedhistory off
noflowcontrol off
forcefloat off
nofunctionargzero off
noglob off
noglobalexport off
noglobalrcs off
globassign off
globcomplete off
globdots off
globsubst off
nohashcmds off
nohashdirs off
hashexecutablesonly off
nohashlistall off
histallowclobber off
nohistbeep off
histexpiredupsfirst off
histfcntllock off
histfindnodups off
histignorealldups off
histignoredups on
histignorespace off
histlexwords off
histnofunctions off
histnostore off
histreduceblanks off
nohistsavebycopy off
histsavenodups off
histsubstpattern off
histverify off
nohup off
ignorebraces off
ignoreclosebraces off
ignoreeof on
incappendhistory on
incappendhistorytime off
interactive on
interactivecomments on
ksharrays off
kshautoload off
kshglob off
kshoptionprint on
kshtypeset off
kshzerosubscript off
nolistambiguous off
nolistbeep off
listpacked on
listrowsfirst off
nolisttypes off
localloops off
localoptions off
localpatterns off
localtraps off
login off
longlistjobs off
magicequalsubst off
mailwarning off
markdirs off
menucomplete off
monitor on
nomultibyte off
nomultifuncdef off
nomultios off
nonomatch off
nonotify off
nullglob off
numericglobsort on
octalzeroes on
overstrike off
pathdirs off
pathscript off
pipefail off
posixaliases off
posixargzero off
posixbuiltins off
posixcd off
posixidentifiers off
posixjobs off
posixstrings off
posixtraps off
printeightbit off
printexitvalue off
privileged off
promptbang off
nopromptcr on
nopromptpercent off
nopromptsp off
promptsubst on
pushdignoredups on
pushdminus off
pushdsilent off
pushdtohome off
rcexpandparam off
rcquotes off
norcs off
recexact off
rematchpcre off
restricted off
rmstarsilent off
rmstarwait off
sharehistory off
shfileexpansion off
shglob off
shinstdin on
shnullcmd off
shoptionletters off
noshortloops off
shwordsplit off
singlecommand off
singlelinezle off
sourcetrace off
sunkeyboardhack off
transientrprompt off
trapsasync off
typesetsilent off
nounset off
verbose off
vi off
warncreateglobal off
xtrace off
zle on
RESULT: prefix |localoptions|, option/MATCH: ||
noaliases off
allexport off
noalwayslastprompt off
alwaystoend off
noappendhistory off
autocd off
autocontinue off
noautolist off
noautomenu on
autonamedirs off
noautoparamkeys off
noautoparamslash off
autopushd on
noautoremoveslash off
autoresume off
nobadpattern off
nobanghist off
nobareglobqual off
bashautolist off
bashrematch off
nobeep off
nobgnice off
braceccl off
bsdecho off
nocaseglob off
nocasematch off
cbases on
cdablevars off
chasedots off
chaselinks off
nocheckjobs off
noclobber off
combiningchars off
completealiases off
completeinword on
continueonerror off
correct off
correctall off
cprecedences off
cshjunkiehistory off
cshjunkieloops off
cshjunkiequotes off
cshnullcmd off
cshnullglob off
nodebugbeforecmd off
dvorak off
emacs off
noequals off
errexit off
errreturn off
noevallineno off
noexec off
extendedglob off
extendedhistory off
noflowcontrol off
forcefloat off
nofunctionargzero off
noglob off
noglobalexport off
noglobalrcs off
globassign off
globcomplete off
globdots off
globsubst off
nohashcmds off
nohashdirs off
hashexecutablesonly off
nohashlistall off
histallowclobber off
nohistbeep off
histexpiredupsfirst off
histfcntllock off
histfindnodups off
histignorealldups off
histignoredups on
histignorespace off
histlexwords off
histnofunctions off
histnostore off
histreduceblanks off
nohistsavebycopy off
histsavenodups off
histsubstpattern off
histverify off
nohup off
ignorebraces off
ignoreclosebraces off
ignoreeof on
incappendhistory on
incappendhistorytime off
interactive on
interactivecomments on
ksharrays off
kshautoload off
kshglob off
kshoptionprint on
kshtypeset off
kshzerosubscript off
nolistambiguous off
nolistbeep off
listpacked on
listrowsfirst off
nolisttypes off
localloops off
localoptions on
localpatterns on
localtraps on
login off
longlistjobs off
magicequalsubst off
mailwarning off
markdirs off
menucomplete off
monitor on
nomultibyte off
nomultifuncdef off
nomultios off
nonomatch off
nonotify off
nullglob off
numericglobsort off
octalzeroes off
overstrike off
pathdirs off
pathscript off
pipefail off
posixaliases off
posixargzero off
posixbuiltins off
posixcd off
posixidentifiers off
posixjobs off
posixstrings off
posixtraps off
printeightbit off
printexitvalue off
privileged off
promptbang off
nopromptcr on
nopromptpercent off
nopromptsp off
promptsubst on
pushdignoredups off
pushdminus off
pushdsilent off
pushdtohome off
rcexpandparam off
rcquotes off
norcs off
recexact off
rematchpcre off
restricted off
rmstarsilent off
rmstarwait off
sharehistory off
shfileexpansion off
shglob off
shinstdin on
shnullcmd off
shoptionletters off
noshortloops off
shwordsplit off
singlecommand off
singlelinezle off
sourcetrace off
sunkeyboardhack off
transientrprompt off
trapsasync off
typesetsilent off
nounset off
verbose off
vi off
warncreateglobal off
xtrace off
zle on

49
doc/tested.txt Normal file
View file

@ -0,0 +1,49 @@
horosgrisa/autoenv
adolfoabegg/browse-commit
arzzen/calc.plugin.zsh
walesmd/caniuse.plugin.zsh
mollifier/cd-gitroot
MikeDacre/cdbk
willghatch/zsh-cdr
rutchkiwi/copyzshell (required OMZ directory structure simulation)
veelenga/crystal-zsh
jgrowl/depot_tools
gusaiani/elixir-oh-my-zsh
b4b4r07/emoji-cli
b4b4r07/enhancd
uvaes/fzf-marks
voronkovich/get-jquery.plugin.zsh
fontno/ghost_zeus
peterhurford/git-aliases.zsh
unixorn/git-extra-commands
peterhurford/git-it-on.zsh
tevren/gitfast-zsh-plugin
zsh-users/zsh-syntax-highlighting
voronkovich/gitignore.plugin.zsh
bbenne10/goenv
or17191/going_places
Seinh/git-prune
joepvd/grep2awk (failed, improper bindkey, the same with antigen)
robertzk/hipchat.zsh (unfull, HIPCHAT_API_TOKEN was required)
willghatch/zsh-hooks (problematic usage, the same with antigen)
mgryszko/jvm (problematic usage, the same with antigen)
rimraf/k
d12frosted/kitsunebook.plugin.zsh (a completion done via manual compdef call)
lesaint/lesaint-mvn
Temikus/mac-packaging
hlohm/mfunc (doesn't fully work, the same with antigen)
horosgrisa/mysql-colorize
voronkovich/mysql.plugin.zsh
bric3/nice-exit-code
chrissicool/zsh-bash
zsh-users/zaw
benclark/parallels-zsh-plugin
oz/safe-paste (works but has issues, the same on antigen)
willghatch/zsh-saneopt
willghatch/zsh-snippets (misses a bindkey, the same with antigen, otherwise works)
skipped:
Stibbons/crayon-syntax-zsh (a wordpress plugin)
jsks/czhttpd (not a plugin, a software, a command)
Vifon/deer (not a plugin, provides manual installation instructions)

File diff suppressed because it is too large Load diff

View file

@ -1,57 +0,0 @@
# This Makefile is to convert supplied Asciidoc files into
# other formats like pdf and man. The files contain Zplugin's
# code documentation.
#
# *.adoc files are generated by Makefile from upper (i.e. top)
# directory.
all: man pdf
# MANUALS
# Converted with a2x from asciidoc package
man: man/zinit.zsh.1 man/zinit-side.zsh.1 man/zinit-install.zsh.1 man/zinit-autoload.zsh.1
man/zinit.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit.zsh.adoc
man/zinit-side.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-side.zsh.adoc
man/zinit-install.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-install.zsh.adoc
man/zinit-autoload.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit-autoload.zsh.adoc
# PDFS
# Uses asciidoctor not a2x (i.e. not asciidoc)
pdf: pdf/zinit.zsh.pdf pdf/zinit-side.zsh.pdf pdf/zinit-install.zsh.pdf pdf/zinit-autoload.zsh.pdf
pdf/zinit.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit.zsh.adoc
pdf/zinit-side.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-side.zsh.adoc
pdf/zinit-install.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-install.zsh.adoc
pdf/zinit-autoload.zsh.pdf:
@mkdir -p pdf
asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-autoload.zsh.adoc
clean:
rm -rf man pdf data
.PHONY: man pdf clean
# vim:noet:sts=8:ts=8

View file

@ -1,22 +0,0 @@
# Code documentation
Here is `Asciidoc` code documentation generated using [Zshelldoc](https://github.com/zdharma-continuum/zshelldoc). There
are `4` Zinit's source files, the main one is [zinit.zsh](zinit.zsh.adoc). The documentation lists all functions,
interactions between them, their comments and features used.
Github allows to directly view `Asciidoc` documents:
- [zinit.zsh](zinit.zsh.adoc) always loaded, in `.zshrc`
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit.zsh))
- [zinit-side.zsh](zinit-side.zsh.adoc) common functions, loaded by `*-install` and `*-autoload` scripts
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-side.zsh))
- [zinit-install.zsh](zinit-install.zsh.adoc) functions used only when installing a plugin or snippet
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-install.zsh))
- [zinit-autoload.zsh](zinit-autoload.zsh.adoc) functions used only in interactive `Zinit` invocations
([pdf](https://zdharma-continuum.github.io/zinit/wiki/zinit-autoload.zsh/))
# PDFs, man pages, etc.
Formats other than `Asciidoc` can be produced by using provided Makefile. For example, issuing `make pdf` will create
and populate a new directory `pdf` (requires `asciidoctor`, install with `gem install asciidoctor-pdf --pre`).
`make man` will create man pages (requires package `asciidoc`, uses its command `a2x`, which is quite slow).

View file

@ -1,185 +0,0 @@
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.).

File diff suppressed because it is too large Load diff

View file

@ -1,854 +0,0 @@
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 59 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.zsh/.zinit-cd-quiet
|-- zinit-side.zsh/.zinit-store-ices
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-cd-quiet
`-- 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 66 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 197 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 <URL>'. 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). Calls functions:
.zinit-mirror-using-svn
`-- zinit.zsh/.zinit-cd-quiet
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 222 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-cd-quiet
`-- 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.zsh/.zinit-cd-quiet
|   |-- zinit-side.zsh/.zinit-store-ices
|   |-- zinit.zsh/+zi-log
|   |-- zinit.zsh/.zinit-cd-quiet
|   `-- 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.
Executable permissions are determined solely by the execute bit already
stored in the archive — i.e. whatever the package author intended.
No heuristics (file(1), shebang scanning, etc.) are applied.
$1 - url
$2 - file
____
Has 284 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 22 line(s). Calls functions:
∞zinit-atclone-hook
|-- zinit-side.zsh/.zinit-countdown
|-- zinit.zsh/.zinit-cd-quiet
|-- zinit.zsh/.zinit-restore-dir
`-- 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-atpull-e-hook
Has 20 line(s). Calls functions:
∞zinit-atpull-e-hook
|-- .zinit-at-eval
|   `-- zinit.zsh/@zinit-substitute
|-- zinit-side.zsh/.zinit-countdown
|-- zinit.zsh/.zinit-cd-quiet
`-- zinit.zsh/.zinit-restore-dir
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
==== ∞zinit-atpull-hook
Has 20 line(s). Calls functions:
∞zinit-atpull-hook
|-- .zinit-at-eval
|   `-- zinit.zsh/@zinit-substitute
|-- zinit-side.zsh/.zinit-countdown
|-- zinit.zsh/.zinit-cd-quiet
`-- zinit.zsh/.zinit-restore-dir
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 49 line(s). Calls functions:
∞zinit-configure-base-hook
|-- zinit.zsh/+zi-log
|-- zinit.zsh/.zinit-cd-quiet
|-- zinit.zsh/.zinit-restore-dir
`-- 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-cd-quiet
|-- zinit.zsh/.zinit-restore-dir
`-- 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-cd-quiet
|-- zinit.zsh/.zinit-restore-dir
`-- 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-cd-quiet
`-- 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-cd-quiet
`-- zinit.zsh/@zinit-substitute
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-cd-quiet
`-- 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 <names ...>'
____
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

View file

@ -1,285 +0,0 @@
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

File diff suppressed because it is too large Load diff

View file

@ -1,41 +0,0 @@
ARG VERSION=latest
FROM alpine:${VERSION}
ARG PUSERNAME=user01
ARG PUID=1000
ARG PGID=1000
ARG TERM=xterm-256color
ARG ZINIT_ZSH_VERSION
ENV PUSERNAME=${PUSERNAME} PUID=${PUID} PGID=${PGID} \
SHELL=/bin/zsh TERM=${TERM} ZINIT_ZSH_VERSION=${ZINIT_ZSH_VERSION}
RUN apk --no-cache --virtual base add \
coreutils curl git libuser rsync sudo zsh && \
apk --no-cache --virtual zsh-build-tools add \
autoconf bash build-base ncurses-dev && \
apk --no-cache --virtual dev-tools add \
go jq nodejs-dev npm ruby-dev neovim
RUN sed -ir 's#^(root:.+):/bin/ash#\1:/bin/zsh#' /etc/passwd && \
adduser -D -s /bin/zsh -u "${PUID}" -h "/home/${PUSERNAME}" \
"${PUSERNAME}" && \
printf "${PUSERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
mkdir -p /src /data /data-static && \
chown -R "${PUID}:${PGID}" /data /data-static && \
ln -sfv /src/docker/zshenv /home/${PUSERNAME}/.zshenv && \
ln -sfv /src/docker/zshrc /home/${PUSERNAME}/.zshrc
WORKDIR /home/${PUSERNAME}
VOLUME ["/src", "/data"]
COPY --chown=${PUSERNAME} . /src
USER ${PUSERNAME}
# Fetch keys config and store it outside of ZINIT[HOME_DIR] since it might get
# overridden at runtime (the /data volume)
RUN ZINIT_HOME_DIR=/data-static ZSH_NO_INIT=1 \
zsh -ils -c -- '@zinit-scheduler burst'
CMD ["/bin/zsh"]

View file

@ -1,26 +0,0 @@
# Fix permissions on /data
if [[ -z "$QUIET" ]]
then
echo "Setting owner of /data to ${PUID}:${PGID}" >&2
fi
sudo chown "${PUID}:${PGID}" /data
sudo chown -R "${PUID}:${PGID}" /data
# sync files between /data-static and /data
if [[ -z "$NOTHING_FANCY" ]]
then
if [[ -z "$QUIET" ]]
then
echo "Copying files from /data-static to /data" >&2
fi
rsync -raq /data-static/ /data
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,69 +0,0 @@
#!/usr/bin/env zsh
zinit::setup() {
source /src/zinit.zsh
}
zinit::reload() {
local zf
for zf in /src/*.zsh
do
source "$zf"
done
}
zinit::setup-keys() {
zinit snippet OMZL::key-bindings.zsh
}
zinit::setup-annexes() {
zinit light-mode compile'*handler' for \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-default-ice \
zdharma-continuum/zinit-annex-meta-plugins \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-readurl \
zdharma-continuum/zinit-annex-rust \
zdharma-continuum/zinit-annex-submods \
zdharma-continuum/zinit-annex-unscope
}
zinit::setup-annexes-extra() {
# Dependencies
sudo apk add ruby-dev grep tree
zinit::install-zshelldoc
zinit light-mode compile'*handler' for \
zdharma-continuum/zinit-annex-man \
zdharma-continuum/zinit-annex-test
}
zinit::install-zshelldoc() {
zinit light-mode \
make"PREFIX=$ZPFX install" \
for zdharma-continuum/zshelldoc
}
zinit::setup-minimal() {
zinit wait lucid light-mode for \
atinit"zicompinit; zicdreplay" \
zdharma-continuum/fast-syntax-highlighting \
atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
blockf atpull'zinit creinstall -q .' \
zsh-users/zsh-completions
}
zinit::pack-zsh() {
local version="$1"
zinit pack"$version" for zsh
}
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,21 +0,0 @@
# Make sure TERM is set
# Without a TERM value some ices might be ignored
# https://github.com/zdharma-continuum/zinit/issues/97
export TERM=${TERM:-xterm-256color}
# Set SHELL
export SHELL=${SHELL:-${commands[zsh]}}
typeset -Ag ZINIT
# ZINIT_HOME_DIR is used at build time to force the installation of plugins
# etc to /data-static
export ZINIT[HOME_DIR]=${ZINIT_HOME_DIR:-/data}
export ZINIT[BIN_DIR]=/src
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,41 +0,0 @@
# Initialization. Trigger stuff that only needs to be run once, at startup.
if [[ "$$" == 1 ]] && [[ -z "$ZSH_NO_INIT" ]]
then
source /src/docker/init.zsh
fi
# load zinit
source /src/zinit.zsh
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# load zinit setup utility functions
source /src/docker/utils.zsh
# Add ZPFX/bin and GOPATH/bin to PATH
typeset -U path
path=("${ZPFX:-${HOME}/.local/share/zinit/polaris}/bin" "${HOME}/go/bin" $path)
# Install custom zsh version
if [[ -n "$ZINIT_ZSH_VERSION" ]]
then
zinit::pack-zsh "$ZINIT_ZSH_VERSION"
fi
source /src/docker/zshrc-fancy
# Source init file
INIT_FILE="/init.zsh"
if [[ -r "$INIT_FILE" ]]
then
source "$INIT_FILE"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,39 +0,0 @@
[[ -n "$NOTHING_FANCY" ]] && return
# Annexes
zinit::setup-annexes
# Setup keys
zinit::setup-keys
# Aliases
alias ls="ls --color=auto"
alias vim="nvim"
alias re-init="source /init.zsh"
# History
HISTFILE=${HOME}/.local/share/zsh/history
HISTSIZE=1000
SAVEHIST=1000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt share_history
mkdir -p ${HISTFILE:A:h}
# Completions
autoload -Uz compinit
compinit
zinit cdreplay -q
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,81 +0,0 @@
#!/usr/bin/env bash
build() {
cd "$(
cd "$(dirname "$0")" > /dev/null 2>&1
pwd -P
)" || exit 9
local image_name="${1:-zinit}"
local tag="${2:-latest}"
local zsh_version="${3}"
shift 3
local dockerfile="../docker/Dockerfile"
if [[ -n $zsh_version ]]; then
tag="zsh${zsh_version}-${tag}"
fi
echo -e "\e[34mBuilding image: ${image_name}\e[0m" >&2
local -a args
[[ -n $NO_CACHE ]] && args+=(--no-cache "$@")
if docker build \
--build-arg "PUSERNAME=$(id -u -n)" \
--build-arg "PUID=$(id -u)" \
--build-arg "PGID=$(id -g)" \
--build-arg "TERM=${TERM:-xterm-256color}" \
--build-arg "ZINIT_ZSH_VERSION=${zsh_version}" \
--file "$dockerfile" \
--tag "${image_name}:${tag}" \
"${args[@]}" \
"$(realpath ..)"; then
{
echo -e "\e[34mTo use this image for zunit tests run: \e[0m"
echo -e "\e[34mexport CONTAINER_IMAGE=\"${image_name}\" CONTAINER_TAG=\"${tag}\"\e[0m"
echo -e "\e[34mzunit run --verbose\e[0m"
} >&2
else
echo -e "\e[31m❌ Container failed to build.\e[0m" >&2
return 1
fi
}
if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then
BUILD_ZSH_VERSION="${BUILD_ZSH_VERSION:-}"
CONTAINER_IMAGE="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
CONTAINER_TAG="${CONTAINER_TAG:-latest}"
NO_CACHE="${NO_CACHE:-}"
while [[ -n $* ]]; do
case "$1" in
--image | -i)
CONTAINER_IMAGE="$2"
shift 2
;;
--no-cache | -N)
NO_CACHE=1
shift
;;
--zsh-version | -zv | --zv)
BUILD_ZSH_VERSION="${2}"
shift 2
;;
*)
break
;;
esac
done
build "${CONTAINER_IMAGE}" "${CONTAINER_TAG}" "${BUILD_ZSH_VERSION}" "$@"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=bash sw=2 ts=2 et

View file

@ -1,260 +0,0 @@
#!/usr/bin/env bash
parent_process() {
local ppid pcmd
ppid="$(ps -o ppid= -p "$$" | awk '{ print $1 }')"
if [[ -z $ppid ]]; then
echo "Failed to determine parent process" >&2
return 1
fi
if pcmd="$(ps -o cmd= -p "$ppid")"; then
echo "$pcmd"
return
fi
return 1
}
running_interactively() {
if [[ -n $CI ]]; then
return 1
fi
if ! [[ -t 1 ]]; then
# return false if running non-interactively, unless run with zunit
parent_process | grep -q zunit
fi
}
create_init_config_file() {
local tempfile
if [[ -z $* ]]; then
return 1
fi
tempfile="$(mktemp)"
echo "$*" > "$tempfile"
# DIRTYFIX perms...
chmod 666 "$tempfile"
echo "$tempfile"
}
run() {
local image="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
local tag="${CONTAINER_TAG:-latest}"
local init_config="$1"
shift
local -a args=(--rm)
local cruntime=docker
local sudo_cmd
if [[ -z $CI ]] && command -v podman > /dev/null 2>&1; then
cruntime=podman
# rootless containers are a PITA
# https://www.tutorialworks.com/podman-rootless-volumes/
sudo_cmd=sudo
fi
if running_interactively; then
args+=(--tty=true --interactive=true)
fi
if [[ -n $init_config ]]; then
if [[ -r $init_config ]]; then
args+=(--volume "${init_config}:/init.zsh")
else
echo "❌ Init config file is not readable" >&2
return 1
fi
fi
if [[ -n $CONTAINER_WORKDIR ]]; then
args+=(--workdir "$CONTAINER_WORKDIR")
fi
# Inherit TERM
if [[ -n $TERM ]]; then
args+=(--env "TERM=${TERM}")
fi
if [[ -n ${CONTAINER_ENV[*]} ]]; then
local e
for e in "${CONTAINER_ENV[@]}"; do
args+=(--env "${e}")
done
fi
if [[ -n ${CONTAINER_VOLUMES[*]} ]]; then
local vol
for vol in "${CONTAINER_VOLUMES[@]}"; do
# shellcheck disable=2076
if [[ ! " ${args[*]} " =~ " --volume ${vol} " ]]; then
args+=(--volume "${vol}")
fi
done
fi
local -a cmd=("$@")
if [[ -n $WRAP_CMD ]]; then
local zsh_opts="ilsc"
[[ -n $ZSH_DEBUG ]] && zsh_opts="x${zsh_opts}"
cmd=(zsh "-${zsh_opts}" "${cmd[*]}")
fi
if [[ -n $DEBUG ]]; then
{
# The @Q below is necessary to keep the quotes intact
# https://stackoverflow.com/a/12985353/1872036
echo -e "🚀 \e[35mRunning command"
echo -e "\$ ${cruntime} run ${args[*]} ${image}:${tag} ${cmd[*]@Q}\e[0m"
} >&2
fi
${sudo_cmd} "${cruntime}" run "${args[@]}" "${image}:${tag}" "${cmd[@]}"
}
if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then
CONTAINER_ENV=()
CONTAINER_IMAGE="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}"
CONTAINER_TAG="${CONTAINER_TAG:-latest}"
CONTAINER_VOLUMES=()
CONTAINER_WORKDIR="${CONTAINER_WORKDIR:-}"
DEBUG="${DEBUG:-}"
INIT_CONFIG_VAL="${INIT_CONFIG_VAL:-}"
PRESET="${PRESET:-}"
WRAP_CMD="${WRAP_CMD:-}"
ZSH_DEBUG="${ZSH_DEBUG:-}"
while [[ -n $* ]]; do
case "$1" in
# Fetch init config from clipboard (Linux only)
--xsel | -b)
INIT_CONFIG_VAL="$(xsel -b)"
shift
;;
-c | --config | --init-config | --init)
INIT_CONFIG_VAL="$2"
shift 2
;;
-f | --config-file | --init-config-file | --file)
if ! [[ -r $2 ]]; then
echo "Unable to read from file: $2" >&2
exit 2
fi
INIT_CONFIG_VAL="$(cat "$2")"
shift 2
;;
-d | --debug)
DEBUG=1
shift
;;
-D | --dev | --devel)
DEVEL=1
shift
;;
--docs)
PRESET=docs
shift
;;
-i | --image)
CONTAINER_IMAGE="$2"
shift 2
;;
-t | --tag)
CONTAINER_TAG="$2"
shift 2
;;
# Additional container env vars
-e | --env | --environment)
CONTAINER_ENV+=("$2")
shift 2
;;
# Additional container volumes
-v | --volume)
CONTAINER_VOLUMES+=("$2")
shift 2
;;
# Whether to wrap the command in zsh -silc
-w | --wrap)
WRAP_CMD=1
shift
;;
--tests | --zunit | -z)
PRESET=zunit
shift
;;
# Whether to enable debug tracing of zinit (zsh -x)
# Only applies to wrapped commands (--w|--wrap)
--zsh-debug | -x | -Z)
ZSH_DEBUG=1
shift
;;
*)
break
;;
esac
done
GIT_ROOT_DIR="$(git rev-parse --show-toplevel)"
CMD=("$@")
case "$PRESET" in
zunit)
# Mount root of the repo to /src
# Mount /tmp/zunit-zinit to /data
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
"${TMPDIR:-/tmp}/zunit-zinit:/data"
)
CONTAINER_ENV+=(
"QUIET=1"
"NOTHING_FANCY=1"
)
;;
docs)
# Mount root of the repo to /src
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
)
CONTAINER_ENV+=(
"QUIET=1"
"NOTHING_FANCY=1"
"LC_ALL=en_US.UTF-8"
)
CONTAINER_WORKDIR=/src
# shellcheck disable=2016
INIT_CONFIG_VAL='zinit nocompile make'\''prefix=$ZPFX all install'\'' for zdharma-continuum/zshelldoc'
# shellcheck disable=2016
CMD=(zsh -ilsc
'sudo chown -R "$(id -u):$(id -g)" /src &&
@zinit-scheduler burst &&
sudo apk add tree &&
make -C /src doc')
;;
esac
if INIT_CONFIG="$(create_init_config_file "$INIT_CONFIG_VAL")"; then
trap 'rm -vf $INIT_CONFIG' EXIT INT
fi
if [[ -n $DEVEL ]]; then
# Mount root of the repo to /src
CONTAINER_VOLUMES+=(
"${GIT_ROOT_DIR}:/src"
)
fi
run "$INIT_CONFIG" "${CMD[@]}"
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=bash sw=2 ts=2 et

View file

@ -1,333 +0,0 @@
#!/usr/bin/env bash
{ # Colors
COLOR_RESET=''
COLOR_BOLD_RED=''
COLOR_BOLD_GREEN=''
COLOR_BOLD_YELLOW=''
COLOR_BOLD_BLUE=''
COLOR_BOLD_MAGENTA=''
COLOR_BOLD_CYAN=''
# The over-the-top fancy ones
COLOR_PALE_MAGENTA=''
COLOR_BOLD_WHITE_ON_BLACK=''
}
echo_fancy() {
emoji="$1"
color="$2"
shift 2
msg=""
# prepend emoji, unless NO_EMOJI is set
if [ -z "$NO_EMOJI" ]; then
msg="$emoji"
fi
# wrap every word in color (needed in case there are custom colors in
# the message itself), unless NO_COLOR is set
for str in "$@"; do
# FIXME: NO_COLOR only applies if there are no colors in the msg
if [ -z "$NO_COLOR" ]; then
msg="${msg}${color}"
fi
msg="${msg}${str}"
done
# Actual output
echo "${msg}${COLOR_RESET}" >&2
# fake "local" vars
unset emoji color str msg
}
echo_info() {
echo_fancy "🔵" "${COLOR_BOLD_BLUE}" "INFO: ${*}"
}
echo_success() {
echo_fancy "✅" "${COLOR_BOLD_GREEN}" "SUCCESS: ${*}"
}
echo_warning() {
echo_fancy "🚧" "${COLOR_BOLD_YELLOW}" "WARNING: ${*}"
}
echo_error() {
echo_fancy "❌" "${COLOR_BOLD_RED}" "ERROR: ${*}"
}
check_dependencies() {
zsh_min_version=5.8
if ! zsh -sfc \
'autoload is-at-least;
is-at-least $1 $ZSH_VERSION' "$zsh_min_version"; then
echo_warning "ZSH version 5.5+ is recommended for zinit." \
"It'll still work, but be warned."
fi
if ! command -v git > /dev/null 2>&1; then
echo_error "${COLOR_BOLD_GREEN}git${COLOR_RESET} is not installed"
exit 1
fi
unset zsh_min_version
}
show_environment() {
echo_info "About to setup zinit from $ZINIT_REPO" \
"(branch: $ZINIT_BRANCH - commit: ${ZINIT_COMMIT:-N/A})" \
"to ${ZINIT_INSTALL_DIR}"
}
create_zinit_home() {
if ! test -d "${ZINIT_HOME}"; then
mkdir -p "${ZINIT_HOME}"
chmod g-w "${ZINIT_HOME}"
chmod o-w "${ZINIT_HOME}"
fi
}
create_zinit_tmpdir() {
# use -d instead of --directory for macos (BSD) compatibility
ZINIT_TMPDIR="$(mktemp -d)"
if [ ! -d "$ZINIT_TMPDIR" ]; then
echo_error "Tempdir creation failed. This ain't good"
exit 1
fi
trap 'rm -rvf "$ZINIT_TMPDIR"' EXIT INT
}
# Get the download-progress bar tool
download_git_output_processor() {
url="https://raw.githubusercontent.com/${ZINIT_REPO}/${ZINIT_COMMIT:-${ZINIT_BRANCH}}/share/git-process-output.zsh"
script_path="${ZINIT_TMPDIR}/git-process-output.zsh"
echo_info "Fetching git-process-output.zsh from $url"
if command -v curl > /dev/null 2>&1; then
curl -fsSL -o "$script_path" "$url"
elif command -v wget > /dev/null 2>&1; then
wget -q -O "$script_path" "$url"
fi
# shellcheck disable=2181
if [ "$?" -eq 0 ]; then
chmod a+x "$script_path" 2> /dev/null
echo_success 'Download finished!'
else
echo_warning "Download failed."
fi
unset url script_path
}
zinit_git_exec() {
command git -C "${ZINIT_INSTALL_DIR}" "$@"
}
zinit_checkout_ref() {
ref="${ZINIT_BRANCH}"
git_obj_type="branch"
if [ -n "$ZINIT_COMMIT" ]; then
ref="$ZINIT_COMMIT"
git_obj_type="commit"
fi
if zinit_git_exec checkout "$ref" > /dev/null 2>&1; then
echo_success "Checked out $git_obj_type $ref"
else
echo_error "Failed to check out $git_obj_type $ref"
fi
unset ref git_obj_type
}
zinit_current_version() {
zinit_git_exec describe --tags 2> /dev/null
}
zinit_update() {
cd "${ZINIT_INSTALL_DIR}" || {
echo_error "Failed to cd to ${ZINIT_INSTALL_DIR}"
exit 1
}
echo_info "Updating ${COLOR_BOLD_CYAN}zinit${COLOR_RESET} in" \
"in ${COLOR_BOLD_MAGENTA}${ZINIT_INSTALL_DIR}"
{ # Clean up repo
zinit_git_exec clean -d -f -f
zinit_git_exec reset --hard HEAD
} > /dev/null 2>&1
# fetch our branch (to ensure the target commit exists locally)
zinit_git_exec fetch origin "$ZINIT_BRANCH"
zinit_checkout_ref
if zinit_git_exec pull origin "$ZINIT_BRANCH"; then
echo_success "Updated zinit to $(zinit_current_version)"
fi
}
zinit_install() {
cd "${ZINIT_HOME}" || {
echo_error "Failed to cd to ${ZINIT_HOME}"
exit 1
}
echo_info "Installing ${COLOR_BOLD_CYAN}zinit${COLOR_RESET} to " \
"${COLOR_BOLD_MAGENTA}${ZINIT_INSTALL_DIR}"
{
command git clone --progress --branch "$ZINIT_BRANCH" \
"https://github.com/${ZINIT_REPO}" \
"${ZINIT_REPO_DIR_NAME}" 2>&1 | {
"${ZINIT_TMPDIR}/git-process-output.zsh" || cat
}
} 2> /dev/null
zinit_checkout_ref
if [ -d "${ZINIT_REPO_DIR_NAME}" ]; then
echo_success "Zinit succesfully installed to " \
"${COLOR_BOLD_GREEN}${ZINIT_INSTALL_DIR}"
echo_info "Zinit Version: ${COLOR_BOLD_GREEN}$(zinit_current_version)"
else
echo_error "Failed to install Zinit to ${COLOR_BOLD_YELLOW}${ZINIT_INSTALL_DIR}"
fi
}
# Modify .zshrc
edit_zshrc() {
rc_update=1
if grep -E '(zinit|zplugin)\.zsh' "${ZSHRC}" > /dev/null 2>&1; then
echo_warning "${ZSHRC} already contains zinit commands. Not making any changes."
rc_update=0
fi
if [ $rc_update -eq 1 ]; then
echo_info "Updating ${ZSHRC} (10 lines of code, at the bottom)"
zinit_home_escaped=${ZINIT_HOME//$HOME/\$HOME}
command cat <<- EOF >> "$ZSHRC"
### Added by Zinit's installer
if [[ ! -f ${zinit_home_escaped}/${ZINIT_REPO_DIR_NAME}/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}${ZINIT_REPO}%F{220})…%f"
command mkdir -p "${zinit_home_escaped}" && command chmod g-rwX "${zinit_home_escaped}"
command git clone https://github.com/${ZINIT_REPO} "${zinit_home_escaped}/${ZINIT_REPO_DIR_NAME}" && \\
print -P "%F{33} %F{34}Installation successful.%f%b" || \\
print -P "%F{160} The clone has failed.%f%b"
fi
source "${zinit_home_escaped}/${ZINIT_REPO_DIR_NAME}/zinit.zsh"
autoload -Uz _zinit
(( \${+_comps} )) && _comps[zinit]=_zinit
EOF
fi
unset rc_update zinit_home_escaped
}
query_for_annexes() {
zshrc_annex_file="$(mktemp)"
command cat <<- EOF >> "$zshrc_annex_file"
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \\
zdharma-continuum/zinit-annex-as-monitor \\
zdharma-continuum/zinit-annex-bin-gem-node \\
zdharma-continuum/zinit-annex-patch-dl \\
zdharma-continuum/zinit-annex-rust
EOF
# Ask user if we should add the annexes to their zshrc
# If NO_INPUT is set, but NO_ANNEXES is the annexes bit gets appended to the
# config (ie. default to yes if NO_INPUT, unless NO_ANNEXES)
reply=n
if [ -n "$NO_INPUT" ]; then
[ -z "$NO_ANNEXES" ] && reply=y
else
echo "${COLOR_PALE_MAGENTA}${COLOR_RESET} Would you like to add 4 useful plugins" \
"- the most useful annexes (Zinit extensions that add new" \
"functions-features to the plugin manager) to the zshrc as well?" \
"It will be the following snippet:"
command cat "$zshrc_annex_file"
# shellcheck disable=2059
printf "${COLOR_PALE_MAGENTA}${COLOR_RESET} Enter y/n and press Return: "
read -r reply
fi
if [ "$reply" = y ] || [ "$reply" = Y ]; then
command cat "$zshrc_annex_file" >> "$ZSHRC"
echo_info "Installing annexes"
zsh -ic "@zinit-scheduler burst"
echo_success 'Done!'
else
echo_warning "Skipped the annexes."
fi
command cat <<- EOF >> "$ZSHRC"
### End of Zinit's installer chunk
EOF
unset reply zshrc_annex_file
}
display_tutorial() {
command cat <<- EOF
🌻 ${COLOR_BOLD_WHITE_ON_BLACK}Welcome!${COLOR_RESET}
Now to get started you can check out the following:
- The ${COLOR_BOLD_WHITE_ON_BLACK}README${COLOR_RESET} section on the ice-modifiers:
🧊 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 highlights some best practices:
📖 https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/
💁 Need help?
- 💬 Get in touch with us on Gitter: https://gitter.im/zdharma-continuum
- 🔖 Or on GitHub: https://github.com/zdharma-continuum
EOF
}
# Globals. Can be overridden.
ZINIT_REPO="${ZINIT_REPO:-zdharma-continuum/zinit}"
ZINIT_BRANCH="${ZINIT_BRANCH:-main}"
ZINIT_COMMIT="${ZINIT_COMMIT:-}" # no default value
ZINIT_HOME="${ZINIT_HOME:-${XDG_DATA_HOME:-${HOME}/.local/share}/zinit}"
ZINIT_REPO_DIR_NAME="${ZINIT_REPO_DIR_NAME:-zinit.git}"
ZINIT_INSTALL_DIR=${ZINIT_INSTALL_DIR:-${ZINIT_HOME}/${ZINIT_REPO_DIR_NAME}}
ZSHRC="${ZSHRC:-${ZDOTDIR:-${HOME}}/.zshrc}"
show_environment
check_dependencies
create_zinit_home
create_zinit_tmpdir
download_git_output_processor
if [ -d "${ZINIT_INSTALL_DIR}/.git" ]; then
zinit_update
ZINIT_UPDATE=1
else
zinit_install
fi
if [ -z "$NO_EDIT" ]; then
edit_zshrc
[ -z "$ZINIT_UPDATE" ] && query_for_annexes
fi
if [ -z "$NO_TUTORIAL" ]; then
display_tutorial
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=bash sw=2 ts=2 et

View file

@ -1,186 +0,0 @@
#!/usr/bin/env zsh
#
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
# Copyright (c) 2021-2022 zdharma-continuum and contributors
emulate -LR zsh
setopt typesetsilent extendedglob warncreateglobal
{ typeset -g COLS="$(tput cols)" } 2>/dev/null
if (( COLS < 10 )); then
COLS=40
fi
# Credit to molovo/revolver for the ideas
progress_frames='0.1 ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏'
integer -g cur_frame=1
typeset -F SECONDS=0 last_time=0
# Alpine Linux doesn't have tput; FreeBSD and Dragonfly BSD have termcap
if whence tput &> /dev/null; then
if [[ $OSTYPE == freebsd* ]] || [[ $OSTYPE == dragonfly* ]]; then
# termcap commands
ZINIT_CNORM='tput ve'
ZINIT_CIVIS='tput vi'
else
# terminfo is more common
ZINIT_CNORM='tput cnorm'
ZINIT_CIVIS='tput civis'
fi
fi
if (( $+ZINIT_CNORM )); then
trap $ZINIT_CNORM EXIT INT TERM
fi
local first=1
# Code by leoj3n
timeline() {
local sp='▚▞'; sp="${sp:$2%2:1}"
# Maximal width is 24 characters
local bar="$(print -f "%.$2s█%0$(($3-$2-1))s" "████████████████████████" "")"
local -a frames_splitted
frames_splitted=( ${(@zQ)progress_frames} )
if (( SECONDS - last_time >= frames_splitted[1] )); then
(( cur_frame = (cur_frame+1) % (${#frames_splitted}+1-1) ))
(( cur_frame = cur_frame ? cur_frame : 1 ))
last_time=$SECONDS
fi
print -nr -- ${frames_splitted[cur_frame+1]}" "
print -nPr "%F{183}"
print -f "%s %s" "${bar// /░}" ""
print -nPr "%f"
}
# $1 - n. of objects
# $2 - packed objects
# $3 - total objects
# $4 - receiving percentage
# $5 - resolving percentage
print_my_line() {
local col="%F{155}" col3="%F{155}" col4="%F{155}" col5="%F{155}"
[[ -n "${4#...}" && -z "${5#...}" ]] && col3="%F{81}"
[[ -n "${5#...}" ]] && col4="%F{81}"
if (( COLS >= 70 )); then
print -Pnr -- "${col}OBJ%f: $1, ${col}PACK%f: $2/$3${${4:#...}:+, ${col3}REC%f: $4%}${${5:#...}:+, ${col4}RES%f: $5%} "
elif (( COLS >= 60 )); then
print -Pnr -- "${col}OBJ%f: $1, ${${4:#...}:+, ${col3}REC%f: $4%}${${5:#...}:+, ${col4}RES%f: $5%} "
else
print -Pnr -- "${${4:#...}:+, ${col3}REC%f: $4%}${${5:#...}:+, ${col4}RES%f: $5%} "
fi
print -n $'\015'
}
print_my_line_compress() {
local col="%F{155}" col3="%F{155}" col4="%F{155}" col5="%F{155}"
[[ -n "${4#...}" && -z "${5#...}" && -z "${6#...}" ]] && col3="%F{81}"
[[ -n "${5#...}" && -z "${6#...}" ]] && col4="%F{81}"
[[ -n "${6#...}" ]] && col5="%F{81}"
if (( COLS >= 80 )); then
print -Pnr -- "${col}OBJ%f: $1, ${col}PACK%f: $2/$3, ${col3}COMPR%f: $4%%${${5:#...}:+, ${col4}REC%f: $5%%}${${6:#...}:+, ${col5}RES%f: $6%%} "
elif (( COLS >= 65 )); then
print -Pnr -- "${col}OBJ%f: $1, ${col3}COMPR%f: $4%%${${5:#...}:+, ${col4}REC%f: $5%%}${${6:#...}:+, ${col5}RES%f: $6%%} "
else
print -Pnr -- "${col}OBJ%f: $1, ${${5:#...}:+, ${col4}REC%f: $5%%}${${6:#...}:+, ${col5}RES%f: $6%%} "
fi
print -n $'\015'
}
integer have_1_counting=0 have_2_total=0 have_3_receiving=0 have_4_deltas=0 have_5_compress=0
integer counting_1=0 total_2=0 total_packed_2=0 receiving_3=0 deltas_4=0 compress_5=0
integer loop_count=0
IFS=''
[[ $+ZINIT_CIVIS == 1 && -n $TERM ]] && eval $ZINIT_CIVIS
if [[ -n $TERM ]]; then
{ command perl -pe 'BEGIN { $|++; $/ = \1 }; tr/\r/\n/' || gstdbuf -o0 gtr '\r' '\n' || cat } |& while read -r line; do
(( ++ loop_count ))
if [[ "$line" = "Cloning into"* ]]; then
print $line
continue
elif [[ "$line" = (#i)*user*name* || "$line" = (#i)*password* ]]; then
print $line
continue
elif [[ "$line" = remote:*~*(Counting|Total|Compressing|Enumerating)* || "$line" = fatal:* ]]; then
print $line
continue
fi
if [[ "$line" = (#b)"remote: Counting objects:"[\ ]#([0-9]##)(*) ]]; then
have_1_counting=1
counting_1="${match[1]}"
fi
if [[ "$line" = (#b)"remote: Enumerating objects:"[\ ]#([0-9]##)(*) ]]; then
have_1_counting=1
counting_1="${match[1]}"
fi
if [[ "$line" = (#b)*"remote: Total"[\ ]#([0-9]##)*"pack-reused"[\ ]#([0-9]##)* ]]; then
have_2_total=1
total_2="${match[1]}" total_packed_2="${match[2]}"
fi
if [[ "$line" = (#b)"Receiving objects:"[\ ]#([0-9]##)%([[:blank:]]#\(([0-9]##)/([0-9]##)\)|)* ]]; then
have_3_receiving=1
receiving_3="${match[1]}"
if [[ -n "${match[2]}" ]]; then
have_2_total=1
total_packed_2="${match[3]}" total_2="${match[4]}"
fi
fi
if [[ "$line" = (#b)"Resolving deltas:"[\ ]#([0-9]##)%* ]]; then
have_4_deltas=1
deltas_4="${match[1]}"
fi
if [[ "$line" = (#b)"remote: Compressing objects:"[\ ]#([0-9]##)"%"(*) ]]; then
have_5_compress=1
compress_5="${match[1]}"
fi
if (( loop_count >= 2 )); then
integer pr
(( pr = have_4_deltas ? deltas_4 / 10 : ( have_3_receiving ? receiving_3 / 10 : ( have_5_compress ? compress_5 / 10 : ((( loop_count - 1 )/14 ) % 10) + 1 )) ))
timeline "" $pr 11
if (( have_5_compress )); then
print_my_line_compress "${${${(M)have_1_counting:#1}:+$counting_1}:-...}" \
"${${${(M)have_2_total:#1}:+$total_packed_2}:-0}" \
"${${${(M)have_2_total:#1}:+$total_2}:-0}" \
"${${${(M)have_5_compress:#1}:+$compress_5}:-...}" \
"${${${(M)have_3_receiving:#1}:+$receiving_3}:-...}" \
"${${${(M)have_4_deltas:#1}:+$deltas_4}:-...}"
else
print_my_line "${${${(M)have_1_counting:#1}:+$counting_1}:-...}" \
"${${${(M)have_2_total:#1}:+$total_packed_2}:-0}" \
"${${${(M)have_2_total:#1}:+$total_2}:-0}" \
"${${${(M)have_3_receiving:#1}:+$receiving_3}:-...}" \
"${${${(M)have_4_deltas:#1}:+$deltas_4}:-...}"
fi
fi
done
else
grep fatal:
fi
print
[[ $+ZINIT_CNORM == 1 && -n $TERM ]] && eval $ZINIT_CNORM
unset ZINIT_CNORM ZINIT_CIVIS
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,64 +0,0 @@
#!/usr/bin/env zsh
#
# -*- mode: sh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
#
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
# Copyright (c) 2021-2022 zdharma-continuum and contributors
emulate -R zsh -o extendedglob
local pkg=$1
if [[ -z $pkg || ! -e $pkg ]]; then
print -u2 -Pr "%F{160}rpm2cpio.sh%f: no package supplied"
exit 1
fi
local leadsize=96
local o=$(( $leadsize + 8 ))
set -- ${(s: :)$(od -j $o -N 8 -t u1 $pkg)}
local i=$(( 256 * ( 256 * ( 256 * $2 + $3 ) + $4 ) + $5 ))
local d=$(( 256 * ( 256 * ( 256 * $6 + $7 ) + $8 ) + $9 ))
sigsize=$(( 8 + 16 * $i + $d ))
o=$(( $o + $sigsize + ( 8 - ( $sigsize % 8 ) ) % 8 + 8 ))
set -- ${(s: :)$(od -j $o -N 8 -t u1 $pkg)}
i=$(( 256 * ( 256 * ( 256 * $2 + $3 ) + $4 ) + $5 ))
d=$(( 256 * ( 256 * ( 256 * $6 + $7 ) + $8 ) + $9 ))
local hdrsize=$(( 8 + 16 * $i + $d ))
o=$(( $o + $hdrsize ))
local -a UNPACKCMD
UNPACKCMD=( dd if=$pkg ibs=$o skip=1 )
local COMPRESSION="$($=UNPACKCMD | file -)"
local -a DECOMPRESSCMD
if [[ $COMPRESSION == (#i)*gzip* ]]; then
DECOMPRESSCMD=( gunzip )
elif [[ $COMPRESSION == (#i)*bzip2* ]]; then
DECOMPRESSCMD=( bunzip2 )
elif [[ $COMPRESSION == (#i)*xz* ]]; then
DECOMPRESSCMD=( unxz )
elif [[ $COMPRESSION == (#i)*cpio* ]]; then
DECOMPRESSCMD=( cat )
else
DECOMPRESSCMD=( $(which unlzma 2>/dev/null) )
if [[ $DECOMPRESSCMD != /* ]]; then
DECOMPRESSCMD=( $(which lzmash 2>/dev/null) )
if [[ $DECOMPRESSCMD == /* ]]; then
DECOMPRESSCMD=( lzmash -d -c )
else
DECOMPRESSCMD=( cat )
fi
fi
fi
command "$UNPACKCMD[@]" 2>/dev/null | command "$DECOMPRESSCMD[@]"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,45 +0,0 @@
#!/usr/bin/env zsh
#
# Copyright (c) YEAR USER_NAME
# An example of type-agnostic script/function, i.e.: the file can be run as a +x
# script or as an autoload function.
# Set the base and typically useful options
emulate -LR zsh
setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes noautopushd
# Run as script? ZSH_SCRIPT is a Zsh 5.3 addition
if [[ $0 != template-script || -n $ZSH_SCRIPT ]]; then
# Handle $0 according to the Zsh Plugin Standard:
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}
0=${${(M)0##/*}:-$PWD/$0}
# Such global variable is expected to be typeset'd -g in the plugin.zsh
# file. Here it's restored in case of the function being run as a script.
typeset -gA Plugins
Plugins[MY_PLUGIN_DIR]=${0:h}
# In case of the script using other scripts from the plugin, either set up
# $fpath and autoload, or add the directory to $PATH.
fpath+=( $Plugins[MY_PLUGIN_DIR] )
autoload …
# OR
path+=( $Plugins[MY_PLUGIN_DIR] )
fi
# The script/function contents possibly using $Plugins[MY_PLUGIN_DIR] …
# …
# Use alternate marks [[[ and ]]] as the original ones can confuse nested
# substitutions, e.g.: ${${${VAR}}}
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et foldmarker=[[[,]]] foldmethod=marker

View file

@ -1,28 +0,0 @@
# Zsh compiled script + zrecompile backup
*.zwc
*.zwc.old
# Zsh completion-optimization dumpfile
*zcompdump*
# Zsh zcalc history
.zcalc_history
# A popular plugin manager's files
._zinit
.zinit_lastupd
# zdharma/zshelldoc tool's files
zsdoc/data
# ohmyzsh/ohmyzsh/plugins/per-directory-history plugin's files
# (when set-up to store the history in the local directory)
.directory_history
# MichaelAquilina/zsh-autoswitch-virtualenv plugin's files
# (for Zsh plugins using Python)
.venv
# Zunit tests' output
/tests/_output/*
!/tests/_output/.gitkeep

View file

@ -1,47 +0,0 @@
#
# Language: Zsh
#
--langdef=zsh
--langmap=zsh:.zsh
#
# 1. Detect variables
# 2. … and function names.
#
--kinddef-zsh=v,var,variables
--kinddef-zsh=f,fun,functions
--_tabledef-zsh=main
--_tabledef-zsh=vardef
--_tabledef-zsh=comment
--_tabledef-zsh=equal
# Feature: Zsh variable detection
--_mtable-regex-zsh=main/^\s*(local|typeset|declare|integer|float|readonly)\s+(-\w+\s+)*///{tenter=vardef}
# Feature: Zsh function name detection
--_mtable-regex-zsh=main/^\s*(function\s+|)([[:alnum:]:@∞.+-]+)\(\s*\)\s*([\{]|[\n]+[\{])/\2/f/
--_mtable-regex-zsh=main/^\s*[\#][^\n]*///{tenter=comment}
--_mtable-regex-zsh=main/.//
--_mtable-regex-zsh=comment/[\n]///{tleave}
--_mtable-regex-zsh=comment/.//
--_mtable-regex-zsh=equal/([\"][^\"]*[\"])///{exclusive}{tleave}
--_mtable-regex-zsh=equal/([\'][^\']*[\'])///{exclusive}{tleave}
--_mtable-regex-zsh=equal/([\$][\(][\(])([^\)][^\)])*([^\)]){0,1}([\)][\)])///{exclusive}{tleave}
--_mtable-regex-zsh=equal/([\$][\(])([^\)]*)([\)])///{exclusive}{tleave}
--_mtable-regex-zsh=equal/([\(])([^\)]*)([\)])///{exclusive}{tleave}
# Try to match sequences of ${…}\w${…}…
--_mtable-regex-zsh=equal/([\$][\{])((([^\}]*[\}][^\s][\$][\{])*[^\}]*)|[^\}]*)([\}])///{exclusive}{tleave}
--_mtable-regex-zsh=equal/[^\s\n]+///{exclusive}{tleave}{_advanceTo=0start} 
--_mtable-regex-zsh=equal/[\n\s]///{exclusive}{tleave}{_advanceTo=0start}
# Match with required ="…
--_mtable-regex-zsh=vardef/([a-zA-Z_]\w*)([\=])/\1/v/{exclusive}{tenter=equal}
--_mtable-regex-zsh=vardef/([a-zA-Z_]\w*)/\1/v/{exclusive}
--_mtable-regex-zsh=vardef/[\x5C][\n]///{exclusive}
--_mtable-regex-zsh=vardef/([\n;\}\)\|\&])///{tleave}{exclusive}
--_mtable-regex-zsh=vardef/^\s*[\#][^\n]*///{tenter=comment}{exclusive}
--_mtable-regex-zsh=vardef/.//

48
test/a::test::plugin.zsh Normal file
View file

@ -0,0 +1,48 @@
#!/usr/bin/env zsh
echo "Test plugin loading"
bindkey -v
alias aa=bb
REPO_DIR="${0%/*}"
CONFIG_DIR="$HOME/.config/zew"
bindkey -N testmap main
bindkey -M testmap -s "^[t" "echo test1"
bindkey -s "^[y" "echo test2"
# 10. Break line
if [[ "$MC_SID" != "" || "$MC_CONTROL_PID" != "" ]]; then
bindkey "^J" accept-line
else
bindkey "^J" self-insert
fi
# 11. Undo
bindkey "^_" undo
alias aaa2=bbb
alias -s gif=iv
alias -g LLL="|less"
[[ -n ${-[(r)9]} ]] && echo "Initially it's -9 (auto_list) set" || echo "Initially it's -9 (auto_list) unset"
setopt +9
[[ -n ${-[(r)w]} ]] && echo "Initially it's -w (chase_links) set" || echo "Initially it's -w (chase_links) unset"
setopt -w
[[ -o "menucomplete" ]] && echo "Initially it's menucomplete set" || echo "Initially it's menucomplete unset"
setopt menucomplete
[[ -o "listtypes" ]] && echo "Initially it's listtypes set" || echo "Initially it's listtypes unset"
[[ -o "listpacked" ]] && echo "Initially it's listpacked set" || echo "Initially it's listpacked unset"
setopt -o nolist_types -o LIST_PACKED
#setopt -o automenu posix_cd -oautocd
#setopt \'pushd_minus
unsetopt +9
autoload -X test
fpath+=/usr/share/zsh
unset MY_VAR
bindkey -N testpluginmain main
bindkey -A testpluginmain main

View file

@ -0,0 +1,36 @@
Plugin report for _dtrace/_dtrace
Bindkey -v
Warning: last bindkey used non-typical options: -v
Alias aa=bb
Bindkey -N testmap main
Bindkey -M testmap -s ^[t echo test1
Bindkey -s ^[y echo test2
Bindkey ^J self-insert
Bindkey ^_ undo
Alias aaa2=bbb
Alias -s gif=iv
Alias -g LLL=|less
Failed autoload -X test
Bindkey -N testpluginmain main
Bindkey -A testpluginmain main
Warning: keymap `main' copied to `_dtrace-main-1' because of `testpluginmain' substitution
Functions created:
my_f
Options changed:
chaselinks was set
listpacked was set
listtypes was unset
menucomplete was set
physical was set
FPATH elements added:
/usr/share/zsh
Variables added or redefined:
REPO_DIR [ "" -> scalar ]
CONFIG_DIR [ "" -> scalar ]
MY_VAR2 [ "" -> scalar ]

View file

@ -0,0 +1,21 @@
Deleting function my_f
Deleting bindkey ^J self-insert
Deleting bindkey ^[t echo test1 mapped to testmap
Deleting bindkey ^[y echo test2
Deleting bindkey ^_ undo
Linking backup-`main' keymap `_dtrace-main-1' back to `main'
Deleting keymap `testmap'
Deleting keymap `testpluginmain'
Unsetting option chaselinks
Unsetting option listpacked
Setting option listtypes
Unsetting option menucomplete
Removing global alias LLL=|less
Removing alias aa=bb
Removing alias aaa2=bbb
Removing suffix alias gif=iv
Removing FPATH element /usr/share/zsh
Unsetting variable REPO_DIR
Unsetting variable CONFIG_DIR
Unsetting variable MY_VAR2
dtrace report saved to $LASTREPORT

View file

@ -0,0 +1,19 @@
Plugin report for _local/safe-paste
Source safe-paste.plugin.zsh
Bindkey -N paste
Bindkey -R -M paste ^@-Þ? paste-insert
Bindkey ^[[200~ _start_paste
Bindkey -M paste ^[[201~ _end_paste
Bindkey -M paste -s ^M ^J
Zle -N _start_paste
Zle -N _end_paste
Zle -N zle-line-init _zle_line_init
Zle -N zle-line-finish _zle_line_finish
Zle -N paste-insert _paste_insert
Functions created:
_end_paste _paste_insert
_start_paste _zle_line_finish
_zle_line_init

View file

@ -0,0 +1,17 @@
Deleting function _end_paste
Deleting function _paste_insert
Deleting function _start_paste
Deleting function _zle_line_finish
Deleting function _zle_line_init
Deleting range bindkey ^@-Þ? paste-insert mapped to paste
Deleting bindkey ^M ^J mapped to paste
Deleting bindkey ^[[200~ _start_paste
Deleting bindkey ^[[201~ _end_paste mapped to paste
Deleting keymap `paste'
Removing Zle widget `_end_paste'
Removing Zle widget `_start_paste'
Removing Zle hook `paste-insert'
Removing Zle hook `zle-line-finish'
Removing Zle hook `zle-line-init'
Unregistering plugin _local/safe-paste
Plugin's report saved to $LASTREPORT

View file

@ -0,0 +1,27 @@
Plugin report for _dtrace/_dtrace
Alias test3alias1=echo Hello
Alias -g test3alias2=echo Hello
Alias -s jpg=iv
Functions created:
my_f
Options changed:
menucomplete was set
PATH elements added:
/component/nr1
/component/nr2
FPATH elements added:
/fcomp/nr1
/fcomp/nr2
Variables added or redefined:
MY_VAR [ "" -> scalar ]
my_hash2 [ "" -> association ]
MY_VAR2 [ "" -> scalar ]
MY_VAR3 [ "" -> scalar ]
my_array [ "" -> array ]

View file

@ -0,0 +1,16 @@
Deleting function my_f
Unsetting option menucomplete
Removing suffix alias jpg=iv
Removing alias test3alias1=echo Hello
Removing global alias test3alias2=echo Hello
Removing PATH element /component/nr2
Removing PATH element /component/nr1
Removing PATH element /component/nr2
Removing FPATH element /fcomp/nr2
Removing FPATH element /fcomp/nr1
Unsetting variable MY_VAR
Unsetting variable my_hash2
Unsetting variable MY_VAR2
Unsetting variable MY_VAR3
Unsetting variable my_array
dtrace report saved to $LASTREPORT

40
test/test1.zsh Executable file
View file

@ -0,0 +1,40 @@
#!/bin/zsh
#
# Do some setup
# Script can be run from arbitrary directory under zplugin/ tree
#
source "`pwd`/${0:h}/tinclude.zsh" "$0" || exit 1
#
# Start Dtrace
#
---start
zplugin dtrace
###
### Test body
###
MY_VAR="test variable"
MY_VAR2="test variable"
zplugin snippet -f test/a::test::plugin.zsh
my_f() { echo "Hello"; }
#
# Stop Dtrace
#
zplugin dstop
---stop
###
### Gather and compare results
###
zplugin dreport > "$___TEST_REPORT_FILE"
zplugin dunload > "$___TEST_UNLOAD_FILE"
---compare

36
test/test2.zsh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/zsh
#
# Do some setup
# Script can be run from arbitrary directory under zplugin/ tree
#
source "`pwd`/${0:h}/tinclude.zsh" "$0" || exit 1
#
# Start Dtrace
#
---start
###
### Test body
###
local PLUGIN_NAME="_local/safe-paste"
zplugin load "$PLUGIN_NAME"
#
# Stop Dtrace
#
---stop
###
### Gather and compare results
###
zplugin report "$PLUGIN_NAME" > "$___TEST_REPORT_FILE"
zplugin unload "$PLUGIN_NAME" > "$___TEST_UNLOAD_FILE"
---compare

77
test/test3.zsh Executable file
View file

@ -0,0 +1,77 @@
#!/bin/zsh
#
# Common test suite code
#
source "`pwd`/${0:h}/tinclude.zsh" "$0" || exit 1
#
# Start Dtrace
#
---start
zplugin dtrace
###
### Test body
###
typeset -U path
PATH="$PATH:/component/nr1"
path+="/component/nr2"
# Intentional nr2
PATH="/component/nr2:$PATH"
declare -p path
echo
FPATH="$FPATH:/fcomp/nr1"
fpath+="/fcomp/nr2"
# Intentional nr2
FPATH="/fcomp/nr2:$FPATH"
declare -p fpath
echo
MY_VAR="test variable1"
MY_VAR2="test variable2"
my_f() { echo "Hello from test3"; MY_VAR3="test variable 3"; typeset -A my_hash }
my_f
typeset -A my_hash2
typeset -a my_array
my_array=( 1 )
setopt menucomplete
alias test3alias1="echo Hello"
alias -g test3alias2="echo Hello"
alias -s jpg="iv"
my_f2() { echo "Short lived"; }
my_f2
unfunction "my_f2"
#
# Stop Dtrace
#
zplugin dstop
---stop
###
### Gather and compare results
###
zplugin dreport > "$___TEST_REPORT_FILE"
zplugin dunload > "$___TEST_UNLOAD_FILE"
# A look at hopefully cleaned up variables
declare -p path
declare -p fpath
---mark
---compare

87
test/tinclude.zsh Normal file
View file

@ -0,0 +1,87 @@
typeset -gH ___TEST_NAME="${${1:t}:r}"
___TEST_DIR="`pwd`"
if [ "${___TEST_DIR/\/zplugin/}" = "${___TEST_DIR}" ]; then
echo "Test run not from zplugin's directory tree"
return 1
fi
if [ "${___TEST_DIR:t}" != "test" ]; then
() {
setopt localoptions extendedglob
local -a match mbegin mend
local MATCH; integer MBEGIN MEND
___TEST_DIR="${___TEST_DIR/\/zplugin*//zplugin/test}"
}
fi
if [ ! -d "$___TEST_DIR" ]; then
echo "Could not resolve test directory (tried $___TEST_DIR)"
return 1
fi
export TERM=vt100
___REPORT_FILE="$___TEST_DIR/models/${___TEST_NAME}_report.txt"
___UNLOAD_FILE="$___TEST_DIR/models/${___TEST_NAME}_unload.txt"
___TEST_REPORT_FILE="$___TEST_DIR/.report.txt"
___TEST_UNLOAD_FILE="$___TEST_DIR/.unload.txt"
___DIFF_FILE="$___TEST_DIR/.diff"
___SUCCEEDED_MSG="--- Succeeded ---"
___FAILED_MSG="--- Failed [ < model, > result ] ---"
___STARTING_MSG="----- Starting $___TEST_NAME -----"
___ZPLG_TESTING_HOME="$___TEST_DIR/tzplugin"
#
# Functions
#
---start() {
print -- "$___STARTING_MSG"
}
---stop() {
integer len="${#___STARTING_MSG}"
integer left_len=len/2
integer right_len=len-left_len
print -- "${(r:left_len-3::-:):--} END ${(r:right_len-2::-:):--}"
}
---mark() {
integer len="${#___STARTING_MSG}"
integer left_len=len/2
integer right_len=len-left_len
print -- "${(r:left_len-3::-:):--} MARK ${(r:right_len-3::-:):--}"
}
---s-or-f() {
[ "$1" -eq "0" ] && print -- "$___SUCCEEDED_MSG" || print -- "$___FAILED_MSG"
}
---compare() {
print
diff "$___REPORT_FILE" "$___TEST_REPORT_FILE" > "$___DIFF_FILE"
---s-or-f $?
cat "$___DIFF_FILE"
print "\n----- REPORT results showed, hit enter for UNLOAD results -----"
local enter
read enter
diff "$___UNLOAD_FILE" "$___TEST_UNLOAD_FILE" > "$___DIFF_FILE"
---s-or-f $?
cat "$___DIFF_FILE"
print "\n----- End of $___TEST_NAME -----"
}
#
# Load zplugin (testability maintained)
#
ZPLG_TESTING_HOME="$___ZPLG_TESTING_HOME"
cd "$___TEST_DIR"
cd ..
source "./zplugin.zsh"

View file

@ -0,0 +1,54 @@
# Code from Mikael Magnusson: http://www.zsh.org/mla/users/2011/msg00367.html
#
# Requires xterm, urxvt, iTerm2 or any other terminal that supports bracketed
# paste mode as documented: http://www.xfree86.org/current/ctlseqs.html
# create a new keymap to use while pasting
bindkey -N paste
# make everything in this keymap call our custom widget
bindkey -R -M paste "^@"-"\M-^?" paste-insert
# these are the codes sent around the pasted text in bracketed
# paste mode.
# do the first one with both -M viins and -M vicmd in vi mode
bindkey '^[[200~' _start_paste
bindkey -M paste '^[[201~' _end_paste
# insert newlines rather than carriage returns when pasting newlines
bindkey -M paste -s '^M' '^J'
zle -N _start_paste
zle -N _end_paste
zle -N zle-line-init _zle_line_init
zle -N zle-line-finish _zle_line_finish
zle -N paste-insert _paste_insert
# switch the active keymap to paste mode
function _start_paste() {
bindkey -A paste main
}
# go back to our normal keymap, and insert all the pasted text in the
# command line. this has the nice effect of making the whole paste be
# a single undo/redo event.
function _end_paste() {
#use bindkey -v here with vi mode probably. maybe you want to track
#if you were in ins or cmd mode and restore the right one.
bindkey -e
LBUFFER+=$_paste_content
unset _paste_content
}
function _paste_insert() {
_paste_content+=$KEYS
}
function _zle_line_init() {
# Tell terminal to send escape codes around pastes.
[[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color || $TERM = screen || $TERM = screen-256color ]] && printf '\e[?2004h'
}
function _zle_line_finish() {
# Tell it to stop when we leave zle, so pasting in other programs
# doesn't get the ^[[200~ codes around the pasted text.
[[ $TERM == rxvt-unicode || $TERM == xterm || $TERM = xterm-256color || $TERM = screen || $TERM = screen-256color ]] && printf '\e[?2004l'
}

View file

View file

@ -1,15 +0,0 @@
#!/usr/bin/env zsh
is_annex() {
local annex="zinit-annex-${1}"
run zinit load zdharma-continuum/${annex}
assert ${state} equals 0
zinit cd zdharma-continuum/${annex}
assert ${PWD}/${${annex}//zinit-annex/z-a}.plugin.zsh is_file
assert ${PWD}/${${annex}//zinit-annex/z-a}.plugin.zsh is_readable
}
load_bin_gem_node(){
run zinit load @zdharma-continuum/zinit-annex-bin-gem-node
zinit default-ice from'gh-r'
}

View file

@ -1,94 +0,0 @@
#!/usr/bin/env zsh
# emulate -L zsh
# setopt no_global_rcs no_rcs no_aliases extended_glob null_glob
emulate zsh
setopt no_global_rcs no_rcs no_aliases extended_glob
# Every git clone below -- this repo, the annexes, and each plugin a test
# installs -- must keep unix EOLs. A developer or CI runner with
# core.autocrlf=true otherwise gets CRLF sources that zsh cannot parse, which
# surfaces as unrelated-looking failures (`command not found: ^M', exit 126)
# across the whole suite. Exported so it reaches the git invocations zinit
# makes from inside the tests, not just the ones here.
# core.eol has to be pinned as well: with the text attribute set, autocrlf=false
# hands the decision to core.eol, so a global core.eol=crlf still produces CRLF.
export GIT_CONFIG_COUNT=2 \
GIT_CONFIG_KEY_0=core.autocrlf GIT_CONFIG_VALUE_0=false \
GIT_CONFIG_KEY_1=core.eol GIT_CONFIG_VALUE_1=lf
# Log functions [[[
function error(){ print -P "%F{red}[ERROR]%f: ${1}" && return 1; }
function info() { print -P "%F{green}[INFO]%f:%F{cyan} ${1} %f"; }
function warn() { print -P "%F{yellow}[WARN]%f: ${1}"; }
# ]]]
# Create Zunit test environment [[[
GIT_REPO=$(git rev-parse --show-toplevel)
_mktemp_cmd='mktemp'
if (( ${+commands[gmktemp]} )); then
_mktemp_cmd='gmktemp'
fi
TMP_ZUNIT=$(${_mktemp_cmd} --directory --tmpdir="${GIT_REPO}/tests/_support")
if [[ ! -d ${TMP_ZUNIT} ]]; then
error "zunit temp dir not found"
exit 1
fi
typeset -gx zi_test_dir="${TMP_ZUNIT}"
typeset -gxAUH ZINIT=()
ZINIT+=(
BIN_DIR "${zi_test_dir}/zinit.git"
COMPLETIONS_DIR "${zi_test_dir}/completions" SNIPPETS_DIR "${zi_test_dir}/snippets"
HOME_DIR "${zi_test_dir}" PLUGINS_DIR "${zi_test_dir}/plugins"
ZCOMPDUMP_PATH "${zi_test_dir}/zcompdump" ZPFX "${zi_test_dir}/polaris"
POLARIS "${zi_test_dir}/polaris"
)
typeset -gxH ZPFX=
ZPFX="${zi_test_dir}/polaris"
command git diff > ${ZINIT[HOME_DIR]}/unstaged.diff
# info 'creating test env'
git clone \
--quiet \
--depth=1 \
--dissociate \
--no-hardlinks \
--reference "${GIT_REPO}" \
file://${GIT_REPO:A} \
"${ZINIT[BIN_DIR]}" >/dev/null
if (( $? != 0 )); then
error "Unable to copy ${GIT_REPO} to ${TMP_ZUNIT}" >&2
exit 1
fi
if [[ -s $ZINIT[HOME_DIR]/unstaged.diff ]]; then
(
git -C "${ZINIT[BIN_DIR]}" apply "${ZINIT[HOME_DIR]}/unstaged.diff" && \
chmod g-rwX "${ZINIT[HOME_DIR]}" && \
zcompile "${ZINIT[BIN_DIR]}/zinit.zsh" >/dev/null
) >/dev/null
fi
(( $? != 0 )) && { error "Unable to copy ${GIT_REPO} to ${TMP_ZUNIT}" >&2; exit 1 }
hash -f
builtin hash -d zinit="${zi_test_dir}"
builtin hash -d zpfx="${zi_test_dir}/polaris"
builtin hash -d plugins="${zi_test_dir}/plugins"
source "${zi_test_dir}/zinit.git/zinit.zsh"
(( $? != 0 )) && { error "Unable to source zinit" >&2; exit 1 }
hash -f
builtin hash -d zinit="${zi_test_dir}"
builtin hash -d zpfx="${zi_test_dir}/polaris"
builtin hash -d plugins="${zi_test_dir}/plugins"
{
zinit for \
@zdharma-continuum/zinit-annex-bin-gem-node \
@zdharma-continuum/zinit-annex-binary-symlink \
@zdharma-continuum/zinit-annex-default-ice \
@zdharma-continuum/zinit-annex-linkman
}>/dev/null
zinit zstatus

View file

@ -1,50 +0,0 @@
#!/usr/bin/env zsh
#
# Easily generate gh-r Zunit tests.
#
# Usage:
# gen-ghr-test [<user/repository>...]
#
# Note: Tests might require slight adjustments to the lbin or id-as ice
#
(){
local flag_help
local -a usage=(
"gen-ghr-test [-h|--help]"
"gen-ghr-test [<project...>]"
)
# -D pulls parsed flags out of $@
# -E allows flags/args and positionals to be mixed, which we don't want in this example
# -F says fail if we find a flag that wasn't defined
# -M allows us to map option aliases (ie: h=flag_help -help=h)
# -K allows us to set default values without zparseopts overwriting them
# Remember that the first dash is automatically handled, so long options are -opt, not --opt
zmodload zsh/zutil
zparseopts -D -F -K -- \
{h,-help}=flag_help \
|| return 1
[[ -z "$flag_help" ]] || { print -l $usage; return 0 }
(( !$# )) && {
builtin print -P -- "%F{red}Error%f gen-ghr-test requires one or more arguments"
return 1
}
local repo description bin_name
for repo in $@; do
bin_name="${repo:t}"
description="$(gh search repos "${repo}" --limit 1 --json description -q '.[].[]')"
cat <<- EOF
@test '${bin_name}' { # ${description}
run zinit for @${repo}; assert \$state equals 0
local $bin_name="\$ZBIN/${bin_name}"; assert "\$${bin_name}" is_executable
run "\$${bin_name}" --version; assert \$state equals 0
}
EOF
done
} $@
# vim: set expandtab filetype=zsh shiftwidth=2 softtabstop=2 tabstop=2:

View file

@ -1,66 +0,0 @@
#!/usr/bin/env zsh
# Fixtures for the `zinit self-update` pager regression tests (issue #632).
#
# make_self_update_behind_upstream leaves the sandbox clone exactly one
# commit behind a scratch bare upstream. The fixture commit reuses HEAD's
# tree, so the fast-forward pull done by `zinit self-update` moves only the
# branch pointer: the unstaged diff the bootstrap applies stays intact and
# no working-tree restore is needed, even when an assertion aborts the
# test. Everything is offline and also works when the bootstrap clone is a
# detached HEAD (CI pull_request checkouts), because the `main` branch and
# its upstream are created here.
typeset -g SU_FIXTURE_SUBJECT='chore: self-update pager regression fixture'
make_self_update_behind_upstream() {
local bin="${ZINIT[BIN_DIR]}" up="${ZINIT[HOME_DIR]}/self-update-upstream.git"
local fixture_sha
# The bootstrap clone is depth=1. Complete it (origin is the local repo,
# so this is offline) to lift the shallow-repo restrictions from the
# local-path push below. From the second call on, the repo is already
# complete and this fails harmlessly.
command git -C "$bin" fetch --quiet --unshallow 2>/dev/null || true
# The sandbox tree is dirty (the bootstrap applies the unstaged diff), so
# ambient pull.rebase/autostash settings change what `git pull` does and
# prints: rebase mode refuses the dirty tree, autostash prints notices
# even under --quiet. Pin all three off in the clone so the pull is a
# silent fast-forward everywhere. --local keeps the writes inside the
# sandbox even where GIT_CONFIG points elsewhere.
command git -C "$bin" config --local pull.rebase false 2>/dev/null || true
command git -C "$bin" config --local merge.autostash false 2>/dev/null || true
command git -C "$bin" config --local rebase.autoStash false 2>/dev/null || true
fixture_sha=$(command git -C "$bin" -c user.name=zunit -c user.email=zunit@localhost \
commit-tree 'HEAD^{tree}' -p HEAD -m "$SU_FIXTURE_SUBJECT") || true
[[ -n $fixture_sha ]] || fail 'fixture: commit-tree failed'
command rm -rf -- "$up"
command git -c init.defaultBranch=main init --quiet --bare "$up" 2>/dev/null \
|| fail 'fixture: git init failed'
command git -C "$bin" push --quiet "$up" "${fixture_sha}:refs/heads/main" \
|| fail 'fixture: git push failed'
# remove+add also replaces the narrowed single-branch fetch refspec of
# the depth=1 bootstrap clone with the wildcard one that the `git pull`
# inside self-update relies on.
command git -C "$bin" remote remove origin 2>/dev/null || true
command git -C "$bin" remote add origin "$up" || fail 'fixture: remote add failed'
command git -C "$bin" fetch --quiet origin || fail 'fixture: fetch failed'
# Covers detached-HEAD sandboxes and avoids the non-main-branch warning
# that self-update prints even under --quiet.
command git -C "$bin" checkout --quiet -B main || fail 'fixture: checkout failed'
command git -C "$bin" branch --quiet --set-upstream-to=origin/main main \
|| fail 'fixture: set-upstream failed'
}
restore_self_update_origin() {
local bin="${ZINIT[BIN_DIR]}"
[[ -n $GIT_REPO ]] || return 0
command git -C "$bin" remote remove origin 2>/dev/null || true
command git -C "$bin" remote add origin "file://${GIT_REPO:A}" 2>/dev/null || true
command rm -rf -- "${ZINIT[HOME_DIR]}/self-update-upstream.git"
}

View file

@ -1,41 +0,0 @@
#!/usr/bin/env zunit
@setup {
load "${PWD}/tests/_support/annex_test_assertions"
}
@test 'zinit-annex-bin-gem-node' {
is_annex "bin-gem-node"
}
@test 'zinit-annex-binary-symlink' {
is_annex "binary-symlink"
}
@test 'zinit-annex-man' {
is_annex "man"
}
@test 'zinit-annex-meta-plugins' {
is_annex "meta-plugins"
}
@test 'zinit-annex-patch-dl' {
is_annex "patch-dl"
}
@test 'zinit-annex-pull' {
is_annex 'pull'
}
@test 'zinit-annex-readurl' {
is_annex 'readurl'
}
@test 'zinit-annex-rust' {
is_annex 'rust'
}
@test 'zinit-annex-submods' {
is_annex 'submods'
}
@test 'zinit-annex-test' {
is_annex 'test'
}
@test 'zinit-annex-unscope' {
is_annex 'unscope'
}
# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker

View file

@ -1,142 +0,0 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
#
# zdharma-continuum/zinit/tests/commands.zunit
# Copyright (c) 2016-2021 Sebastian Gniazdowski
# Copyright (c) 2021-2024 zdharma-continuum
# Homepage: https://github.com/zdharma-continuum/zinit
# License: MIT License
#
@setup {
typeset -gx HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
load "${PWD}/tests/_support/self_update_fixtures"
}
@test 'help' {
for cmd in 'help' '-h' '--help'; do
run zinit $cmd
assert $output contains '—— help usage information'
assert $state equals 0
done
run zinit -help
assert $output contains 'Unknown subcommand'
assert $state equals 1
}
@test 'delete --help' {
run zinit delete --help
assert $output contains 'zinit delete [options] [plugins...]'
assert $state equals 0
}
@test 'delete --all' {
run zinit as'completion' is-snippet for @'https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker'
assert $state equals 0
}
@test 'delete a snippet' {
run zinit id-as'git.zsh' is-snippet for @'OMZL::git.zsh'
run zinit delete --yes 'git.zsh'
assert $state equals 0
}
@test 'delete a plugin' {
run zinit from'gh-r' as'program' id-as mv'shfmt* -> shfmt' for @'mvdan/sh'
run zinit delete --yes sh
assert $state equals 0
}
@test 'delete a program' {
run zinit as'program' cp'wd.sh->wd' mv'_wd.sh->_wd' pick'wd' completions for @'mfaerevaag/wd'
assert $state equals 0
run return ${+commands[wd]}; assert $state equals 0
run zinit delete --yes mfaerevaag/wd
}
@test 'plugins' {
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit plugins)
assert $state equals 0
assert $output contains "==> 5 Plugins"
assert $output contains 'Loaded: L | Unloaded: U'
}
@test 'plugins with keyword' {
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit plugins zdharma)
assert $state equals 0
assert $output contains "==> 4 Plugins matching 'zdharma'"
}
@test 'self-update' {
run zinit self-update
assert $output matches 'Already up to date'; assert $state equals 0
run zinit self-update --help
assert $output matches '.*(HELP).*(self-update).*'; assert $state equals 1
run zinit self-update --quiet
assert $output is_empty; assert $state equals 0
}
@test 'self-update --help / -h shows help and exits 1' {
for flag in '--help' '-h'; do
run zinit self-update $flag
assert $output contains 'self-update'
assert $output contains '--quiet'
assert $output contains '--no-pager'
assert $state equals 1
done
}
@test 'self-update --quiet / -q suppresses output' {
for flag in '--quiet' '-q'; do
run zinit self-update $flag
assert $output is_empty
assert $state equals 0
done
}
@test 'self-update rejects unknown flags' {
run zinit self-update --foo
assert $output contains 'Incorrect options given'
assert $output contains '--foo'
assert $state equals 1
}
@test 'self-update --no-pager / -n accepted when up to date' {
for flag in '--no-pager' '-n'; do
run zinit self-update $flag
assert $output contains 'Already up to date'
assert $state equals 0
done
}
@test 'self-update pages the commit list through less by default' {
less() { command cat > /dev/null; builtin print -- 'PAGER-INVOKED'; }
make_self_update_behind_upstream
run zinit self-update
assert $output contains 'PAGER-INVOKED'
assert $output does_not_contain $SU_FIXTURE_SUBJECT
assert $state equals 0
}
@test 'self-update --no-pager / -n prints the commit list without the pager' {
less() { command cat > /dev/null; builtin print -- 'PAGER-INVOKED'; }
for flag in '--no-pager' '-n'; do
make_self_update_behind_upstream
run zinit self-update $flag
assert $output contains $SU_FIXTURE_SUBJECT
assert $output does_not_contain 'PAGER-INVOKED'
assert $state equals 0
done
}
@test 'self-update --quiet / -q skips the pager when behind upstream' {
less() { command cat > /dev/null; builtin print -- 'PAGER-INVOKED'; }
for flag in '--quiet' '-q'; do
make_self_update_behind_upstream
run zinit self-update $flag
assert $output is_empty
assert $state equals 0
done
restore_self_update_origin
}
@test 'set-debug' {
ZINIT+=(DEBUG 'true')
run +zi-log -n '{dbg} message'
assert $output contains '[debug]'; assert $state equals 0
}
@test 'unset-dbg' {
run +zi-log -n '{dbg} message'; assert $output contains ''
run +zi-log -n '{m} message'
assert $output contains 'message'; assert $state equals 0
}

View file

@ -1,53 +0,0 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
@setup {
typeset -gx HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
}
@test 'compile ice - multiple files' {
run zinit for compile'h*~*zwc' id-as'hsmw-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-compile-ice)
assert $output contains "==> Compiling 4 files history-search-multi-word, history-search-multi-word.plugin.zsh, hsmw-context-main, hsmw-highlight [OK]"
assert $state equals 0
}
@test 'compile ice - single file' {
run zinit for id-as'hsmw-no-compile-ice' @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile hsmw-no-compile-ice)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile ice' {
run zinit light @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile zdharma-continuum/history-search-multi-word)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
}
@test 'compile cmd' {
run zinit for id-as"compile-command" @zdharma-continuum/history-search-multi-word
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile --quiet compile-command)
assert $state equals 0
assert $output contains "==> Compiling history-search-multi-word.plugin.zsh [OK]"
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compiled)
assert $state equals 0
assert $output contains 'compile-command:'
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile --quiet compile-command)
assert $state equals 0; assert $output contains '==> Uncompiling compile-command [OK]'
}
@test 'compiled cmd' {
zinit uncompile --all --quiet
run zinit compiled; assert $state equals 0
assert $output contains 'No compiled plugins'
}
@test 'uncompile cmd' {
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit compile -q compile-command)
assert $state equals 0
run perl -pe 's/\x1b\[[0-9;]*[mG]//g' <(zinit uncompile -q compile-command)
assert $state equals 0
assert $output contains '==> Uncompiling compile-command [OK]'
}

View file

@ -1,68 +0,0 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
#
# zdharma-continuum/zinit/tests/config-zstyle.zunit
# Copyright (c) 2016-2021 Sebastian Gniazdowski
# Copyright (c) 2021-2024 zdharma-continuum
# Homepage: https://github.com/zdharma-continuum/zinit
# License: MIT License
#
# Tests for configuring ZINIT[...] settings via `zstyle ':zinit:config' ...'.
#
# NOTE: the test bootstrap pre-sets every ZINIT[KEY], which would mask the
# zstyle path. Each test therefore exercises the feature in a CLEAN
# `zsh -fc` subshell that sets a zstyle, sources the patched zinit.zsh
# (located at ${ZINIT[BIN_DIR]}/zinit.zsh inside the test env) and prints the
# resulting hash field.
#
# The subshell is captured with `$(...)` rather than zunit's `run`: `run`
# re-`eval`s its arguments in the *outer* process, where the bootstrap has
# already populated ZINIT[HOME_DIR] et al., which would clobber the inner
# `${ZINIT[...]}` reads we want to observe. Single-quoting the inner script
# defers those reads to the subshell; only ${ZINIT[BIN_DIR]} is expanded
# (concatenated in) by the outer shell to locate zinit.zsh.
#
@test 'zstyle fills an unset key' {
output=$(zsh -fc 'zmodload zsh/zutil; typeset -gAH ZINIT
ZINIT[BIN_DIR]='"${ZINIT[BIN_DIR]}"'
zstyle ":zinit:config" home-dir /tmp/zi-fromstyle
source '"${ZINIT[BIN_DIR]}"'/zinit.zsh >/dev/null 2>&1
print -r -- ${ZINIT[HOME_DIR]}')
state=$?
assert $state equals 0
assert $output same_as '/tmp/zi-fromstyle'
}
@test 'explicit ZINIT[KEY] beats zstyle' {
output=$(zsh -fc 'zmodload zsh/zutil; typeset -gAH ZINIT
ZINIT[BIN_DIR]='"${ZINIT[BIN_DIR]}"'
ZINIT[HOME_DIR]=/tmp/zi-explicit
zstyle ":zinit:config" home-dir /tmp/zi-fromstyle
source '"${ZINIT[BIN_DIR]}"'/zinit.zsh >/dev/null 2>&1
print -r -- ${ZINIT[HOME_DIR]}')
state=$?
assert $state equals 0
assert $output same_as '/tmp/zi-explicit'
}
@test 'derived dir follows zstyle-provided home-dir' {
output=$(zsh -fc 'zmodload zsh/zutil; typeset -gAH ZINIT
ZINIT[BIN_DIR]='"${ZINIT[BIN_DIR]}"'
zstyle ":zinit:config" home-dir /tmp/zi-fromstyle
source '"${ZINIT[BIN_DIR]}"'/zinit.zsh >/dev/null 2>&1
print -r -- ${ZINIT[PLUGINS_DIR]}')
state=$?
assert $state equals 0
assert $output same_as '/tmp/zi-fromstyle/plugins'
}
@test 'no zstyle, no array still resolves a default home-dir' {
output=$(zsh -fc 'zmodload zsh/zutil; typeset -gAH ZINIT
ZINIT[BIN_DIR]='"${ZINIT[BIN_DIR]}"'
source '"${ZINIT[BIN_DIR]}"'/zinit.zsh >/dev/null 2>&1
[[ -n ${ZINIT[HOME_DIR]} ]] && print OK')
state=$?
assert $state equals 0
assert $output same_as 'OK'
}

View file

@ -1,912 +0,0 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=4:sts=4:et:foldmarker={,}:foldmethod=marker
@setup {
load "${PWD}/tests/_support/annex_test_assertions"
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
}
@test 'act' { # Run your GitHub Actions locally
run zinit for @nektos/act; assert $state equals 0
local act="$ZBIN/act"; assert "$act" is_executable
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
local cli="$ZBIN/akamai"; assert "$cli" is_executable
run "$cli" --version; assert $state equals 0
}
@test 'alacritty' { # Run your GitHub alacrittyions locally
[[ $OSTYPE =~ 'linux*' ]] && skip "Alacritty test skipped on $os_type"
run zinit for @alacritty/alacritty; assert $state equals 0
local alacritty="$ZBIN/alacritty"; assert "$alacritty" is_executable
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 @alistgo/alist; assert $state equals 0
local alist="$ZBIN/alist"; assert "$alist" is_executable
run "$alist" version; assert $state equals 0
}
@test 'asciigraph' { # Go package to make lightweight ASCII line graphs in command line apps with no external dependencies.
run zinit for @guptarohit/asciigraph; assert $state equals 0
local asciigraph="$ZBIN/asciigraph"; assert "$asciigraph" is_executable
run "$asciigraph" --help; assert $state equals 0
}
@test 'assh' { # make your ssh client smarter
run zinit for @moul/assh; assert $state equals 0
local assh="$ZBIN/assh"; assert "$assh" is_executable
run "$assh" --version; assert $state equals 0
}
@test 'atuin' { # Magical shell history
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
}
@test 'aurora' { # Cross-platform beanstalkd queue server admin console
run zinit for @xuri/aurora; assert $state equals 0
local aurora="$ZBIN/aurora"; assert "$aurora" is_executable
run "$aurora" -v; assert $state equals 0
}
@test 'bandwhich' { # Terminal bandwidth utilization tool
[[ $OSTYPE =~ 'darwin*' ]] && skip "on $os_type"
run zinit for @imsnif/bandwhich; assert $state equals 0
local bandwhich="$ZBIN/bandwhich"; assert "$bandwhich" is_executable
run "$bandwhich" --version; assert $state equals 0
}
@test 'bat' { # A cat(1) clone with wings
run zinit for @sharkdp/bat; assert $state equals 0
local bat="$ZBIN/bat"; assert "$bat" is_executable
run "$bat" --version; assert $state equals 0
}
@test 'bazel' { # a fast, scalable, multi-language and extensible build system
run zinit lbin"!bazel* -> bazel" for @bazelbuild/bazel; assert $state equals 0
local bazel="$ZBIN/bazel"; assert "$bazel" is_executable
run "$bazel" --version; assert $state equals 0
}
@test 'blast' { # Blast is a simple tool for API load testing and batch jobs
[[ $OSTYPE =~ 'darwin*' ]] && skip "on $os_type"
run zinit for @dave/blast; assert $state equals 0
local blast="$ZBIN/blast"; assert "$blast" is_executable
run "$blast" --dry=1; assert $state equals 0
}
@test 'booklit' { # a pretty lit content authoring system
run zinit for lbin'!* -> booklit' @vito/booklit; assert $state equals 0
local booklit="$ZBIN/booklit"; assert "$booklit" is_executable
run "$booklit" --version; assert $state equals 0
}
@test 'bottom' { # Yet another cross-platform graphical process/system monitor
run zinit lbin'!btm' for ClementTsang/bottom; assert $state equals 0
local bottom="$ZBIN/btm"; assert "$bottom" is_executable
run "$bottom" --version; assert $state equals 0
}
@test 'broot' { # A new way to see and navigate directory trees
[[ $OSTYPE =~ 'darwin*' ]] && skip " on $os_type"
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
}
@test 'btop' { # A monitor of resources
run zinit ver'v1.2.13' for aristocratos/btop; assert $state equals 0
local btop="$ZBIN/btop"; assert "$btop" is_executable
run "$btop" --version; assert $state equals 0
}
@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
}
@test 'certificates' { # An opinionated helper for generating tls certificates
run zinit lbin'!* -> certificates' for @mvmaasakkers/certificates; assert $state equals 0
local certificates="$ZBIN/certificates"; assert "$certificates" is_executable
run "$certificates" --version; assert $state equals 0
}
@test 'checkmake' { # experimental linter/analyzer for Makefiles
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
}
@test 'cosign' { # Container signing, verification and storage in an OCI registry
run zinit lbin'!* -> cosign' for @sigstore/cosign; assert $state equals 0
local cosign="$ZBIN/cosign"; assert "$cosign" is_executable
run $cosign version; assert $state equals 0
}
@test 'compress' { # Optimized Go Compression Packages
run zinit bpick'*.tar.gz' lbin'!s2c;s2d;s2sx;' for @klauspost/compress; assert $state equals 0
local compress="$ZBIN/s2c"; assert "$compress" is_executable
run $compress --help; assert $state equals 0
}
@test 'create-go-app' { # Create a new production-ready project with backend, frontend and deploy automation by running one CLI command
run zinit for id-as'cgapp' @create-go-app/cli; assert $state equals 0
local cgapp="$ZBIN/cgapp"; assert "$cgapp" is_executable
[[ $OSTYPE =~ 'darwin*' ]] && assert "$output" contains "darwin_${$(uname -m)//x86_/amd}" && pass
run $cgapp --version; assert $state equals 0
}
@test 'csview' { # Pretty csv viewer for cli with cjk/emoji support
run zinit for @wfxr/csview; assert $state equals 0
local csview="$ZBIN/csview"; assert "$csview" is_executable
run $csview --version; assert $state equals 0
}
@test 'dapr' { # Command-line tools for Dapr.
run zinit id-as'dapr' for @dapr/cli; assert $state equals 0
local cli="$ZBIN/dapr"; assert "$cli" is_executable
run "$cli" --version; assert $state equals 0
}
@test 'delta' { # A syntax-highlighting pager for git, diff, and grep output
run zinit for @dandavison/delta; assert $state equals 0
local delta="$ZBIN/delta"; assert "$delta" is_executable
run $delta --version; assert $state equals 0
}
@test 'difftastic' { # A structural diff that understands syntax
run zinit lbin'!difft' for @Wilfred/difftastic; assert $state equals 0
local difftastic="$ZBIN/difft"; assert "$difftastic" is_executable
run $difftastic --version; assert $state equals 0
}
@test 'dive' { # A tool for exploring each layer in a docker image
run zinit for @wagoodman/dive; assert $state equals 0
local dive="$ZBIN/dive"; assert "$dive" is_executable
run $dive --version; assert $state equals 0
}
@test 'docker-buildx' { # A monitor of resources
run zinit for lbin'!* -> buildx' @docker/buildx; assert $state equals 0
local buildx="$ZBIN/buildx"; assert "$buildx" is_executable
run $buildx version; assert $state equals 0
}
@test 'docker-compose' { # Define and run multi-container applications with Docker
run zinit lbin'!* -> docker-compose' for @docker/compose; assert $state equals 0
local dc="$ZBIN/docker-compose"; assert "$dc" is_executable
run $dc --version; assert $state equals 0
}
@test 'docker-credential-helpers' { # A monitor of resources
[[ $OSTYPE =~ 'linux*' ]] && skip "on $os_type"
run zinit for lbin'!* -> docker-credential-desktop' @docker/docker-credential-helpers; assert $state equals 0
local credential_desktop="$ZBIN/docker-credential-desktop"; assert "$credential_desktop" is_executable
run $credential_desktop version; assert $state equals 0
}
@test 'documize' { # Modern Confluence alternative designed for internal & external docs, built with Go & Ember JS
run zinit lbin'!* -> documize' for @documize/community; assert $state equals 0
local documize="$ZBIN/documize"; assert "$documize" is_executable
run $documize version; assert $state equals 0
}
@test 'dstask' { # Git powered terminal-based todo/note manager -- markdown note page per task
run zinit lbin'!*->dstask' bpick'^*import*' for @naggie/dstask; assert $state equals 0
local dstask="$ZBIN/dstask"; assert "$dstask" is_executable
run $dstask version; assert $state equals 0
}
@test 'dua' { # View disk space usage and delete unwanted data, fast
run zinit ver'v2.20.3' lbin'!dua' for @Byron/dua-cli; assert $state equals 0
local dua="$ZBIN/dua"; assert "$dua" is_executable
run $dua --version; assert $state equals 0
}
@test 'duci' { # The simple CI server
run zinit for @duck8823/duci; assert $state equals 0
local duci="$ZBIN/duci"; assert "$duci" is_executable
run $duci version; assert $state equals 0
}
@test 'dust' { # A more intuitive version of du in rust
run zinit for @bootandy/dust; assert $state equals 0
local dust="$ZBIN/dust"; assert "$dust" is_executable
run $dust --version; assert $state equals 0
}
@test 'dyff' { # diff tool for YAML files, and sometimes JSON
run zinit for @homeport/dyff; assert $state equals 0
local dyff="$ZBIN/dyff"; assert "$dyff" is_executable
run $dyff version; assert $state equals 0
}
@test 'dysk' { # A linux utility to get information on filesystems, like df but better
[[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type"
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
}
@test 'etcd' { # Distributed reliable key-value store for the most critical data of a distributed system
run zinit for @etcd-io/etcd; assert $state equals 0
local etcd="$ZBIN/etcd"; assert "$etcd" is_executable
run $etcd --version; assert $state equals 0
}
@test 'exa' { # A modern replacement for ls
run zinit for @ogham/exa; assert $state equals 0
local exa="$ZBIN/exa"; assert "$exa" is_executable
run $exa --version; assert $state equals 0
}
@test 'fclones' { # Efficient duplicate file Finder
[[ $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" --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
local fd="$ZBIN/fd"; assert "$fd" is_executable
run $fd version; assert $state equals 0
}
@test 'fnm' { # Fast and simple Node.js version manager, built in Rust
run zinit for @Schniz/fnm; assert $state equals 0
local fnm="$ZBIN/fnm"; assert "$fnm" is_executable
run $fnm --version; assert $state equals 0
}
@test 'fogg' { # Manage Infrastructure as Code with less pain
run zinit ver'v0.92.1' for @chanzuckerberg/fogg; assert $state equals 0
local fogg="$ZBIN/fogg"; assert "$fogg" is_executable
run $fogg version; assert $state equals 0
}
@test 'fx' { # Terminal JSON viewer
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
}
@test 'fzf' { # A command-line fuzzy finder
run zinit for @junegunn/fzf; assert $state equals 0
local fzf="$ZBIN/fzf"; assert "$fzf" is_executable
run $fzf --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
run $gdu --version; assert $state equals 0
}
@test 'gf' { # Fast disk usage analyzer with console interface written in Go
run zinit lbin'!* -> gf' for @gogf/gf; assert $state equals 0
local gf="$ZBIN/gf"; assert "$gf" is_executable
run $gf --version; assert $state equals 0
}
@test 'ggsrun' { # This is a CLI tool to execute Google Apps Script (GAS) at own terminal on local PC. Also this CLI tool can be used for managing files in Google Drive for OAuth2 and Service Account
run zinit lbin'!* -> ggsrun' ver'v2.0.0' for @tanaikech/ggsrun; assert $state equals 0
local git_sizer="$ZBIN/ggsrun"; assert "$git_sizer" is_executable
run $git_sizer --version; assert $state equals 0
}
@test 'gh-cli' { # GitHubs official command line tool
run zinit lbin'!gh' for @cli/cli; assert $state equals 0
local gh_cli="$ZBIN/gh"; assert "$gh_cli" is_executable
run $gh_cli --version; assert $state equals 0
}
@test 'gh-hub' { # A command-line tool that makes git easier to use with GitHub
run zinit cp"hub-*/etc/hub.zsh_completion -> _hub" for @mislav/hub; assert $state equals 0
local hub="$ZBIN/hub"; assert "$hub" is_executable
run $hub --version; assert $state equals 0
}
@test 'ghg' { # Get the executable from github releases easily
run zinit for @Songmu/ghg; assert $state equals 0
local ghg="$ZBIN/ghg"; assert "$ghg" is_executable
run "$ghg" version; assert $state equals 0
}
@test 'ghq' { # Remote repository management made easy
run zinit for @x-motemen/ghq; assert $state equals 0
local ghq="$ZBIN/ghq"; assert "$ghq" is_executable
run "$ghq" --version; assert $state equals 0
}
@test 'git-absorb' { # git commit --fixup, but automatic
run zinit for @tummychow/git-absorb; assert $state equals 0
local git_absorb="$ZBIN/git-absorb"; assert "$git_absorb" is_executable
run "$git_absorb" --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
local git_mkver="$ZBIN/git-mkver"; assert "$git_mkver" is_executable
run "$git_mkver" info; assert $state equals 0
}
@test 'git-sizer' { # Compute various size metrics for a Git repository, flagging those that might cause problems
run zinit for @github/git-sizer; assert $state equals 0
local git_sizer="$ZBIN/git-sizer"; assert "$git_sizer" is_executable
run "$git_sizer" --version; assert $state equals 0
}
@test 'gitui' { # Blazing fast terminal-ui for git written in rust
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
}
@test 'glow' { # Render markdown on the CLI, with pizzazz
run zinit for @charmbracelet/glow; assert $state equals 0
local git_sizer="$ZBIN/glow"; assert "$git_sizer" is_executable
run $git_sizer --version; assert $state equals 0
}
@test 'go-james' { # James is your butler and helps you to create, build, debug, test and run your Go projects
run zinit for @pieterclaerhout/go-james; assert $state equals 0
local git_sizer="$ZBIN/go-james"; assert "$git_sizer" is_executable
run $git_sizer version; assert $state equals 0
}
@test 'go-swagger' { # Swagger 2.0 implementation for go
run zinit lbin'!* -> go-swagger' for @go-swagger/go-swagger; assert $state equals 0
local git_sizer="$ZBIN/go-swagger"; assert "$git_sizer" is_executable
run $git_sizer version; assert $state equals 0
}
@test 'gojq' { # Pure Go implementation of jq
run zinit for @itchyny/gojq; assert $state equals 0
local git_sizer="$ZBIN/gojq"; assert "$git_sizer" is_executable
run $git_sizer --version; assert $state equals 0
}
@test 'gomi' { # Replacement for UNIX rm command
run zinit for @babarot/gomi; assert $state equals 0
local gomi="$ZBIN/gomi"; assert "$gomi" is_executable
run $gomi --version; assert $state equals 0
}
@test 'gosu' { # Simple Go-based setuid+setgid+setgroups+exec
[[ $OSTYPE =~ "darwin*" ]] && skip "on $os_type"
run zinit lbin'!* -> gosu' for @tianon/gosu; assert $state equals 0
local gosu="$ZBIN/gosu"; assert "$gosu" is_executable
run $gosu --version; assert $state equals 0
}
@test 'got' { # Simple golang package and CLI tool to download large files faster than cURL and Wget
run zinit for @melbahja/got; assert $state equals 0
local got="$ZBIN/got"; assert "$got" is_executable
run $got --version; assert $state equals 0
}
@test 'gotestfmt' { # go test output for humans
run zinit for @GoTestTools/gotestfmt; assert $state equals 0
local gotestfmt="$ZBIN/gotestfmt"; assert "$gotestfmt" is_executable
run $gotestfmt --help; assert $state equals 0
}
@test 'gothanks' { # go test output for humans
run zinit for @psampaz/gothanks; assert $state equals 0
local gothanks="$ZBIN/gothanks"; assert "$gothanks" is_executable
run $gothanks --help; assert $state equals 0
}
@test 'grex' { # A command-line tool and library for generating regular expressions from user-provided test cases
run zinit for @pemistahl/grex; assert $state equals 0
local grex="$ZBIN/grex"; assert "$grex" is_executable
run $grex --version; assert $state equals 0
}
@test 'gron' { # go test output for humans
run zinit for @tomnomnom/gron; assert $state equals 0
local gron="$ZBIN/gron"; assert "$gron" is_executable
run $gron --version; assert $state equals 0
}
@test 'hadolint' { # Dockerfile linter, validate inline bash, written in Haskell
run zinit ver'v2.12.1-beta' lbin'!hadolint* -> hadolint' for @hadolint/hadolint; assert $state equals 0
local hadolint="$ZBIN/hadolint"; assert "$hadolint" is_executable
run $hadolint --version; assert $state equals 0
}
# TODO: gh-r does not find older assets anymore (possible bug from https://github.com/zdharma-continuum/zinit/pull/373)
@test 'heksa' { # CLI hex dumper with colors
[[ $OSTYPE =~ "darwin*" ]] && skip "on $os_type"
run zinit for @raspi/heksa; assert $state equals 0
local heksa="$ZBIN/heksa"; assert "$heksa" is_executable
run $heksa --version; assert $state equals 0
}
@test 'helix' { # A post-modern modal text editor
run zinit lbin'!hx' for @helix-editor/helix; assert $state equals 0
local helix="$ZBIN/hx"; assert "$helix" is_executable
run $helix --version; assert $state equals 0
}
@test 'hexyl' { # A command-line hex viewer
run zinit for @sharkdp/hexyl; assert $state equals 0
local hexyl="$ZBIN/hexyl"; assert "$hexyl" is_executable
run $hexyl --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
run $hoofli -h; assert $state equals 0
}
@test 'hors' { # instant coding answers via the command line
[[ $OSTYPE =~ "linux*" ]] && skip "skipped on $os_type"
run zinit for @WindSoilder/hors; assert $state equals 0
local hors="$ZBIN/hors"; assert "$hors" is_executable
run $hors --version; assert $state equals 0
}
@test 'htmlq' { # Like jq, but for HTML
run zinit for @mgdm/htmlq; assert $state equals 0
local htmlq="$ZBIN/htmlq"; assert "$htmlq" is_executable
run "$htmlq" --version; assert $state equals 0
}
@test 'hyperfine' { # A command-line benchmarking tool
run zinit bpick'*tar.gz*' for @sharkdp/hyperfine; assert $state equals 0
local hyperfine="$ZBIN/hyperfine"; assert "$hyperfine" is_executable
run $hyperfine --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
run $igo version; assert $state equals 0
}
@test 'insect' { # High precision scientific calculator with support for physical units
run zinit ver'v5.7.0' lbin'!* -> insect' for @sharkdp/insect; assert $state equals 0
local insect="$ZBIN/insect"; assert "$insect" is_executable
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
local cli="$ZBIN/ipinfo"; assert "$cli" is_executable
run "$cli" --version; assert $state equals 0
}
@test 'joincap' { # Merge multiple pcap files together, gracefully
run zinit lbin'!* -> joincap' for @assafmo/joincap; assert $state equals 0
local joincap="$ZBIN/joincap"; assert "$joincap" is_executable
run $joincap --version; assert $state equals 0
}
@test 'jq' { # Command-line JSON processor
run zinit lbin'!* -> jq' for jqlang/jq; assert $state equals 0
local jq="$ZBIN/jq"; assert "$jq" is_executable
run $jq --version; assert $state equals 0
}
@test 'just' { # Just a command runner
run zinit for @casey/just; assert $state equals 0
local just="$ZBIN/just"; assert "$just" is_executable
run $just --version; assert $state equals 0
}
# @test 'keepassxc' { # a cross-platform community-driven port of the Windows application Keepass Password Safe
# [[ $OSTYPE =~ 'linux*' ]] && skip "skipped on $os_type"
# run zinit for lbin'!*-cli -> keepassxc-cli' @keepassxreboot/keepassxc; assert $state equals 0
# local keepassxc="$ZBIN/keepassxc-cli"; assert "$keepassxc" is_executable
# run $keepassxc --version; assert $state equals 0
# }
@test 'ko' { # Build and deploy Go applications on Kubernetes
run zinit for @ko-build/ko; assert $state equals 0
local ko="$ZBIN/ko"; assert "$ko" is_executable
run $ko version; assert $state equals 0
}
@test 'kopia' { # Cross-platform backup tool with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication
run zinit for @kopia/kopia; assert $state equals 0
local kopia="$ZBIN/kopia"; assert "$kopia" is_executable
run $kopia --version; assert $state equals 0
}
@test 'krew' { # Build and deploy Go applications on Kubernetes
run zinit lbin'!krew* -> krew' for @kubernetes-sigs/krew; assert $state equals 0
local krew="$ZBIN/krew"; assert "$krew" is_executable
run $krew 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
run zinit for bpick'kubectx;kubens' sbin'kubectx;kubens' @ahmetb/kubectx
local bin prog
for bin in 'kubectx' 'kubens'; do
prog="$ZBIN/${bin}"; assert "$prog" is_executable;
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
run $lazygit --version; assert $state equals 0
}
@test 'lemmeknow' { # The fastest way to identify anything
run zinit lbin'!* -> lemmeknow' for @swanandx/lemmeknow; assert $state equals 0
local lemmeknow="$ZBIN/lemmeknow"; assert "$lemmeknow" is_executable
run "$lemmeknow" --version; assert $state equals 0
}
@test 'lf' { # Terminal file manager
run zinit for @gokcehan/lf; assert $state equals 0
local lf="$ZBIN/lf"; assert "$lf" is_executable
run $lf -version; assert $state equals 0
}
@test 'lnav' { # advanced log file viewer
run zinit for @tstack/lnav; assert $state equals 0
local lnav="$ZBIN/lnav"; assert "$lnav" is_executable
run $lnav --version; assert $state equals 0
}
@test 'lsd' { # The next gen ls command
run zinit for @lsd-rs/lsd; assert $state equals 0
local lsd="$ZBIN/lsd"; assert "$lsd" is_executable
run $lsd --version; assert $state equals 0
}
@test 'lstf' { # The aggregated TCP flows printer in Linux
[[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type"
run zinit for @yuuki/lstf; assert $state equals 0
local lstf="$ZBIN/lstf"; assert "$lstf" is_executable
run $lstf --version; assert $state equals 0
}
@test 'macchina' { # A system information frontend with an emphasis on performance
[[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type"
run zinit lbin'!* -> macchina' for @macchina-cli/macchina; assert $state equals 0
local macchina="$ZBIN/macchina"; assert "$macchina" is_executable
run $macchina --version; assert $state equals 0
}
@test 'mage' { # A Make/rake-like dev tool using Go
run zinit for @magefile/mage; assert $state equals 0
local mage="$ZBIN/mage"; assert "$mage" is_executable
run $mage -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
run "$mcfly" --version; assert $state equals 0
}
@test 'mdbook-lbin' { # Create book from markdown files. Like Gitbook but implemented in Rust
local mdbook="$ZBIN/mdbook";
run zinit for @rust-lang/mdBook; assert $state equals 0 assert "$mdbook" is_executable
run "$mdbook" --version; assert $state equals 0
run command file "$(command realpath ${mdbook})"; assert $output contains 'executable'
run zinit delete --yes rust-lang/mdBook; assert $state equals 0
run "$mdbook" --version;
assert $state equals 127; assert $output contains 'no such file or directory'
}
@test 'mdbook-sbin' { # Create book from markdown files. Like Gitbook but implemented in Rust
load_bin_gem_node
local mdbook="$ZBIN/mdbook";
run zinit from'gh-r' sbin"mdbook" for @rust-lang/mdBook; assert $state equals 0 assert "$mdbook" is_executable
run "$mdbook" --version; assert $state equals 0
run command file "$(command realpath ${mdbook})";
assert $output contains 'zsh script'; assert $output contains 'ASCII text'
run zinit delete --yes rust-lang/mdBook; assert $state equals 0
run "$mdbook" --version;
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 @micro-editor/micro; assert $state equals 0
local micro="$ZBIN/micro"; assert "$micro" is_executable
run $micro --version; assert $state equals 0
}
@test 'miniserve' { # For when you really just want to serve some files over HTTP right now!
[[ $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 --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
local mkcert="$ZBIN/mkcert"; assert "$mkcert" is_executable
run $mkcert --version; assert $state equals 0
}
@test 'mmake' { # A Make/rake-like dev tool using Go
run zinit for ver'v1.4.0' @tj/mmake; assert $state equals 0
local mmake="$ZBIN/mmake"; assert "$mmake" is_executable
run $mmake --version; assert $state equals 0
}
@test 'mmv' { # rename multiple files with editor
run zinit for @itchyny/mmv; assert $state equals 0
local mmv="$ZBIN/mmv"; assert "$mmv" is_executable
run $mmv --version; assert $state equals 0
}
@test 'mob' { # rename multiple files with editor
run zinit for @remotemobprogramming/mob; assert $state equals 0
local mob="$ZBIN/mob"; assert "$mob" is_executable
run $mob --version; assert $state equals 0
}
@test 'mocword' { # Predict next words
run zinit lbin'!mocword* -> mocword' for @high-moctane/mocword; assert $state equals 0
local mocword="$ZBIN/mocword"; assert "$mocword" is_executable
run $mocword --version; assert $state equals 0
}
@test 'monolith' { # CLI tool for saving complete web pages as a single HTML file
[[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type"
run zinit lbin'!* -> monolith' for @Y2Z/monolith; assert $state equals 0
local monolith="$ZBIN/monolith"; assert "$monolith" is_executable
run $monolith --version; assert $state equals 0
}
@test 'moonwalk' { # Cover your tracks during Linux Exploitation by leaving zero traces on system logs and filesystem timestamps
run zinit lbin'!moonwalk* -> moonwalk' for @mufeedvh/moonwalk; assert $state equals 0
local moonwalk="$ZBIN/moonwalk"; assert "$moonwalk" is_executable
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
}
@test 'onefetch' { # Git repository summary on your terminal
run zinit for @o2sh/onefetch; assert $state equals 0
local onefetch="$ZBIN/onefetch"; assert "$onefetch" is_executable
run $onefetch --version; assert $state equals 0
}
@test 'ollama' { # Get up and running with large language models
# The suite's only `.tar.zst' release asset. darwin ships a `.tgz', so the
# zstd extraction path is reachable on Linux only. bpick drops the
# accelerator builds (mlx/rocm/jetpack), which sort ahead of the plain one.
[[ $OSTYPE =~ 'darwin*' ]] && skip "no .tar.zst asset on $os_type"
(( ${+commands[zstd]} )) || skip 'zstd not installed'
run zinit id-as lbin'!ollama' bpick'^*(mlx|rocm|jetpack)*' for @ollama/ollama; assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "didn't recognize archive type"
local ollama="$ZBIN/ollama"; assert "$ollama" is_executable
run "$ollama" --version; assert $state equals 0
}
@test 'ouch' { # Painless compression and decompression for your terminal
run zinit for @ouch-org/ouch; assert $state equals 0
local ouch="$ZBIN/ouch"; assert "$ouch" is_executable
run "$ouch" --version; assert $state equals 0
}
@test 'pastel' { # A command-line tool to generate, analyze, convert and manipulate colors
run zinit for @sharkdp/pastel; assert $state equals 0
local pastel="$ZBIN/pastel"; assert "$pastel" is_executable
run "$pastel" --version; assert $state equals 0
}
@test 'peco' { # Simplistic interactive filtering tool
run zinit for @peco/peco; assert $state equals 0
local peco="$ZBIN/peco"; assert "$peco" is_executable
run $peco --version; assert $state equals 0
}
@test 'piknik' { # Copy/paste anything over the network
run zinit for @jedisct1/piknik; assert $state equals 0
local piknik="$ZBIN/piknik"; assert "$piknik" is_executable
run $piknik --version; assert $state equals 0
}
@test 'pipr' { # A tool to interactively write shell pipelines.
[[ $OSTYPE =~ 'darwin*' ]] && skip "skipped on $os_type"
run zinit for @Elkowar/pipr; assert $state equals 0
local pipr="$ZBIN/pipr"; assert "$pipr" is_executable
run "$pipr" --help; assert $state equals 0
}
@test 'pmy' { # General purpose context-aware zsh completion engine powered by fuzzy finder
run zinit for @relastle/pmy; assert $state equals 0
local pmy="$ZBIN/pmy"; assert "$pmy" is_executable
run "$pmy" --version; assert $state equals 0
}
@test 'procs' { # A modern replacement for ps written in Rust
run zinit for @dalance/procs; assert $state equals 0
local procs="$ZBIN/procs"; assert "$procs" is_executable
run "$procs" --version; assert $state equals 0
}
@test 'pulumi' { # A modern replacement for ps written in Rust
run zinit for @pulumi/pulumi; assert $state equals 0
local pulumi="$ZBIN/pulumi"; assert "$pulumi" is_executable
run "$pulumi" version; 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
}
@test 'rancher' { # Rancher CLI
run zinit for id-as'rancher' @rancher/cli; assert $state equals 0
local cli="$ZBIN/rancher"; assert "$cli" is_executable
run "$cli" --version; assert $state equals 0
}
@test 'rare' { # Realtime regex-extraction and aggregation into common formats such as histograms, bar graphs, tables, etc
run zinit for @zix99/rare; assert $state equals 0
local rare="$ZBIN/rare"; assert "$rare" is_executable
run "$rare" --version; assert $state equals 0
}
@test 'rargs' { # xargs + awk with pattern matching support
run zinit for @lotabout/rargs; assert $state equals 0
local rargs="$ZBIN/rargs"; assert "$rargs" is_executable
run "$rargs" --version; assert $state equals 0
}
@test 'rclone' { # Realtime regex-extraction and aggregation into common formats such as histograms, bar graphs, tables, etc
run zinit for @rclone/rclone; assert $state equals 0
local rclone="$ZBIN/rclone"; assert "$rclone" is_executable
run "$rclone" --version; assert $state equals 0
}
@test 'reg' { # Docker registry v2 command line client and repo listing generator with security checks
run zinit lbin'!* -> reg' for @genuinetools/reg; assert $state equals 0
local reg="$ZBIN/reg"; assert "$reg" is_executable
run "$reg" version; assert $state equals 0
}
# TODO: gh-r does not find older assets anymore (possible bug from https://github.com/zdharma-continuum/zinit/pull/373)
@test 'rip' { # A safe and ergonomic alternative to rm
run zinit ver'0.11.3' for @nivekuil/rip; assert $state equals 0
local rip="$ZBIN/rip"; assert "$rip" is_executable
run "$rip" --version; assert $state equals 0
}
@test 'ripgrep' { # Recursively searches directories for a regex pattern while respecting your gitignore
run zinit lbin'!rg' for @BurntSushi/ripgrep; assert $state equals 0
local rg="$ZBIN/rg"; assert "$rg" is_executable
run "$rg" --version; assert $state equals 0
}
@test 'ripsecrets' { # A command-line tool to prevent committing secret keys into your source code
run zinit for @sirwart/ripsecrets; assert $state equals 0
local ripsecrets="$ZBIN/ripsecrets"; assert "$ripsecrets" is_executable
run "$ripsecrets" --version; assert $state equals 0
}
@test 'rnr' { # A command-line tool to batch rename files and directories
run zinit for @ismaelgv/rnr; assert $state equals 0
local rnr="$ZBIN/rnr"; assert "$rnr" is_executable
run "$rnr" --version; assert $state equals 0
}
@test 'rust-analyzer' { # A Rust compiler front-end for IDEs
[[ $OSTYPE =~ "linux*" ]] && skip "skipped on $os_type"
run zinit lbin'!* -> rust-analyzer' for @rust-lang/rust-analyzer; assert $state equals 0
local rust_analyzer="$ZBIN/rust-analyzer"; assert "$rust_analyzer" is_executable
run "$rust_analyzer" --version; assert $state equals 0
}
@test 's' { # Open a web search in your terminal
run zinit for @zquestz/s; assert $state equals 0
local s="$ZBIN/s"; assert "$s" is_executable
run "$s" --version; assert $state equals 0
}
@test 'sd' { # Intuitive find & replace CLI a.k.a modern sed
run zinit for @chmln/sd; assert $state equals 0
local sd="$ZBIN/sd"; assert "$sd" is_executable
run "$sd" --version; assert $state equals 0
}
@test 'shellcheck' { # a static analysis tool for shell scripts
run zinit for @koalaman/shellcheck; assert $state equals 0
local shellcheck="$ZBIN/shellcheck"; assert "$shellcheck" is_executable
run "$shellcheck" --version; assert $state equals 0
}
@test 'shfmt' { # A shell parser, formatter, and interpreter with bash support
run zinit lbin'!sh* -> shfmt' for @mvdan/sh; assert $state equals 0
local shfmt="$ZBIN/shfmt"; assert "$shfmt" is_executable
run $shfmt --version; assert $state equals 0
}
@test 'skim' { # Fuzzy Finder in rust
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
}
@test 'snm' { # Smol and simple node version manager written in rust
run zinit for @numToStr/snm; assert $state equals 0
local snm="$ZBIN/snm"; assert "$snm" is_executable
run "$snm" --version; assert $state equals 0
}
@test 'starship' { # The minimal, blazing-fast, and infinitely customizable prompt for any shell
run zinit for @starship/starship; assert $state equals 0
local starship="$ZBIN/starship"; assert "$starship" is_executable
run "$starship" --version; assert $state equals 0
}
@test 'step' { # A zero trust swiss army knife for working with X509, OAuth, JWT, OATH OTP, etc.
run zinit for id-as'step' @smallstep/cli; assert $state equals 0
local cli="$ZBIN/step"; assert "$cli" is_executable
run "$cli" --version; assert $state equals 0
}
@test 'stern' { # Multi pod and container log tailing for Kubernetes
run zinit for @stern/stern; assert $state equals 0
local stern="$ZBIN/stern"; assert "$stern" is_executable
run "$stern" --version; assert $state equals 0
}
@test 'tealdeer' { # A very fast implementation of tldr in Rust
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
}
@test 'tin-summer' { # Find build artifacts that are taking up disk space
run zinit for @vmchale/tin-summer; assert $state equals 0
local tin_summer="$ZBIN/sn"; assert "$tin_summer" is_executable
run "$tin_summer" --version; assert $state equals 0
}
@test 'tokei' { # Count your code, quickly.
run zinit lbin'!*tokei -> tokei' ver'v12.1.1' for @XAMPPRocky/tokei; assert $state equals 0
local tokei="$ZBIN/tokei"; assert "$tokei" is_executable
run $tokei --version; assert $state equals 0
}
@test 'topgrade' { # Upgrade everything
run zinit for @r-darwish/topgrade; assert $state equals 0
local topgrade="$ZBIN/topgrade"; assert "$topgrade" is_executable
run $topgrade --version; assert $state equals 0
}
@test 'tre' { # Tree command, improved
run zinit for @dduan/tre; assert $state equals 0
local tre="$ZBIN/tre"; assert "$tre" is_executable
run $tre --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
run $up -h; assert $output contains "up is the Ultimate Plumber"
}
@test 'volta-cli' { # JS Toolchains as Code
[[ "$OSTYPE" =~ 'linux*' ]] && skip 'Volta CLI skipped on Linux'
export VOLTA_HOME="${ZPFX}/bin"
run zinit lbin'volta;volta-migrate' for @volta-cli/volta; assert $state equals 0
local volta="$ZBIN/volta"; assert "$volta" is_executable
run $volta --version; assert $state equals 0
}
@test 'watchexec' { # Executes commands in response to file modifications
run zinit for @watchexec/watchexec; assert $state equals 0
local watchexec="$ZBIN/watchexec"; assert "$watchexec" is_executable
run "$watchexec" --version; assert $state equals 0
}
@test 'whalebrew' { # Homebrew, but with Docker images
run zinit lbin'!* -> whalebrew' for whalebrew/whalebrew; assert $state equals 0
local whalebrew="$ZBIN/whalebrew"; assert "$whalebrew" is_executable
run $whalebrew version; assert $state equals 0
}
@test 'wifiqr' { # Create a QR code with your Wi-Fi login details
run zinit lbin'!* -> wifiqr' for reugn/wifiqr; assert $state equals 0
local wifiqr="$ZBIN/wifiqr"; assert "$wifiqr" is_executable
run $wifiqr --version; assert $state equals 0
}
@test 'wtf' { # The personal information dashboard for your terminal
run zinit lbin'!wtf* -> wtf' for wtfutil/wtf; assert $state equals 0
local wtf="$ZBIN/wtf"; assert "$wtf" is_executable
run $wtf --version; assert $state equals 0
}
@test 'xh' { # Friendly and fast tool for sending HTTP requests
run zinit for @ducaale/xh; assert $state equals 0
local xh="$ZBIN/xh"; assert "$xh" is_executable
run $xh --version; assert $state equals 0
}
@test 'xsv' { # A fast CSV command line toolkit written in Rust.
run zinit for @BurntSushi/xsv; assert $state equals 0
local xsv="$ZBIN/xsv"; assert "$xsv" is_executable
run "$xsv" --version; assert $state equals 0
}
@test 'yabai' { # A tiling window manager for macOS based on binary space partitioning
[[ $OSTYPE =~ 'linux*' ]] && skip 'Yabai skipped on Linux'
run zinit for @asmvik/yabai; assert $state equals 0
local yabai="$ZBIN/yabai"; assert "$yabai" is_executable
run $yabai --version; assert $state equals 0
}
@test 'yq' { # a portable command-line YAML, JSON and XML processor
run zinit lbin'!* -> yq' for @mikefarah/yq; assert $state equals 0
local yq="$ZBIN/yq"; assert "$yq" is_executable
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
}
@test 'zoxide' { # A smarter cd command
run zinit for @ajeetdsouza/zoxide; assert $state equals 0
local zoxide="$ZBIN/zoxide"; assert "$zoxide" is_executable
run $zoxide --version; assert $state equals 0
}
@test 'extract-bang with gh-r' { # extract'!' should extract exactly once via ∞zinit-extract-hook
run zinit from'gh-r' extract'!' id-as'bat/extract-bang' for @sharkdp/bat
assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "doesn't exist"
local bat="$ZBIN/bat"; assert "$bat" is_executable
run "$bat" --version; assert $state equals 0
}
@test 'extract-bang-bang with gh-r' { # extract'!!' flattens two levels: hub-ver/bin/hub → hub at root
# hub archive: hub-darwin-amd64-X.Y.Z/bin/hub (3 levels deep, requires !!)
run zinit from'gh-r' extract'!!' id-as'hub/extract-bangbang' for @mislav/hub
assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "doesn't exist"
local hub="$ZBIN/hub"; assert "$hub" is_executable
run "$hub" --version; assert $state equals 0
}
@test 'extract-bang update with gh-r' { # extract hook must run after download, not before
# Install bat with extract'!'
run zinit from'gh-r' extract'!' id-as'bat/extract-update' for @sharkdp/bat
assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "doesn't exist"
local bat="$ZBIN/bat"; assert "$bat" is_executable
# Tamper with stored release info so zinit sees a "new" version
local plugin_dir="${ZINIT[PLUGINS_DIR]}/bat---extract-update"
echo "/fake/old/release" >! "$plugin_dir/._zinit/is_release"
# Remove extracted contents (keep ._zinit) to verify re-extraction
local f
for f in "$plugin_dir"/*(N); do
[[ "${f:t}" != "._zinit" ]] && command rm -rf "$f"
done
# Update — should re-download and extract the archive
run zinit update bat/extract-update
assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "doesn't exist"
# Verify the binary was re-extracted and linked
assert "$bat" is_executable
run "$bat" --version; assert $state equals 0
}
#=============
# Flaky Tests
#=============
# @test 'atmos' { Universal Tool for DevOps and Cloud Automation (works with terraform, helm, helmfile, etc)
# skip 'null'
# run zinit for lbin'!* -> atmos' @cloudposse/atmos; assert $state equals 0
# local atmos="$ZBIN/atmos"; assert "$atmos" is_executable
# $atmos version; assert $state equals 0
# }
# @test 'bit' { A tool for composable software development
# skip 'skip bit test due to gh-r version bug'
# run zinit lbin'!bit* -> bit' for @teambit/bit; assert $state equals 0
# local bit="$ZBIN/bit"; assert "$bit" is_executable
# $bit --version; assert $state equals 0
# }
# @test 'neovim::appimage' { # Vim-fork focused on extensibility and usability
# skip 'null'
# run zinit bpick'*appimage*' id-as'neovim/appimage' for neovim/neovim
# assert $state equals 0; assert $output contains 'nvim.appimage'
# assert "$ZINIT[PLUGINS_DIR]/neovim---appimage/nvim.appimage" is_file
# }
# @test 'neovim::binary' { # Vim-fork focused on extensibility and usability
# skip 'null'
# run zinit lbin'!**/nvim' id-as'neovim/binary' for neovim/neovim; assert $state equals 0; assert $output does_not_contain 'appimage'
# local nvim="$ZBIN/nvim"; assert "$nvim" is_executable
# $nvim --version; assert $state equals 0
# }

View file

@ -1,67 +0,0 @@
#!/usr/bin/env zunit
# Tests for issue #728: Empty hook handlers cause "permission denied" errors
# https://github.com/zdharma-continuum/zinit/issues/728
@setup {
# Only the hook registries are needed. Do NOT re-source zinit.zsh here: the
# bootstrap has already sourced it from the sandbox clone, @setup bodies run
# under ERR_EXIT, and sourcing zinit.zsh trips it partway through, which
# aborts the setup and reports every test in this file as a failure with an
# empty message. Re-pointing ZINIT[BIN_DIR] at $PWD is likewise wrong -- it
# aims the tests at the real checkout instead of the sandbox. Neither test
# below calls a zinit function.
#
# HOME still has to point at the sandbox: the second test runs `zsh -c', which
# sources $HOME/.zshenv, so the developer's own rc file would otherwise leak
# into $output and $state.
HOME="$zi_test_dir"
typeset -gA ZINIT_EXTS ZINIT_EXTS2
}
@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

View file

@ -1,288 +0,0 @@
#!/usr/bin/env zunit
# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker
#
# Tests for ice value validation in .zinit-validate-ice()
#
@test 'as-valid-null' {
run zinit ice as'null'
assert $state equals 0
}
@test 'as-valid-command' {
run zinit ice as'command'
assert $state equals 0
}
@test 'as-valid-program' {
run zinit ice as'program'
assert $state equals 0
}
@test 'as-valid-completion' {
run zinit ice as'completion'
assert $state equals 0
}
@test 'as-empty' {
run zinit ice as''
assert $state equals 0
}
@test 'as-invalid-none' {
run zinit ice as'none'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'none'
assert $output contains 'null'
assert $output contains 'program'
}
@test 'as-invalid-banana' {
run zinit ice as'banana'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'banana'
}
@test 'wait-valid-0' {
run zinit ice wait'0'
assert $state equals 0
}
@test 'wait-valid-3' {
run zinit ice wait'3'
assert $state equals 0
}
@test 'wait-valid-0a' {
run zinit ice wait'0a'
assert $state equals 0
}
@test 'wait-valid-3b' {
run zinit ice wait'3b'
assert $state equals 0
}
@test 'wait-valid-1c' {
run zinit ice wait'1c'
assert $state equals 0
}
@test 'wait-valid-bang' {
run zinit ice wait'!0'
assert $state equals 0
}
@test 'wait-valid-bang-a' {
run zinit ice wait'!2a'
assert $state equals 0
}
@test 'wait-valid-bang-no-suffix' {
run zinit ice wait'!3'
assert $state equals 0
}
@test 'wait-valid-decimal' {
run zinit ice wait'3.5'
assert $state equals 0
}
@test 'wait-empty' {
run zinit ice wait
assert $state equals 0
}
@test 'wait-cond-command-exists' {
run zinit ice wait'[[ -n $commands[fzf] ]]'
assert $state equals 0
}
@test 'wait-cond-arithmetic' {
run zinit ice wait'(( $+commands[kubectl] ))'
assert $state equals 0
}
@test 'wait-cond-variable' {
run zinit ice wait'[[ -n $MY_VAR ]]'
assert $state equals 0
}
@test 'wait-cond-always-false' {
run zinit ice wait'[[ 1 = 0 ]]'
assert $state equals 0
}
@test 'wait-cond-single-command' {
run zinit ice wait'type fzf &>/dev/null'
assert $state equals 0
}
@test 'wait-invalid-suffix-x' {
run zinit ice wait'0x'
assert $state equals 0
assert $output contains 'wait'
assert $output contains 'x'
# +zi-log colourises each suffix letter separately, so the list reads
# `a<esc>, <esc>b<esc>, <esc>c' in the raw output and no contiguous
# 'a, b, c' exists to match. Strip the escapes before asserting on the
# sentence as a whole.
setopt localoptions extendedglob
local plain="${(S)output//$'\e'\[[0-9;]#[a-zA-Z]/}"
assert "$plain" contains 'Expected one of: a, b, c'
}
@test 'wait-invalid-suffix-d' {
run zinit ice wait'3d'
assert $state equals 0
assert $output contains 'wait'
assert $output contains 'd'
}
@test 'wait-invalid-suffix-z' {
run zinit ice wait'1z'
assert $state equals 0
assert $output contains 'wait'
assert $output contains 'z'
}
@test 'wait-invalid-bang-suffix' {
run zinit ice wait'!2x'
assert $state equals 0
assert $output contains 'wait'
assert $output contains 'x'
}
@test 'wait-invalid-suffix-A' {
run zinit ice wait'0A'
assert $state equals 0
assert $output contains 'wait'
assert $output contains 'A'
}
@test 'depth-valid-1' {
run zinit ice depth'1'
assert $state equals 0
}
@test 'depth-valid-10' {
run zinit ice depth'10'
assert $state equals 0
}
@test 'depth-invalid-zero' {
run zinit ice depth'0'
assert $state equals 0
assert $output contains 'depth'
assert $output contains '0'
}
@test 'depth-empty' {
run zinit ice depth''
assert $state equals 0
}
@test 'depth-invalid-text' {
run zinit ice depth'abc'
assert $state equals 0
assert $output contains 'depth'
assert $output contains 'abc'
}
@test 'depth-invalid-negative' {
run zinit ice depth'-1'
assert $state equals 0
assert $output contains 'depth'
assert $output contains '-1'
}
@test 'depth-invalid-decimal' {
run zinit ice depth'1.5'
assert $state equals 0
assert $output contains 'depth'
assert $output contains '1.5'
}
@test 'combined-all-valid' {
run zinit ice as'null' wait'0a' depth'1'
assert $state equals 0
}
@test 'combined-some-invalid' {
run zinit ice as'none' wait'0a'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'none'
}
@test 'combined-all-invalid' {
run zinit ice as'none' wait'3x' depth'abc'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'wait'
assert $output contains 'depth'
}
@test 'dash-prefix-valid' {
run zinit ice --as'null'
assert $state equals 0
}
@test 'dash-prefix-invalid' {
run zinit ice --as'none'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'none'
}
@test 'as-invalid-NULL-case' {
run zinit ice as'NULL'
assert $state equals 0
assert $output contains 'as'
assert $output contains 'NULL'
}
@test 'as-colon-valid' {
run zinit ice as:null
assert $state equals 0
}
@test 'as-colon-invalid' {
run zinit ice as:none
assert $state equals 0
assert $output contains 'as'
assert $output contains 'none'
}
@test 'for-invalid-as' {
# nocompile keeps the assertion on ice validation. Without it the load
# reaches ∞zinit-compile-plugin-hook, which returns 1 on this fixture
# ("No files for compilation found") and makes `zinit for' exit 1 for a
# reason that has nothing to do with the invalid ice under test.
run zinit for as'none' nocompile @zdharma-continuum/null
assert $state equals 0
assert $output contains 'as'
assert $output contains 'none'
}

View file

@ -1,338 +0,0 @@
#!/usr/bin/env zunit
@setup {
ZPLUGINS=$ZINIT[PLUGINS_DIR]
function _zunit_assert_not_executable(){
local pathname=$1 filepath
# If filepath is relative, prepend the test directory
if [[ "${pathname:0:1}" != "/" ]]; then
filepath="$testdir/${pathname}"
else
filepath="$pathname"
fi
[[ ! -x "$filepath" ]] && return 0
echo "'$pathname' is executable but should not be"
exit 1
}
function _zunit_assert_not_exists(){
local file_path=$1
if [[ "${file_path:0:1}" != "/" ]]; then # relative path - prepend the test directory
filepath="${testdir}/${file_path}"
fi
[[ ! -e "$file_path" ]] && return 0
exit "found '${file_path}'"
}
# Loads $1 once so it is already cloned, then cds so that $OLDPWD is a known
# directory of our own making, reported in $oldpwd_away. Deliberately not
# returning it via $(...): that forks a subshell, which would discard the cd.
function _oldpwd_fixture() {
local id="$1"
typeset -g oldpwd_away="$zi_test_dir/away-${id//\//-}"
zinit as"null" id-as"$id" for zdharma-continuum/null || true
command mkdir -p "$oldpwd_away"
builtin cd -q "$oldpwd_away"
builtin cd -q "$zi_test_dir"
}
# $1 - the $PWD to expect; $2 - where `cd -' must land, which also proves
# $OLDPWD. `equals' is arithmetic in zunit, so paths need `same_as'.
function _assert_dirs_restored() {
assert "$PWD" same_as "$1"
assert "$OLDPWD" same_as "$2"
builtin cd - >/dev/null 2>&1 || true
assert "$PWD" same_as "$2"
}
}
@test 'mv' {
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_readable
assert "$ZPLUGINS/test---mv/readme.md" not_exists
}
@test 'cp' {
run zinit as"null" id-as"test/cp" cp"readme.md -> cp.md" for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---cp/cp.md" is_file
assert "$ZPLUGINS/test---cp/cp.md" is_readable
assert "$ZPLUGINS/test---cp/readme.md" is_file
}
@test 'atclone' {
run zinit as"null" id-as"test/atclone" atclone"mv readme.md atclone.md" for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---atclone/atclone.md" is_file
assert "$ZPLUGINS/test---atclone/atclone.md" is_readable
assert "$ZPLUGINS/test---atclone/readme.md" not_exists
}
@test 'make' {
run zinit as"null" id-as"test/make" atclone"printf 'all:\n\ttouch whatever\n' > Makefile" make"all" for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---make/whatever" is_file
}
@test 'completions' {
run zinit as"null" id-as"test/completions" atclone"touch _whatever" completions for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---completions/_whatever" is_file
assert "$ZINIT[COMPLETIONS_DIR]/_whatever" is_file
}
@test 'completions-overwrite' {
# if both are given, the completions wins
run zinit as"null" id-as"test/completions-overwrite" atclone"touch _whatever2" nocompletions completions for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---completions-overwrite/_whatever2" is_file
assert "$ZINIT[COMPLETIONS_DIR]/_whatever2" is_file
}
@test 'completions-ignored' {
# only the _valid file should be installed as a completion
run zinit as"null" id-as"test/ignored_completions" atclone"touch __init__.py _valid" completions for zdharma-continuum/null
assert $state equals 0
assert "$ZPLUGINS/test---ignored_completions/_valid" is_file
assert "$ZPLUGINS/test---ignored_completions/__init__.py" is_file
assert "$ZINIT[COMPLETIONS_DIR]/_valid" is_file
# Basenames, and `not_in' for a flat array: `is_not_value_in' builds a hash,
# so it dies on an odd element count and never matches a bare name anyway.
local -a comps=( "$ZINIT[COMPLETIONS_DIR]"/_*(N:t) )
assert __init__.py not_in $comps
}
@test 'ziextract error on missing file' {
run ziextract /tmp/zi-nonexistent-file.zip
assert $state equals 1
assert $output contains 'ERROR'
assert $output contains "doesn't exist"
}
@test 'ziextract plain single file (not an archive)' {
# A bare gh-r-style release binary: no "unrecognized archive" error,
# the file is kept as-is and marked executable.
local workdir=$(mktemp -d)
printf '#!/bin/sh\necho jq\n' > "$workdir/jq-macos-arm64"
_zi_extract_plain() { cd "$workdir" && ziextract jq-macos-arm64 }
run _zi_extract_plain
assert $state equals 0
assert $output does_not_contain "didn't recognize archive type"
assert $output contains 'not an archive'
assert "$workdir/jq-macos-arm64" is_executable
rm -rf "$workdir"
}
@test 'gh-r appimage: bpick + mv on non-archive asset' {
# Real-world recipe for the ziextract non-archive fallback: the AppImage is not
# an archive, must be kept, marked executable, and renamed by the mv ice.
run zinit as"program" from"gh-r" bpick"*AppImage" mv"gh* -> ghostty" id-as"test/ghostty" for pkgforge-dev/ghostty-appimage
assert $state equals 0
assert $output does_not_contain 'ERROR'
assert $output does_not_contain "didn't recognize archive type"
assert "$ZPLUGINS/test---ghostty/ghostty" is_file
assert "$ZPLUGINS/test---ghostty/ghostty" is_executable
local -a leftovers=( "$ZPLUGINS"/test---ghostty/*.appimage(N) )
assert $#leftovers equals 0
}
@test 'ziextract still errors on unrecognized explicit type' {
local workdir=$(mktemp -d)
printf 'plain text\n' > "$workdir/somefile"
_zi_extract_bogus() { cd "$workdir" && ziextract somefile bogus-type }
run _zi_extract_bogus
assert $output contains "didn't recognize archive type"
rm -rf "$workdir"
}
@test 'ziextract plain (no flattening)' {
# extract'' → ziextract with no flags: directory structure is preserved
local workdir=$(mktemp -d)
mkdir "$workdir/subdir"
printf 'hello\n' > "$workdir/subdir/file1.txt"
( cd "$workdir" && zip -qr test.zip subdir/ )
( cd "$workdir" && ziextract test.zip )
assert "$workdir/subdir/file1.txt" is_file
assert "$workdir/file1.txt" not_exists
rm -rf "$workdir"
}
@test 'ziextract --move (flatten one level)' {
# extract'!' → ziextract --move: outer/file.txt → file.txt at root
local workdir=$(mktemp -d)
mkdir "$workdir/outer"
printf 'hello\n' > "$workdir/outer/file1.txt"
printf 'world\n' > "$workdir/outer/file2.txt"
( cd "$workdir" && zip -qr test.zip outer/ )
( cd "$workdir" && ziextract test.zip --move )
assert "$workdir/file1.txt" is_file
assert "$workdir/file2.txt" is_file
assert "$workdir/outer" not_exists
rm -rf "$workdir"
}
@test 'ziextract --move2 (flatten two levels)' {
# extract'!!' → ziextract --move --move2: outer/inner/file.txt → file.txt at root
local workdir=$(mktemp -d)
mkdir -p "$workdir/outer/inner"
printf 'hello\n' > "$workdir/outer/inner/file1.txt"
( cd "$workdir" && zip -qr test.zip outer/ )
( cd "$workdir" && ziextract test.zip --move --move2 )
assert "$workdir/file1.txt" is_file
assert "$workdir/outer" not_exists
rm -rf "$workdir"
}
@test 'ziextract deletes archive by default' {
local workdir=$(mktemp -d)
( cd "$workdir" && printf 'hello\n' > file1.txt && zip -q test.zip file1.txt && rm file1.txt )
( cd "$workdir" && ziextract test.zip )
assert "$workdir/file1.txt" is_file
assert "$workdir/test.zip" not_exists
rm -rf "$workdir"
}
@test 'ziextract --norm keeps archive after extraction' {
# extract'-' → ziextract --norm: archive is preserved after extraction
local workdir=$(mktemp -d)
( cd "$workdir" && printf 'hello\n' > file1.txt && zip -q test.zip file1.txt && rm file1.txt )
( cd "$workdir" && ziextract test.zip --norm )
assert "$workdir/file1.txt" is_file
assert "$workdir/test.zip" is_file
rm -rf "$workdir"
}
@test 'ziextract-permissions' {
# Build a zip with known permissions, call ziextract directly, and verify
# that only files with +x in the archive come out executable.
local srcdir workdir
srcdir=$(mktemp -d)
workdir=$(mktemp -d)
# run_me.sh: +x in archive, has shebang → must be executable
printf '#!/bin/sh\necho run\n' > "$srcdir/run_me.sh"
chmod +x "$srcdir/run_me.sh"
# also_run.py: no +x in archive, has shebang → must NOT be executable (shebang alone is not enough)
printf '#!/usr/bin/env python3\nprint("hi")\n' > "$srcdir/also_run.py"
# library.py: no +x, no shebang → must NOT be executable
printf 'def foo(): pass\n' > "$srcdir/library.py"
# pre_marked.sh: +x in archive, no shebang → must be executable (archive bit)
printf 'echo pre\n' > "$srcdir/pre_marked.sh"
chmod +x "$srcdir/pre_marked.sh"
# Build zip preserving permissions, then extract via ziextract
( cd "$srcdir" && zip -q "$workdir/test.zip" run_me.sh also_run.py library.py pre_marked.sh )
(( ${+functions[ziextract]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh"
( builtin cd "$workdir" && ziextract test.zip )
assert "$workdir/run_me.sh" is_executable
assert "$workdir/pre_marked.sh" is_executable
assert "$workdir/also_run.py" not_executable
assert "$workdir/library.py" not_executable
rm -rf "$srcdir" "$workdir"
}
# $OLDPWD regression coverage. See the block comment on .zinit-restore-dir in
# zinit.zsh: zinit cds into the plugin directory to run atinit/atload/multisrc,
# and the cd back used to restore $PWD but leave $OLDPWD -- and zsh's internal
# `cd -' target -- pointing at the plugin directory.
@test 'atload does not leak $OLDPWD' {
_oldpwd_fixture test/oldpwd-atload
zinit as"null" id-as"test/oldpwd-atload" atload"true" for zdharma-continuum/null || true
_assert_dirs_restored "$zi_test_dir" "$oldpwd_away"
}
@test 'atinit does not leak $OLDPWD' {
_oldpwd_fixture test/oldpwd-atinit
zinit as"null" id-as"test/oldpwd-atinit" atinit"true" for zdharma-continuum/null || true
_assert_dirs_restored "$zi_test_dir" "$oldpwd_away"
}
@test 'multisrc does not leak $OLDPWD' {
_oldpwd_fixture test/oldpwd-multisrc
# multisrc evaluates its value with the plugin directory as cwd, so give it
# a real file to find there.
builtin print -r -- 'true' >! "$ZPLUGINS/test---oldpwd-multisrc/extra.zsh"
zinit as"null" id-as"test/oldpwd-multisrc" multisrc"extra.zsh" for zdharma-continuum/null || true
_assert_dirs_restored "$zi_test_dir" "$oldpwd_away"
}
@test 'nocd ice leaves $OLDPWD untouched' {
# nocd suppresses the cd into the plugin directory, so the restore must not
# run either. It used to run unconditionally, and its no-op cd back to $PWD
# still set OLDPWD=$PWD -- turning the user's `cd -' into a dead no-op.
_oldpwd_fixture test/oldpwd-nocd
zinit as"null" id-as"test/oldpwd-nocd" atload"true" nocd for zdharma-continuum/null || true
_assert_dirs_restored "$zi_test_dir" "$oldpwd_away"
}
@test 'nocd ice still restores a cwd the ice body moved' {
# nocd only suppresses zinit's own cd into the plugin directory. An ice body
# that cds on its own must still be undone, or the ice strands the user's
# shell wherever the plugin decided to go.
_oldpwd_fixture test/oldpwd-nocd-moved
local elsewhere="$zi_test_dir/elsewhere-nocd"
command mkdir -p "$elsewhere"
zinit as"null" id-as"test/oldpwd-nocd-moved" nocd \
atload"builtin cd -q $elsewhere" for zdharma-continuum/null || true
_assert_dirs_restored "$zi_test_dir" "$oldpwd_away"
}
@test 'atload survives a since-deleted $OLDPWD' {
# Restoring by bouncing through the original $OLDPWD must not blow up when
# that directory is gone: no error on stderr, and no leak of the plugin dir.
local home="$zi_test_dir" stale="$zi_test_dir/stale-oldpwd"
zinit as"null" id-as"test/oldpwd-stale" for zdharma-continuum/null || true
command mkdir -p "$stale"
builtin cd -q "$stale"
builtin cd -q "$home"
command rmdir "$stale"
local errfile="$zi_test_dir/oldpwd-stale.err"
zinit as"null" id-as"test/oldpwd-stale" atload"true" for zdharma-continuum/null \
2>"$errfile" || true
assert "$(<$errfile)" does_not_contain "no such file or directory"
# $OLDPWD cannot be honoured, so `cd -' must degrade to a harmless no-op
# rather than navigating into the plugin directory.
_assert_dirs_restored "$home" "$home"
}
@test 'atload leaves a usable $OLDPWD when it started unset' {
local home="$zi_test_dir"
zinit as"null" id-as"test/oldpwd-unset" for zdharma-continuum/null || true
builtin cd -q "$home"
unset OLDPWD
zinit as"null" id-as"test/oldpwd-unset" atload"true" for zdharma-continuum/null || true
# A fresh zsh sets OLDPWD to PWD, which makes `cd -' a no-op. Match that.
_assert_dirs_restored "$home" "$home"
}
@test 'configure hook restores the current directory' {
# ∞zinit-configure-base-hook cds into the plugin directory inside a plain
# { } block -- not a subshell -- and every return path used to leave the
# shell parked there. A directory that already has a Makefile takes the
# earliest of those return paths.
(( ${+functions[∞zinit-configure-base-hook]} )) || \
builtin source "${ZINIT[BIN_DIR]}/zinit-install.zsh"
local home="$zi_test_dir" away="$zi_test_dir/away-configure"
local dir="$zi_test_dir/configure-plugin"
command mkdir -p "$away" "$dir"
builtin print -r -- 'all:' >! "$dir/Makefile"
builtin cd -q "$away"
builtin cd -q "$home"
# zsh's dynamic scoping makes this ICE visible to the hook we call, without
# disturbing the global one.
local -A ICE=( configure '' )
∞zinit-configure-base-hook snippet '' '' "$dir" '' '' '' || true
_assert_dirs_restored "$home" "$away"
}
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=\ {,}:foldmethod=marker

View file

@ -1,125 +0,0 @@
#!/usr/bin/env zunit
@setup {
HOME="$zi_test_dir"
typeset -gx ZBIN="$zi_test_dir/polaris/bin"
}
# @test 'cmatrix' {
# run zinit build for @abishekvashok/cmatrix;
# local cmatrix="$ZBIN/cmatrix"; assert "$cmatrix" is_executable
# run "$cmatrix" -V; assert $state equals 0
# # ensure cmake artifacts are deleted
# zinit delete --yes abishekvashok/cmatrix; assert $state equals 0
# run "$cmatrix"; assert $state equals 127
# }
@test 'figlet' {
run zinit make for @cmatsuoka/figlet; assert $state equals 0
local figlet="$ZBIN/figlet"; assert "$figlet" is_executable
run "$figlet" -I 1; assert $state equals 0
}
@test 'htop' {
run zinit build for @htop-dev/htop; assert $state equals 0
local htop="$ZBIN/htop"; assert "$htop" is_executable
run "$htop" --version; assert $state equals 0
}
@test 'bash' {
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
}
@test 'ctags' {
run zinit build for @universal-ctags/ctags; assert $state equals 0
local ctags="$ZBIN/ctags"; assert "$ctags" is_executable
run "$ctags" --version; assert $state equals 0
}
@test 'lua-format' {
run zinit cmake for @Koihik/LuaFormatter; assert $state equals 0
local lua_format="$ZBIN/lua-format"; assert "$lua_format" is_executable
run "$lua_format" --version; assert $state equals 0
run zinit delete --yes Koihik/LuaFormatter; assert $state equals 0
run "$lua_format" --version; assert $state equals 127
}
@test 'jq' {
run zinit build for @jqlang/jq; assert $state equals 0
local jq="$ZBIN/jq"; assert "$jq" is_executable
run "$jq" --version; assert $state equals 0
}
@test 'ncurses' {
run zinit configure'--enable-widec --enable-termcap' make for @mirror/ncurses; assert $state equals 0
local ncurses="$ZBIN/clear"; assert "$ncurses" is_executable
run "$ncurses" -V; assert $state equals 0
run zinit delete --yes mirror/ncurses; assert $state equals 0
run "$ncurses" -V; assert $state equals 127
}
@test 'neofetch' {
run zinit make for @dylanaraps/neofetch; assert $state equals 0
local neofetch="$ZBIN/neofetch"; assert "$neofetch" is_executable
run "$neofetch" --version; assert $state equals 1; assert $output contains 'Neofetch'
}
@test 'neovim-make' {
run zinit make for @neovim/neovim; assert $state equals 0
local neovim="$ZBIN/nvim"; assert $neovim is_executable
run "$neovim" --version; assert $state equals 0
nvim_ver="$($neovim --version | head -n1 | awk '{print $2}')";
nvim_commit="$(git --work-tree=$ZINIT[PLUGINS_DIR]/neovim---neovim rev-parse --short HEAD)";
print -lPr " " "nvim ver: %F{blue}$nvim_ver%f" "nvim commit sha: %F{blue}$nvim_commit%f" "check: [[ %F{blue}$nvim_ver%f = %F{blue}*$nvim_commit(#e)%f ]]"
[[ $nvim_ver = *$nvim_commit(#e) ]] && print -P "%F{green}ok%f"
run zinit delete --yes neovim/neovim; assert $state equals 0
run "$neovim" --version; assert $state equals 127
}
# @test 'neovim-cmake' {
# run zinit cmake for @neovim/neovim; assert $state equals 0
# local neovim="$ZBIN/nvim"; assert $neovim is_executable
# run "$neovim" --version; assert $state equals 0
#
# nvim_ver="$($neovim --version | head -n1 | awk '{print $2}')";
# nvim_commit="$(git --work-tree=$ZINIT[PLUGINS_DIR]/neovim---neovim rev-parse --short HEAD)";
# print -lPr " " "nvim ver: %F{blue}$nvim_ver%f" "nvim commit sha: %F{blue}$nvim_commit%f" "check: [[ %F{blue}$nvim_ver%f = %F{blue}*$nvim_commit(#e)%f ]]"
# [[ $nvim_ver = *$nvim_commit(#e) ]] && print -P "%F{green}ok%f"
#
# run zinit delete --yes neovim/neovim; assert $state equals 0
# }
@test 'tmux' {
if [[ $OSTYPE =~ 'darwin*' ]]; then
run zinit configure'--disable-utf8proc' make for @tmux/tmux; assert $state equals 0
else
run zinit build for @tmux/tmux; assert $state equals 0
fi
local tmux="$ZBIN/tmux"; assert $tmux is_executable
run "$tmux" -V; assert $state equals 0
run zinit delete --yes tmux/tmux; assert $state equals 0
run "$tmux" -V; assert $state equals 127
}
@test 'vim' {
run zinit build for @vim/vim; assert $state equals 0
local vim="$ZBIN/vim"; assert $vim is_executable
run "$vim" --version; assert $state equals 0
# run zinit delete --yes vim/vim; assert $state equals 0
}
@test 'zsh' {
# run zinit configure'--with-tcsetpgrp' make'install.bin' for @zsh-users/zsh; assert $state equals 0
run zinit configure'--with-tcsetpgrp' atclone"./Util/preconfig" make'install.bin' for @zsh-users/zsh; assert $state equals 0
local zsh="$ZBIN/zsh"; assert $zsh is_executable
run "$zsh" --version; assert $state equals 0
run zinit delete --yes zsh-users/zsh; assert $state equals 0
run "$zsh" --version; assert $state equals 127
}
# ===========
# Flaky tests
# ===========
# @test 'stow' {
# run zinit configure'--without-pmdir' make for @aspiers/stow; assert $state equals 0
# local stow="$ZBIN/stow"; assert "$stow" is_executable
# run "$stow" --version; assert $state equals 0
# }
# @test 'zsh-completions' {
# run zinit light-mode for zsh-users/zsh-completions
# zinit cd zsh-users/zsh-completions
# run zinit creinstall -q .; assert $state equals 0
# local broken_completions=($(echo "$ZINIT[COMPLETIONS_DIR]"/*(-@N))); assert "$#broken_completions[@]" equals 0
# }
# vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=indent

View file

@ -1,84 +0,0 @@
#!/usr/bin/env zunit
@setup {
GH_RAW_URL='https://raw.githubusercontent.com'
setup_snippet_ok() { # state=$1, output=$2, file=$3
assert $1 equals 0
assert $2 contains "Setting up snippet"
assert $3 is_file; assert $3 is_readable
}
install_completion(){
zinit for as'completion' nocompile id-as"$1" is-snippet "$GH_RAW_URL/$2"
}
}
@test 'OMZL::spectrum.zsh' {
run zinit snippet OMZL::spectrum.zsh
setup_snippet_ok $state $output "$ZINIT[SNIPPETS_DIR]/OMZL::spectrum.zsh/OMZL::spectrum.zsh"
}
@test 'OMZP::git' {
run zinit snippet OMZP::git
setup_snippet_ok $state $output "$ZINIT[SNIPPETS_DIR]/OMZP::git/OMZP::git"
}
@test 'PZTM::environment' {
run zinit snippet PZTM::environment
setup_snippet_ok $state $output "$ZINIT[SNIPPETS_DIR]/PZTM::environment/PZTM::environment"
}
@test 'bat-completion' {
run install_completion 'bat-completion/_bat' 'sharkdp/bat/master/assets/completions/bat.zsh.in'
setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_bat
}
@test 'brew-completion' {
run install_completion 'brew-completion/_brew' 'Homebrew/brew/master/completions/zsh/_brew'
setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_brew
}
@test 'docker-completion' {
run install_completion 'docker-completion/_docker' 'docker/cli/master/contrib/completion/zsh/_docker'
setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_docker
}
@test 'exa-completion' {
run install_completion 'exa-completion/_exa' 'ogham/exa/master/completions/zsh/_exa'
setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_exa
}
@test 'fd-completion' {
run install_completion 'fd-completion/_fd' 'sharkdp/fd/master/contrib/completion/_fd'
setup_snippet_ok $state $output "$ZINIT[COMPLETIONS_DIR]"/_fd
}
@test 'tldr-completion::snippet' {
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" @tealdeer-rs/tealdeer
assert $state equals 0
assert "$artifact/_tldr_ghr" is_file
assert $artifact/_tldr_ghr is_readable
assert "$ZINIT[COMPLETIONS_DIR]"/_tldr_ghr is_file
assert "$ZINIT[COMPLETIONS_DIR]"/_tldr_ghr is_readable
}
@test 'zinit local snippet symlink' {
mkdir -p "${ZINIT[HOME_DIR]}/external"
local actual="${ZINIT[HOME_DIR]}/external/mysnippet.zsh"
cat<<EOF >$actual
alias foo=date
EOF
run zinit is-snippet link nocompile id-as'mysnippet' for $actual
assert $state equals 0
assert "$output" contains "Setting up snippet"
assert "$output" contains "Linking"
local artifact="${ZINIT[SNIPPETS_DIR]}/mysnippet/mysnippet"
assert $artifact is_link
assert $artifact is_readable
local link="$(readlink "$artifact")"
local target="$(cd ${artifact:h}; cd ${link:h}; pwd)/${link:t}"
assert $target same_as $actual
}
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=@test,}:foldmethod=marker

197
widget-list.zsh Normal file
View file

@ -0,0 +1,197 @@
typeset -gAH ZPLG_WIDGET_LIST
ZPLG_WIDGET_LIST=(
accept-and-hold "1"
accept-and-infer-next-history "1"
accept-and-menu-complete "1"
accept-line "1"
accept-line-and-down-history "1"
accept-search "1"
argument-base "1"
auto-suffix-remove "1"
auto-suffix-retain "1"
backward-char "1"
backward-delete-char "1"
backward-delete-word "1"
backward-kill-line "1"
backward-kill-word-match "1"
backward-kill-word "1"
backward-word-match "1"
backward-word "1"
beginning-of-buffer-or-history "1"
beginning-of-history "1"
beginning-of-line "1"
beginning-of-line-hist "1"
capitalize-word-match "1"
capitalize-word "1"
clear-screen "1"
complete-word "1"
copy-prev-shell-word "1"
copy-prev-word "1"
copy-region-as-kill "1"
delete-char "1"
delete-char-or-list "1"
delete-word "1"
describe-key-briefly "1"
digit-argument "1"
down-case-word-match "1"
down-case-word "1"
down-history "1"
down-line "1"
down-line-or-history "1"
down-line-or-search "1"
emacs-backward-word "1"
emacs-forward-word "1"
end-of-buffer-or-history "1"
end-of-history "1"
end-of-line "1"
end-of-line-hist "1"
end-of-list "1"
exchange-point-and-mark "1"
execute-last-named-cmd "1"
execute-named-cmd "1"
expand-cmd-path "1"
expand-history "1"
expand-or-complete "1"
expand-or-complete-prefix "1"
expand-word "1"
forward-char "1"
forward-word-match "1"
forward-word "1"
get-line "1"
gosmacs-transpose-chars "1"
history-beginning-search-backward "1"
history-beginning-search-forward "1"
history-incremental-pattern-search-backward "1"
history-incremental-pattern-search-forward "1"
history-incremental-search-backward "1"
history-incremental-search-forward "1"
history-search-backward "1"
history-search-forward "1"
infer-next-history "1"
insert-last-word "1"
kill-buffer "1"
kill-line "1"
kill-region "1"
kill-whole-line "1"
kill-word-match "1"
kill-word "1"
list-choices "1"
list-expand "1"
magic-space "1"
menu-complete "1"
menu-expand-or-complete "1"
menu-select "1"
neg-argument "1"
overwrite-mode "1"
pound-insert "1"
push-input "1"
push-line "1"
push-line-or-edit "1"
put-replace-selection "1"
quote-line "1"
quote-region "1"
quoted-insert "1"
read-command "1"
recursive-edit "1"
redisplay "1"
redo "1"
reset-prompt "1"
reverse-menu-complete "1"
select-a-blank-word "1"
select-a-shell-word "1"
select-a-word "1"
select-in-blank-word "1"
select-in-shell-word "1"
select-in-word "1"
self-insert "1"
self-insert-unmeta "1"
send-break "1"
set-mark-command "1"
spell-word "1"
split-undo "1"
transpose-chars "1"
transpose-words-match "1"
transpose-words "1"
undefined-key "1"
undo "1"
universal-argument "1"
up-case-word-match "1"
up-case-word "1"
up-history "1"
up-line "1"
up-line-or-history "1"
up-line-or-search "1"
vi-add-eol "1"
vi-add-next "1"
vi-backward-blank-word "1"
vi-backward-blank-word-end "1"
vi-backward-char "1"
vi-backward-delete-char "1"
vi-backward-kill-word "1"
vi-backward-word "1"
vi-backward-word-end "1"
vi-beginning-of-line "1"
vi-caps-lock-panic "1"
vi-change "1"
vi-change-eol "1"
vi-change-whole-line "1"
vi-cmd-mode "1"
vi-delete "1"
vi-delete-char "1"
vi-digit-or-beginning-of-line "1"
vi-down-line-or-history "1"
vi-end-of-line "1"
vi-fetch-history "1"
vi-find-next-char "1"
vi-find-next-char-skip "1"
vi-find-prev-char "1"
vi-find-prev-char-skip "1"
vi-first-non-blank "1"
vi-forward-blank-word "1"
vi-forward-blank-word-end "1"
vi-forward-char "1"
vi-forward-word "1"
vi-forward-word-end "1"
vi-goto-column "1"
vi-goto-mark "1"
vi-goto-mark-line "1"
vi-history-search-backward "1"
vi-history-search-forward "1"
vi-indent "1"
vi-insert "1"
vi-insert-bol "1"
vi-join "1"
vi-kill-eol "1"
vi-kill-line "1"
vi-match-bracket "1"
vi-open-line-above "1"
vi-open-line-below "1"
vi-oper-swap-case "1"
vi-pound-insert "1"
vi-put-after "1"
vi-put-before "1"
vi-quoted-insert "1"
vi-repeat-change "1"
vi-repeat-find "1"
vi-repeat-search "1"
vi-replace "1"
vi-replace-chars "1"
vi-rev-repeat-find "1"
vi-rev-repeat-search "1"
vi-set-buffer "1"
vi-set-mark "1"
vi-substitute "1"
vi-swap-case "1"
vi-undo-change "1"
vi-unindent "1"
vi-up-line-or-history "1"
vi-yank "1"
vi-yank-eol "1"
vi-yank-whole-line "1"
visual-line-mode "1"
visual-mode "1"
what-cursor-position "1"
where-is "1"
yank-pop "1"
)

View file

@ -1,504 +0,0 @@
#!/bin/zsh
# This is a Zle widget file. In general, it is s used as (without setup
# provided by the plugin):
#
# autoload browse-symbol
# zle -N browse-symbol
# zle -N browse-symbol-backwards browse-symbol
# zle -N browse-symbol-pbackwards browse-symbol
# zle -N browse-symbol-pforwards browse-symbol
# bindkey "^T" browse-symbol
#
# This will bind to Ctrl-T. The plugin binds to Ctrl-O Ctrl-K.
#
# Example zstyles:
# zstyle ":plugin:zinit:symbol-search" page-size 5
# zstyle ":plugin:zinit:symbol-search" highlight-color "fg=magenta,bold"
# zstyle ":plugin:zinit:symbol-search" heading-color "fg=18,bold"
# zstyle ":plugin:zinit:symbol-search" title-color "fg=180,bold"
# zstyle ":plugin:zinit:symbol-search" arrow-color "fg=180,bg=39,bold"
# zstyle ":plugin:zinit:symbol-search" func-color "fg=208,bold"
# zstyle ":plugin:zinit:symbol-search" var-color "fg=174,bg=39,bold"
# zstyle ":plugin:zinit:symbol-search" macro-color "fg=39,bold"
# zstyle ":plugin:zinit:symbol-search" eqdol-color "fg=183,bg=39,bold"
emulate -L zsh
setopt typesetsilent extendedglob noshortloops localtraps warncreateglobal
# When an error, then no cursor keys bindings
zmodload zsh/terminfo 2>/dev/null
zmodload zsh/termcap 2>/dev/null
typeset -gA TAG
integer -g __tfind_spe_index
integer -g __tfind_spe_restart __tfind_spe_call_count __tfind_spe_funct __tfind_spe_sort
typeset -g __tfind_page_size __tfind_high_color __tfind_heading_color \
__tfind_title_color __tfind_arrow_color __tfind_func_color \
__tfind_var_color __tfind_eqdol_color __tfind_macro_color
typeset -gaU __tfind_spe_found
typeset -ga __tfind_tag_data
typeset -g __tfind_git_or_project __tfind_outside_git
local mbegin mend match
local MATCH
integer MBEGIN MEND
(( __tfind_spe_call_count ++ ))
trap '(( __tfind_spe_call_count -- )); return 0;' INT
_tfind_find_index() {
local q
local -a p
# Read tags file
p=( (../)#TAGS(N) )
TAG[file]=${${(On)p}[1]}
[[ -f ./TAGS ]] && TAG[file]=$PWD/TAGS
if [[ -n $TAG[file] ]]; then
TAG[git-or-project]=${${TAG[file]:a}:h:t}
else
TAG[git-or-project]="<unknown>"
#TAG[file]=
fi
# Pre-process found index
TAG[file-pp]=${TAG[file]/TAGS/.TAGS}.z
if [[ -n $TAG[file] && -f $TAG[file] && ( ! -f $TAG[file-pp] || $TAG[file] -nt $TAG[file-pp]) ]]
then
local sed_
(( $+commands[sed] )) && sed_=sed
(( $+commands[gsed] )) && sed_=gsed
# Generate simplified file append the filename at each line,
# so that it's not only at the preamble line
command $sed_ -r -n $'/^\x0c$/ { n; s/,[^,]*$//;s/^/\x02/; h; d;}; G; y/\\n/,/; p' $TAG[file] >! $TAG[file-pp]
fi
# Read index, and as index is found, establish git main dir for it
__tfind_outside_git=$TAG[file]:h
if [[ -n $TAG[file] && -f $TAG[file-pp] ]]; then
__tfind_tag_data=( ${"${(@f)"$(<${TAG[file-pp]})"}"##[[:space:]]##} )
# Cleanup functions and their preambles
__tfind_tag_data=( ${__tfind_tag_data[@]/(#b)(\([^\)]#\))[[:space:]]#[\{]*($'\x7f')/$match[1]$match[2]} )
__tfind_tag_data=( ${__tfind_tag_data[@]/(#b)[[:space:]]\#*($'\x7f')/$match[1]} )
__tfind_outside_git="${PWD%/${$(git rev-parse --quiet --show-prefix 2>/dev/null)%/}}"
if [[ -d $__tfind_outside_git && -n ${${(M)PWD##$__tfind_outside_git}##$HOME} ]]; then
TAG[git-or-project]=$__tfind_outside_git:t
TAG[repo-dir]=$__tfind_outside_git
else
TAG[git-or-project]=$TAG[file]:h
TAG[repo-dir]=$TAG[file]:h
fi
return 0
fi
return 1
}
_tfind_error_msg()
{
integer buflen=$#BUFFER
if [[ -z $TAG[repo-dir] || $TAG[repo-dir] == . ]]; then
POSTDISPLAY=$'\n'"Symbol index NOT found, NO DATA to show, sleeping…"
local search_buffer=
elif [[ $#__tfind_tag_data -eq 0 ]]; then
POSTDISPLAY=$'\n'"The index file contains NO symbol data, forced sleeping..."
local search_buffer=
elif [[ $#__tfind_spe_found -eq 0 && $search_buffer == [[:space:]]# ]]; then
POSTDISPLAY=$'\n'"No items found"
elif [[ $search_buffer != [[:space:]]# && $#__tfind_spe_found -eq 0 ]]; then
POSTDISPLAY=$'\n'"Found 0 matches for query: $search_buffer"
else
return 1
fi
region_highlight+=("$buflen $(( $buflen+$#POSTDISPLAY-$#search_buffer )) fg=179,bold")
region_highlight+=("$(( $buflen+$#POSTDISPLAY-$#search_buffer )) $(( $buflen+$#POSTDISPLAY )) fg=39,bold")
# Number?
[[ -n ${#${(MS)POSTDISPLAY##<->##}} ]] && \
region_highlight+=("$((buflen+7)) $((buflen+7+${#${(MS)POSTDISPLAY##<->##}})) fg=39,bold")
return 0
}
_tfind_main() {
local match mbegin mend
local MATCH
integer MBEGIN MEND buflen=${#BUFFER}
TAG[fun-xt-chars]='+.:@\/→↓←↑\$,_\--'
# First call or restart?
if [[ $__tfind_spe_call_count -le 1 || $__tfind_spe_restart = 1 ]]; then
if [[ $__tfind_spe_call_count -le 1 ]]; then
# Read configuration data
zstyle -s ":plugin:zinit:symbol-search" page-size __tfind_page_size || __tfind_page_size=$(( LINES / 3 ))
zstyle -s ":plugin:zinit:symbol-search" highlight-color __tfind_high_color || __tfind_high_color="fg=39,bold"
zstyle -s ":plugin:zinit:symbol-search" heading-color __tfind_heading_color || __tfind_heading_color="fg=69,bold"
zstyle -s ":plugin:zinit:symbol-search" title-color __tfind_title_color || __tfind_title_color="fg=208,bold"
zstyle -s ":plugin:zinit:symbol-search" arrow-color __tfind_arrow_color || __tfind_arrow_color="fg=227,bg=69,bold"
zstyle -s ":plugin:zini t:symbol-search" var-color __tfind_var_color || __tfind_var_color="fg=127,bold"
zstyle -s ":plugin:zinit:symbol-search" func-color __tfind_func_color || __tfind_func_color="fg=70,bold"
zstyle -s ":plugin:zinit:symbol-search" macro-color __tfind_macro_color || __tfind_macro_color="fg=208,bold"
zstyle -s ":plugin:zinit:symbol-search" eqdol-color __tfind_eqdol_color || __tfind_eqdol_color="fg=69,bold"
# Find the index to operate on, git dir, etc.
_tfind_find_index || { _tfind_error_msg && return;}
fi
# '0' will get changed into $to_display limit
[[ $WIDGET = *-symbol || $WIDGET = *-pforwards ]] && __tfind_spe_index=1
[[ $WIDGET = *-backwards || $WIDGET = *-pbackwards ]] && __tfind_spe_index=0
__tfind_spe_found=()
__tfind_spe_restart=0
else
# Consecutive call
[[ $WIDGET = *-symbol ]] && (( __tfind_spe_index ++ ))
[[ $WIDGET = *-backwards ]] && (( __tfind_spe_index -- ))
[[ $WIDGET = *-pforwards ]] && (( __tfind_spe_index = __tfind_spe_index + __tfind_page_size ))
[[ $WIDGET = *-pbackwards ]] && (( __tfind_spe_index = __tfind_spe_index - __tfind_page_size ))
fi
# Find history entries matching pattern *word1*~^*word2*~^*word3* etc.
local search_buffer="${BUFFER%% ##}" search_pattern="" csearch_pattern=""
search_buffer="${${search_buffer## ##}%% ##}"
search_buffer="${search_buffer//(#m)[][*?|#~^()><\\]/\\$MATCH}"
search_pattern="*${search_buffer// ##/*~^*}*"
csearch_pattern="${search_buffer// ##/|}"
if [[ $#__tfind_spe_found -eq 0 ]]; then
# The repeat will make the matching work on a fresh heap arena
repeat 1; do
# Match only before ^? ($'\177')
__tfind_spe_found=( "${(@M)__tfind_tag_data:#(#i)$~search_pattern*$'\177'*}" )
((__tfind_spe_funct)) && __tfind_spe_found=(${(M)__tfind_spe_found:#[[:alnum:]$TAG[fun-xt-chars]]##[[:space:]]#\([^\)]#\)[[:space:]]#(\{|)*})
((__tfind_spe_sort)) && __tfind_spe_found=(${(no)__tfind_spe_found})
done
fi
if ((!$#__tfind_spe_found)); then
_tfind_error_msg && return
fi
#
# Pagination, index value guards
#
integer page_size=$__tfind_page_size
integer max_index="$#__tfind_spe_found"
[[ $page_size -gt $max_index ]] && page_size=$max_index
[[ $__tfind_spe_index -le 0 ]] && __tfind_spe_index=$max_index
[[ $__tfind_spe_index -gt $max_index ]] && __tfind_spe_index=1
integer page_start_idx=$(( ((__tfind_spe_index-1)/page_size)*page_size+1 ))
integer on_page_idx=$(( (__tfind_spe_index-1) % page_size + 1 ))
#
# Prepare display
#
typeset -a disp_list
disp_list=( "${(@)__tfind_spe_found[page_start_idx,page_start_idx+page_size-1]}" )
# Remove meta-data from the entries
disp_list=( "${(@)disp_list//$'\177'*/}" )
# All entries should have multilines replaced
disp_list=( "${(@)disp_list//$'\n'/\\n}" )
# ... and truncated to display width, and
# also preceeded by two spaces
disp_list=( "${(@)disp_list/(#m)*/ ${MATCH[1,COLUMNS-8]}}" )
local p=$'\n'
local entry=$disp_list[on_page_idx]
entry[1]='»'
disp_list[on_page_idx]=$entry
#
# Detect where "> .." entry starts
#
local txt_before="${(F)${(@)disp_list[1,on_page_idx-1]}}"
#
# Colorify
#
local noun=${${${__tfind_spe_funct:#0}:+function}:-symbol}
local preamble=$'\n'"View of ${noun}s for repo: «««${(U)TAG[git-or-project]}»»» located at: $TAG[repo-dir]:h"$'\n'"${(C)noun} no. #$__tfind_spe_index. Found $max_index ${noun}s in the index."$'\n' \
key="Ctrl-f to toggle functions-ONLY view. Alt-s to toggle sort."$'\n'
preamble+=$key
local text="${(F)disp_list}"
integer offset=${#preamble}+$buflen
POSTDISPLAY="$preamble$text"
region_highlight=( "$(( offset + ${#txt_before} )) $(( offset + ${#txt_before} + ${#entry} + 1 )) underline" )
color_att() { local c;if (($4==0)){c=$__tfind_title_color;} elif (($4==1)){c=$__tfind_high_color;} elif (($4==4)){c=$__tfind_var_color;} elif (($4==7)){c=$__tfind_func_color;} elif (($4==9)){c=$__tfind_eqdol_color;} elif (($4==10)){c=$__tfind_macro_color;} else {c=$__tfind_arrow_color;}; region_highlight_+=("$(($1+$2-1)) $(($1+$3)) $c"); }
functions -M coloratt 4 4 color_att
local -a region_highlight_
# Also highlight project name
local h="$(( 30+buflen+__tfind_spe_funct*2 )) $(( 30+$buflen+${#TAG[git-or-project]}+__tfind_spe_funct*2 )) $__tfind_title_color"
local q="$buflen $offset $__tfind_heading_color"
region_highlight+=( $q $h )
: "${preamble//(#b)no. ([^.]##)./$((coloratt(buflen,mbegin[1],mend[1],0)))}"
: "${preamble//(#b)Found ([0-9]##)/$((coloratt(buflen,mbegin[1],mend[1],1)))}"
: "${preamble//(#b)» located at: ([^$p]##)/$((coloratt(buflen,mbegin[1],mend[1],1)))}"
: "${preamble//(#b)(Ctrl-f)/$((coloratt(buflen,mbegin[1],mend[1],0)))}"
: "${preamble//(#b)(Alt-s)/$((coloratt(buflen,mbegin[1],mend[1],0)))}"
: "${text//((#s)|$p)(#b)(»)/$((coloratt(offset,mbegin[1],mend[1],3)))}"
# Basic syntax highlighting - a few keywords like C/Java type names
: "${text//(#b)((([[:space:]\(\{\[]int|double|enum|short|long|(u|w|g|gu)(int|char|long|short)(8|16|32|64|128|max|)(_t|)|char|(|un)signed|FILE|const|restrict|size_t|va_list|ptrdiff_t|off_t|gboolean|gpointer|gconstpointer|typedef|static|struct|union)[[:space:]])|[a-zA-Z_]##_t|local|integer|float|declare|typeset|readonly)/$((coloratt(offset,mbegin[1],mend[1],4)))}"
: "${text//(#b)(=)/$((coloratt(offset,mbegin[1],mend[1],9)))}"
: "${text//(#b)(\#[[:space:]]#(include|define|if|endif))/$((coloratt(offset,mbegin[1],mend[1],10)))}"
: "${text//(#b)(\$<->#)/$((coloratt(offset,mbegin[1],mend[1],9)))}"
: "${text//(#b)([[:alnum:]$TAG[fun-xt-chars]]##)[[:space:]]#\([^\)]#\)/$((coloratt(offset,mbegin[1],mend[1],7)))}"
: "${text//(#b)\#[[:space:]]#(include|define)[[:space:]]##([[:alnum:]_]##)[^[:alnum:]_]/$((coloratt(offset,mbegin[2],mend[2],7)))}"
if [[ -n $search_pattern ]]; then
: "${(f)${(S)text//*(#bi)(${~csearch_pattern})/$((coloratt(offset,mbegin[1],mend[1],1)))}}"
fi
functions +M color_att
unfunction color_att
region_highlight+=( $region_highlight_ )
}
_tfind_functions() {
__tfind_spe_funct=1-__tfind_spe_funct
__tfind_spe_restart=1
_tfind_simulate_widget
}
_tfind_sort() {
__tfind_spe_sort=1-__tfind_spe_sort
__tfind_spe_restart=1
_tfind_simulate_widget
}
_tfind_simulate_widget() {
(( __tfind_spe_call_count ++ ))
_tfind_main
}
_tfind_self_insert() {
[[ $#KEYS ]] && __tfind_spe_restart=1
LBUFFER+="${KEYS[-1]}"
_tfind_simulate_widget
}
_tfind_backward_delete_char() {
[[ $#LBUFFER ]] && __tfind_spe_restart=1
LBUFFER="${LBUFFER%?}"
_tfind_simulate_widget
}
_tfind_delete_char() {
[[ $#RBUFFER ]] && __tfind_spe_restart=1
RBUFFER="${RBUFFER#?}"
_tfind_simulate_widget
}
_tfind_cancel_accept() {
BUFFER=""
__tfind_spe_index=-1
zle .accept-line
}
_tfind_main
if [[ $__tfind_spe_call_count -eq 1 ]]; then
# Make the tfind keymap a copy of the current main
bindkey -N tfind emacs
local down_widget="${${${WIDGET%-backwards}%-pbackwards}-pforwards}"
local up_widget="${down_widget}-backwards"
local pdown_widget="${down_widget}-pforwards"
local pup_widget="${down_widget}-pbackwards"
# Manual, termcap, terminfo
bindkey -M tfind '^[OA' $up_widget
bindkey -M tfind '^[OB' $down_widget
bindkey -M tfind '^[[A' $up_widget
bindkey -M tfind '^[[B' $down_widget
[[ -n "$termcap[ku]" ]] && bindkey -M tfind "$termcap[ku]" $up_widget
[[ -n "$termcap[kd]" ]] && bindkey -M tfind "$termcap[kd]" $down_widget
[[ -n "$termcap[kD]" ]] && bindkey -M tfind "$termcap[kD]" delete-char
[[ -n "$terminfo[kcuu1]" ]] && bindkey -M tfind "$terminfo[kcuu1]" $up_widget
[[ -n "$terminfo[kcud1]" ]] && bindkey -M tfind "$terminfo[kcud1]" $down_widget
[[ -n "$terminfo[kdch1]" ]] && bindkey -M tfind "$terminfo[kdch1]" delete-char
# More bindkeys, to remove influence of overloading plugins (sy-h, suggestions)
# Left/Right cursor keys
bindkey -M tfind '^[[D' .backward-char
bindkey -M tfind '^[[C' .forward-char
[[ -n "$termcap[kl]" ]] && bindkey -M tfind "$termcap[kl]" .backward-char
[[ -n "$termcap[kr]" ]] && bindkey -M tfind "$termcap[kr]" .forward-char
[[ -n "$terminfo[kcub1]" ]] && bindkey -M tfind "$terminfo[kcub1]" .backward-char
[[ -n "$terminfo[kcuf1]" ]] && bindkey -M tfind "$terminfo[kcuf1]" .forward-char
# Now Home/End keys, first few recorded in my .zshrc during the years sequences
bindkey -M tfind "\e[1~" .beginning-of-line
bindkey -M tfind "\e[7~" .beginning-of-line
bindkey -M tfind "\e[H" .beginning-of-line
bindkey -M tfind "\e[4~" .end-of-line
bindkey -M tfind "\e[F" .end-of-line
bindkey -M tfind "\e[8~" .end-of-line
[[ -n "$termcap[kh]" ]] && bindkey -M tfind "$termcap[kh]" .beginning-of-line
[[ -n "$termcap[@7]" ]] && bindkey -M tfind "$termcap[@7]" .end-of-line
[[ -n "$terminfo[khome]" ]] && bindkey -M tfind "$terminfo[khome]" .beginning-of-line
[[ -n "$terminfo[kend]" ]] && bindkey -M tfind "$terminfo[kend]" .end-of-line
# The same for Ctrl-E, Ctrl-F
bindkey -M tfind '^A' .beginning-of-line
bindkey -M tfind '^E' .end-of-line
# Additional keys
bindkey -M tfind '^[b' .backward-word
bindkey -M tfind '^[B' .backward-word
bindkey -M tfind '^[f' .forward-word
bindkey -M tfind '^[F' .forward-word
bindkey -M tfind '^[w' .forward-word
bindkey -M tfind '^[W' .forward-word
# Additional keys
bindkey -M tfind '^P' $up_widget
bindkey -M tfind '^N' $down_widget
# Page Up, Page Down keys
[[ -n "$termcap[kP]" ]] && bindkey -M tfind "$termcap[kP]" $pup_widget
[[ -n "$termcap[kN]" ]] && bindkey -M tfind "$termcap[kN]" $pdown_widget
[[ -n "$terminfo[kpp]" ]] && bindkey -M tfind "$terminfo[kpp]" $pup_widget
[[ -n "$terminfo[knp]" ]] && bindkey -M tfind "$terminfo[knp]" $pdown_widget
# Needed for Fedora 23, zsh-5.1.1
bindkey -M tfind ' ' self-insert
# Removal of default Ctrl-R binding
bindkey -M tfind '^R' $down_widget
# If one would like to re-open
bindkey -M tfind '^O' $down_widget
# Substitute self-insert, backward-delete-char, delete-char
zle -A self-insert saved-self-insert
zle -A backward-delete-char saved-backward-delete-char
zle -A delete-char saved-delete-char
zle -N self-insert _tfind_self_insert
zle -N backward-delete-char _tfind_backward_delete_char
zle -N delete-char _tfind_delete_char
zle -N tfind-functions _tfind_functions
zle -N tfind-sort _tfind_sort
# Override ourselves with what we actually are
# because zsh-autosuggestions change us
zle -A $down_widget saved-$down_widget
zle -A $up_widget saved-$up_widget
zle -N $down_widget _tfind_simulate_widget
zle -N $up_widget _tfind_simulate_widget
zle -A $pdown_widget saved-$pdown_widget
zle -A $pup_widget saved-$pup_widget
zle -N $pdown_widget _tfind_simulate_widget
zle -N $pup_widget _tfind_simulate_widget
if (( $+widgets[zle-line-pre-redraw] )); then
zle -A zle-line-pre-redraw saved-pre-redraw
zle -D zle-line-pre-redraw
fi
local selected_editor cd_at_edit tagtext tagline taglinebyte tagfile
local -a comm
comm=()
# Add Ctrl-V, ESC bindings to cancel search
# A workaround for Zsh versions like 5.0.2
zle -N _tfind_cancel_accept
bindkey -M tfind "^[" _tfind_cancel_accept
bindkey -M tfind "^f" tfind-functions
bindkey -M tfind "\es" tfind-sort
local redrawbkp=0
# Trap INT to manually interrupt Zle to work around a bug
trap 'zle && zle .send-break' INT
if zle .recursive-edit -K tfind; then
if ((__tfind_spe_index<=0)); then
:
else
zstyle -s ":plugin:zinit:symbol-search" editor selected_editor || selected_editor=${VISUAL:-${EDITOR:-mcedit}}
zstyle -T ":plugin:zinit:symbol-search" cd_at_edit && cd_at_edit=yes || cd_at_edit=no
(( ! $+commands[$selected_editor] )) && selected_editor=vim
(( ! $+commands[$selected_editor] )) && selected_editor=nano
(( ! $+commands[$selected_editor] )) && selected_editor=emacs
tagtext=$__tfind_spe_found[__tfind_spe_index]
if [[ $tagtext = (#b)[^$'\177']#$'\177'[^$'\1']#$'\1'([^$'\2']#)$'\2'(*) ]]; then
taglinebyte=${match[1]}
tagline=${taglinebyte%%,*}
# CD vs absolute path
if [[ $match[2] != /* && -n $TAG[repo-dir] ]]; then
tagfile=$TAG[repo-dir]/$match[2]
else
tagfile=$match[2]
fi
[[ ! -f $tagfile && -f $match[2] ]] && tagfile=$match[2]
# Editor command
case "$selected_editor" in
(vim|vi|gvim|mvim|nvim)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
(emacs|emacsclient)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
(gedit)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
(nano)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
(mcedit)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
(*)
comm+=( $selected_editor "+$tagline" -- "${(q)tagfile}" )
;;
esac
fi
fi
else
BUFFER=""
fi
POSTDISPLAY=
# Restore self-insert, backward-delete-char, delete-char
zle -A saved-self-insert self-insert
zle -A saved-backward-delete-char backward-delete-char
zle -A saved-delete-char delete-char
zle -D saved-self-insert saved-backward-delete-char saved-delete-char
# Restore ourselves
zle -A saved-$down_widget $down_widget
zle -A saved-$up_widget $up_widget
zle -D saved-$down_widget saved-$up_widget
zle -A saved-$pdown_widget $pdown_widget
zle -A saved-$pup_widget $pup_widget
zle -D saved-$pdown_widget saved-$pup_widget
if (( $+widgets[saved-pre-redraw] )); then
zle -A saved-pre-redraw zle-line-pre-redraw
zle -D saved-pre-redraw
fi
# Full reinitialisation at next call
__tfind_spe_call_count=0
# Free memory
__tfind_spe_found=()
__tfind_tag_data=()
region_highlight=()
# Is there a command to run?
if [[ $#comm != 0 ]]; then
local auto_run
zstyle -T ":plugin:zinit" auto_run && auto_run=yes || auto_run=no
BUFFER=$comm[*]
CURSOR=$buflen
[[ $auto_run = yes ]] && zle .accept-line
fi
elif (( __tfind_spe_call_count > 0 )); then
(( __tfind_spe_call_count -- ))
fi
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

View file

@ -1,219 +0,0 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.
# FUNCTION: :zinit-tmp-subst-source [[[
:zinit-tmp-subst-source() {
local -a ___substs ___ab
___substs=( "${(@s.;.)ICE[subst]}" )
if [[ -n ${(M)___substs:#*\\(#e)} ]] {
local ___prev
___substs=( ${___substs[@]//(#b)((*)\\(#e)|(*))/${match[3]:+${___prev:+$___prev\;}}${match[3]}${${___prev::=${match[2]:+${___prev:+$___prev\;}}${match[2]}}:+}} )
}
# Load the plugin
if [[ ! -r $1 ]] {
+zi-log "{error}source: Couldn't read the script {obj}${1}{error}" \
", cannot substitute {data}${ICE[subst]}{error}.{rst}"
}
local ___data="$(<$1)"
() {
builtin emulate -LR zsh -o extendedglob -o interactivecomments ${=${options[xtrace]:#off}:+-o xtrace}
local ___subst ___tabspc=$'\t'
for ___subst ( "${___substs[@]}" ) {
___ab=( "${(@)${(@)${(@s:->:)___subst}##[[:space:]]##}%%[[:space:]]##}" )
___ab[2]=${___ab[2]//(#b)\\([[:digit:]])/\${match[${match[1]}]}}
builtin eval "___data=\"\${___data//(#b)\${~___ab[1]}/${___ab[2]}}\""
}
___data="() { ${(F)${(@)${(f)___data[@]}:#[$___tabspc]#\#*}} ; } \"\${@[2,-1]}\""
}
builtin eval "$___data"
} # ]]]
# FUNCTION: .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'')
.zinit-service() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob warncreateglobal typesetsilent noshortloops
local ___tpe="$1" ___mode="$2" ___id="$3" ___fle="${ZINIT[SERVICES_DIR]}/${ICE[service]}.lock" ___fd ___cmd ___tmp ___lckd ___strd=0
{ builtin print -n >! "$___fle"; } 2>/dev/null 1>&2
[[ ! -e ${___fle:r}.fifo ]] && command mkfifo "${___fle:r}.fifo" 2>/dev/null 1>&2
[[ ! -e ${___fle:r}.fifo2 ]] && command mkfifo "${___fle:r}.fifo2" 2>/dev/null 1>&2
typeset -gx ZSRV_WORK_DIR="${ZINIT[SERVICES_DIR]}" ZSRV_ID="${ICE[service]}" # should be also set by other p-m
while (( 1 )); do
(
while (( 1 )); do
[[ ! -f ${___fle:r}.stop ]] && if (( ___lckd )) || zsystem 2>/dev/null 1>&2 flock -t 1 -f ___fd -e $___fle; then
___lckd=1
if (( ! ___strd )) || [[ $___cmd = RESTART ]]; then
[[ $___tpe = p ]] && { ___strd=1
.zinit-load "$___id" "" "$___mode" 0;
}
[[ $___tpe = s ]] && { ___strd=1
.zinit-load-snippet "$___id" "" 0;
}
fi
___cmd=
while (( 1 )); do builtin read -t 32767 ___cmd <>"${___fle:r}.fifo" && break; done
else
return 0
fi
[[ $___cmd = (#i)NEXT ]] && { kill -TERM "$ZSRV_PID"; builtin read -t 2 ___tmp <>"${___fle:r}.fifo2"; kill -HUP "$ZSRV_PID"; exec {___fd}>&-; ___lckd=0; ___strd=0; builtin read -t 10 ___tmp <>"${___fle:r}.fifo2"; }
[[ $___cmd = (#i)STOP ]] && { kill -TERM "$ZSRV_PID"; builtin read -t 2 ___tmp <>"${___fle:r}.fifo2"; kill -HUP "$ZSRV_PID"; ___strd=0; builtin print >! "${___fle:r}.stop"; }
[[ $___cmd = (#i)QUIT ]] && { kill -HUP ${sysparams[pid]}; return 1; }
[[ $___cmd != (#i)RESTART ]] && { ___cmd=; builtin read -t 1 ___tmp <>"${___fle:r}.fifo2"; }
done
) || break
builtin read -t 1 ___tmp <>"${___fle:r}.fifo2"
done >>! "$ZSRV_WORK_DIR/$ZSRV_ID".log 2>&1
} # ]]]
# FUNCTION: .zinit-wrap-track-functions [[[
.zinit-wrap-track-functions() {
local user="$1" plugin="$2" id_as="$3" f
local -a wt
wt=( ${(@s.;.)ICE[wrap-track]} )
for f in ${wt[@]}; do
functions[${f}-zinit-bkp]="${functions[$f]}"
eval "
function $f {
ZINIT[CUR_USR]=\"$user\" ZINIT[CUR_PLUGIN]=\"$plugin\" ZINIT[CUR_USPL2]=\"$id_as\"
.zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Starting to track function: $f ===\"
.zinit-diff \"\${ZINIT[CUR_USPL2]}\" begin
.zinit-tmp-subst-on load
functions[${f}]=\${functions[${f}-zinit-bkp]}
${f} \"\$@\"
.zinit-tmp-subst-off load
.zinit-diff \"\${ZINIT[CUR_USPL2]}\" end
.zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Ended tracking function: $f ===\"
ZINIT[CUR_USR]= ZINIT[CUR_PLUGIN]= ZINIT[CUR_USPL2]=
}"
done
} # ]]]
#
# debug command
#
# FUNCTION: .zinit-debug-clear [[[
# Clear latest debug report
.zinit-debug-clear() {
{
.zinit-clear-report-for _dtrace/_dtrace
+zi-log '{m} Cleared debug report'
} || {
+zi-log '{e} Failed to clear debug report'
return 1
}
} # ]]]
# FUNCTION: .zinit-debug-report [[[
# Displays debug report (data recorded in interactive session).
.zinit-debug-report() {
if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi-log "{e} Debug mode active, stop it first via {cmd}zinit debug stop{rst}"
else
(( ${+functions[.zinit-unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
.zinit-show-report "_dtrace/_dtrace"
fi
} # ]]]
# FUNCTION: .zinit-debug-revert [[[
# Revert changes made during debug mode
.zinit-debug-revert() {
if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi-log "{e} Debug mode is active. To stop, run {cmd}zinit debug stop{rst}"
else
(( ${+functions[.zinit-unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
.zinit-unload _dtrace _dtrace
+zi-log "{m} Reverted changes detected during debug mode"
fi
} # ]]]
# FUNCTION: .zinit-debug-start [[[
# Start debug mode
.zinit-debug-start() {
if [[ $ZINIT[DTRACE] = 1 ]]; then
+zi-log "{e} Debug mode currently active"
return 1
fi
(){
ZINIT[DTRACE]=1
.zinit-diff _dtrace/_dtrace begin
.zinit-tmp-subst-on dtrace
}
if (( $? == 0 )); then
+zi-log "{i} Started debug mode"
return 0
fi
} # ]]]
# FUNCTION: .zinit-debug-status [[[
# Revert changes made during debug mode
.zinit-debug-status() {
+zi-log -n '{m} Debug mode: '
(( ZINIT[DTRACE] )) && +zi-log 'running' || +zi-log 'stopped'
} # ]]]
# FUNCTION: .zinit-debug-stop [[[
# Stop debug mode
.zinit-debug-stop() {
if [[ $ZINIT[DTRACE] = 0 ]]; then
+zi-log '{e} Debug mode not active'
return 0
else
ZINIT[DTRACE]=0
(){
.zinit-tmp-subst-off dtrace # turn of shadowing
.zinit-diff _dtrace/_dtrace end # get end data to diff later
}
if (( $? == 0 )); then
+zi-log '{i} Stopped debug mode'
return 0
fi
fi
} # ]]]
# FUNCTION: +zinit-debug [[[
# Debug command entry point
+zinit-debug(){
emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob noksharrays nokshglob nullglob typesetsilent warncreateglobal
local o_help cmd
local -a usage=(
'Usage:'
' zinit debug [options] [command]'
' '
'Options:'
' -h, --help Show list of command-line options'
' '
'Commands:'
' clear Clear debug report'
' report Show debug report'
' revert Revert changes made during debug mode'
' start Start debug mode'
' status Current debug status'
' stop Stop debug mode'
)
zmodload zsh/zutil
zparseopts -D -F -K -- \
{h,-help}=o_help \
|| return 1
(( $#o_help )) && {
print -l -- $usage
return 0
}
cmd="$1"
if (( ! $+functions[.zinit-debug-${cmd}] )); then
print -l -- $usage
return 1
else
.zinit-debug-${cmd} "${(@)@:2}"
fi
} # ]]]
# vim: ft=zsh sw=4 ts=4 et foldmarker=[[[,]]] foldmethod=marker

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,397 +0,0 @@
#!/usr/bin/env zsh
#
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
# Copyright (c) 2021-2022 zdharma-continuum and contributors
# FUNCTION: .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
.zinit-any-colorify-as-uspl2() {
.zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}"
if [[ "$user" = "%" ]]; then
.zinit-any-to-pid "" $plugin
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--plugins--/OMZP::}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--plugins/OMZP}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--lib--/OMZL::}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--lib/OMZL}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--themes--/OMZT::}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--themes/OMZT}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk--/OMZ::}"
REPLY="${REPLY/https--github.com--(robbyrussell--oh-my-zsh|ohmyzsh--ohmyzsh)--trunk/OMZ}"
REPLY="${REPLY/https--github.com--sorin-ionescu--prezto--trunk--modules--/PZTM::}"
REPLY="${REPLY/https--github.com--sorin-ionescu--prezto--trunk--modules/PZTM}"
REPLY="${REPLY/https--github.com--sorin-ionescu--prezto--trunk--/PZT::}"
REPLY="${REPLY/https--github.com--sorin-ionescu--prezto--trunk/PZT}"
REPLY="${REPLY/(#b)%([A-Z]##)(#c0,1)(*)/%$ZINIT[col-uname]$match[1]$ZINIT[col-pname]$match[2]$ZINIT[col-rst]}"
elif [[ $user == http(|s): ]]; then
REPLY="${ZINIT[col-ice]}${user}/${plugin}${ZINIT[col-rst]}"
else
REPLY="${user:+${ZINIT[col-uname]}${user}${ZINIT[col-rst]}/}${ZINIT[col-pname]}${plugin}${ZINIT[col-rst]}"
fi
} # ]]]
# FUNCTION: .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
.zinit-compute-ice() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops
local ___URL="${1%/}" ___pack="$2" ___is_snippet=0
local ___var_name1="${3:-ZINIT_ICE}" ___var_name2="${4:-local_dir}" ___var_name3="${5:-filename}" ___var_name4="${6:-is_snippet}"
# Copy from .zinit-recall
local -a ice_order nval_ices
ice_order=(
${(s.|.)ZINIT[ice-list]}
# include all additional ices after stripping them from the possible: ''
${(@)${(@Akons:|:)${ZINIT_EXTS[ice-mods]//\'\'/}}/(#s)<->-/}
)
nval_ices=(
${(s.|.)ZINIT[nval-ice-list]}
# include only those additional ices, don't have the '' in their name, i.e.
# aren't designed to hold value
${(@)${(@)${(@Akons:|:)ZINIT_EXTS[ice-mods]}:#*\'\'*}/(#s)<->-/}
svn
)
# strip whitespace from beginning of url
___URL="${${___URL#"${___URL%%[! $'\t']*}"}%/}"
# snippet
.zinit-two-paths "$___URL"
local ___s_path="${reply[-4]}" ___s_svn="${reply[-3]}" ___path="${reply[-2]}" ___filename="${reply[-1]}" ___local_dir
if [[ -d "$___s_path" || -d "$___path" ]]; then
___is_snippet=1
else
# plugin
.zinit-any-to-user-plugin "$___URL" ""
local ___user="${reply[-2]}" ___plugin="${reply[-1]}"
___s_path="" ___filename=""
[[ "$___user" = "%" ]] && ___path="$___plugin" || ___path="${ZINIT[PLUGINS_DIR]}/${___user:+${___user}---}${___plugin//\//---}"
.zinit-exists-physically-message "$___user" "$___plugin" || return 1
fi
[[ $___pack = pack* ]] && (( ${#ICE} > 0 )) && .zinit-pack-ice "${___user-$___URL}" "$___plugin"
local -A ___sice
local -a ___tmp
___tmp=( "${(z@)ZINIT_SICE[${___user-$___URL}${${___user:#(%|/)*}:+/}$___plugin]}" )
(( ${#___tmp[@]} > 1 && ${#___tmp[@]} % 2 == 0 )) && ___sice=( "${(Q)___tmp[@]}" )
if [[ "${+___sice[svn]}" = "1" || -n "$___s_svn" ]]; then
if (( !___is_snippet && ${+___sice[svn]} == 1 )); then
builtin print -r -- "The \`svn' ice is given, but the argument ($___URL) is a plugin"
builtin print -r -- "(\`svn' can be used only with snippets)"
return 1
elif (( !___is_snippet )); then
builtin print -r -- "Undefined behavior #1 occurred, please report at https://github.com/zdharma-continuum/zinit/issues"
return 1
fi
if [[ -e "$___s_path" && -n "$___s_svn" ]]; then
___sice[svn]=""
___local_dir="$___s_path"
else
if [[ ! -e "$___path" ]] {
builtin print -r -- "No such snippet, looked at paths (1): $___s_path, and: $___path";
return 1;
}
unset '___sice[svn]'
___local_dir="$___path"
fi
else
if [[ -e "$___path" ]]; then
unset '___sice[svn]'
___local_dir="$___path"
else
builtin print -r -- "No such snippet, looked at paths (2): $___s_path, and: $___path"
return 1
fi
fi
local ___zinit_path="$___local_dir/._zinit"
# read disk-ice
local -A ___mdata
local ___key
{
for ___key in mode url is_release is_release{2..5} ${ice_order[@]}; do
[[ -f "$___zinit_path/$___key" ]] && ___mdata[$___key]="$(<$___zinit_path/$___key)"
done
[[ "${___mdata[mode]}" = "1" ]] && ___mdata[svn]=""
} 2>/dev/null
# handle flag-ices; svn must be last
for ___key in ${ice_order[@]}; do
[[ $___key == (no|)compile ]] && continue
if (( 0 == ${+ICE[no$___key]} && 0 == ${+___sice[no$___key]} )) {
continue
}
# "If there is such ice currently, and there's no no* ice given, and
# there's the no* ice in the static ice" skip, don't unset. With
# conjunction with the previous line this has the proper meaning: uset if
# at least in one  current or static ice there is the no* ice unless it
# is the only in the static ice (unless there's on such ice "anyway").
if (( 1 == ${+ICE[$___key]} && 0 == ${+ICE[no$___key]} && 1 == ${+___sice[no$___key]} )) {
continue
}
if [[ "$___key" = "svn" ]]; then
command builtin print -r -- "0" >! "$___zinit_path/mode"
___mdata[mode]=0
else
command rm -f -- "$___zinit_path/$___key"
fi
unset "___mdata[$___key]" "___sice[$___key]" "ICE[$___key]"
done
# final decision, static ice vs. saved ice
local -A ___MY_ICE
for ___key in mode url is_release is_release{2..5} ${ice_order[@]}; do
# The second sum is: if the pack is *not* pack-nf, then depending on the
# disk availability, otherwise: no disk ice
(( ${+___sice[$___key]} + ${${${___pack:#pack-nf*}:+${+___mdata[$___key]}}:-0} )) && ___MY_ICE[$___key]="${___sice[$___key]-${___mdata[$___key]}}"
done
# One more round for the special case update, which ALWAYS needs the teleid
# from the disk or static ice
___key=teleid; [[ "$___pack" = pack-nftid ]] && {
(( ${+___sice[$___key]} + ${+___mdata[$___key]} )) && ___MY_ICE[$___key]="${___sice[$___key]-${___mdata[$___key]}}"
}
: ${(PA)___var_name1::="${(kv)___MY_ICE[@]}"}
: ${(P)___var_name2::=$___local_dir}
: ${(P)___var_name3::=$___filename}
: ${(P)___var_name4::=$___is_snippet}
return 0
} # ]]]
# FUNCTION: .zinit-countdown [[[
# Displays a countdown 5...4... etc.
#
# $REPLY - 1 if Ctrl-C is pressed, otherwise 0
.zinit-countdown() {
(( !${+ICE[countdown]} )) && return 0
builtin emulate -L zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
trap "+zi-log \"{ehi}ABORTING, the ice {ice}$ice{ehi} not ran{rst}\"; return 1" INT
local count=5 ice tpe="$1"
ice="${ICE[$tpe]}"
[[ $tpe = "atpull" && $ice = "%atclone" ]] && ice="${ICE[atclone]}"
ice="{b}{ice}$tpe{ehi}:{rst}${ice//(#b)(\{[a-z0-9…_-]##\})/\\$match[1]}"
+zi-log -n "{hi}Running $ice{rst}{hi} ice in...{rst} "
while (( -- count + 1 )) {
+zi-log -n -- "{b}{error}"$(( count + 1 ))"{rst}{…}"
sleep 1
}
+zi-log -r -- "{b}{error}0 <running now>{rst}{…}"
return 0
} # ]]]
# FUNCTION: .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)
.zinit-exists-physically() {
.zinit-any-to-user-plugin "$1" "$2"
if [[ ${reply[-2]} = % ]]; then
[[ -d ${reply[-1]} ]] && return 0 || return 1
else
[[ -d ${ZINIT[PLUGINS_DIR]}/${reply[-2]:+${reply[-2]}---}${reply[-1]//\//---} ]] \
&& return 0 \
|| return 1
fi
} # ]]]
# FUNCTION: .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)
.zinit-exists-physically-message() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes
if ! .zinit-exists-physically "$1" "$2"; then
.zinit-any-to-user-plugin "$1" "$2"
if [[ $reply[1] = % ]]; then
.zinit-any-to-pid "$1" "$2"
local spec1=$REPLY
if [[ $1 = %* ]]; then
local spec2=%${1#%}${${1#%}:+${2:+/}}$2
elif [[ -z $1 || -z $2 ]]; then
local spec3=%${1#%}${2#%}
fi
else
integer nospec=1
fi
.zinit-any-colorify-as-uspl2 "$1" "$2"
+zi-log "{error}No such (plugin or snippet){rst}: $REPLY."
[[ $nospec -eq 0 && $spec1 != $spec2 ]] \
&& +zi-log "(expands to: {file}${spec2#%}{rst})."
return 1
fi
return 0
} # ]]]
# FUNCTION: .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)
.zinit-first() {
.zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}"
.zinit-any-to-pid "$1" "$2"
.zinit-get-object-path plugin "$REPLY"
integer ret=$?
local dname="$REPLY"
(( ret )) && { reply=( "$dname" "" ); return 1; }
# look for file to compile - first look for the most common one (optimization)
# then for other possibilities
if [[ -e "$dname/$plugin.plugin.zsh" ]]; then
reply=( "$dname/$plugin.plugin.zsh" )
else
.zinit-find-other-matches "$dname" "$plugin"
fi
if [[ "${#reply}" -eq "0" ]]; then
reply=( "$dname" "" )
return 1
fi
# take first entry (ksharrays resilience)
reply=( "$dname" "${reply[-${#reply}]}" )
return 0
} # ]]]
# FUNCTION: .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
.zinit-store-ices() {
local ___pfx="$1" ___ice_var="$2" ___add_ices="$3" ___add_ices2="$4"
local url="$5" mode="$6"
# Copy from zinit-recall response
local -a ice_order nval_ices
ice_order=(
${(s.|.)ZINIT[ice-list]}
# include all additional ices after stripping them from the possible: ''
${(@)${(@Akons:|:)${ZINIT_EXTS[ice-mods]//\'\'/}}/(#s)<->-/}
)
nval_ices=(
${(s.|.)ZINIT[nval-ice-list]}
# include only those additional ices, don't have the '' in their name, i.e.
# aren't designed to hold value
${(@)${(@)${(@Akons:|:)ZINIT_EXTS[ice-mods]}:#*\'\'*}/(#s)<->-/}
# must be last
svn
)
command mkdir -p "$___pfx" && echo '*' > "$___pfx/.gitignore"
local ___key ___var_name
# No nval_ices here
for ___key in ${ice_order[@]:#(${(~j:|:)nval_ices[@]})} ${(s: :)___add_ices[@]}; do
___var_name="${___ice_var}[$___key]"
(( ${(P)+___var_name} )) && builtin print -r -- "${(P)___var_name}" >! "$___pfx"/"$___key"
done
# Ices that even empty mean something
for ___key in ${nval_ices[@]} ${(s: :)___add_ices2[@]}; do
___var_name="${___ice_var}[$___key]"
if (( ${(P)+___var_name} )); then
builtin print -r -- "${(P)___var_name}" >! "$___pfx"/"$___key"
else
command rm -f "$___pfx"/"$___key"
fi
done
# url and mode are declared at the beginning of the body
for ___key in url mode; do
[[ -n "${(P)___key}" ]] && builtin print -r -- "${(P)___key}" >! "$___pfx"/"$___key"
done
} # ]]]
# FUNCTION: .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
.zinit-two-paths() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops
local dirnameA dirnameB local_dirA local_dirB svn_dirA url1 url2 url=$1
local -a fileB_there
# remove leading whitespace and trailing /
url="${${url#"${url%%[! $'\t']*}"}%/}"
url1=$url
url2=$url
.zinit-get-object-path snippet "$url1"
local_dirA=$reply[-3] dirnameA=$reply[-2]
[[ -d "$local_dirA/$dirnameA/.svn" ]] && {
svn_dirA=".svn"
if { .zinit-first % "$local_dirA/$dirnameA"; } {
fileB_there=( ${reply[-1]} )
}
}
.zinit-get-object-path snippet "$url2"
local_dirB=$reply[-3] dirnameB=$reply[-2]
[[ -z $svn_dirA ]] && fileB_there=( "$local_dirB/$dirnameB"/*~*.(zwc|md|js|html)(.-DOnN[1]) )
reply=( "$local_dirA/$dirnameA" "$svn_dirA" "$local_dirB/$dirnameB" "${fileB_there[1]##$local_dirB/$dirnameB/#}" )
} # ]]]
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et foldmarker=[[[,]]] foldmethod=marker

3450
zinit.zsh

File diff suppressed because it is too large Load diff

2855
zplugin.zsh Normal file

File diff suppressed because it is too large Load diff