revert: "Merge branch 'refactor/zinit-function-names' into main"

This reverts commit b979847bd4, reversing
changes made to da924a21a1.

I (@vladdoster) accidentally merged this into the wrong repository. Apologies for the lack of due diligence.
This commit is contained in:
Vladislav Doster 2022-12-17 21:09:35 -06:00
parent b979847bd4
commit 515688bc97
36 changed files with 4892 additions and 71123 deletions

View file

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

View file

@ -15,14 +15,14 @@ jobs:
zshelldoc: zshelldoc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout repository - name: checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: build docker image - name: re-generate documentation
run: make container-build run: |
make doc/container
- name: generate documentation sudo chown -R "$(id -u):$(id -g)" .
run: make container-docs
- name: check for out-of-date documentation - name: check for out-of-date documentation
run: | run: |

View file

@ -34,7 +34,7 @@ ### Bug Fixes
* 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) * 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)) * 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)) * 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 zi::compinit call ([44765e0](https://github.com/zdharma-continuum/zinit/commit/44765e0bcb8d3f1ee3eb55286e33ad17b8c72a5e)) * 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) * 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 & 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 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)

View file

@ -1,25 +0,0 @@
# syntax=docker/dockerfile-upstream:master
ARG TARGETPLATFORM=linux/amd64
FROM --platform=$TARGETPLATFORM asciidoctor/docker-asciidoctor:latest
ENV USER root
ENV ZINIT_HOME /${USER}/zinit.git
RUN apk add \
asciidoc-doc \
make \
less \
tree \
zsh
WORKDIR /${USER}
COPY . ./zinit.git
COPY ./docker/zshrc .zshrc
RUN zsh --interactive --login -c -- '@zi::scheduler burst'
CMD ["zsh","--interactive","--login"]
# vim: set fenc=utf8 ffs=unix ft=dockerfile list noet sw=4 ts=4 tw=72:

View file

@ -1,41 +1,27 @@
.EXPORT_ALL_VARIABLES: .EXPORT_ALL_VARIABLES:
ZSH := $(shell command -v zsh 2> /dev/null) ZSH := $(shell command -v zsh 2> /dev/null)
SRC := share/{'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh SRC := zinit{'','-additional','-autoload','-install','-side'}.zsh
DOC_SRC := $(foreach wrd,$(SRC),../$(wrd)) DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))
HAS_TTY := $(shell [[ -z $$GITHUB_ACTIONS ]] && echo '--tty')
.PHONY: all clean container-build container-shell container-docs tags tags/emacs tags/vim test zwc .PHONY: all clean container doc doc/container tags tags/emacs tags/vim test zwc
all: help
clean: clean:
rm -rvf *.zwc doc/zsdoc/zinit{'','-additional','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/ rm -rvf *.zwc doc/zsdoc/zinit{'','-additional','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/
doc: clean ## Generate zinit documentation container:
cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\+\@\-\:\_\_a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*|\#[[:space:]][\]]*)' $(DOC_SRC); make -C ./zsdoc pdf" docker build --tag=ghcr.io/zdharma-continuum/zinit:latest --file=docker/Dockerfile .
CONTAINER_NAME := zinit doc: clean
CONTAINER_CMD := docker run --interactive --mount=source=$(CONTAINER_NAME)-volume,destination=/root --platform=linux/x86_64 $(HAS_TTY) cd doc; zsh -l -d -f -i -c "zsd -v --scomm --cignore '(\#*FUNCTION:[[:space:]][\:\∞\.\+\@\-a-zA-Z0-9]*[\[]*|}[[:space:]]\#[[:space:]][\]]*)' $(DOC_SRC)"
container-build: ## build docker image doc/container: container
docker build --file=Dockerfile --platform=linux/x86_64 --tag=$(CONTAINER_NAME):latest . ./scripts/docker-run.sh --docs --debug
container-docs: ## regenerate zinit docs in container # Run ctags to generate Emacs and Vim's format tag file.
$(CONTAINER_CMD) $(CONTAINER_NAME):latest make --directory zinit.git/ doc tags: tags/emacs tags/vim
container-shell: ## start shell in docker container tags/emacs: ## Build Emacs-style ctags file
$(CONTAINER_CMD) $(CONTAINER_NAME):latest
test: ## Run zunit tests
zunit run
zwc: ## compile zsh files via zcompile
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
tags: tags/emacs tags/vim ## run ctags to generate emacs and vim's format tag file.
tags/emacs: ## build emacs-style ctags file
@if type ctags >/dev/null 2>&1; then \ @if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \ if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; then \
ctags -e -R --options=share/zsh.ctags --languages=zsh \ ctags -e -R --options=share/zsh.ctags --languages=zsh \
@ -49,7 +35,7 @@ tags/emacs: ## build emacs-style ctags file
'version) utility first.\n'; \ 'version) utility first.\n'; \
fi fi
tags/vim: ## build the vim-style ctags file tags/vim: ## Build the Vim-style ctags file
@if type ctags >/dev/null 2>&1; then \ @if type ctags >/dev/null 2>&1; then \
if ctags --version | grep >/dev/null 2>&1 "Universal Ctags"; 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; \ ctags --languages=zsh --maxdepth=1 --options=share/zsh.ctags --pattern-length-limit=250 -R; \
@ -61,8 +47,8 @@ tags/vim: ## build the vim-style ctags file
printf 'Error: Please install a ctags first.\n'; \ printf 'Error: Please install a ctags first.\n'; \
fi fi
help: ## display available make targets test:
@ # credit: tweekmonster github gist zunit run
@echo "$$(grep -hE '^[a-zA-Z0-9_-]+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\033[36m\1\\033[m:\2/' | column -c2 -t -s : | sort)"
# vim: set fenc=utf8 ffs=unix ft=make list noet sw=4 ts=4 tw=72: zwc:
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'

View file

@ -115,7 +115,7 @@ # Changelog
- 06-11-2021 - 06-11-2021
- 🚧 zinit has a new home: https://github.com/zdharma-continuum/zinit - 🚧 zinit has a new home: https://github.com/zdharma-continuum/zinit
- The migration from @zdharma, @Zsh-Packages and @zi::zsh is still in progress. If you are interested in helping - 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 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) [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 - 📚 zinit now ensures that the man dirs under `$ZPFX/man` are created on startup. Please note that these directories

View file

@ -1,59 +1,57 @@
# This Makefile is to convert supplied Asciidoc files into # This Makefile is to convert supplied Asciidoc files into
# other formats like pdf and man. The files contain Zplugin's # other formats like pdf and man. The files contain Zplugin's
# code documentation. # code documentation.
# *.adoc files are generated by Makefile from upper (i.e. top) directory. #
# *.adoc files are generated by Makefile from upper (i.e. top)
# directory.
SRC := $(shell zsh -c "echo {'git-process-output','rpm2cpio'}.zsh zinit{'','-additional','-autoload','-install','-side'}.zsh") all: man pdf
PDF_SRC := $(foreach wrd,$(SRC),$(wrd).pdf) # MANUALS
PDF_CMD := asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf # Converted with a2x from asciidoc package
MAN_SRC := $(foreach wrd,$(SRC),man/$(wrd)) man: man/zinit.zsh.1 man/zinit-side.zsh.1 man/zinit-install.zsh.1 man/zinit-autoload.zsh.1
MAN_CMD := a2x --verbose -L --doctype manpage --format manpage -D man
.PHONY: all clean test man pdf man/zinit.zsh.1:
@mkdir -p man
a2x --verbose -L --doctype manpage --format manpage -D man zinit.zsh.adoc
all: clean man pdf man/zinit-side.zsh.1:
dirs: @mkdir -p man
mkdir -p man pdf a2x --verbose -L --doctype manpage --format manpage -D man zinit-side.zsh.adoc
# Manual pages man/zinit-install.zsh.1:
# uses a2x from asciidoc package @mkdir -p man
man: dirs $(MAN_SRC) a2x --verbose -L --doctype manpage --format manpage -D man zinit-install.zsh.adoc
man/git-process-output.zsh:
$(MAN_CMD) git-process-output.zsh.adoc man/zinit-autoload.zsh.1:
man/rpm2cpio.zsh: @mkdir -p man
$(MAN_CMD) rpm2cpio.zsh.adoc a2x --verbose -L --doctype manpage --format manpage -D man zinit-autoload.zsh.adoc
man/zinit-additional.zsh:
$(MAN_CMD) zinit-additional.zsh.adoc
man/zinit-autoload.zsh:
$(MAN_CMD) zinit-autoload.zsh.adoc
man/zinit-install.zsh:
$(MAN_CMD) zinit-install.zsh.adoc
man/zinit-side.zsh:
$(MAN_CMD) zinit-side.zsh.adoc
man/zinit.zsh:
$(MAN_CMD) zinit.zsh.adoc
# PDFS # PDFS
# uses asciidoctor not a2x (i.e. not asciidoc) # Uses asciidoctor not a2x (i.e. not asciidoc)
pdf: dirs $(PDF_SRC)
git-process-output.zsh.pdf: pdf: pdf/zinit.zsh.pdf pdf/zinit-side.zsh.pdf pdf/zinit-install.zsh.pdf pdf/zinit-autoload.zsh.pdf
$(PDF_CMD) git-process-output.zsh.adoc
rpm2cpio.zsh.pdf: pdf/zinit.zsh.pdf:
$(PDF_CMD) rpm2cpio.zsh.adoc @mkdir -p pdf
zinit-additional.zsh.pdf: asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit.zsh.adoc
$(PDF_CMD) zinit-additional.zsh.adoc
zinit-autoload.zsh.pdf: pdf/zinit-side.zsh.pdf:
$(PDF_CMD) zinit-autoload.zsh.adoc @mkdir -p pdf
zinit-install.zsh.pdf: asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-side.zsh.adoc
$(PDF_CMD) zinit-install.zsh.adoc
zinit-side.zsh.pdf: pdf/zinit-install.zsh.pdf:
$(PDF_CMD) zinit-side.zsh.adoc @mkdir -p pdf
zinit.zsh.pdf: asciidoctor -a reproducible -b pdf -r asciidoctor-pdf -D pdf zinit-install.zsh.adoc
$(PDF_CMD) zinit.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: clean:
rm -rf man pdf data rm -rf man pdf data
# vim:ft=make:noet:sts=4:ts=4 .PHONY: man pdf clean
# vim:noet:sts=8:ts=8

View file

@ -1,75 +0,0 @@
git-process-output.zsh(1)
=========================
:compat-mode!:
NAME
----
git-process-output.zsh - a shell script
SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
print_my_line
print_my_line_compress
timeline
DETAILS
-------
Script Body
~~~~~~~~~~~
Has 113 line(s). Calls functions:
Script-Body
|-- print_my_line
|-- print_my_line_compress
`-- timeline
Uses feature(s): _eval_, _read_, _setopt_, _trap_
print_my_line
~~~~~~~~~~~~~
____
$1 - n. of objects
$2 - packed objects
$3 - total objects
$4 - receiving percentage
$5 - resolving percentage
____
Has 13 line(s). Doesn't call other functions.
Called by:
Script-Body
print_my_line_compress
~~~~~~~~~~~~~~~~~~~~~~
Has 12 line(s). Doesn't call other functions.
Called by:
Script-Body
timeline
~~~~~~~~
____
Code by leoj3n
____
Has 15 line(s). Doesn't call other functions.
Called by:
Script-Body

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,24 +0,0 @@
rpm2cpio.zsh(1)
===============
:compat-mode!:
NAME
----
rpm2cpio.zsh - a shell script
SYNOPSIS
--------
Documentation automatically generated with `zshelldoc'
FUNCTIONS
---------
DETAILS
-------
Script Body
~~~~~~~~~~~
Has 51 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).

View file

@ -13,13 +13,13 @@ Documentation automatically generated with `zshelldoc'
FUNCTIONS FUNCTIONS
--------- ---------
:zi::tmp-subst-source .zinit-clear-debug-report
zi::clear-debug-report .zinit-debug-start
zi::debug-start .zinit-debug-stop
zi::debug-stop .zinit-debug-unload
zi::debug-unload .zinit-service
zi::service .zinit-wrap-track-functions
zi::wrap-track-functions :zinit-tmp-subst-source
DETAILS DETAILS
------- -------
@ -29,20 +29,8 @@ 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.). Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
:zi::tmp-subst-source .zinit-clear-debug-report
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
Has 25 line(s). Calls functions:
:zi::tmp-subst-source
`-- zinit.zsh/+zi::message
Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
zi::clear-debug-report
~~~~~~~~~~~~~~~~~~~~~~
____ ____
@ -51,16 +39,16 @@ ____
Has 1 line(s). Calls functions: Has 1 line(s). Calls functions:
zi::clear-debug-report .zinit-clear-debug-report
`-- zinit-autoload.zsh/zi::clear-report-for `-- zinit-autoload.zsh/.zinit-clear-report-for
Called by: Called by:
zinit-autoload.zsh/zi::unload zinit-autoload.zsh/.zinit-unload
zinit.zsh/zinit zinit.zsh/zinit
zi::debug-start .zinit-debug-start
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
____ ____
@ -69,17 +57,17 @@ ____
Has 9 line(s). Calls functions: Has 9 line(s). Calls functions:
zi::debug-start .zinit-debug-start
|-- zinit.zsh/+zi::message |-- zinit.zsh/+zinit-message
|-- zinit.zsh/zi::diff |-- zinit.zsh/.zinit-diff
`-- zinit.zsh/zi::tmp-subst-on `-- zinit.zsh/.zinit-tmp-subst-on
Called by: Called by:
zinit.zsh/zinit zinit.zsh/zinit
zi::debug-stop .zinit-debug-stop
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
____ ____
@ -88,16 +76,16 @@ ____
Has 3 line(s). Calls functions: Has 3 line(s). Calls functions:
zi::debug-stop .zinit-debug-stop
|-- zinit.zsh/zi::diff |-- zinit.zsh/.zinit-diff
`-- zinit.zsh/zi::tmp-subst-off `-- zinit.zsh/.zinit-tmp-subst-off
Called by: Called by:
zinit.zsh/zinit zinit.zsh/zinit
zi::debug-unload .zinit-debug-unload
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
____ ____
@ -106,9 +94,9 @@ ____
Has 6 line(s). Calls functions: Has 6 line(s). Calls functions:
zi::debug-unload .zinit-debug-unload
|-- zinit-autoload.zsh/zi::unload |-- zinit-autoload.zsh/.zinit-unload
`-- zinit.zsh/+zi::message `-- zinit.zsh/+zinit-message
Uses feature(s): _source_ Uses feature(s): _source_
@ -116,8 +104,8 @@ Called by:
zinit.zsh/zinit zinit.zsh/zinit
zi::service .zinit-service
~~~~~~~~~~~ ~~~~~~~~~~~~~~
____ ____
@ -130,16 +118,16 @@ ____
Has 37 line(s). Calls functions: Has 37 line(s). Calls functions:
zi::service .zinit-service
|-- zinit.zsh/zi::load |-- zinit.zsh/.zinit-load
`-- zinit.zsh/zi::load-snippet `-- zinit.zsh/.zinit-load-snippet
Uses feature(s): _kill_, _read_, _setopt_ Uses feature(s): _kill_, _read_, _setopt_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). Not called by script or any function (may be e.g. a hook, a Zle widget, etc.).
zi::wrap-track-functions .zinit-wrap-track-functions
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Has 19 line(s). Doesn't call other functions. Has 19 line(s). Doesn't call other functions.
@ -147,3 +135,15 @@ Uses feature(s): _eval_
Not called by script or any function (may be e.g. a hook, a Zle widget, etc.). 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/+zinit-message
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

File diff suppressed because it is too large Load diff

View file

@ -13,14 +13,14 @@ Documentation automatically generated with `zshelldoc'
FUNCTIONS FUNCTIONS
--------- ---------
zi::any-colorify-as-uspl2 .zinit-any-colorify-as-uspl2
zi::compute-ice .zinit-compute-ice
zi::countdown .zinit-countdown
zi::exists-physically .zinit-exists-physically
zi::exists-physically-message .zinit-exists-physically-message
zi::first .zinit-first
zi::store-ices .zinit-store-ices
zi::two-paths .zinit-two-paths
DETAILS DETAILS
------- -------
@ -30,8 +30,8 @@ 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.). Has 1 line(s). No functions are called (may set up e.g. a hook, a Zle widget bound to a key, etc.).
zi::any-colorify-as-uspl2 .zinit-any-colorify-as-uspl2
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
____ ____
@ -46,36 +46,36 @@ ____
Has 22 line(s). Calls functions: Has 22 line(s). Calls functions:
zi::any-colorify-as-uspl2 .zinit-any-colorify-as-uspl2
|-- zinit.zsh/zi::any-to-pid |-- zinit.zsh/.zinit-any-to-pid
`-- zinit.zsh/zi::any-to-user-plugin `-- zinit.zsh/.zinit-any-to-user-plugin
Called by: Called by:
zi::exists-physically-message .zinit-exists-physically-message
zinit-autoload.zsh/zi::clear-completions zinit-autoload.zsh/.zinit-clear-completions
zinit-autoload.zsh/zi::compile-uncompile-all zinit-autoload.zsh/.zinit-compile-uncompile-all
zinit-autoload.zsh/zi::compiled zinit-autoload.zsh/.zinit-compiled
zinit-autoload.zsh/zi::create zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/zi::exists-message zinit-autoload.zsh/.zinit-exists-message
zinit-autoload.zsh/zi::get-completion-owner-uspl2col zinit-autoload.zsh/.zinit-get-completion-owner-uspl2col
zinit-autoload.zsh/zi::list-bindkeys zinit-autoload.zsh/.zinit-list-bindkeys
zinit-autoload.zsh/zi::recently zinit-autoload.zsh/.zinit-recently
zinit-autoload.zsh/zi::search-completions zinit-autoload.zsh/.zinit-search-completions
zinit-autoload.zsh/zi::show-completions zinit-autoload.zsh/.zinit-show-completions
zinit-autoload.zsh/zi::show-registered-plugins zinit-autoload.zsh/.zinit-show-registered-plugins
zinit-autoload.zsh/zi::show-times zinit-autoload.zsh/.zinit-show-times
zinit-autoload.zsh/zi::uncompile-plugin zinit-autoload.zsh/.zinit-uncompile-plugin
zinit-autoload.zsh/zi::unload zinit-autoload.zsh/.zinit-unload
zinit-autoload.zsh/zi::update-all-parallel zinit-autoload.zsh/.zinit-update-all-parallel
zinit-autoload.zsh/zi::update-or-status-all zinit-autoload.zsh/.zinit-update-or-status-all
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/zi::install-completions zinit-install.zsh/.zinit-install-completions
zinit-install.zsh/zi::setup-plugin-dir zinit-install.zsh/.zinit-setup-plugin-dir
zinit.zsh/zi::formatter-pid zinit.zsh/.zinit-formatter-pid
zi::compute-ice .zinit-compute-ice
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
____ ____
@ -102,39 +102,23 @@ ____
Has 110 line(s). Calls functions: Has 110 line(s). Calls functions:
zi::compute-ice .zinit-compute-ice
|-- zi::exists-physically-message |-- zinit.zsh/.zinit-any-to-user-plugin
|   |-- zi::any-colorify-as-uspl2 `-- zinit.zsh/.zinit-pack-ice
|   |   |-- zinit.zsh/zi::any-to-pid
|   |   `-- zinit.zsh/zi::any-to-user-plugin
|   |-- zi::exists-physically
|   |   `-- zinit.zsh/zi::any-to-user-plugin
|   |-- zinit.zsh/+zi::message
|   |-- zinit.zsh/zi::any-to-pid
|   `-- zinit.zsh/zi::any-to-user-plugin
|-- zi::two-paths
|   |-- zi::first
|   |   |-- zinit.zsh/zi::any-to-pid
|   |   |-- zinit.zsh/zi::any-to-user-plugin
|   |   |-- zinit.zsh/zi::find-other-matches
|   |   `-- zinit.zsh/zi::get-object-path
|   `-- zinit.zsh/zi::get-object-path
|-- zinit.zsh/zi::any-to-user-plugin
`-- zinit.zsh/zi::pack-ice
Uses feature(s): _setopt_ Uses feature(s): _setopt_
Called by: Called by:
zinit-autoload.zsh/zi::delete zinit-autoload.zsh/.zinit-delete
zinit-autoload.zsh/zi::edit zinit-autoload.zsh/.zinit-edit
zinit-autoload.zsh/zi::recall zinit-autoload.zsh/.zinit-recall
zinit-autoload.zsh/zi::update-or-status-snippet zinit-autoload.zsh/.zinit-update-or-status-snippet
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/zi::compile-plugin zinit-install.zsh/.zinit-compile-plugin
zi::countdown .zinit-countdown
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
____ ____
@ -145,23 +129,23 @@ ____
Has 20 line(s). Calls functions: Has 20 line(s). Calls functions:
zi::countdown .zinit-countdown
`-- zinit.zsh/+zi::message `-- zinit.zsh/+zinit-message
Uses feature(s): _trap_ Uses feature(s): _trap_
Called by: Called by:
zinit-autoload.zsh/zi::run-delete-hooks zinit-autoload.zsh/.zinit-run-delete-hooks
zinit-install.zsh/__zi::atclone-hook zinit-install.zsh/.zinit-configure-run-autoconf
zinit-install.zsh/__zi::atpull-e-hook zinit-install.zsh/∞zinit-atclone-hook
zinit-install.zsh/__zi::atpull-hook zinit-install.zsh/∞zinit-atpull-e-hook
zinit-install.zsh/__zi::configure-base-hook zinit-install.zsh/∞zinit-atpull-hook
zinit-install.zsh/__zi::make-base-hook zinit-install.zsh/∞zinit-configure-base-hook
zinit-install.zsh/zi::configure-run-autoconf zinit-install.zsh/∞zinit-make-base-hook
zi::exists-physically .zinit-exists-physically
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
____ ____
@ -173,17 +157,17 @@ ____
Has 8 line(s). Calls functions: Has 8 line(s). Calls functions:
zi::exists-physically .zinit-exists-physically
`-- zinit.zsh/zi::any-to-user-plugin `-- zinit.zsh/.zinit-any-to-user-plugin
Called by: Called by:
zi::exists-physically-message .zinit-exists-physically-message
zinit-autoload.zsh/zi::create zinit-autoload.zsh/.zinit-create
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status
zi::exists-physically-message .zinit-exists-physically-message
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
____ ____
@ -196,37 +180,32 @@ ____
Has 25 line(s). Calls functions: Has 25 line(s). Calls functions:
zi::exists-physically-message .zinit-exists-physically-message
|-- zi::any-colorify-as-uspl2 |-- zinit.zsh/+zinit-message
|   |-- zinit.zsh/zi::any-to-pid |-- zinit.zsh/.zinit-any-to-pid
|   `-- zinit.zsh/zi::any-to-user-plugin `-- zinit.zsh/.zinit-any-to-user-plugin
|-- zi::exists-physically
|   `-- zinit.zsh/zi::any-to-user-plugin
|-- zinit.zsh/+zi::message
|-- zinit.zsh/zi::any-to-pid
`-- zinit.zsh/zi::any-to-user-plugin
Uses feature(s): _setopt_ Uses feature(s): _setopt_
Called by: Called by:
zi::compute-ice .zinit-compute-ice
zinit-autoload.zsh/zi::changes zinit-autoload.zsh/.zinit-changes
zinit-autoload.zsh/zi::glance zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/zi::stress zinit-autoload.zsh/.zinit-stress
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/zi::install-completions zinit-install.zsh/.zinit-install-completions
zi::first .zinit-first
~~~~~~~~~ ~~~~~~~~~~~~
____ ____
Finds the main file of plugin. There are multiple file name formats, they are Finds the main file of plugin. There are multiple file name formats, they are
ordered in order starting from more correct ones, and matched. ordered in order starting from more correct ones, and matched.
zi::load-plugin() has similar code parts and doesn't call zi::first() .zinit-load-plugin() has similar code parts and doesn't call .zinit-first()
for performance. Obscure matching is done in zi::find-other-matches, here for performance. Obscure matching is done in .zinit-find-other-matches, here
and in zi::load(). Obscure = non-standard main-file naming convention. and in .zinit-load(). Obscure = non-standard main-file naming convention.
$1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
$2 - plugin (only when $1 - i.e. user - given) $2 - plugin (only when $1 - i.e. user - given)
@ -234,21 +213,21 @@ ____
Has 20 line(s). Calls functions: Has 20 line(s). Calls functions:
zi::first .zinit-first
|-- zinit.zsh/zi::any-to-pid |-- zinit.zsh/.zinit-any-to-pid
|-- zinit.zsh/zi::any-to-user-plugin |-- zinit.zsh/.zinit-any-to-user-plugin
|-- zinit.zsh/zi::find-other-matches |-- zinit.zsh/.zinit-find-other-matches
`-- zinit.zsh/zi::get-object-path `-- zinit.zsh/.zinit-get-object-path
Called by: Called by:
zi::two-paths .zinit-two-paths
zinit-autoload.zsh/zi::glance zinit-autoload.zsh/.zinit-glance
zinit-autoload.zsh/zi::stress zinit-autoload.zsh/.zinit-stress
zinit-install.zsh/zi::compile-plugin zinit-install.zsh/.zinit-compile-plugin
zi::store-ices .zinit-store-ices
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
____ ____
@ -266,12 +245,12 @@ Has 30 line(s). Doesn't call other functions.
Called by: Called by:
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status
zinit-install.zsh/zi::download-snippet zinit-install.zsh/.zinit-download-snippet
zinit-install.zsh/zi::setup-plugin-dir zinit-install.zsh/.zinit-setup-plugin-dir
zi::two-paths .zinit-two-paths
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
____ ____
@ -284,18 +263,13 @@ ____
Has 24 line(s). Calls functions: Has 24 line(s). Calls functions:
zi::two-paths .zinit-two-paths
|-- zi::first `-- zinit.zsh/.zinit-get-object-path
|   |-- zinit.zsh/zi::any-to-pid
|   |-- zinit.zsh/zi::any-to-user-plugin
|   |-- zinit.zsh/zi::find-other-matches
|   `-- zinit.zsh/zi::get-object-path
`-- zinit.zsh/zi::get-object-path
Uses feature(s): _setopt_ Uses feature(s): _setopt_
Called by: Called by:
zi::compute-ice .zinit-compute-ice
zinit-autoload.zsh/zi::update-or-status zinit-autoload.zsh/.zinit-update-or-status

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,6 @@ USER ${PUSERNAME}
# Fetch keys config and store it outside of ZINIT[HOME_DIR] since it might get # Fetch keys config and store it outside of ZINIT[HOME_DIR] since it might get
# overridden at runtime (the /data volume) # overridden at runtime (the /data volume)
RUN ZINIT_HOME_DIR=/data-static ZSH_NO_INIT=1 \ RUN ZINIT_HOME_DIR=/data-static ZSH_NO_INIT=1 \
zsh -ils -c -- '@zi::scheduler burst' zsh -ils -c -- '@zinit-scheduler burst'
CMD ["/bin/zsh"] CMD ["/bin/zsh"]

View file

@ -1,26 +1,41 @@
#!/usr/bin/env zsh # 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
typeset -Ag ZINIT # load zinit
source /src/zinit.zsh
ZINIT[HOME_DIR]=${ZINIT_DATA:-$HOME/zinit}
ZINIT[BIN_DIR]=${ZINIT_SRC:-$HOME/zinit.git}
source ${ZINIT[BIN_DIR]}/zinit.zsh
autoload -Uz _zinit autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit (( ${+_comps} )) && _comps[zinit]=_zinit
#=== OH-MY-ZSH & PREZTO PLUGINS ======================= # load zinit setup utility functions
zi is-snippet light-mode nocompletions for {PZTM::{environment,history},OMZL::{compfix,completion,git,key-bindings}.zsh} source /src/docker/utils.zsh
#=== COMPLETIONS ======================================
zi make"PREFIX=/usr/local install" load for @zdharma-continuum/zshelldoc # Add ZPFX/bin and GOPATH/bin to PATH
#=== PROMPT =========================================== typeset -U path
eval "MODE_CURSOR_"{'SEARCH="#ff00ff blinking underline"','VICMD="green block"','VIINS="#ffff00 bar"'}";" path=("${ZPFX:-${HOME}/.local/share/zinit/polaris}/bin" "${HOME}/go/bin" $path)
zi for as'null' compile'(pure|async).zsh' multisrc'(pure|async).zsh' light-mode atinit"
PURE_GIT_DOWN_ARROW='↓'; PURE_GIT_UP_ARROW='↑' # Install custom zsh version
PURE_PROMPT_SYMBOL=''; PURE_PROMPT_VICMD_SYMBOL='' if [[ -n "$ZINIT_ZSH_VERSION" ]]
zstyle ':prompt:pure:git:action' color 'yellow' then
zstyle ':prompt:pure:git:branch' color 'blue' zinit::pack-zsh "$ZINIT_ZSH_VERSION"
zstyle ':prompt:pure:git:dirty' color 'red' fi
zstyle ':prompt:pure:path' color 'cyan'
zstyle ':prompt:pure:prompt:success' color 'green'" \ source /src/docker/zshrc-fancy
@sindresorhus/pure
# 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

81
scripts/docker-build.sh Executable file
View file

@ -0,0 +1,81 @@
#!/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

260
scripts/docker-run.sh Executable file
View file

@ -0,0 +1,260 @@
#!/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 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

@ -261,7 +261,7 @@ EOF
if [ "$reply" = y ] || [ "$reply" = Y ]; then if [ "$reply" = y ] || [ "$reply" = Y ]; then
command cat "$zshrc_annex_file" >> "$ZSHRC" command cat "$zshrc_annex_file" >> "$ZSHRC"
echo_info "Installing annexes" echo_info "Installing annexes"
zsh -ic "@zi::scheduler burst" zsh -ic "@zinit-scheduler burst"
echo_success 'Done!' echo_success 'Done!'
else else
echo_warning "Skipped the annexes." echo_warning "Skipped the annexes."

View file

@ -177,4 +177,10 @@ print
unset ZINIT_CNORM ZINIT_CIVIS unset ZINIT_CNORM ZINIT_CIVIS
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 : # 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

@ -55,4 +55,10 @@ fi
command "$UNPACKCMD[@]" 2>/dev/null | command "$DECOMPRESSCMD[@]" command "$UNPACKCMD[@]" 2>/dev/null | command "$DECOMPRESSCMD[@]"
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 : # 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,10 +1,9 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
_annex_test_function() { _annex_test_function() {
# run zinit load zdharma-continuum/${1} run zinit load zdharma-continuum/${1}
run zinit id-as ver'refactor/zinit-function-names' for load vladdoster/${1}
assert ${state} equals 0 assert ${state} equals 0
zinit cd ${1} zinit cd zdharma-continuum/${1}
assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_file assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_file
assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_readable assert ${PWD}/${${1}//zinit-annex/z-a}.plugin.zsh is_readable
} }

View file

@ -40,8 +40,10 @@ source $ZINIT[BIN_DIR]/zinit.zsh \
# ]]] # ]]]
# Install Annexes [[[ # Install Annexes [[[
info 'installing test dependencies' info 'installing test dependencies'
zi id-as ver'refactor/zinit-function-names' light-mode for \ # ver'fix/improve-lbin-logic' \
@vladdoster/zinit-annex-{bin-gem-node,binary-symlink,default-ice,patch-dl,submods} zinit depth'1' light-mode for \
zdharma-continuum/zinit-annex-binary-symlink \
zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
# ]]] # ]]]
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker # vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker

View file

@ -484,4 +484,10 @@ elif (( __tfind_spe_call_count > 0 )); then
(( __tfind_spe_call_count -- )) (( __tfind_spe_call_count -- ))
fi fi
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 : # 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,8 +1,8 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors. # Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.
# FUNCTION: :zi::tmp-subst-source [[[ # FUNCTION: :zinit-tmp-subst-source [[[
:zi::tmp-subst-source() { :zinit-tmp-subst-source() {
local -a ___substs ___ab local -a ___substs ___ab
___substs=( "${(@s.;.)ICE[subst]}" ) ___substs=( "${(@s.;.)ICE[subst]}" )
if [[ -n ${(M)___substs:#*\\(#e)} ]] { if [[ -n ${(M)___substs:#*\\(#e)} ]] {
@ -12,7 +12,7 @@
# Load the plugin # Load the plugin
if [[ ! -r $1 ]] { if [[ ! -r $1 ]] {
+zi::message "{error}source: Couldn't read the script {obj}${1}{error}" \ +zinit-message "{error}source: Couldn't read the script {obj}${1}{error}" \
", cannot substitute {data}${ICE[subst]}{error}.{rst}" ", cannot substitute {data}${ICE[subst]}{error}.{rst}"
} }
@ -31,13 +31,13 @@
builtin eval "$___data" builtin eval "$___data"
} # ]]] } # ]]]
# FUNCTION: zi::service [[[ # FUNCTION: .zinit-service [[[
# Handles given service, i.e. obtains lock, runs it, or waits if no lock # Handles given service, i.e. obtains lock, runs it, or waits if no lock
# #
# $1 - type "p" or "s" (plugin or snippet) # $1 - type "p" or "s" (plugin or snippet)
# $2 - mode - for plugin (light or load) # $2 - mode - for plugin (light or load)
# $3 - id - URL or plugin ID or alias name (from id-as'') # $3 - id - URL or plugin ID or alias name (from id-as'')
zi::service() { .zinit-service() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob warncreateglobal typesetsilent noshortloops setopt extendedglob warncreateglobal typesetsilent noshortloops
@ -55,10 +55,10 @@ zi::service() {
___lckd=1 ___lckd=1
if (( ! ___strd )) || [[ $___cmd = RESTART ]]; then if (( ! ___strd )) || [[ $___cmd = RESTART ]]; then
[[ $___tpe = p ]] && { ___strd=1 [[ $___tpe = p ]] && { ___strd=1
zi::load "$___id" "" "$___mode" 0; .zinit-load "$___id" "" "$___mode" 0;
} }
[[ $___tpe = s ]] && { ___strd=1 [[ $___tpe = s ]] && { ___strd=1
zi::load-snippet "$___id" "" 0; .zinit-load-snippet "$___id" "" 0;
} }
fi fi
___cmd= ___cmd=
@ -76,8 +76,9 @@ zi::service() {
builtin read -t 1 ___tmp <>"${___fle:r}.fifo2" builtin read -t 1 ___tmp <>"${___fle:r}.fifo2"
done >>! "$ZSRV_WORK_DIR/$ZSRV_ID".log 2>&1 done >>! "$ZSRV_WORK_DIR/$ZSRV_ID".log 2>&1
} # ]]] } # ]]]
# FUNCTION: zi::wrap-track-functions [[[
zi::wrap-track-functions() { # FUNCTION: .zinit-wrap-track-functions [[[
.zinit-wrap-track-functions() {
local user="$1" plugin="$2" id_as="$3" f local user="$1" plugin="$2" id_as="$3" f
local -a wt local -a wt
wt=( ${(@s.;.)ICE[wrap-track]} ) wt=( ${(@s.;.)ICE[wrap-track]} )
@ -86,14 +87,14 @@ zi::wrap-track-functions() {
eval " eval "
function $f { function $f {
ZINIT[CUR_USR]=\"$user\" ZINIT[CUR_PLUGIN]=\"$plugin\" ZINIT[CUR_USPL2]=\"$id_as\" ZINIT[CUR_USR]=\"$user\" ZINIT[CUR_PLUGIN]=\"$plugin\" ZINIT[CUR_USPL2]=\"$id_as\"
zi::add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Starting to track function: $f ===\" .zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Starting to track function: $f ===\"
zi::diff \"\${ZINIT[CUR_USPL2]}\" begin .zinit-diff \"\${ZINIT[CUR_USPL2]}\" begin
zi::tmp-subst-on load .zinit-tmp-subst-on load
functions[${f}]=\${functions[${f}-zinit-bkp]} functions[${f}]=\${functions[${f}-zinit-bkp]}
${f} \"\$@\" ${f} \"\$@\"
zi::tmp-subst-off load .zinit-tmp-subst-off load
zi::diff \"\${ZINIT[CUR_USPL2]}\" end .zinit-diff \"\${ZINIT[CUR_USPL2]}\" end
zi::add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Ended tracking function: $f ===\" .zinit-add-report \"\${ZINIT[CUR_USPL2]}\" \"Note: === Ended tracking function: $f ===\"
ZINIT[CUR_USR]= ZINIT[CUR_PLUGIN]= ZINIT[CUR_USPL2]= ZINIT[CUR_USR]= ZINIT[CUR_PLUGIN]= ZINIT[CUR_USPL2]=
}" }"
done done
@ -103,46 +104,52 @@ function $f {
# Dtrace # Dtrace
# #
# FUNCTION: zi::clear-debug-report [[[ # FUNCTION: .zinit-debug-start [[[
# Forgets dtrace repport gathered up to this moment.
zi::clear-debug-report() {
zi::clear-report-for _dtrace/_dtrace
} # ]]]
# FUNCTION: zi::debug-start [[[
# Starts Dtrace, i.e. session tracking for changes in Zsh state. # Starts Dtrace, i.e. session tracking for changes in Zsh state.
zi::debug-start() { .zinit-debug-start() {
if [[ ${ZINIT[DTRACE]} = 1 ]]; then if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi::message "{error}Dtrace is already active, stop it first with \`dstop'{rst}" +zinit-message "{error}Dtrace is already active, stop it first with \`dstop'{rst}"
return 1 return 1
fi fi
ZINIT[DTRACE]=1 ZINIT[DTRACE]=1
zi::diff _dtrace/_dtrace begin .zinit-diff _dtrace/_dtrace begin
# Full shadeing on # Full shadeing on
zi::tmp-subst-on dtrace .zinit-tmp-subst-on dtrace
} # ]]] } # ]]]
# FUNCTION: zi::debug-stop [[[ # FUNCTION: .zinit-debug-stop [[[
# Stops Dtrace (i.e., session tracking for changes in Zsh state). # Stops Dtrace (i.e., session tracking for changes in Zsh state).
zi::debug-stop() { .zinit-debug-stop() {
ZINIT[DTRACE]=0 ZINIT[DTRACE]=0
# Shadowing fully off # Shadowing fully off
zi::tmp-subst-off dtrace .zinit-tmp-subst-off dtrace
# Gather end data now, for diffing later # Gather end data now, for diffing later
zi::diff _dtrace/_dtrace end .zinit-diff _dtrace/_dtrace end
} # ]]] } # ]]]
# FUNCTION: zi::debug-unload [[[ # FUNCTION: .zinit-clear-debug-report [[[
# Forgets dtrace repport gathered up to this moment.
.zinit-clear-debug-report() {
.zinit-clear-report-for _dtrace/_dtrace
} # ]]]
# FUNCTION: .zinit-debug-unload [[[
# Reverts changes detected by dtrace run. # Reverts changes detected by dtrace run.
zi::debug-unload() { .zinit-debug-unload() {
(( ${+functions[zi::unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1 (( ${+functions[.zinit-unload]} )) || builtin source "${ZINIT[BIN_DIR]}/zinit-autoload.zsh" || return 1
if [[ ${ZINIT[DTRACE]} = 1 ]]; then if [[ ${ZINIT[DTRACE]} = 1 ]]; then
+zi::message "{error}Dtrace is still active, stop it first with \`dstop'{rst}" +zinit-message "{error}Dtrace is still active, stop it first with \`dstop'{rst}"
else else
zi::unload _dtrace _dtrace .zinit-unload _dtrace _dtrace
fi fi
} # ]]] } # ]]]
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72: # 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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors # Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors
# Copyright (c) 2021-2022 zdharma-continuum and contributors # Copyright (c) 2021-2022 zdharma-continuum and contributors
# FUNCTION: zi::any-colorify-as-uspl2 [[[ # FUNCTION: .zinit-any-colorify-as-uspl2 [[[
# Returns ANSI-colorified "user/plugin" string, from any supported # Returns ANSI-colorified "user/plugin" string, from any supported
# plugin spec (user---plugin, user/plugin, user plugin, plugin). # plugin spec (user---plugin, user/plugin, user plugin, plugin).
# #
@ -11,11 +11,11 @@
# $2 - plugin (only when $1 - i.e. user - given) # $2 - plugin (only when $1 - i.e. user - given)
# #
# $REPLY - ANSI-colorified "user/plugin" string # $REPLY - ANSI-colorified "user/plugin" string
zi::any-colorify-as-uspl2() { .zinit-any-colorify-as-uspl2() {
zi::any-to-user-plugin "$1" "$2" .zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}" local user="${reply[-2]}" plugin="${reply[-1]}"
if [[ "$user" = "%" ]]; then if [[ "$user" = "%" ]]; then
zi::any-to-pid "" $plugin .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--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::}"
@ -35,7 +35,7 @@ zi::any-colorify-as-uspl2() {
REPLY="${user:+${ZINIT[col-uname]}${user}${ZINIT[col-rst]}/}${ZINIT[col-pname]}${plugin}${ZINIT[col-rst]}" REPLY="${user:+${ZINIT[col-uname]}${user}${ZINIT[col-rst]}/}${ZINIT[col-pname]}${plugin}${ZINIT[col-rst]}"
fi fi
} # ]]] } # ]]]
# FUNCTION: zi::compute-ice [[[ # FUNCTION: .zinit-compute-ice [[[
# Computes ICE array # Computes ICE array
# - input # - input
# - static # - static
@ -55,14 +55,14 @@ zi::any-colorify-as-uspl2() {
# $6 - name of output string parameter, to hold is-snippet 0/1-bool ("is_snippet") # $6 - name of output string parameter, to hold is-snippet 0/1-bool ("is_snippet")
# #
# $REPLY - snippet directory filepath # $REPLY - snippet directory filepath
zi::compute-ice() { .zinit-compute-ice() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops setopt extendedglob typesetsilent warncreateglobal noshortloops
local ___URL="${1%/}" ___pack="$2" ___is_snippet=0 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}" local ___var_name1="${3:-ZINIT_ICE}" ___var_name2="${4:-local_dir}" ___var_name3="${5:-filename}" ___var_name4="${6:-is_snippet}"
# Copy from zi::recall # Copy from .zinit-recall
local -a ice_order nval_ices local -a ice_order nval_ices
ice_order=( ice_order=(
${(s.|.)ZINIT[ice-list]} ${(s.|.)ZINIT[ice-list]}
@ -81,21 +81,21 @@ zi::compute-ice() {
___URL="${${___URL#"${___URL%%[! $'\t']*}"}%/}" ___URL="${${___URL#"${___URL%%[! $'\t']*}"}%/}"
# snippet # snippet
zi::two-paths "$___URL" .zinit-two-paths "$___URL"
local ___s_path="${reply[-4]}" ___s_svn="${reply[-3]}" ___path="${reply[-2]}" ___filename="${reply[-1]}" ___local_dir local ___s_path="${reply[-4]}" ___s_svn="${reply[-3]}" ___path="${reply[-2]}" ___filename="${reply[-1]}" ___local_dir
if [[ -d "$___s_path" || -d "$___path" ]]; then if [[ -d "$___s_path" || -d "$___path" ]]; then
___is_snippet=1 ___is_snippet=1
else else
# plugin # plugin
zi::any-to-user-plugin "$___URL" "" .zinit-any-to-user-plugin "$___URL" ""
local ___user="${reply[-2]}" ___plugin="${reply[-1]}" local ___user="${reply[-2]}" ___plugin="${reply[-1]}"
___s_path="" ___filename="" ___s_path="" ___filename=""
[[ "$___user" = "%" ]] && ___path="$___plugin" || ___path="${ZINIT[PLUGINS_DIR]}/${___user:+${___user}---}${___plugin//\//---}" [[ "$___user" = "%" ]] && ___path="$___plugin" || ___path="${ZINIT[PLUGINS_DIR]}/${___user:+${___user}---}${___plugin//\//---}"
zi::exists-physically-message "$___user" "$___plugin" || return 1 .zinit-exists-physically-message "$___user" "$___plugin" || return 1
fi fi
[[ $___pack = pack* ]] && (( ${#ICE} > 0 )) && zi::pack-ice "${___user-$___URL}" "$___plugin" [[ $___pack = pack* ]] && (( ${#ICE} > 0 )) && .zinit-pack-ice "${___user-$___URL}" "$___plugin"
local -A ___sice local -A ___sice
local -a ___tmp local -a ___tmp
@ -191,15 +191,15 @@ zi::compute-ice() {
return 0 return 0
} # ]]] } # ]]]
# FUNCTION: zi::countdown [[[ # FUNCTION: .zinit-countdown [[[
# Displays a countdown 5...4... etc. # Displays a countdown 5...4... etc.
# #
# $REPLY - 1 if Ctrl-C is pressed, otherwise 0 # $REPLY - 1 if Ctrl-C is pressed, otherwise 0
zi::countdown() { .zinit-countdown() {
(( !${+ICE[countdown]} )) && return 0 (( !${+ICE[countdown]} )) && return 0
builtin emulate -L zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace} builtin emulate -L zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
trap "+zi::message \"{ehi}ABORTING, the ice {ice}$ice{ehi} not ran{rst}\"; return 1" INT trap "+zinit-message \"{ehi}ABORTING, the ice {ice}$ice{ehi} not ran{rst}\"; return 1" INT
local count=5 ice tpe="$1" local count=5 ice tpe="$1"
@ -207,23 +207,23 @@ zi::countdown() {
[[ $tpe = "atpull" && $ice = "%atclone" ]] && ice="${ICE[atclone]}" [[ $tpe = "atpull" && $ice = "%atclone" ]] && ice="${ICE[atclone]}"
ice="{b}{ice}$tpe{ehi}:{rst}${ice//(#b)(\{[a-z0-9…_-]##\})/\\$match[1]}" ice="{b}{ice}$tpe{ehi}:{rst}${ice//(#b)(\{[a-z0-9…_-]##\})/\\$match[1]}"
+zi::message -n "{hi}Running $ice{rst}{hi} ice in...{rst} " +zinit-message -n "{hi}Running $ice{rst}{hi} ice in...{rst} "
while (( -- count + 1 )) { while (( -- count + 1 )) {
+zi::message -n -- "{b}{error}"$(( count + 1 ))"{rst}{…}" +zinit-message -n -- "{b}{error}"$(( count + 1 ))"{rst}{…}"
sleep 1 sleep 1
} }
+zi::message -r -- "{b}{error}0 <running now>{rst}{…}" +zinit-message -r -- "{b}{error}0 <running now>{rst}{…}"
return 0 return 0
} # ]]] } # ]]]
# FUNCTION: zi::exists-physically [[[ # FUNCTION: .zinit-exists-physically [[[
# Checks if directory of given plugin exists in PLUGIN_DIR. # Checks if directory of given plugin exists in PLUGIN_DIR.
# #
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) # $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given) # $2 - plugin (only when $1 - i.e. user - given)
zi::exists-physically() { .zinit-exists-physically() {
zi::any-to-user-plugin "$1" "$2" .zinit-any-to-user-plugin "$1" "$2"
if [[ ${reply[-2]} = % ]]; then if [[ ${reply[-2]} = % ]]; then
[[ -d ${reply[-1]} ]] && return 0 || return 1 [[ -d ${reply[-1]} ]] && return 0 || return 1
else else
@ -232,19 +232,19 @@ zi::exists-physically() {
|| return 1 || return 1
fi fi
} # ]]] } # ]]]
# FUNCTION: zi::exists-physically-message [[[ # FUNCTION: .zinit-exists-physically-message [[[
# Checks if directory of given plugin exists in PLUGIN_DIR, and outputs error # Checks if directory of given plugin exists in PLUGIN_DIR, and outputs error
# message if it doesn't. # message if it doesn't.
# #
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) # $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given) # $2 - plugin (only when $1 - i.e. user - given)
zi::exists-physically-message() { .zinit-exists-physically-message() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes builtin setopt extendedglob warncreateglobal typesetsilent noshortloops rcquotes
if ! zi::exists-physically "$1" "$2"; then if ! .zinit-exists-physically "$1" "$2"; then
zi::any-to-user-plugin "$1" "$2" .zinit-any-to-user-plugin "$1" "$2"
if [[ $reply[1] = % ]]; then if [[ $reply[1] = % ]]; then
zi::any-to-pid "$1" "$2" .zinit-any-to-pid "$1" "$2"
local spec1=$REPLY local spec1=$REPLY
if [[ $1 = %* ]]; then if [[ $1 = %* ]]; then
local spec2=%${1#%}${${1#%}:+${2:+/}}$2 local spec2=%${1#%}${${1#%}:+${2:+/}}$2
@ -254,32 +254,32 @@ zi::exists-physically-message() {
else else
integer nospec=1 integer nospec=1
fi fi
zi::any-colorify-as-uspl2 "$1" "$2" .zinit-any-colorify-as-uspl2 "$1" "$2"
+zi::message "{error}No such (plugin or snippet){rst}: $REPLY." +zinit-message "{error}No such (plugin or snippet){rst}: $REPLY."
[[ $nospec -eq 0 && $spec1 != $spec2 ]] \ [[ $nospec -eq 0 && $spec1 != $spec2 ]] \
&& +zi::message "(expands to: {file}${spec2#%}{rst})." && +zinit-message "(expands to: {file}${spec2#%}{rst})."
return 1 return 1
fi fi
return 0 return 0
} # ]]] } # ]]]
# FUNCTION: zi::first [[[ # FUNCTION: .zinit-first [[[
# Finds the main file of plugin. There are multiple file name formats, they are # Finds the main file of plugin. There are multiple file name formats, they are
# ordered in order starting from more correct ones, and matched. # ordered in order starting from more correct ones, and matched.
# zi::load-plugin() has similar code parts and doesn't call zi::first() # .zinit-load-plugin() has similar code parts and doesn't call .zinit-first()
# for performance. Obscure matching is done in zi::find-other-matches, here # for performance. Obscure matching is done in .zinit-find-other-matches, here
# and in zi::load(). Obscure = non-standard main-file naming convention. # and in .zinit-load(). Obscure = non-standard main-file naming convention.
# #
# $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin) # $1 - plugin spec (4 formats: user---plugin, user/plugin, user, plugin)
# $2 - plugin (only when $1 - i.e. user - given) # $2 - plugin (only when $1 - i.e. user - given)
zi::first() { .zinit-first() {
zi::any-to-user-plugin "$1" "$2" .zinit-any-to-user-plugin "$1" "$2"
local user="${reply[-2]}" plugin="${reply[-1]}" local user="${reply[-2]}" plugin="${reply[-1]}"
zi::any-to-pid "$1" "$2" .zinit-any-to-pid "$1" "$2"
zi::get-object-path plugin "$REPLY" .zinit-get-object-path plugin "$REPLY"
integer ret=$? integer ret=$?
local dname="$REPLY" local dname="$REPLY"
(( ret )) && { reply=( "$dname" "" ); return 1; } (( ret )) && { reply=( "$dname" "" ); return 1; }
@ -289,7 +289,7 @@ zi::first() {
if [[ -e "$dname/$plugin.plugin.zsh" ]]; then if [[ -e "$dname/$plugin.plugin.zsh" ]]; then
reply=( "$dname/$plugin.plugin.zsh" ) reply=( "$dname/$plugin.plugin.zsh" )
else else
zi::find-other-matches "$dname" "$plugin" .zinit-find-other-matches "$dname" "$plugin"
fi fi
if [[ "${#reply}" -eq "0" ]]; then if [[ "${#reply}" -eq "0" ]]; then
@ -301,7 +301,7 @@ zi::first() {
reply=( "$dname" "${reply[-${#reply}]}" ) reply=( "$dname" "${reply[-${#reply}]}" )
return 0 return 0
} # ]]] } # ]]]
# FUNCTION: zi::store-ices [[[ # FUNCTION: .zinit-store-ices [[[
# Saves ice mods in given hash onto disk. # Saves ice mods in given hash onto disk.
# #
# $1 - directory where to create or delete files # $1 - directory where to create or delete files
@ -310,7 +310,7 @@ zi::first() {
# $4 - additional keys of hash to store, empty-meaningful ices, space separated # $4 - additional keys of hash to store, empty-meaningful ices, space separated
# $5 URL, if applicable # $5 URL, if applicable
# $6 mode, svn=1, 0=single file # $6 mode, svn=1, 0=single file
zi::store-ices() { .zinit-store-ices() {
local ___pfx="$1" ___ice_var="$2" ___add_ices="$3" ___add_ices2="$4" local ___pfx="$1" ___ice_var="$2" ___add_ices="$3" ___add_ices2="$4"
local url="$5" mode="$6" local url="$5" mode="$6"
@ -353,13 +353,13 @@ zi::store-ices() {
[[ -n "${(P)___key}" ]] && builtin print -r -- "${(P)___key}" >! "$___pfx"/"$___key" [[ -n "${(P)___key}" ]] && builtin print -r -- "${(P)___key}" >! "$___pfx"/"$___key"
done done
} # ]]] } # ]]]
# FUNCTION: zi::two-paths [[[ # FUNCTION: .zinit-two-paths [[[
# Obtains a snippet URL without specification if it is an SVN URL (points to # 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 # directory) or regular URL (points to file), returns 2 possible paths for
# further examination # further examination
# #
# $REPLY - two filepaths # $REPLY - two filepaths
zi::two-paths() { .zinit-two-paths() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace} builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
setopt extendedglob typesetsilent warncreateglobal noshortloops setopt extendedglob typesetsilent warncreateglobal noshortloops
@ -371,16 +371,16 @@ zi::two-paths() {
url1=$url url1=$url
url2=$url url2=$url
zi::get-object-path snippet "$url1" .zinit-get-object-path snippet "$url1"
local_dirA=$reply[-3] dirnameA=$reply[-2] local_dirA=$reply[-3] dirnameA=$reply[-2]
[[ -d "$local_dirA/$dirnameA/.svn" ]] && { [[ -d "$local_dirA/$dirnameA/.svn" ]] && {
svn_dirA=".svn" svn_dirA=".svn"
if { zi::first % "$local_dirA/$dirnameA"; } { if { .zinit-first % "$local_dirA/$dirnameA"; } {
fileB_there=( ${reply[-1]} ) fileB_there=( ${reply[-1]} )
} }
} }
zi::get-object-path snippet "$url2" .zinit-get-object-path snippet "$url2"
local_dirB=$reply[-3] dirnameB=$reply[-2] local_dirB=$reply[-3] dirnameB=$reply[-2]
[[ -z $svn_dirA ]] && fileB_there=( "$local_dirB/$dirnameB"/*~*.(zwc|md|js|html)(.-DOnN[1]) ) [[ -z $svn_dirA ]] && fileB_there=( "$local_dirB/$dirnameB"/*~*.(zwc|md|js|html)(.-DOnN[1]) )
@ -388,4 +388,10 @@ zi::two-paths() {
reply=( "$local_dirA/$dirnameA" "$svn_dirA" "$local_dirB/$dirnameB" "${fileB_there[1]##$local_dirB/$dirnameB/#}" ) reply=( "$local_dirA/$dirnameA" "$svn_dirA" "$local_dirB/$dirnameB" "${fileB_there[1]##$local_dirB/$dirnameB/#}" )
} # ]]] } # ]]]
# vim: set fenc=utf8 ffs=unix foldmarker=[[[,]]] foldmethod=marker ft=zsh list noet sw=2 ts=2 tw=72 : # 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

773
zinit.zsh

File diff suppressed because it is too large Load diff