diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index f9d63f688..3e5532c1c 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -1,47 +1,38 @@ -name: ๐ฎ linting -on: [push, pull_request, workflow_dispatch] +name: Lint + +on: + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + jobs: - build-matrix: + + lint: + name: Lint runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - name: "๐ก Check out repository code" - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: "๐ฌ Set matrix output" - id: set-matrix + - name: install dependencies run: | - MATRIX="$(find . -type d -name 'doc' -prune -o -type f -iname '*.zsh' -print | jq -ncR '{"include": [{"file": inputs}]}')" - echo "MATRIX=${MATRIX}" >&2 - echo "::set-output name=matrix::${MATRIX}" + brew install shellcheck shfmt zsh + pip3 install --user linkify-it-py mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc - lint: - runs-on: ubuntu-latest - needs: build-matrix - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }} + - name: run mdformat + run: find . -name '*.md' -type f -print0 | xargs -0 -n1 -P4 python3 -m mdformat --check --wrap 120 - steps: - - name: "๐ก Check out repository code" - uses: actions/checkout@v3 + - name: run shfmt + run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shfmt -bn -ci -d -i 2 -ln bash -s -sr - - name: "๐ฆ Install dependencies" - run: | - sudo apt install -y zsh + - name: run shellcheck + run: find . -name '*.sh' -type f -print0 | xargs -0 -n1 -P4 shellcheck - - name: "๐ zsh -n ${{ matrix.file }}" - env: - ZSH_FILE: ${{ matrix.file }} - run: | - zsh -n "${ZSH_FILE}" + - name: "run zsh" + run: find . -name '*.zsh' -type f -print0 | xargs -0 -n1 -P4 zsh -n - - name: "๐ zcompile ${{ matrix.file }}" - env: - ZSH_FILE: ${{ matrix.file }} - run: | - zsh -fc "zcompile ${ZSH_FILE}" - rc=$? - ls -al "${ZSH_FILE}.zwc" - exit "$rc" + - name: "run zcompile" + run: find . -name '*.zsh' -type f -exec zsh -fc "zcompile {}" \; diff --git a/README.md b/README.md index 2c573d098..2c921c5a6 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,23 @@
-[![MIT License][mit-badge]][mit-link] -[![zinit version][ver-badge]][ver-link] -[![zunit tests][tests-badge]][tests-link] +[![MIT License][mit-badge]][mit-link] [![zinit version][ver-badge]][ver-link] [![zunit tests][tests-badge]][tests-link] [![Join the chat at https://gitter.im/zdharma-continuum/zinit][gitter-badge]][gitter-link] -> **Note**: [The original author](https://github.com/psprint) of zinit deleted the `zdharma` organization randomly. +> **Note**: [The original author](https://github.com/psprint) of Zinit deleted the `zdharma` organization randomly. > -> This is a reliable fork / place for the continuation of the project. +> This is a reliable fork/place for the continuation of the project. > -> ๐ง For migration instructions please refer [to this wiki entry](https://github.com/zdharma-continuum/zinit/wiki/%F0%9F%9A%9A-Migration-to-zdharma-continuum) +> ๐ง For migration instructions please refer +> [to this wiki entry](https://github.com/zdharma-continuum/zinit/wiki/%F0%9F%9A%9A-Migration-to-zdharma-continuum) + + - + - [News](#news) @@ -66,7 +67,7 @@ - [Supporting](#supporting) - [Getting Help and Community](#getting-help-and-community) - + # News @@ -80,56 +81,45 @@ See [the changelog](doc/CHANGELOG.md). -Zinit is a flexible and fast Zshell plugin manager that will allow you to -install everything from GitHub and other sites. Its characteristics are: +Zinit is a flexible and fast Zshell plugin manager that will allow you to install everything from GitHub and other +sites. Its characteristics are: -1. Zinit is currently the only plugin manager out there that provides Turbo mode - which yields **50-80% faster Zsh startup** (i.e.: the shell will start up to - **5** times faster!). Check out a speed comparison with other popular plugin +1. Zinit is currently the only plugin manager that provides Turbo mode, which yields **50-80% faster Zsh startup** + (i.e., the shell will start up to **5** times faster!). Check out a speed comparison with other popular plugin managers [here](https://github.com/zdharma-continuum/pm-perf-test). -1. The plugin manager gives **reports** from plugin loadings describing what - **aliases**, functions, **bindkeys**, Zle widgets, zstyles, **completions**, - variables, `PATH` and `FPATH` elements a plugin has set up. This allows to - quickly familiarize oneself with a new plugin and provides rich and easy to - digest information which might be helpful on various occasions. - -1. Supported is unloading of plugin and ability to list, (un)install and - **selectively disable**, **enable** plugin's completions. - -1. The plugin manager supports loading Oh My Zsh and Prezto plugins and - libraries, however the implementation isn't framework specific and doesn't - bloat the plugin manager with such code (more on this topic can be found on - the Wiki, in the - [Introduction](https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/#oh_my_zsh_prezto)). - -1. The system does not use `$FPATH`, loading multiple plugins doesn't clutter - `$FPATH` with the same number of entries (e.g. `10`, `15` or more). Code is - immune to `KSH_ARRAYS` and other options typically causing compatibility - problems. - -1. Zinit supports special, dedicated **packages** that offload the user from - providing long and complex commands. See the - [zinit-packages repository](https://github.com/zdharma-continuum/zinit-packages) - for a growing, complete list of Zinit packages and the [Wiki - page](https://zdharma-continuum.github.io/zinit/wiki/Zinit-Packages/) for an article about - the feature. - -1. Also, specialized Zinit extensions โ called **annexes** โ allow to extend the - plugin manager with new commands, URL-preprocessors (used by e.g.: - [zinit-annex-readurl](https://github.com/zdharma-continuum/zinit-annex-readurl) annex), - post-install and post-update hooks and much more. See the - [zdharma-continuum](https://github.com/zdharma-continuum) organization for a growing, - complete list of available Zinit extensions and refer to the [Wiki - article](https://zdharma-continuum.github.io/zinit/wiki/Annexes/) for an introduction on - creating your own annex. +1. The plugin manager gives **reports** from plugin loadings describing what **aliases**, functions, **bindkeys**, Zle + widgets, zstyles, **completions**, variables, `PATH` and `FPATH` elements a plugin has set up. This allows one to + quickly familiarize oneself with a new plugin and provides rich and easy-to-digest information which might be helpful + on various occasions. + +1. Supported is the unloading of plugin and ability to list, (un)install and **selectively disable**, **enable** + plugin's completions. + +1. The plugin manager supports loading plugins and libraries from Oh My Zsh or Prezto. However, the implementation isn't + framework-specific and doesn't bloat the plugin manager with such code (more on this topic can be found on the Wiki, + in the [Introduction](https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/#oh_my_zsh_prezto)). + +1. The system does not use `$FPATH`, loading multiple plugins doesn't clutter `$FPATH` with the same number of entries + (e.g. `10`, `15` or more). Code is immune to `KSH_ARRAYS` and other options typically causing compatibility problems. + +1. Zinit supports special, dedicated **packages** that offload the user from providing long and complex commands. See + the [zinit-packages repository](https://github.com/zdharma-continuum/zinit-packages) for a growing, complete list of + Zinit packages and the [Wiki page](https://zdharma-continuum.github.io/zinit/wiki/Zinit-Packages/) for an article + about the feature. + +1. Also, specialized Zinit extensions โ called **annexes** โ have the ability to extend the plugin manager with new + commands, URL-preprocessors (used by e.g.: + [zinit-annex-readurl](https://github.com/zdharma-continuum/zinit-annex-readurl) annex), post-install and post-update + hooks, and much more. See the [zdharma-continuum](https://github.com/zdharma-continuum) organization for a growing, + complete list of available Zinit extensions and refer to the + [Wiki article](https://zdharma-continuum.github.io/zinit/wiki/Annexes/) for an introduction on creating your annex. # Zinit Wiki -The information in this README is complemented by the [Zinit -Wiki](https://zdharma-continuum.github.io/zinit/wiki/). The README is an introductory overview of -Zinit while the Wiki gives a complete information with examples. Make sure to -read it to get the most out of Zinit. +The information in this README is complemented by the [Zinit Wiki](https://zdharma-continuum.github.io/zinit/wiki/). The +README is an introductory overview of Zinit, while the Wiki gives complete information with examples. Make sure to read +it to get the most out of Zinit. # Quick Start @@ -143,15 +133,18 @@ The easiest way to install Zinit is to execute: sh -c "$(curl -fsSL https://git.io/zinit-install)" ``` -This will install Zinit in `~/.local/share/zinit/zinit.git`. -`.zshrc` will be updated with three lines of code that will be added to the bottom. -The lines will be sourcing `zinit.zsh` and setting up completion for command `zinit`. +This will install Zinit in `~/.local/share/zinit/zinit.git`. `.zshrc` will be updated with three lines of code that will +be added to the bottom. The lines will be sourcing `zinit.zsh` and setting up completion for command `zinit`. -After installing and reloading the shell compile Zinit with `zinit self-update`. +After installing and reloading the shell, compile Zinit via: + +```zsh +zinit self-update +``` ### Manual Installation -To manually install Zinit clone the repo to e.g. `~/.local/share/zinit/zinit.git`: +To manually install Zinit, clone the repo to, e.g. `~/.local/share/zinit/zinit.git`: ```sh ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" @@ -159,7 +152,8 @@ mkdir -p "$(dirname $ZINIT_HOME)" git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" ``` -and source `zinit.zsh` from your `.zshrc` (above [compinit](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization)): +and source `zinit.zsh` from your `.zshrc` (above +[compinit](http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization)): ```sh ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" @@ -168,24 +162,26 @@ source "${ZINIT_HOME}/zinit.zsh" If you place the `source` below `compinit`, then add those two lines after the `source`: -```sh +```zsh autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit ``` -Various paths can be customized, see section [Customizing Paths](#customizing-paths). +Various paths can be customized; see section [Customizing Paths](#customizing-paths). -After installing and reloading the shell compile Zinit with `zinit self-update`. +After installing and reloading the shell, compile Zinit with `zinit self-update`. ## Usage ### Introduction -[Click here to read the introduction to Zinit](https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/). It explains basic usage and some of the more unique features of Zinit such as the Turbo mode. If you're new to Zinit we highly recommend you read it at least once. +[Click here to read the introduction to Zinit](https://zdharma-continuum.github.io/zinit/wiki/INTRODUCTION/). It +explains basic usage and some of the more unique features of Zinit, such as the Turbo mode. If you're new to Zinit, we +recommend you read it at least once. ### Plugins and snippets -Plugins can be loaded using `load` or `light`. +Plugins can be loaded using `load` or `light`. ```zsh zinit load-Some plugins require performing an action each time they're updated. One way you can do -this is by using the `atpull` ice modifier. For example, writing `zinit ice atpull'./configure'` before loading a plugin will execute `./configure` after a successful update. Refer to [Ice Modifiers](#ice-modifiers) for more information. +Some plugins require performing an action each time they're updated. One way you can do this is by using the `atpull` +ice modifier. For example, writing `zinit ice atpull'./configure'` before loading a plugin will execute `./configure` +after a successful update. Refer to [Ice Modifiers](#ice-modifiers) for more information. -The ice modifiers for any plugin or snippet are stored in their directory in a -`._zinit` subdirectory, hence the plugin doesn't have to be loaded to be correctly -updated. There's one other file created there, `.zinit_lstupd` โ it holds the log of -the new commits pulled-in in the last update. +The ice modifiers for any plugin or snippet are stored in their directory in a `._zinit` subdirectory, hence the plugin +doesn't have to be loaded to be correctly updated. There's one other file created there, `.zinit_lstupd` โ it holds the +log of the new commits pulled-in in the last update. # Completions ## Calling `compinit` Without Turbo Mode -With no Turbo mode in use, compinit can be called normally, i.e.: as `autoload compinit; compinit`. This should be done after loading of all plugins and before possibly calling -`zinit cdreplay`. +With no Turbo mode in use, compinit can be called normally, i.e.: as `autoload compinit; compinit`. This should be done +after loading of all plugins and before possibly calling `zinit cdreplay`. -The `cdreplay` subcommand is provided to re-play all catched `compdef` calls. The -`compdef` calls are used to define a completion for a command. For example, `compdef _git git` defines that the `git` command should be completed by a `_git` function. +The `cdreplay` subcommand is provided to re-play all catched `compdef` calls. The `compdef` calls are used to define a +completion for a command. For example, `compdef _git git` defines that the `git` command should be completed by a `_git` +function. -The `compdef` function is provided by `compinit` call. As it should be called later, -after loading all of the plugins, Zinit provides its own `compdef` function that -catches (i.e.: records in an array) the arguments of the call, so that the loaded -plugins can freely call `compdef`. Then, the `cdreplay` (*compdef-replay*) can be used, -after `compinit` will be called (and the original `compdef` function will become -available), to execute all detected `compdef` calls. To summarize: +The `compdef` function is provided by `compinit` call. As it should be called later, after loading all of the plugins, +Zinit provides its own `compdef` function that catches (i.e.: records in an array) the arguments of the call, so that +the loaded plugins can freely call `compdef`. Then, the `cdreplay` (*compdef-replay*) can be used, after `compinit` will +be called (and the original `compdef` function will become available), to execute all detected `compdef` calls. To +summarize: ```zsh ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" @@ -939,24 +938,20 @@ zinit cdreplay -q # -q is for quiet; actually run all the `compdef's saved bef # use with `zinit cdreplay') ``` -This allows to call compinit once. -Performance gains are huge, example shell startup time with double `compinit`: **0.980** sec, with -`cdreplay` and single `compinit`: **0.156** sec. +This allows to call compinit once. Performance gains are huge, example shell startup time with double `compinit`: +**0.980** sec, with `cdreplay` and single `compinit`: **0.156** sec. ## Calling `compinit` With Turbo Mode -If you load completions using `wait''` Turbo mode then you can add -`atinit'zicompinit'` to syntax-highlighting plugin (which should be the last -one loaded, as their (2 projects, [z-sy-h](https://github.com/zsh-users/zsh-syntax-highlighting) & -[f-sy-h](https://github.com/zdharma-continuum/fast-syntax-highlighting)) -documentation state), or `atload'zicompinit'` to last -completion-related plugin. `zicompinit` is a function that just runs `autoload -compinit; compinit`, created for convenience. There's also `zicdreplay` which -will replay any caught compdefs so you can also do: `atinit'zicompinit; -zicdreplay'`, etc. Basically, the whole topic is the same as normal `compinit` call, -but it is done in `atinit` or `atload` hook of the last related plugin with use of the -helper functions (`zicompinit`,`zicdreplay` & `zicdclear` โ see below for explanation -of the last one). To summarize: +If you load completions using `wait''` Turbo mode then you can add `atinit'zicompinit'` to syntax-highlighting plugin +(which should be the last one loaded, as their (2 projects, +[z-sy-h](https://github.com/zsh-users/zsh-syntax-highlighting) & +[f-sy-h](https://github.com/zdharma-continuum/fast-syntax-highlighting)) documentation state), or `atload'zicompinit'` +to last completion-related plugin. `zicompinit` is a function that just runs `autoload compinit; compinit`, created for +convenience. There's also `zicdreplay` which will replay any caught compdefs so you can also do: +`atinit'zicompinit; zicdreplay'`, etc. Basically, the whole topic is the same as normal `compinit` call, but it is done +in `atinit` or `atload` hook of the last related plugin with use of the helper functions (`zicompinit`,`zicdreplay` & +`zicdclear` โ see below for explanation of the last one). To summarize: ```zsh ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share/zinit}" @@ -974,9 +969,8 @@ zinit wait lucid atload"zicompinit; zicdreplay" blockf for \ ## Ignoring Compdefs -If you want to ignore compdefs provided by some plugins or snippets, place their load commands -before commands loading other plugins or snippets, and issue `zinit cdclear` (or -`zicdclear`, designed to be used in hooks like `atload''`): +If you want to ignore compdefs provided by some plugins or snippets, place their load commands before commands loading +other plugins or snippets, and issue `zinit cdclear` (or `zicdclear`, designed to be used in hooks like `atload''`): ```zsh ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" @@ -995,16 +989,14 @@ zinit cdreplay -q # <- execute compdefs provided by rest of plugins zinit cdlist # look at gathered compdefs ``` -The `cdreplay` is important if you use plugins like -`OMZP::kubectl` or `asdf-vm/asdf`, because these plugins call +The `cdreplay` is important if you use plugins like `OMZP::kubectl` or `asdf-vm/asdf`, because these plugins call `compdef`. ## Disabling System-Wide `compinit` Call (Ubuntu) -On Ubuntu users might get surprised that e.g. their completions work while they didn't -call `compinit` in their `.zshrc`. That's because the function is being called in -`/etc/zshrc`. To disable this call โ what is needed to avoid the slowdown and if user -loads any completion-equipped plugins, i.e. almost on 100% โ add the following lines to +On Ubuntu users might get surprised that e.g. their completions work while they didn't call `compinit` in their +`.zshrc`. That's because the function is being called in `/etc/zshrc`. To disable this call โ what is needed to avoid +the slowdown and if user loads any completion-equipped plugins, i.e. almost on 100% โ add the following lines to `~/.zshenv`: ```zsh @@ -1020,10 +1012,9 @@ The module is now hosted [in its own repository](https://github.com/zdharma-cont ## Customizing Paths -Following variables can be set to custom values, before sourcing Zinit. The -previous global variables like `$ZPLG_HOME` have been removed to not pollute -the namespace โย there's single `$ZINIT` hash instead of `8` string -variables. Please update your dotfiles. +Following variables can be set to custom values, before sourcing Zinit. The previous global variables like `$ZPLG_HOME` +have been removed to not pollute the namespace โ there's single `$ZINIT` hash instead of `8` string variables. Please +update your dotfiles. ```zsh declare -A ZINIT # initial Zinit's hash definition, if configuring before loading Zinit, and then: @@ -1031,9 +1022,9 @@ declare -A ZINIT # initial Zinit's hash definition, if configuring before loadi | Hash Field | Description | | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ZINIT\[BIN_DIR\] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | -| ZINIT\[HOME_DIR\] | Where Zinit should create all working directories, e.g.: "~/.local/share/zinit" | -| ZINIT\[MAN_DIR\] | Directory where plugins can store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not necessarily be used by `man` (See #8). Default: `$ZPFX/man` | +| ZINIT\[BIN_DIR\] | Where Zinit code resides, e.g.: "~/.local/share/zinit/zinit.git" | +| ZINIT\[HOME_DIR\] | Where Zinit should create all working directories, e.g.: "~/.local/share/zinit" | +| ZINIT\[MAN_DIR\] | Directory where plugins can store their manpages (`atclone"cp -vf myplugin.1 $ZINIT[MAN_DIR]/man1"`). If overridden, this directory will not necessarily be used by `man` (See #8). Default: `$ZPFX/man` | | ZINIT\[PLUGINS_DIR\] | Override single working directory โ for plugins, e.g. "/opt/zsh/zinit/plugins" | | ZINIT\[COMPLETIONS_DIR\] | As above, but for completion files, e.g. "/opt/zsh/zinit/root_completions" | | ZINIT\[SNIPPETS_DIR\] | As above, but for snippets | @@ -1042,31 +1033,26 @@ declare -A ZINIT # initial Zinit's hash definition, if configuring before loadi | ZINIT\[MUTE_WARNINGS\] | If set to `1`, then mutes some of the Zinit warnings, specifically the `plugin already registered` warning | | ZINIT\[OPTIMIZE_OUT_DISK_ACCESSES\] | If set to `1`, then Zinit will skip checking if a Turbo-loaded object exists on the disk. By default Zinit skips Turbo for non-existing objects (plugins or snippets) to install them before the first prompt โ without any delays, during the normal processing of `zshrc`. This option can give a performance gain of about 10 ms out of 150 ms (i.e.: Zsh will start up in 140 ms instead of 150 ms). | -There is also `$ZPFX`, set by default to `~/.local/share/zinit/polaris` โ a directory -where software with `Makefile`, etc. can be pointed to, by e.g. `atclone'./configure --prefix=$ZPFX'`. +There is also `$ZPFX`, set by default to `~/.local/share/zinit/polaris` โ a directory where software with `Makefile`, +etc. can be pointed to, by e.g. `atclone'./configure --prefix=$ZPFX'`. ## Non-GitHub (Local) Plugins -Use `create` subcommand with user name `_local` (the default) to create plugin's -skeleton in `$ZINIT[PLUGINS_DIR]`. It will be not connected with GitHub repository -(because of user name being `_local`). To enter the plugin's directory use `cd` command -with just plugin's name (without `_local`, it's optional). +Use `create` subcommand with user name `_local` (the default) to create plugin's skeleton in `$ZINIT[PLUGINS_DIR]`. It +will be not connected with GitHub repository (because of user name being `_local`). To enter the plugin's directory use +`cd` command with just plugin's name (without `_local`, it's optional). -If user name will not be `_local`, then Zinit will create repository also on GitHub -and setup correct repository origin. +If user name will not be `_local`, then Zinit will create repository also on GitHub and setup correct repository origin. ## Extending Git -There are several projects that provide git extensions. Installing them with -Zinit has many benefits: +There are several projects that provide git extensions. Installing them with Zinit has many benefits: - all files are under `$HOME` โ no administrator rights needed, -- declarative setup (like Chef or Puppet) โ copying `.zshrc` to different account - brings also git-related setup, +- declarative setup (like Chef or Puppet) โ copying `.zshrc` to different account brings also git-related setup, - easy update by e.g. `zinit update --all`. -Below is a configuration that adds multiple git extensions, loaded in Turbo mode, -1 second after prompt, with use of the +Below is a configuration that adds multiple git extensions, loaded in Turbo mode, 1 second after prompt, with use of the [Bin-Gem-Node](https://github.com/zdharma-continuum/zinit-annex-bin-gem-node) annex: ```zsh @@ -1089,9 +1075,9 @@ Target directory for installed files is `$ZPFX` (`~/.local/share/zinit/polaris` # Supporting -Zinit is a personal, free-time project with no funding and a huge [feature request -backlog](https://github.com/zdharma-continuum/zinit/issues). If you love it, consider supporting its -development via GitHub Sponsors [pending]. Any help counts! +Zinit is a personal, free-time project with no funding and a huge +[feature request backlog](https://github.com/zdharma-continuum/zinit/issues). If you love it, consider supporting its +development via GitHub Sponsors \[pending\]. Any help counts! # Getting Help and Community @@ -1099,15 +1085,16 @@ Do you need help or wish to get in touch with other Zinit users? - [Open a discussion](https://github.com/zdharma-continuum/zinit/discussions). -- Or via reach out via Gitter [![Join the chat at https://gitter.im/zdharma-continuum/community][gitter-badge]][gitter-link] +- Or via reach out via Gitter + [![Join the chat at https://gitter.im/zdharma-continuum/community][gitter-badge]][gitter-link] + + [gitter-badge]: https://badges.gitter.im/zdharma-continuum/zinit.svg [gitter-link]: https://gitter.im/zdharma-continuum/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-link]: ./LICENSE -[ver-badge]: https://img.shields.io/github/tag/zdharma-continuum/zinit.svg -[ver-link]: https://github.com/zdharma-continuum/zinit/releases [tests-badge]: https://github.com/zdharma-continuum/zinit/actions/workflows/tests.yaml/badge.svg [tests-link]: https://github.com/zdharma-continuum/zinit/actions/workflows/tests.yaml - - +[ver-badge]: https://img.shields.io/github/tag/zdharma-continuum/zinit.svg +[ver-link]: https://github.com/zdharma-continuum/zinit/releases diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 5d8ca2ef7..fea1ff7ec 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,18 +1,20 @@ + -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [Changelog](#changelog) # 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: +- 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' \ @@ -21,28 +23,28 @@ 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). +- 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: +For installing from a specific branch you can: + 1. Leverage the `ver` ice (eg: `ver"my-branch`) -2. Override zinit's default branch with `ZINIT[PACKAGES_BRANCH]=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 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: +- 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]} @@ -52,48 +54,44 @@ 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 +- 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. + [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 +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) +- 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). + - 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: +- 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` @@ -108,64 +106,62 @@ https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.s 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. +- 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 -* 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 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?). + - 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 -* 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+) + - 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, + - 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: + - 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 @@ -177,19 +173,18 @@ startup. Please note that these directories will not necessarily be part of your ``` 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 โฆ`. + ([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. -* 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 -* 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: + - 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 @@ -197,11 +192,11 @@ startup. Please note that these directories will not necessarily be part of your 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.: +- 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 \ @@ -211,13 +206,14 @@ startup. Please note that these directories will not necessarily be part of your ``` 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`. + [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. - See the [Zinit Wiki](https://zdharma-continuum.github.io/zinit/wiki/For-Syntax/) for more - information on the for-syntax. +- 06-11-2019 -* 06-11-2019 - A new syntax, called for-syntax. Example: ```zsh @@ -243,19 +239,19 @@ startup. Please note that these directories will not necessarily be part of your /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/). + 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 -* 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. + - 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: +- 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 @@ -265,29 +261,33 @@ startup. Please note that these directories will not necessarily be part of your 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. +- 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 -* 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. + - 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. +- 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. + - 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 -* 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.: + - 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" @@ -296,21 +296,22 @@ startup. Please note that these directories will not necessarily be part of your 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). +- 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. +- 13-09-2019 -* 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.: + - 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" \ @@ -319,83 +320,78 @@ startup. Please note that these directories will not necessarily be part of your 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. + 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) -* 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/)): + 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-man](https://github.com/zplugin/zinit-annex-man) + - [zinit-annex-test](https://github.com/zplugin/zinit-annex-test) - 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)). + Runs tests (if detected `test' target in a `Makefile`or any`\*.zunit\` files) on plugin installation and non-empty + update. - - [zinit-annex-test](https://github.com/zplugin/zinit-annex-test) + - [zinit-annex-patch-dl](https://github.com/zplugin/zinit-annex-patch-dl) - Runs tests (if detected `test' target in a `Makefile` or any `*.zunit` files) - on plugin installation and non-empty update. + Allows easy download and applying of patches, to e.g. aid building a binary program equipped in the plugin. - - [zinit-annex-patch-dl](https://github.com/zplugin/zinit-annex-patch-dl) + - 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. - Allows easy download and applying of patches, to e.g. aid building a binary - program equipped in the plugin. +- 09-08-2019 - - 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. + - 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. -* 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 -* 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: + - `--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 \ @@ -407,15 +403,16 @@ startup. Please note that these directories will not necessarily be part of your % 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. +- 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.: + - 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" @@ -435,9 +432,10 @@ startup. Please note that these directories will not necessarily be part of your 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: +- 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 @@ -450,38 +448,40 @@ startup. Please note that these directories will not necessarily be part of your 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: + 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 @@ -491,27 +491,32 @@ startup. Please note that these directories will not necessarily be part of your ![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: +- 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 +- 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) + ![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. +- 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: +- 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 @@ -521,50 +526,56 @@ startup. Please note that these directories will not necessarily be part of your 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: + +- 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 +- 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 +- 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 +- 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 +- 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 + `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: + [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 @@ -574,38 +585,44 @@ startup. Please note that these directories will not necessarily be part of your % 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)). + 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 -* 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 :) + - 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 -* 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. + - 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`). -* 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 -* 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 + - 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 +- 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: +- 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 @@ -617,31 +634,34 @@ startup. Please note that these directories will not necessarily be part of your 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. + - 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 -* 06-11-2017 - - The subcommand `clist` 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. + - The subcommand `clist` 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 +- 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: +- 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)): + - 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 @@ -660,7 +680,8 @@ startup. Please note that these directories will not necessarily be part of your - Fixed a bug with `cURL` usage (snippets) for downloading, it will now be properly used -* 13-10-2017 +- 13-10-2017 + - Snippets can use "**OMZ::**" prefix to easily point to `Oh-My-Zsh` plugins and libraries, e.g.: ```SystemVerilog @@ -668,10 +689,11 @@ startup. Please note that these directories will not necessarily be part of your zplugin snippet OMZ::plugins/git/git.plugin.zsh ``` -* 12-10-2017 +- 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: + + - The `times` subcommand now includes statistics on snippets. Also, entries are displayed in order of loading: ```zsh % zplugin times @@ -683,10 +705,12 @@ startup. Please note that these directories will not necessarily be part of your 0.003 sec - zsh-users/zsh-autosuggestions ``` -* 24-09-2017 +- 24-09-2017 + - **[Code documentation](zsdoc)** for contributors and interested people. -* 13-06-2017 +- 13-06-2017 + - Plugins can now be absolute paths: ```SystemVerilog @@ -697,7 +721,8 @@ startup. Please note that these directories will not necessarily be part of your Completions are not automatically installed, but user can run `zplg creinstall %HOME/github/{directory}`, etc. -* 23-05-2017 +- 23-05-2017 + - New `ice` modifier: `if`, to which you can provide a conditional expression: ```SystemVerilog diff --git a/doc/HACKING.md b/doc/HACKING.md index bb5a0d1e1..7777398b4 100644 --- a/doc/HACKING.md +++ b/doc/HACKING.md @@ -3,7 +3,7 @@ ## README: Update the table of content 1. Install [doctoc](https://github.com/thlorenz/doctoc) -2. To update the TOC run the following command: +1. To update the TOC run the following command: ```zsh doctoc --github README.md @@ -11,26 +11,24 @@ doctoc --github README.md ## Update asciidoc and/or zshelldoc -1. Make sure you have [docker](https://www.docker.com/) or -[podman](https://podman.io/) installed. -2. From the root of the repo, run: +1. 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: +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` +1. [zshelldoc (zsd)](https://github.com/zdharma-continuum/zshelldoc) +1. [asciidoc](https://asciidoc.org/) +1. `make doc` ## Generate the manpage (doc/zinit.1) 1. Install [pandoc](https://pandoc.org/) -2. From the root of the repo run: +1. From the root of the repo run: ```zsh pandoc --standalone --to man README.md -o doc/zinit.1 @@ -39,17 +37,18 @@ 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 you can 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 +2. Do your modifications and push your changes +1. Keep an eye on [the CI logs](https://github.com/zdharma-continuum/zinit/actions/workflows/gh-pages.yaml) +1. If all went well you can 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 @@ -115,13 +114,12 @@ 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! - +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: @@ -130,5 +128,6 @@ To get the list in a quick-and-dirty fashion you issue: zinit --help | tail -1 ``` -See [zinit-autoload.zsh](https://github.com/zdharma-continuum/zinit/blob/2feb41cf70d2f782386bbaa6fda691e3bdc7f1ac/zinit-autoload.zsh#L3445-L3447) +See +[zinit-autoload.zsh](https://github.com/zdharma-continuum/zinit/blob/2feb41cf70d2f782386bbaa6fda691e3bdc7f1ac/zinit-autoload.zsh#L3445-L3447) for implementation details. diff --git a/doc/zsdoc/README.md b/doc/zsdoc/README.md index d8b3533cb..f34001183 100644 --- a/doc/zsdoc/README.md +++ b/doc/zsdoc/README.md @@ -1,18 +1,22 @@ # 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. +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/)) + +- [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). +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). diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh index 433fdc03c..36db2bacf 100755 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash build() { - cd "$(cd "$(dirname "$0")" >/dev/null 2>&1; pwd -P)" || exit 9 + cd "$( + cd "$(dirname "$0")" > /dev/null 2>&1 + pwd -P + )" || exit 9 local image_name="${1:-zinit}" local tag="${2:-latest}" @@ -10,15 +13,14 @@ build() { local dockerfile="../docker/Dockerfile" - if [[ -n "$zsh_version" ]] - then + 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 "$@") + [[ -n $NO_CACHE ]] && args+=(--no-cache "$@") if docker build \ --build-arg "PUSERNAME=$(id -u -n)" \ @@ -29,8 +31,7 @@ build() { --file "$dockerfile" \ --tag "${image_name}:${tag}" \ "${args[@]}" \ - "$(realpath ..)" - then + "$(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" @@ -42,25 +43,23 @@ build() { fi } -if [[ "${BASH_SOURCE[0]}" == "${0}" ]] -then +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 + while [[ -n $* ]]; do case "$1" in - --image|-i) + --image | -i) CONTAINER_IMAGE="$2" shift 2 ;; - --no-cache|-N) + --no-cache | -N) NO_CACHE=1 shift ;; - --zsh-version|-zv|--zv) + --zsh-version | -zv | --zv) BUILD_ZSH_VERSION="${2}" shift 2 ;; diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index dff7b830c..eab1c5c7b 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -4,14 +4,12 @@ parent_process() { local ppid pcmd ppid="$(ps -o ppid= -p "$$" | awk '{ print $1 }')" - if [[ -z "$ppid" ]] - then + if [[ -z $ppid ]]; then echo "Failed to determine parent process" >&2 return 1 fi - if pcmd="$(ps -o cmd= -p "$ppid")" - then + if pcmd="$(ps -o cmd= -p "$ppid")"; then echo "$pcmd" return fi @@ -20,13 +18,11 @@ parent_process() { } running_interactively() { - if [[ -n "$CI" ]] - then + if [[ -n $CI ]]; then return 1 fi - if ! [[ -t 1 ]] - then + if ! [[ -t 1 ]]; then # return false if running non-interactively, unless run with zunit parent_process | grep -q zunit fi @@ -35,8 +31,7 @@ running_interactively() { create_init_config_file() { local tempfile - if [[ -z "$*" ]] - then + if [[ -z $* ]]; then return 1 fi @@ -57,23 +52,19 @@ run() { local cruntime=docker local sudo_cmd - if [[ -z "$CI" ]] && command -v podman >/dev/null 2>&1 - then + 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 + if running_interactively; then args+=(--tty=true --interactive=true) fi - if [[ -n "$init_config" ]] - then - if [[ -r "$init_config" ]] - then + 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 @@ -81,34 +72,27 @@ run() { fi fi - if [[ -n "$CONTAINER_WORKDIR" ]] - then + if [[ -n $CONTAINER_WORKDIR ]]; then args+=(--workdir "$CONTAINER_WORKDIR") fi # Inherit TERM - if [[ -n "$TERM" ]] - then + if [[ -n $TERM ]]; then args+=(--env "TERM=${TERM}") fi - if [[ -n "${CONTAINER_ENV[*]}" ]] - then + if [[ -n ${CONTAINER_ENV[*]} ]]; then local e - for e in "${CONTAINER_ENV[@]}" - do + for e in "${CONTAINER_ENV[@]}"; do args+=(--env "${e}") done fi - if [[ -n "${CONTAINER_VOLUMES[*]}" ]] - then + if [[ -n ${CONTAINER_VOLUMES[*]} ]]; then local vol - for vol in "${CONTAINER_VOLUMES[@]}" - do + for vol in "${CONTAINER_VOLUMES[@]}"; do # shellcheck disable=2076 - if [[ ! " ${args[*]} " =~ " --volume ${vol} " ]] - then + if [[ ! " ${args[*]} " =~ " --volume ${vol} " ]]; then args+=(--volume "${vol}") fi done @@ -116,15 +100,13 @@ run() { local -a cmd=("$@") - if [[ -n "$WRAP_CMD" ]] - then + if [[ -n $WRAP_CMD ]]; then local zsh_opts="ilsc" - [[ -n "$ZSH_DEBUG" ]] && zsh_opts="x${zsh_opts}" + [[ -n $ZSH_DEBUG ]] && zsh_opts="x${zsh_opts}" cmd=(zsh "-${zsh_opts}" "${cmd[*]}") fi - if [[ -n "$DEBUG" ]] - then + if [[ -n $DEBUG ]]; then { # The @Q below is necessary to keep the quotes intact # https://stackoverflow.com/a/12985353/1872036 @@ -136,8 +118,7 @@ run() { ${sudo_cmd} "${cruntime}" run "${args[@]}" "${image}:${tag}" "${cmd[@]}" } -if [[ "${BASH_SOURCE[0]}" == "${0}" ]] -then +if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then CONTAINER_ENV=() CONTAINER_IMAGE="${CONTAINER_IMAGE:-ghcr.io/zdharma-continuum/zinit}" CONTAINER_TAG="${CONTAINER_TAG:-latest}" @@ -149,32 +130,30 @@ then WRAP_CMD="${WRAP_CMD:-}" ZSH_DEBUG="${ZSH_DEBUG:-}" - while [[ -n "$*" ]] - do + while [[ -n $* ]]; do case "$1" in # Fetch init config from clipboard (Linux only) - --xsel|-b) + --xsel | -b) INIT_CONFIG_VAL="$(xsel -b)" shift ;; - -c|--config|--init-config|--init) + -c | --config | --init-config | --init) INIT_CONFIG_VAL="$2" shift 2 ;; - -f|--config-file|--init-config-file|--file) - if ! [[ -r "$2" ]] - then + -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) + -d | --debug) DEBUG=1 shift ;; - -D|--dev|--devel) + -D | --dev | --devel) DEVEL=1 shift ;; @@ -182,36 +161,36 @@ then PRESET=docs shift ;; - -i|--image) + -i | --image) CONTAINER_IMAGE="$2" shift 2 ;; - -t|--tag) + -t | --tag) CONTAINER_TAG="$2" shift 2 ;; # Additional container env vars - -e|--env|--environment) + -e | --env | --environment) CONTAINER_ENV+=("$2") shift 2 ;; # Additional container volumes - -v|--volume) + -v | --volume) CONTAINER_VOLUMES+=("$2") shift 2 ;; # Whether to wrap the command in zsh -silc - -w|--wrap) + -w | --wrap) WRAP_CMD=1 shift ;; - --tests|--zunit|-z) + --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 | -x | -Z) ZSH_DEBUG=1 shift ;; @@ -221,7 +200,10 @@ then esac done - GIT_ROOT_DIR="$(cd "$(dirname "$0")/.." >/dev/null 2>&1; pwd -P)" || exit 9 + GIT_ROOT_DIR="$( + cd "$(dirname "$0")/.." > /dev/null 2>&1 + pwd -P + )" || exit 9 CMD=("$@") case "$PRESET" in @@ -259,13 +241,11 @@ then ;; esac - if INIT_CONFIG="$(create_init_config_file "$INIT_CONFIG_VAL")" - then + if INIT_CONFIG="$(create_init_config_file "$INIT_CONFIG_VAL")"; then trap 'rm -vf $INIT_CONFIG' EXIT INT fi - if [[ -n "$DEVEL" ]] - then + if [[ -n $DEVEL ]]; then # Mount root of the repo to /src CONTAINER_VOLUMES+=( "${GIT_ROOT_DIR}:/src" diff --git a/scripts/install.sh b/scripts/install.sh index dbf087fb3..cac7bd477 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -27,8 +27,7 @@ echo_fancy() { # 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 + 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}" @@ -61,13 +60,13 @@ echo_error() { check_dependencies() { zsh_min_version=5.5 if ! zsh -sfc \ - 'autoload is-at-least; + '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." + "It'll still work, but be warned." fi - if ! command -v git >/dev/null 2>&1; then + if ! command -v git > /dev/null 2>&1; then echo_error "${COLOR_BOLD_GREEN}git${COLOR_RESET} is not installed" exit 1 fi @@ -77,8 +76,8 @@ check_dependencies() { show_environment() { echo_info "About to setup zinit from $ZINIT_REPO" \ - "(branch: $ZINIT_BRANCH - commit: ${ZINIT_COMMIT:-N/A})" \ - "to ${ZINIT_INSTALL_DIR}" + "(branch: $ZINIT_BRANCH - commit: ${ZINIT_COMMIT:-N/A})" \ + "to ${ZINIT_INSTALL_DIR}" } create_zinit_home() { @@ -106,16 +105,15 @@ download_git_output_processor() { 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 + if command -v curl > /dev/null 2>&1; then curl -fsSL -o "$script_path" "$url" - elif command -v wget >/dev/null 2>&1; then + 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 + if [ "$?" -eq 0 ]; then + chmod a+x "$script_path" 2> /dev/null echo_success 'Download finished!' else echo_warning "Download failed." @@ -132,13 +130,12 @@ zinit_checkout_ref() { ref="${ZINIT_BRANCH}" git_obj_type="branch" - if [ -n "$ZINIT_COMMIT" ] - then + if [ -n "$ZINIT_COMMIT" ]; then ref="$ZINIT_COMMIT" git_obj_type="commit" fi - if zinit_git_exec checkout "$ref" >/dev/null 2>&1; then + 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" @@ -148,7 +145,7 @@ zinit_checkout_ref() { } zinit_current_version() { - zinit_git_exec describe --tags 2>/dev/null + zinit_git_exec describe --tags 2> /dev/null } zinit_update() { @@ -158,11 +155,11 @@ zinit_update() { } echo_info "Updating ${COLOR_BOLD_CYAN}zinit${COLOR_RESET} in" \ - "in ${COLOR_BOLD_MAGENTA}${ZINIT_INSTALL_DIR}" + "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 + } > /dev/null 2>&1 # fetch our branch (to ensure the target commit exists locally) zinit_git_exec fetch origin "$ZINIT_BRANCH" @@ -180,20 +177,20 @@ zinit_install() { } echo_info "Installing ${COLOR_BOLD_CYAN}zinit${COLOR_RESET} to " \ - "${COLOR_BOLD_MAGENTA}${ZINIT_INSTALL_DIR}" + "${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; + "${ZINIT_TMPDIR}/git-process-output.zsh" || cat } - } 2>/dev/null + } 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}" + "${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}" @@ -203,7 +200,7 @@ zinit_install() { # Modify .zshrc edit_zshrc() { rc_update=1 - if grep -E '(zinit|zplugin)\.zsh' "${ZSHRC}" >/dev/null 2>&1; then + 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 @@ -211,7 +208,7 @@ edit_zshrc() { if [ $rc_update -eq 1 ]; then echo_info "Updating ${ZSHRC} (10 lines of code, at the bottom)" zinit_home_escaped="$(echo "${ZINIT_HOME}" | sed "s|$HOME|\$HOME|")" - command cat <<-EOF >> "$ZSHRC" + command cat <<- EOF >> "$ZSHRC" ### Added by Zinit's installer if [[ ! -f ${zinit_home_escaped}/${ZINIT_REPO_DIR_NAME}/zinit.zsh ]]; then @@ -233,7 +230,7 @@ EOF query_for_annexes() { zshrc_annex_file="$(mktemp)" - command cat <<-EOF >>"$zshrc_annex_file" + command cat <<- EOF >> "$zshrc_annex_file" # Load a few important annexes, without Turbo # (this is currently required for annexes) @@ -248,14 +245,13 @@ EOF # 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 + 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:" + "- 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: " @@ -271,15 +267,14 @@ EOF echo_warning "Skipped the annexes." fi - command cat <<-EOF >> "$ZSHRC" + command cat <<- EOF >> "$ZSHRC" ### End of Zinit's installer chunk EOF unset reply zshrc_annex_file } - display_tutorial() { - command cat <<-EOF + command cat <<- EOF ๐ป ${COLOR_BOLD_WHITE_ON_BLACK}Welcome!${COLOR_RESET} @@ -301,7 +296,7 @@ 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_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}} @@ -320,14 +315,12 @@ else zinit_install fi -if [ -z "$NO_EDIT" ] -then +if [ -z "$NO_EDIT" ]; then edit_zshrc [ -z "$ZINIT_UPDATE" ] && query_for_annexes fi -if [ -z "$NO_TUTORIAL" ] -then +if [ -z "$NO_TUTORIAL" ]; then display_tutorial fi diff --git a/scripts/zunit-tests.sh b/scripts/zunit-tests.sh index ab6f2ee30..caa5d3635 100755 --- a/scripts/zunit-tests.sh +++ b/scripts/zunit-tests.sh @@ -1,12 +1,14 @@ #!/usr/bin/env bash run_tests() { - cd "$(cd "$(dirname "$0")" >/dev/null 2>&1; pwd -P)/.." || exit 9 + cd "$( + cd "$(dirname "$0")" > /dev/null 2>&1 + pwd -P + )/.." || exit 9 zunit run --verbose "$@" } -if [[ "${BASH_SOURCE[0]}" == "${0}" ]] -then +if [[ ${BASH_SOURCE[0]} == "${0}" ]]; then run_tests "$@" fi