pax_global_header00006660000000000000000000000064146463105160014520gustar00rootroot0000000000000052 comment=d7f8de1ae5c19c935066226c87acd529f2209980 antidote-1.9.7/000077500000000000000000000000001464631051600133455ustar00rootroot00000000000000antidote-1.9.7/.bumpversion.cfg000066400000000000000000000006041464631051600164550ustar00rootroot00000000000000[bumpversion] current_version = 1.9.7 parse = v?(?P\d+)\.(?P\d+)\.(?P\d+) serialize = {major}.{minor}.{revision} [bumpversion:file:functions/__antidote_version] [bumpversion:file:tests/README.md] [bumpversion:file:tests/test_antidote.md] [bumpversion:file:tests/test_antidote_core.md] [bumpversion:file:tests/test_cmd_update.md] [bumpversion:file:README.md] antidote-1.9.7/.editorconfig000066400000000000000000000004121464631051600160170ustar00rootroot00000000000000root = true [*] charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space indent_size = 2 [*.crlf.*] end_of_line = crlf [*.md] trim_trailing_whitespace = false [makefile] indent_style = tab indent_size = 4 antidote-1.9.7/.github/000077500000000000000000000000001464631051600147055ustar00rootroot00000000000000antidote-1.9.7/.github/CODE_OF_CONDUCT.md000066400000000000000000000064531464631051600175140ustar00rootroot00000000000000 # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at getantidote@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq antidote-1.9.7/.github/workflows/000077500000000000000000000000001464631051600167425ustar00rootroot00000000000000antidote-1.9.7/.github/workflows/test.yml000066400000000000000000000007701464631051600204500ustar00rootroot00000000000000name: test on: push: pull_request: workflow_dispatch: jobs: test: strategy: matrix: os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: actions/checkout@v3 with: repository: "aureliojargas/clitest" path: bin/clitest - run: sudo apt install zsh if: ${{ runner.os == 'Linux' }} - run: PATH=$GITHUB_WORKSPACE/bin/clitest:$PATH make test shell: zsh {0} antidote-1.9.7/.gitignore000066400000000000000000000001721464631051600153350ustar00rootroot00000000000000~* *.zwc *.zwc.old .cache/ !/tests/**/.cache/ .tmp/ .plugins/ .todo/ sandbox/ *.old **/realzdotdir/zsh_plugins.zsh foo*.* antidote-1.9.7/LICENSE000066400000000000000000000021431464631051600143520ustar00rootroot00000000000000MIT License Copyright (c) 2015-2017 Carlos Alexandro Becker Copyright (c) 2021-2024 Matt McElheny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. antidote-1.9.7/README.md000066400000000000000000000126701464631051600146320ustar00rootroot00000000000000# antidote [![MIT License](https://img.shields.io/badge/license-MIT-007EC7.svg)](/LICENSE) ![version](https://img.shields.io/badge/version-v1.9.7-df5e88) GetAntidote Logo > [Get the cure][getantidote] [Antidote][getantidote] is a feature-complete Zsh implementation of the legacy [Antibody][antibody] plugin manager, which in turn was derived from [Antigen][antigen]. Antidote not only aims to provide continuity for those legacy plugin managers, but also to delight new users with high-performance, easy-to-use Zsh plugin management. ## NOTICE **The planned upcoming 2.0 release will stop defaulting to compatibility with antibody.** If maintaining compatibility with antibody is important to you, you can ensure that your config remains compatible by add the following `zstyle` to your config **now**, before the 2.0 release goes live: ```zsh zstyle ':antidote:compatibility-mode' 'antibody' 'on' ``` Breaking compatibility by default will allow antidote to continue to grow and gain new features, as well as fix some long-standing issues that have always been present in antibody, for example: - In 2.0, `fpath` can be fully set at the beginning of your bundles in you static file, making setting up completion bundles properly way easier and less frustrating ([#74](https://github.com/mattmc3/antidote/discussions/74), [#144](https://github.com/mattmc3/antidote/issues/144)). - bundles will no longer default to using fugly directory names ($ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar), making `zstyle ':antidote:bundle' use-friendly-names on` obsolete. - probably some other minor deviations as well Just to be clear, if you don't specifically care about backwards compatibility with antibody, you do not need to change a thing. 2.x will not break your 1.x antidote config. If you do care, be sure to add the compatibility mode `zstyle` above to your config **now**, before the 2.0 release. ## Usage Basic usage should look really familiar to you if you have used Antibody or Antigen. Bundles (aka: Zsh plugins) are stored in a file typically called `.zsh_plugins.txt`. ```zsh # .zsh_plugins.txt rupa/z # some bash plugins work too sindresorhus/pure # enhance your prompt # you can even use Oh My Zsh plugins ohmyzsh/ohmyzsh path:lib ohmyzsh/ohmyzsh path:plugins/extract # add fish-like features zsh-users/zsh-syntax-highlighting zsh-users/zsh-autosuggestions zsh-users/zsh-history-substring-search ``` A typical `.zshrc` might then look like: ```zsh # .zshrc source /path-to-antidote/antidote.zsh antidote load ${ZDOTDIR:-$HOME}/.zsh_plugins.txt ``` The full documentation can be found at [https://getantidote.github.io][getantidote]. ## Help getting started If you want to see a full-featured example Zsh configuration using antidote, you can have a look at this [example zdotdir](https://github.com/getantidote/zdotdir) project. Feel free to incorporate code or plugins from it into your own dotfiles, or you can fork it to get started building your own Zsh config from scratch driven by antidote. ## Installation ### Install with git You can install the latest release of antidote by cloning it with `git`: ```zsh # first, run this from an interactive zsh terminal session: git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote ``` ### Install with a package manager antidote may also be available in your system's package manager: - [macOS homebrew](https://formulae.brew.sh/formula/antidote): `brew install antidote` - [Arch AUR](https://aur.archlinux.org/packages/zsh-antidote): `yay -S zsh-antidote` - [Nix Home-Manager](https://mipmip.github.io/home-manager-option-search/?query=antidote) : `programs.zsh.antidote.enable = true;` ## Performance antidote supports ultra-high performance plugin loads using a static plugin file. It also allows deferred loading for [plugins that support it](https://github.com/romkatv/zsh-defer#caveats). ```zsh # .zsh_plugins.txt # some plugins support deferred loading zdharma-continuum/fast-syntax-highlighting kind:defer zsh-users/zsh-autosuggestions kind:defer zsh-users/zsh-history-substring-search kind:defer ``` ```zsh # .zshrc # Lazy-load antidote and generate the static load file only when needed zsh_plugins=${ZDOTDIR:-$HOME}/.zsh_plugins if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then ( source /path-to-antidote/antidote.zsh antidote bundle <${zsh_plugins}.txt >${zsh_plugins}.zsh ) fi source ${zsh_plugins}.zsh ``` ## Benchmarks You can see how antidote compares with other setups [here][benchmarks]. ## Plugin authors If you authored a Zsh plugin, the recommended snippet for antidote is: ```zsh antidote install gh_user/gh_repo ``` If your plugin is hosted somewhere other than GitHub, you can use this: ```zsh antidote install https://bitbucket.org/bb_user/bb_repo ``` ## Credits A big thank you to [Carlos](https://github.com/caarlos0) for all his work on [antibody] over the years. [antigen]: https://github.com/zsh-users/antigen [antibody]: https://github.com/getantibody/antibody [getantidote]: https://getantidote.github.io [getantibody]: https://github.com/getantibody/antibody [benchmarks]: https://github.com/romkatv/zsh-bench/blob/master/doc/linux-desktop.md [zsh]: https://www.zsh.org antidote-1.9.7/antidote000066400000000000000000000005351464631051600151020ustar00rootroot00000000000000#!/bin/zsh ### antidote - the cure to slow zsh plugin management # # https://getantidote.github.io # run `antidote -h` for usage # # Note: this gets overridden if using `antidote init`. # function antidote { 0=${(%):-%x} if ! typeset -f antidote-main > /dev/null; then source ${0:A:h}/antidote.zsh fi antidote-main "$@" } antidote "$@" antidote-1.9.7/antidote.zsh000066400000000000000000000010051464631051600156760ustar00rootroot00000000000000# shell prereq if test -z "$ZSH_VERSION"; then shellname=$(ps -p $$ -oargs= | awk 'NR=1{print $1}') echo >&2 "antidote: Expecting zsh. Found '$shellname'." return 1 else builtin autoload -Uz is-at-least if ! is-at-least 5.4.2; then echo >&2 "antidote: Unsupported Zsh version '$ZSH_VERSION'. Expecting Zsh >5.4.2." return 1 fi typeset -f __antidote_setup &>/dev/null && unfunction __antidote_setup 0=${(%):-%N} builtin autoload -Uz ${0:A:h}/functions/__antidote_setup __antidote_setup fi antidote-1.9.7/functions/000077500000000000000000000000001464631051600153555ustar00rootroot00000000000000antidote-1.9.7/functions/__antidote_bulk_clone000066400000000000000000000021211464631051600215760ustar00rootroot00000000000000#!/bin/zsh ### Generate background clone commands #function __antidote_bulk_clone { emulate -L zsh; setopt local_options $_adote_funcopts # Allow the user to define zsh-defer repo in case they want to fork it. local zsh_defer_bundle zstyle -s ':antidote:defer' bundle 'zsh_defer_bundle' \ || zsh_defer_bundle='romkatv/zsh-defer' # get a list of clonable repos from a bundle file $__adote_awkcmd -v ZSH_DEFER_BUNDLE=$zsh_defer_bundle ' BEGIN { RS="[\r\n]" } # initialize vars { bundle=""; opts="--kind clone" } # skip blank or commented lines /^ *(#.+)?$/ { next } # clone zsh-defer /kind:defer/ { print "antidote-script --kind clone " ZSH_DEFER_BUNDLE " &" } # handle user/repo and URL forms $1~/^[^\/]+\/[^\/]+$/ { bundle=$1 } $1~/^(https?:|(ssh|git)@)/ { bundle=$1 } # find branch annotation if it exists match($0, /branch:[^\t ]+/) { opts=opts " --branch " substr($0, RSTART+7, RLENGTH-7) } # print result bundle!=""{ print "antidote-script", opts, bundle, "&" } END { print "wait" } ' "$@" | sort | uniq #} antidote-1.9.7/functions/__antidote_bundle_dir000066400000000000000000000032211464631051600215720ustar00rootroot00000000000000#!/bin/zsh ### Get the name of the bundle dir. #function __antidote_bundle_dir { emulate -L zsh; setopt local_options $_adote_funcopts # If the bundle is a repo/URL, then by default we use the legacy antibody format: # `$ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions` # With `zstyle ':antidote:bundle' use-friendly-names on`, we can simplify to # `$ANTIDOTE_HOME/zsh-users/zsh-autosuggestions` # If the bundle is a file, use its parent directory. # Otherwise, just assume the bundle is a directory. local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local bundle="$1" local bundle_type="$(__antidote_bundle_type $bundle)" # handle repo bundle paths if [[ "$bundle_type" == (repo|url|sshurl) ]] && [[ ! -e "$bundle_path" ]]; then if zstyle -t ':antidote:bundle' use-friendly-names; then # user/repo format # ex: $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions bundle=${bundle%.git} bundle=${bundle:gs/\:/\/} local parts=( ${(ps./.)bundle} ) if [[ $#parts -gt 1 ]]; then print $(antidote-home)/${parts[-2]}/${parts[-1]} else print $(antidote-home)/$bundle fi else # sanitize URL for safe use as a dir name # ex: $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions local url=$(__antidote_tourl $bundle) url=${url%.git} url=${url:gs/\@/-AT-} url=${url:gs/\:/-COLON-} url=${url:gs/\//-SLASH-} print $(antidote-home)/$url fi elif [[ -f "$bundle" ]]; then print ${bundle:A:h} else print ${bundle} fi #} antidote-1.9.7/functions/__antidote_bundle_name000066400000000000000000000010561464631051600217400ustar00rootroot00000000000000#!/bin/zsh ### Get the short name of the bundle. #function __antidote_bundle_name { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local bundle=$1 local bundle_type="$(__antidote_bundle_type $bundle)" if [[ "$bundle_type" == (url|sshurl) ]] ; then bundle=${bundle%.git} bundle=${bundle:gs/\:/\/} local parts=(${(ps./.)bundle}) print ${parts[-2]}/${parts[-1]} else print $bundle | sed -e "s|^\~/|$HOME/|" -e "s|^$HOME|\$HOME|" fi #} antidote-1.9.7/functions/__antidote_bundle_type000066400000000000000000000025351464631051600220040ustar00rootroot00000000000000#!/bin/zsh ### Determine bundle type: ### - ? - unknown ### - empty - empty string ### - file - an existing file ### - dir - an existing directory ### - path - an non-existant path ### - relpath - a relative path ### - repo - a git repo (user/repo format) ### - sshurl - a git repo (SSH format) ### - url - a git repo (URL format) ### - word - a word #function __antidote_bundle_type { emulate -L zsh; setopt local_options $_adote_funcopts local bundle=$1 # Try to expand path bundles with '$' and '~' prefixes so that we get a more # granular result than 'path'. if [[ $bundle == '~/'* ]]; then bundle="${HOME}/${bundle#\~/*}" elif [[ $bundle == '$'* ]] && [[ $bundle != *'('* ]] && [[ $bundle != *';'* ]]; then bundle=$(eval print $bundle) fi # Determine the bundle type. local result if [[ -e "$bundle" ]]; then [[ -f $bundle ]] && result=file || result=dir elif [[ -z "${bundle// }" ]]; then result=empty else case "$bundle" in (/|~|'$')*) result=path ;; *://*) result=url ;; *@*:*/*) result=sshurl ;; *(:|@)*) result='?' ;; */*/*) result=relpath ;; */) result=relpath ;; */*) result=repo ;; *) result=word ;; esac fi typeset -g REPLY=$result print $result #} antidote-1.9.7/functions/__antidote_bundle_zcompile000066400000000000000000000011271464631051600226410ustar00rootroot00000000000000#!/bin/zsh ### Compile bundles #function __antidote_bundle_zcompile { emulate -L zsh; setopt local_options $_adote_funcopts builtin autoload -Uz zrecompile local -a bundles if [[ -z "$1" ]]; then bundles=($(antidote-list --dirs)) elif [[ -f "$1" ]]; then zrecompile -pq "$1" return elif [[ -d "$1" ]]; then bundles=($1) else bundles=($(antidote-path "$1")) fi local bundle zfile for bundle in $bundles; do for zfile in ${bundle}/**/*.zsh{,-theme}(N); do [[ $zfile != */test-data/* ]] || continue zrecompile -pq "$zfile" done done # } antidote-1.9.7/functions/__antidote_collect_input000066400000000000000000000005051464631051600223310ustar00rootroot00000000000000#!/bin/zsh ### Collect 0 )); then input=("${(s.\n.)${@}}") elif [[ ! -t 0 ]]; then local data while IFS= read -r data || [[ -n "$data" ]]; do input+=("$data") done fi printf '%s\n' "${input[@]}" #} antidote-1.9.7/functions/__antidote_del000066400000000000000000000014071464631051600202330ustar00rootroot00000000000000#!/bin/zsh # Call me paranoid, but I want to be really certain antidote will never rm something it # shouldn't. This function wraps rm to double check that any paths being removed are # valid. If it's not in your $HOME or $TMPDIR, we need to block it. #function __antidote_del { emulate -L zsh; setopt local_options local -a rmflags rmpaths local p while (( $# )); do case "$1" in --) shift; break ;; -*) rmflags+=($1) ;; *) break ;; esac shift done (( $# > 0 )) || return 1 for p in $@; do p="${p:a}" if [[ "$p" != $HOME/* ]] && [[ "$p" != ${TMPDIR:-/tmp}/* ]]; then print -ru2 -- "antidote: Blocked attempt to rm path: '$p'." return 1 fi done command rm ${rmflags[@]} -- "$@" #} antidote-1.9.7/functions/__antidote_filter_defers000066400000000000000000000006271464631051600223070ustar00rootroot00000000000000#!/bin/zsh ### Filter all but the first defer block. #function __antidote_filter_defers { emulate -L zsh; setopt local_options $_adote_funcopts $__adote_awkcmd ' # filter all but the first time we source zsh-defer (a 4 line if statement) BEGIN { skip=0; found=0 } skip>0 { skip-- } /^if.+functions\[zsh\-defer\]/ { if(!found) found=1; else skip=4 } skip==0 { print } ' "$@" #} antidote-1.9.7/functions/__antidote_get_cachedir000066400000000000000000000012501464631051600220640ustar00rootroot00000000000000#!/bin/zsh ### Get the default cache directory per OS #function __antidote_get_cachedir { emulate -L zsh; setopt local_options $_adote_funcopts local result if [[ "${OSTYPE}" == darwin* ]]; then result=$HOME/Library/Caches elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then result=${LOCALAPPDATA:-$LocalAppData} if type cygpath > /dev/null; then result=$(cygpath "$result") fi elif [[ -n "$XDG_CACHE_HOME" ]]; then result=$XDG_CACHE_HOME else result=$HOME/.cache fi if [[ -n "$1" ]]; then if [[ $result == *\\* ]] && [[ $result != */* ]]; then result+="\\$1" else result+="/$1" fi fi print -r -- $result #} antidote-1.9.7/functions/__antidote_indent000066400000000000000000000003161464631051600207460ustar00rootroot00000000000000#!/bin/zsh ### Indent strings #function __antidote_indent { emulate -L zsh; setopt local_options $_adote_funcopts local -a lines=("${(@f)$(__antidote_collect_input "$@")}") printf ' %s\n' $lines #} antidote-1.9.7/functions/__antidote_initfiles000066400000000000000000000010731464631051600214540ustar00rootroot00000000000000#!/bin/zsh ### Get the path to a plugin's init file. #function __antidote_initfiles { emulate -L zsh; setopt local_options $_adote_funcopts typeset -ga reply=() local dir=${1:A} local initfiles=($dir/${dir:A:t}.plugin.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.plugin.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.zsh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.sh(N)) [[ $#initfiles -gt 0 ]] || initfiles=($dir/*.zsh-theme(N)) typeset -ga reply=($initfiles) printf "%s\n" ${(u)initfiles[@]} (( $#initfiles )) || return 1 #} antidote-1.9.7/functions/__antidote_load_prep000066400000000000000000000036151464631051600214370ustar00rootroot00000000000000#!/bin/zsh ### Prep to load #function __antidote_load_prep { emulate -L zsh; setopt local_options $_adote_funcopts # pass in bundle file, read from zstyle, or use default .zsh_plugins.txt local bundlefile="$1" if [[ -z "$bundlefile" ]]; then zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt fi # pass in static file, read from zstyle, change extension, or use default .zsh_plugins.zsh local staticfile="$2" if [[ -z "$staticfile" ]]; then zstyle -s ':antidote:static' file 'staticfile' if [[ -z "$staticfile" ]]; then if [[ -z "$bundlefile:t:r" ]]; then staticfile=${bundlefile}.zsh else staticfile=${bundlefile:r}.zsh fi fi fi if [[ ! -e "$bundlefile" ]]; then # the files can't have the same name print -ru2 -- "antidote: bundle file not found '$bundlefile'." return 1 elif [[ "$bundlefile" == "$staticfile" ]]; then # the files can't have the same name print -ru2 -- "antidote: bundle file and static file are the same '$bundlefile'." return 1 fi # regenerate the static file based on whether the bundle file is newer and whether # antidote home exists and is ready to be loaded local force_bundle=0 if ! zstyle -t ':antidote:load:checkfile' disabled; then local loadable_check_path="$(antidote-home)/.antidote.load" if [[ ! -e $loadable_check_path ]]; then force_bundle=1 [[ -d $loadable_check_path:h ]] || mkdir -p $loadable_check_path:h touch $loadable_check_path fi fi if [[ ! $staticfile -nt $bundlefile ]] || [[ $force_bundle -eq 1 ]]; then antidote bundle <"$bundlefile" >|"$staticfile" if [[ -r "${staticfile}.zwc" ]] && ! zstyle -t ':antidote:static' zcompile; then __antidote_del -f -- "${staticfile}.zwc" fi fi # tell antidote-load what to source typeset -g REPLY=$staticfile #print $REPLY #} antidote-1.9.7/functions/__antidote_parse_bundles000066400000000000000000000015401464631051600223130ustar00rootroot00000000000000#!/bin/zsh ### Parse antidote's bundle DSL. #function __antidote_parse_bundles { emulate -L zsh; setopt local_options $_adote_funcopts $__adote_awkcmd ' BEGIN { RS="[\r\n]" } # skip comments and empty lines /^ *$/ || /^ *#/ {next} # strip trailing comments { sub(/[ \t]#.*$/,"",$0) } # escape leading $ variables { sub(/^\$/,"\\$",$0) } # handle extension functionality (eg :use ohmyzsh) $1~/^:/ { sub(/^:/,"",$1) printf "antidote-script-" $1 for (i=2; i<=NF; i++) { printf " %s",$i } printf "\n" next } # move flags to front and call antidote-script { sub(/ #.*$/,"",$0) printf "antidote-script" for (i=2; i<=NF; i++) { sub(/^/,"--",$i) sub(/:/," ",$i) printf " %s",$i } printf " %s\n",$1 } ' "$@" #} antidote-1.9.7/functions/__antidote_print_path000066400000000000000000000002371464631051600216370ustar00rootroot00000000000000#!/bin/zsh ### Pretty print a path if zstyle -t ':antidote:compatibility-mode' 'antibody'; then echo "$1" else echo "$1" | sed -e "s|^$HOME/|\$HOME/|" fi antidote-1.9.7/functions/__antidote_setup000066400000000000000000000020771464631051600206330ustar00rootroot00000000000000#!/bin/zsh ### Setup antidote. #function __antidote_setup { 0=${(%):-%x} fpath=( "${0:A:h}" $fpath ) local fn for fn in ${0:A:h}/*; do [[ ${fn:t} != '__antidote_setup' ]] || continue if typeset -f ${fn:t} > /dev/null; then unfunction -- ${fn:t} fi # autoload extensionless function files [[ -z "${fn:e}" ]] && autoload -Uz "${fn}" done # man pages if [[ "$MANPATH" != *"${0:A:h:h}/man"* ]]; then export MANPATH="${0:A:h:h}/man:$MANPATH" fi builtin autoload -Uz is-at-least if is-at-least 5.8; then # the -F option was added in 5.8 typeset -gHa _adote_zparopt_flags=( -D -M -F ) else typeset -gHa _adote_zparopt_flags=( -D -M ) fi typeset -gHa _adote_funcopts=( extended_glob no_monitor pipefail ) if zstyle -t ':antidote:tests' set-warn-options; then typeset -gHa _adote_funcopts=( $_adote_funcopts warn_create_global warn_nested_var ) fi gawk --version &>/dev/null && typeset -gH __adote_awkcmd=gawk || typeset -gH __adote_awkcmd=awk typeset -gHi __adote_ksh_arrays typeset -gHi __adote_sh_glob #} antidote-1.9.7/functions/__antidote_tourl000066400000000000000000000004361464631051600206350ustar00rootroot00000000000000#!/bin/zsh ### Get the url from a repo bundle. #function __antidote_tourl { emulate -L zsh; setopt local_options $_adote_funcopts local bundle=$1 local url=$bundle if [[ $bundle != *://* && $bundle != git@*:*/* ]]; then url=https://github.com/$bundle fi print $url #} antidote-1.9.7/functions/__antidote_usage000066400000000000000000000015111464631051600205670ustar00rootroot00000000000000#!/bin/zsh ### Print usage. #function __antidote_usage { emulate -L zsh; setopt local_options $_adote_funcopts cat<] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles EOS #} antidote-1.9.7/functions/__antidote_version000066400000000000000000000004751464631051600211600ustar00rootroot00000000000000#!/bin/zsh ### Get the antidote version. #function __antidote_version { emulate -L zsh; setopt local_options $_adote_funcopts 0=${(%):-%x} local ver='1.9.7' local gitsha=$(git -C "${0:A:h:h}" rev-parse --short HEAD 2>/dev/null) [[ -z "$gitsha" ]] || ver="$ver ($gitsha)" print "antidote version $ver" #} antidote-1.9.7/functions/_antidote000066400000000000000000000071711464631051600172540ustar00rootroot00000000000000#compdef antidote function _antidote_subcommands { local usage=$( antidote --help | ${__adote_awkcmd:-awk} ' BEGIN{OFS=":"; p=0} /^commands:$/ {p=1; next} !p{next} { for(i=3; i<=NF; i++) { $2=$2" "$i } } { print $1,$2 } ' ) local -a subcommands=("${(@f)usage}") _describe -t subcommands 'subcommand' subcommands "$@" } function _antidote_installed_bundles { local -a bundles=("${(@f)$(antidote list -s)}") _describe 'installed bundles' bundles } function _antidote_bundle_kinds { local -a kinds=( 'autoload' 'clone' 'defer' 'fpath' 'path' 'zsh' ) _describe 'bundle kinds' kinds } function _antidote { typeset -A opt_args local context state line local curcontext="$curcontext" local ret=1 _arguments -C \ '(- *)'{-v,--version}'[Show version]' \ '(- *)'{-h,--help}'[Show usage information]' \ '1: :_antidote_subcommands' \ '*:: :->subcmds' && return 0 case "$state" in (subcmds) case $words[1] in (bundle) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (help) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (home) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (init) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (install|script) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-k --kind)'{-k,--kind}'[The kind of bundle]:kinds:_antidote_bundle_kinds' \ '(-p --path)'{-p,--path}'[A relative subpath within the bundle where the plugin is located]' \ '(-a --autoload)'{-a,--autoload}'[A relative subpath within the bundle where autoload function files are located]' \ '(-c --conditional)'{-c,--conditional}'[A conditional function used to check whether to load the bundle]' \ '(-b --branch)'{-b,--branch}'[The git branch to use]' \ '(--pre)--pre[A function to be called prior to loading the bundle]' \ '(--post)--post[A function to be called after loading the bundle]' \ && ret=0 ;; (list) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-s --short)'{-s,--short}'[Show shortened repos where possible]' \ '(-d --dirs)'{-d,--dirs}'[Show only bundle directories]' \ '(-u --url)'{-u,--url}'[Show bundle URLs]' \ && ret=0 ;; (load) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (path) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ && ret=0 ;; (purge) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-a --all)'{-a,--all}'[Purge all cloned bundles]' \ "*::antidote bundles:_antidote_installed_bundles" \ && ret=0 ;; (update) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '(-s --selp)'{-s,--self}'[Update antidote]' \ '(-b --bundles)'{-b,--bundles}'[Update bundles]' \ && ret=0 ;; (*) _arguments \ '(- *)'{-h,--help}'[Show usage information]' \ '*: :_files' \ && ret=0 ;; esac ;; esac return ret } _antidote "$@" # vim: ft=zsh sw=2 ts=2 et antidote-1.9.7/functions/antidote000066400000000000000000000005231464631051600171070ustar00rootroot00000000000000#!/bin/zsh ### antidote - the cure to slow zsh plugin management # # https://getantidote.github.io # run `antidote -h` for usage # # Note: this gets overridden if using `antidote init`. # #function antidote { 0=${(%):-%x} if ! typeset -f antidote-main > /dev/null; then source ${0:A:h:h}/antidote.zsh fi antidote-main "$@" #} antidote-1.9.7/functions/antidote-bundle000066400000000000000000000026041464631051600203600ustar00rootroot00000000000000#!/bin/zsh ### Clone bundle(s) and generate the static load script. # # usage: antidote bundle [-h|--help] ... # ### Clone bundle(s) and generate the static load script. #function antidote-bundle { # Download a bundle and prints its Zsh source line. emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help bundle return fi # handle bundles as newline delimited arg strings, # or as 1 )); then source <(printf '%s\n' $bundles | __antidote_bulk_clone) fi # generate bundle script source <(printf '%s\n' $bundles | __antidote_parse_bundles) | __antidote_filter_defers #} antidote-1.9.7/functions/antidote-help000066400000000000000000000011751464631051600200410ustar00rootroot00000000000000#!/bin/zsh ### Show antidote documentation. # # usage: antidote [-h|--help] [] # antidote help [] # #function antidote-help { emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 local manpage if (( $#o_help )); then manpage=antidote-help elif [[ "$1" == antidote ]]; then manpage=antidote elif [[ -n "$1" ]]; then manpage="antidote-${1}" fi if (( $+commands[man] )) && [[ -n "$manpage" ]]; then man "$manpage" || { __antidote_usage && return 1 } else __antidote_usage fi #} antidote-1.9.7/functions/antidote-home000066400000000000000000000011101464631051600200260ustar00rootroot00000000000000#!/bin/zsh ### Print where antidote is cloning bundles. # # usage: antidote home [-h|--help] # # Can be overridden by setting `$ANTIDOTE_HOME`. # #function antidote-home { emulate -L zsh; setopt local_options $_adote_funcopts typeset -g REPLY= local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help home return fi local result if [[ -n "$ANTIDOTE_HOME" ]]; then result=$ANTIDOTE_HOME else result=$(__antidote_get_cachedir "antidote") fi print $result typeset -g REPLY=$result #} antidote-1.9.7/functions/antidote-init000066400000000000000000000013571464631051600200560ustar00rootroot00000000000000#!/bin/zsh ### Initialize the shell for dynamic bundles. # # usage: antidote init [-h|--help] # source <(antidote init) # # This function changes how the `antidote` command works by sourcing the results of # `antidote bundle` instead of just generating the Zsh script. #function antidote-init { local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help init return fi local script=( '#!/usr/bin/env zsh' 'function antidote {' ' case "$1" in' ' bundle)' ' source <( antidote-main $@ ) || antidote-main $@' ' ;;' ' *)' ' antidote-main $@' ' ;;' ' esac' '}' ) printf "%s\n" "${script[@]}" #} antidote-1.9.7/functions/antidote-install000066400000000000000000000033641464631051600205610ustar00rootroot00000000000000#!/bin/zsh ### Clone a new bundle and add it to your plugins file. # usage: antidote install [-h|--help] [-k|--kind ] [-p|--path ] # [-c|--conditional ] [-b|--branch ] # [--pre ] [--post ] # [-a|--autoload ] [] #function antidote-install { emulate -L zsh; setopt local_options $_adote_funcopts local -A flag_to_annotation=( '-a' autoload '-b' branch '-c' conditional '-h' help '-k' kind '-p' path ) local -a annotations=() local arg while (( $# )); do arg="$1" case "$arg" in -h|--help) antidote-help install return ;; --) shift; break ;; --*) annotations+=( "${arg#*--}:$2" ); shift ;; -*) annotations+=( $flag_to_annotation[$arg]:$2 ); shift ;; *) break ;; esac shift done if [[ $# -eq 0 ]]; then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundle=$1 local bundlefile=$2 if [[ -z "$bundlefile" ]]; then zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt fi local bundledir=$(__antidote_bundle_dir $bundle) if [[ -d "$bundledir" ]]; then print -ru2 "antidote: error: $bundle already installed: $bundledir" return 1 fi # use antidote bundle to clone our bundle local bundlestr=$bundle (( $#annotations )) && bundlestr+=" $annotations" antidote-bundle "$bundlestr" >/dev/null if [[ $? -ne 0 ]]; then print -ru2 "antidote: unable to install bundle '$bundle'." else print "Adding bundle to '$bundlefile':" print $bundlestr | tee -a $bundlefile fi #} antidote-1.9.7/functions/antidote-list000066400000000000000000000021261464631051600200610ustar00rootroot00000000000000#!/bin/zsh ### List cloned bundles. # # usage: antidote list [-h|--help] [-s|--short] [-d|--dirs] [-u|--url] # #function antidote-list { emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_short o_url o_dirs zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ s=o_short -short=s \ u=o_url -url=u \ d=o_dirs -dirs=d || return 1 if (( $#o_help )); then antidote-help list return fi if [[ $# -ne 0 ]]; then print -ru2 "antidote: error: unexpected $1, try --help" return 1 fi local bundledir local output=() local bundles=($(antidote-home)/**/.git(/N)) for bundledir in $bundles; do bundledir=${bundledir:h} local url=$(git -C "$bundledir" config remote.origin.url) if (( $#o_dirs )); then output+=($bundledir) elif (( $#o_url )); then output+=($url) elif (( $#o_short )); then url=${url%.git} url=${url#https://github.com/} output+=($url) else output+=("$(printf '%-64s %s\n' $url $bundledir)") fi done (( $#output )) && printf '%s\n' ${(o)output} #} antidote-1.9.7/functions/antidote-load000066400000000000000000000015131464631051600200240ustar00rootroot00000000000000#!/bin/zsh ### Statically source all bundles from the plugins file. # # usage: antidote load [-h|--help] [ []] # #function antidote-load { if [[ "$1" == (-h|--help) ]]; then antidote-help load return fi # We can't use LOCAL_OPTIONS because sourcing plugins means we'd lose any Zsh options # set in those plugins, so we delegate all the work to __antidote_load_prep where # we can safely use LOCAL_OPTIONS. For this function, we should do the bare minimum # so the user can set whatever crazy Zsh options they want, and antidote doesn't need # to concern itself with that. # # "Is your house on fire, Clark? No, Aunt Bethany, those are the user's Zsh options." # typeset -g REPLY= __antidote_load_prep "$@" || return 1 [[ -f "$REPLY" ]] || return 2 source "$REPLY" unset REPLY #} antidote-1.9.7/functions/antidote-main000066400000000000000000000023531464631051600200340ustar00rootroot00000000000000#!/bin/zsh ### The main controller for antidote. # The reason we use `antidote-main` instead putting all of this in `antidote` # is that this allows the `antidote` function to be overridden via `antidote init`. # The init command switches antidote from static mode to dynamic mode, but this # core functionality remains. #function antidote-main { 0=${(%):-%x} [[ -o KSH_ARRAYS ]] && __adote_ksh_arrays=1 && unsetopt KSH_ARRAYS [[ -o SH_GLOB ]] && __adote_sh_glob=1 && unsetopt SH_GLOB local o_help o_version zparseopts ${_adote_zparopt_flags} -- \ h=o_help -help=h \ v=o_version -version=v || return 1 local ret=0 if (( ${#o_version} )); then __antidote_version elif (( ${#o_help} )); then antidote-help "$@" elif [[ ${#} -eq 0 ]]; then antidote-help ret=2 elif [[ "${1}" = help ]]; then local manpage=${2:-antidote} antidote-help $manpage elif (( $+functions[antidote-${1}] )); then local cmd=${1}; shift antidote-${cmd} "$@" ret=$? else print -ru2 "antidote: command not found '${1}'" ret=1 fi (( __adote_ksh_arrays )) && __adote_ksh_arrays=0 && setopt KSH_ARRAYS (( __adote_sh_glob )) && __adote_sh_glob=0 && setopt SH_GLOB return $ret #} antidote-1.9.7/functions/antidote-path000066400000000000000000000017331464631051600200450ustar00rootroot00000000000000#!/bin/zsh ### Print the path of a cloned bundle. # # usage: antidote path [-h|--help] # #function antidote-path { emulate -L zsh; setopt local_options $_adote_funcopts local o_help zparseopts $_adote_zparopt_flags -- h=o_help -help=h || return 1 if (( $#o_help )); then antidote-help path return fi local -a bundles=("${(@f)$(__antidote_collect_input "$@")}") if (( $#bundles == 0 )); then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundle bundledir local -a results=() for bundle in $bundles; do if [[ $bundle == '$'* ]] && [[ $bundle != *'('* ]] && [[ $bundle != *';'* ]]; then bundle=$(eval print $bundle) fi bundledir=$(__antidote_bundle_dir $bundle) if [[ ! -d $bundledir ]]; then print -ru2 "antidote: error: $bundle does not exist in cloned paths" return 1 else results+=("$bundledir") fi done print -l -- $results #} antidote-1.9.7/functions/antidote-purge000066400000000000000000000051301464631051600202260ustar00rootroot00000000000000#!/bin/zsh ### Remove a cloned bundle. # # usage: antidote purge [-h|--help] # antidote purge [-a|--all] # #function antidote-purge { emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_all zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ a=o_all -all=a || return 1 if (( $#o_help )); then antidote-help purge return fi if [[ $# -eq 0 ]] && ! (( $#o_all )); then print -ru2 "antidote: error: required argument 'bundle' not provided, try --help" return 1 fi local bundlefile zstyle -s ':antidote:bundle' file 'bundlefile' || bundlefile=${ZDOTDIR:-$HOME}/.zsh_plugins.txt if (( $#o_all )); then # last chance to save the user from themselves local antidote_home="$(antidote-home)" local REPLY zstyle -s ':antidote:purge:all' answer 'REPLY' || { read -q "REPLY?You are about to permanently remove '$antidote_home' and all its contents!"$'\n'"Are you sure [Y/n]? " print } [[ ${REPLY:u} == "Y" ]] || return 1 # remove antidote home and static cache file __antidote_del -rf -- "$antidote_home" if [[ -e "${bundlefile:r}.zsh" ]]; then zstyle -s ':antidote:purge:all' answer 'REPLY' || { read -q "REPLY?You are about to remove '${bundlefile:t:r}.zsh'"$'\n'"Are you sure [Y/n]? " print } if [[ ${REPLY:u} == "Y" ]]; then local dtstmp=$(date -u '+%Y%m%d_%H%M%S') command mv -f "${bundlefile:r}.zsh" "${bundlefile:r}.${dtstmp}.bak" print "'"${bundlefile:r}.zsh"' backed up to '${bundlefile:t:r}.${dtstmp}.bak'" fi fi print "Antidote purge complete. Be sure to start a new Zsh session." else local bundle=$1 # make sure the user isn't trying to do something out-of-bounds if [[ -e "$bundle" ]]; then print -ru2 "antidote: error: '$bundle' is not a repo and cannot be removed by antidote." return 2 fi local bundledir=$(__antidote_bundle_dir $bundle) if [[ ! -d "$bundledir" ]]; then print -ru2 "antidote: error: $bundle does not exist at the expected location: $bundledir" return 1 fi # remove __antidote_del -rf "$bundledir" print "Removed '$bundle'." # attempt to comment out the bundle from .zsh_plugins.txt if [[ -e "$bundlefile" ]]; then local tmpfile="${bundlefile}.antidote.tmp" $__adote_awkcmd -v pat="$bundle" '$0~"^[[:blank:]]*"pat{print "# " $0;next}1' <$bundlefile >|$tmpfile command mv -f "$tmpfile" "$bundlefile" || __antidote_del -f "$tmpfile" print "Bundle '$bundle' was commented out in '$bundlefile'." fi fi #} antidote-1.9.7/functions/antidote-script000066400000000000000000000155561464631051600204250ustar00rootroot00000000000000#!/bin/zsh ### Generate the Zsh script to load a plugin. # # usage: antidote script [-h|--help] [-k|--kind ] [-p|--path ] # [-c|--conditional ] [-b|--branch ] # [--pre ] [--post ] # [-a|--autoload ] # : zsh,path,fpath,defer,clone,autoload # : Relative path from the bundle root # : The git branch # : A bundle can be a directory, a zsh script, or a git repo # ### Generate the Zsh script to load a plugin. #function antidote-script { emulate -L zsh; setopt local_options $_adote_funcopts local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' local REPLY= local o_help o_kind o_path o_branch o_cond o_autoload o_pre o_post o_fpath_rule zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ a:=o_autoload -autoload:=a \ b:=o_branch -branch:=b \ k:=o_kind -kind:=k \ p:=o_path -path:=p \ -pre:=o_pre \ -post:=o_post \ -fpath-rule:=o_fpath_rule \ c:=o_cond -conditional:=c || return 1 # set defaults (( $#o_kind )) || o_kind=(--kind zsh) if ! (( $#o_fpath_rule )); then zstyle -a ':antidote:fpath' rule 'o_fpath_rule' || o_fpath_rule=(append) fi # strip '=' or ':' from beginning of arg values local re='^[=:]?(.+)$' [[ $o_kind[-1] =~ $re ]] && o_kind[-1]=$match [[ $o_autoload[-1] =~ $re ]] && o_autoload[-1]=$match [[ $o_path[-1] =~ $re ]] && o_path[-1]=$match [[ $o_cond[-1] =~ $re ]] && o_cond[-1]=$match [[ $o_branch[-1] =~ $re ]] && o_branch[-1]=$match [[ $o_pre[-1] =~ $re ]] && o_pre[-1]=$match [[ $o_post[-1] =~ $re ]] && o_post[-1]=$match [[ $o_fpath_rule[-1] =~ $re ]] && o_fpath_rule[-1]=$match local supported_kind_vals=(autoload clone defer fpath path zsh) if (( $#o_kind )) && ! (( $supported_kind_vals[(Ie)$o_kind[-1]] )); then print -ru2 "antidote: error: unexpected kind value: '$o_kind[-1]'" && return 1 fi # If no fpath_rule is set, use the zstyle if ! (( $#o_fpath_rule )); then local zstyle_fpath_rule zstyle -s ':antidote:fpath' rule 'zstyle_fpath_rule' [[ -z "$zstyle_fpath_rule" ]] || o_fpath_rule=($zstyle_fpath_rule) fi local supported_fpath_rules=(append prepend) if ! (( $supported_fpath_rules[(Ie)$o_fpath_rule[-1]] )); then print -ru2 "antidote: error: unexpected fpath rule: '$o_fpath_rule[-1]'" && return 1 fi local bundle=$1 if [[ -z "$bundle" ]]; then print -ru2 "antidote: error: bundle argument expected" && return 1 fi local bundle_name=$(__antidote_bundle_name $bundle) # replace ~/ with $HOME/ if [[ "$bundle" == '~/'* ]]; then bundle=$HOME/${bundle#'~/'*} fi # set the path to the bundle (repo or local) local bundle_path [[ -e "$bundle" ]] && bundle_path=$bundle || bundle_path=$(__antidote_bundle_dir $bundle) # handle cloning repo bundles local bundle_type bundle_type="$(__antidote_bundle_type $bundle)" if [[ "$bundle_type" == (repo|url|sshurl) ]] && [[ ! -e "$bundle_path" ]]; then local giturl=$(__antidote_tourl $bundle) print -ru2 "# antidote cloning $bundle_name..." git clone --quiet --depth 1 --recurse-submodules --shallow-submodules $o_branch $giturl $bundle_path [[ $? -eq 0 ]] || return 1 fi # if we only needed to clone the bundle, compile and we're done if [[ "$o_kind[-1]" == "clone" ]]; then if zstyle -t ":antidote:bundle:$bundle" zcompile; then __antidote_bundle_zcompile $bundle_path fi return fi # add path to bundle [[ -n "$o_path[-1]" ]] && bundle_path+="/$o_path[-1]" # handle defer pre-reqs first local dopts zsh_defer='zsh-defer' zstyle -s ":antidote:bundle:${bundle}" defer-options 'dopts' [[ -n "$dopts" ]] && zsh_defer="zsh-defer $dopts" # generate the script local -a script=() # add pre-load function (( $#o_pre )) && script+=("$o_pre[-1]") # handle defers local source_cmd="source" local zsh_defer_bundle zstyle -s ':antidote:defer' bundle 'zsh_defer_bundle' \ || zsh_defer_bundle='romkatv/zsh-defer' if [[ "$o_kind[-1]" == "defer" ]]; then source_cmd="${zsh_defer} source" script+=( 'if ! (( $+functions[zsh-defer] )); then' "$(antidote-script $zsh_defer_bundle | __antidote_indent)" 'fi' ) fi # Let's make the path a little nicer to deal with local print_bundle_path="$(__antidote_print_path "$bundle_path")" # handle autoloading before sourcing if (( $#o_autoload )); then if [[ "$o_fpath_rule[-1]" == prepend ]]; then script+=("fpath=( ${print_bundle_path}/${o_autoload[-1]} \$fpath )") script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") else script+=("fpath+=( ${print_bundle_path}/${o_autoload[-1]} )") script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi fi # generate load script bundle_type="$(__antidote_bundle_type $bundle_path)" local fpath_script if [[ "$o_fpath_rule[-1]" == prepend ]]; then fpath_script="fpath=( $print_bundle_path \$fpath )" else fpath_script="fpath+=( $print_bundle_path )" fi if [[ "$o_kind[-1]" == fpath ]]; then # fpath script+="$fpath_script" elif [[ "$o_kind[-1]" == path ]]; then # path script+="export PATH=\"$print_bundle_path:\$PATH\"" elif [[ "$o_kind[-1]" == autoload ]]; then # autoload script+=("$fpath_script") if [[ "$o_fpath_rule[-1]" == prepend ]]; then script+=("builtin autoload -Uz \$fpath[1]/*(N.:t)") else script+=("builtin autoload -Uz \$fpath[-1]/*(N.:t)") fi else if zstyle -t ":antidote:bundle:$bundle" zcompile; then __antidote_bundle_zcompile $bundle_path fi if [[ $bundle_type == file ]]; then script+="$source_cmd $print_bundle_path" else # directory/default local initfile initfiles initfiles=(${(@f)$(__antidote_initfiles $bundle_path)}) # if no init file was found, assume the default if [[ $#initfiles -eq 0 ]]; then if (( $#o_path )); then initfiles=($bundle_path/${bundle_path:t}.plugin.zsh) else initfiles=($bundle_path/${bundle_name:t}.plugin.zsh) fi fi script+="$fpath_script" local print_initfile for initfile in $initfiles; do print_initfile="$(__antidote_print_path "$initfile")" script+="$source_cmd $print_initfile" done fi fi # add post-load function if (( $#o_post )); then if [[ "$o_kind[-1]" == "defer" ]]; then script+=("${zsh_defer} $o_post[-1]") else script+=("$o_post[-1]") fi fi # mark bundle as loaded # script+="zstyle ':antidote:bundle:${bundle_name}' loaded yes" # wrap conditional if [[ -n "$o_cond[-1]" ]]; then print "if $o_cond[-1]; then" printf " %s\n" $script print "fi" else printf "%s\n" $script fi #} antidote-1.9.7/functions/antidote-update000066400000000000000000000051361464631051600203740ustar00rootroot00000000000000#!/bin/zsh ### Update antidote and its cloned bundles. # # usage: antidote update [-h|--help] # #function antidote-update { 0=${(%):-%x} emulate -L zsh; setopt local_options $_adote_funcopts local o_help o_self o_bundles zparseopts $_adote_zparopt_flags -- \ h=o_help -help=h \ s=o_self -self=s \ b=o_bundles -bundles=b || return 1 if (( $#o_help )); then antidote-help update return fi # colors local green normal if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then if (( $+commands[tput] )); then green=$(tput setaf 2) normal=$(tput sgr0) else green=$'\E[32m' normal=$'\E[0m' fi fi if (( $#o_bundles )) || ! (( $#o_self )); then print "Updating bundles..." local bundledir url repo # remove zcompiled files __antidote_del -rf -- $(antidote-home)/**/*.zwc(N) # remove check file local loadable_check_path="$(antidote-home)/.antidote.load" [[ -r "$loadable_check_path" ]] && __antidote_del -- "$loadable_check_path" # update all bundles for bundledir in $(antidote-list --dirs); do url=$(git -C "$bundledir" config remote.origin.url) repo="${url:h:t}/${${url:t}%.git}" print "antidote: checking for updates: $url" () { local oldsha=$(git -C "$1" rev-parse --short HEAD) git -C "$1" pull --quiet --ff --rebase --autostash local newsha=$(git -C "$1" rev-parse --short HEAD) if [[ $oldsha != $newsha ]]; then print "${green}antidote: updated: $2 ${oldsha} -> ${newsha}${normal}" git -C "$1" --no-pager log --oneline --ancestry-path ${oldsha}..${newsha} 2>/dev/null fi # recompile bundles if zstyle -t ":antidote:bundle:$repo" zcompile; then __antidote_bundle_zcompile $bundledir fi } "$bundledir" "$url" & done print "Waiting for bundle updates to complete..." print "" wait print "${green}Bundle updates complete.${normal}" print "" fi # update antidote if (( $#o_self )) || ! (( $#o_bundles )); then print "Updating antidote..." if [[ -d "${0:A:h:h}/.git" ]]; then git -C "${0:A:h:h}" pull --quiet --ff --rebase --autostash print "antidote self-update complete.\n" # setup antidote again (( $+functions[__antidote_setup] )) && unfunction __antidote_setup builtin autoload -Uz ${0:A:h}/__antidote_setup __antidote_setup # show antidote version antidote -v else print "Self updating is disabled in this build." print "Use your OS package manager to update antidote itself." fi fi #} antidote-1.9.7/makefile000066400000000000000000000020301464631051600150400ustar00rootroot00000000000000# Do not remove ##? comments. They are used by 'help' to construct the help docs. ##? antidote - the cure to slow zsh plugin management ##? ##? Usage: make " ##? ##? Commands: .DEFAULT_GOAL := help all : build buildman test unittest bump-maj bump-min bump-rev help .PHONY : all ##? help display this makefile's help information help: @grep "^##?" makefile | cut -c 5- ##? build run build tasks like generating man pages build: ./tools/buildman ./tools/run-clitests ./tools/bumpver revision ##? buildman rebuild man pages buildman: ./tools/buildman ##? test run tests test: ./tools/run-clitests ##? unittest run only unittests unittest: ./tools/run-clitests --unit ##? bump-maj bump the major version (X.0.0) bump-maj: ./tools/bumpver major ##? bump-min bump the minor version (0.X.0) bump-min: ./tools/bumpver minor ##? bump-rev bump the revision version (0.0.X) bump-rev: ./tools/bumpver revision ##? bumpver bump the revision version (0.0.X) bumpver: ./tools/bumpver revision antidote-1.9.7/man/000077500000000000000000000000001464631051600141205ustar00rootroot00000000000000antidote-1.9.7/man/antidote-bundle.md000066400000000000000000000072171464631051600175270ustar00rootroot00000000000000--- title: antidote-bundle section: 1 header: Antidote Manual --- # NAME **antidote bundle** - download a bundle and print its source line # SYNOPSIS | antidote bundle [\...] # DESCRIPTION **antidote-bundle** assembles your Zsh plugins. Bundles can be git repos, or local files or directories. If a plugin is a repo, it will be cloned if necessary. The zsh code necessary to load (source) the plugin is then printed. | antidote bundle gituser/gitrepo | antidote bundle $ZSH_CUSTOM/plugins/myplugin | antidote bundle ${ZDOTDIR:-\$HOME}/.zlibs/myfile.zsh Bundles also support annotations. Annotations allow you have finer grained control over your plugins. Annotations are used in the form \'keyword:value\'. `kind` : - **zsh**: A zsh plugin. This is the default kind of bundle. : - **fpath**: Only add the plugin to your _\$fpath_. : - **path**: Add the plugin to your _\$PATH_. : - **clone**: Only clone a plugin, but don't do anything else with it. : - **defer**: Defers loading of a plugin using \'romkatv/zsh-defer\'. : - **autoload**: Autoload all the files in the plugin directory as zsh functions. `branch` : The branch annotation allows you to change the default branch of a plugin's repo from **main** to a branch of your choosing. `path` : The path annotation allows you to use a subdirectory or file within a plugin's structure instead of the root plugin (eg: \'path:plugins/subplugin\'). `conditional` : The conditonal annotation allows you to wrap an **if** statement around a plugin's load script. Supply the name of a zero argument zsh function to conditional to perform the test (eg: \'conditional:is-macos\'). `pre` / `post` : The pre and post annotations allow you to call a function before or after a plugin's load script. This is helpful when configuring plugins, since the configuration functions will only run for active plugins. Supply the name of a zero argument zsh function to pre or post. `autoload` : The autoload annotation allows you to autoload a zsh functions directory in addition to however the plugin was loaded as specified by \'kind\'. Supply a relative path to autoload (eg: \'autoload:functions\'). Cloned repo directory names can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' use-friendly-names \'yes\' # OPTIONS -h, \--help : Show the help documentation. [*\...*] : Zsh plugin bundles # EXAMPLES Using the **kind:** annotation... | # a regular plugin (kind:zsh is implied, so it's unnecessary) | antidote bundle zsh-users/zsh-history-substring-search kind:zsh | # add prompt plugins to $fpath | antidote bundle sindresorhus/pure kind:fpath | # add utility plugins to $PATH | antidote bundle romkatv/zsh-bench kind:path | # clone a repo for use in other ways | antidote bundle mbadolato/iTerm2-Color-Schemes kind:clone | # autoload a functions directory | antidote bundle sorin-ionescu/prezto path:modules/utility/functions kind:autoload | # defer a plugin to speed up load times | antidote bundle olets/zsh-abbr kind:defer Using the **branch:** annotation... | # don't use the main branch, use develop instead | antidote bundle zsh-users/zsh-autosuggestions branch:develop Using the **path:** annotation... | # load oh-my-zsh | antidote bundle ohmyzsh/ohmyzsh path:lib | antidote bundle ohmyzsh/ohmyzsh path:plugins/git Using the **conditional:** annotation... | # define a conditional function prior to loading antidote | function is_macos { | [[ $OSTYPE == darwin* ]] || return 1 | } | | # conditionally load a plugin using the function you made | antidote bundle ohmyzsh/ohmyzsh path:plugins/macos conditional:is_macos antidote-1.9.7/man/antidote-help.md000066400000000000000000000006061464631051600172010ustar00rootroot00000000000000--- title: antidote-help section: 1 header: Antidote Manual --- # NAME **antidote help** - show antidote documentation # SYNOPSIS | antidote help [\] # DESCRIPTION **antidote-help** is used to show context-sensitive help for antidote and its commands. # OPTIONS -h, \--help : Inception-style meta-help recursively. [*\*] : Show help for a specific command. antidote-1.9.7/man/antidote-home.md000066400000000000000000000011031464631051600171720ustar00rootroot00000000000000--- title: antidote-home section: 1 header: Antidote Manual --- # NAME **antidote home** - print where antidote is cloning bundles # SYNOPSIS | antidote home # DESCRIPTION **antidote-home** shows you where antidote stores its cloned repos. It is not the home of the antidote utility itself. | antidote home You can override antidote's default home directory by setting the _\$ANTIDOTE_HOME_ variable in your **.zshrc**. # OPTIONS -h, \--help : Show the help documentation. # EXAMPLES You can clear out all your cloned repos like so: | rm -rfi $(antidote home) antidote-1.9.7/man/antidote-init.md000066400000000000000000000015761464631051600172230ustar00rootroot00000000000000--- title: antidote-init section: 1 header: Antidote Manual --- # NAME **antidote init** - initialize the shell for dynamic bundles # SYNOPSIS | source <(antidote init) # DESCRIPTION **antidote-init** changes how the **antidote** command works by causing **antidote bundle** to automatically source its own output instead of just generating the Zsh script for a static file. This behavior exists mainly to support legacy antigen/antibody usage. Static bundling is highly recommended for the best performance. However, dynamic bundling may be preferable for some scenarios, so you can rely on this functionality remaining a key feature in **antidote** to support users preferring dynamic bundles. Typical usage involves adding this snippet to your **.zshrc** before using **antidote bundle** commands: | source <(antidote init) # OPTIONS -h, \--help : Show the help documentation. antidote-1.9.7/man/antidote-install.md000066400000000000000000000030621464631051600177160ustar00rootroot00000000000000--- title: antidote-install section: 1 header: Antidote Manual --- # NAME **antidote install** - install a bundle # SYNOPSIS | antidote install [-h|\--help] [-k|\--kind \] [-p|\--path \] | [-a|\--autoload \] [-c|\--conditional \] | [\--pre \] [\--post \] | [-b|\--branch \] \ [\] # DESCRIPTION **antidote-install** clones a new bundle and adds it to your plugins file. The default bundle file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt**. This can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' file /path/to/my/bundle_file.txt # OPTIONS -h, \--help : Show the help documentation. -k, \--kind : The kind of bundle. Valid values: autoload, fpath, path, clone, defer, zsh. -p, \--path : A relative subpath within the bundle where the plugin is located. -b, \--branch : The git branch to use. -a, \--autoload : A relative subpath within the bundle where autoload function files are located. -c, \--conditional : A conditional function used to check whether to load the bundle. \--pre : A function to be called prior to loading the bundle. \--post : A function to be called after loading the bundle. \ : Bundle to be installed. [\] : Bundle file to write to if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt** or zstyle setting. # EXAMPLES | antidote install zsh-users/zsh-history-substring-search antidote-1.9.7/man/antidote-list.md000066400000000000000000000007241464631051600172250ustar00rootroot00000000000000--- title: antidote-list section: 1 header: Antidote Manual --- # NAME **antidote list** - list cloned bundles # SYNOPSIS | antidote list [-h|\--help] [-s|\--short] [-d|\--dirs] [-u|\--url] # DESCRIPTION **antidote-list** lists the cloned bundles in **antidote home**. # OPTIONS -h, \--help : Show the help documentation. -s, \--short : Show shortened repos where possible. -d, \--dirs : Show only bundle directories. -u, \--url : Show bundle URLs. antidote-1.9.7/man/antidote-load.md000066400000000000000000000017761464631051600172010ustar00rootroot00000000000000--- title: antidote-load section: 1 header: Antidote Manual --- # NAME **antidote load** - statically source bundles # SYNOPSIS | antidote load [\ [\]] # DESCRIPTION **antidote-load** will turn the bundle file into a static load file and then source it. The default bundle file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt**. This can be overridden with the following **zstyle**: | zstyle \':antidote:bundle\' file /path/to/my/bundle_file.txt The default static file is **${ZDOTDIR:-\$HOME}/.zsh_plugins.zsh**. This can be overridden with the following **zstyle**: | zstyle \':antidote:static\' file /path/to/my/static_file.zsh # OPTIONS -h, \--help : Show the help documentation. [\] : The plugins file to source if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.txt** or zstyle setting. [\] : The static plugins file to generate if not using the default. Defaults to **${ZDOTDIR:-\$HOME}/.zsh_plugins.zsh** or zstyle setting. antidote-1.9.7/man/antidote-path.md000066400000000000000000000005461464631051600172100ustar00rootroot00000000000000--- title: antidote-path section: 1 header: Antidote Manual --- # NAME **antidote path** - print the path of a cloned bundle # SYNOPSIS | antidote path \ # DESCRIPTION **antidote-path** prints the path of a cloned bundle. # OPTIONS -h, \--help : Show the help documentation. [\] : The bundle whose cloned path will be printed. antidote-1.9.7/man/antidote-purge.md000066400000000000000000000006431464631051600173740ustar00rootroot00000000000000--- title: antidote-purge section: 1 header: Antidote Manual --- # NAME **antidote purge** - remove a bundle # SYNOPSIS | antidote purge \ # DESCRIPTION **antidote-purge** removes a cloned bundle. # OPTIONS -h, \--help : Show the help documentation. -a, \--all : Purge all cloned bundles. \ : Bundle to be purged. # EXAMPLES | antidote purge zsh-users/zsh-history-substring-search antidote-1.9.7/man/antidote-update.md000066400000000000000000000006441464631051600175350ustar00rootroot00000000000000--- title: antidote-update section: 1 header: Antidote Manual --- # NAME **antidote update** - update bundles # SYNOPSIS | antidote update [-h|\--help] [-s|\--self] [-b|\--bundles] # DESCRIPTION **antidote-update** updates antidote and its cloned bundles. # OPTIONS -h, \--help : Show the help documentation. -s, \--self : Update antidote. -b, \--bundles : Update bundles. # EXAMPLES | antidote update antidote-1.9.7/man/antidote.md000066400000000000000000000123461464631051600162570ustar00rootroot00000000000000--- title: antidote section: 1 header: Antidote Manual --- # NAME **antidote** - the cure to slow zsh plugin management # SYNOPSIS | antidote [-v | --version] [-h | --help] \ [\ ...] # DESCRIPTION **antidote** is a Zsh plugin manager made from the ground up thinking about performance. It is fast because it can do things concurrently, and generates an ultra-fast static plugin file that you can easily load from your Zsh config. It is written natively in Zsh, is well tested, and picks up where Antigen and Antibody left off. # OPTIONS -h, \--help : Show context-sensitive help for antidote. -v, \--version : Show currently installed antidote version. # COMMANDS `help` : Show documentation `load` : Statically source all bundles from the plugins file `bundle` : Clone bundle(s) and generate the static load script `install` : Clone a new bundle and add it to your plugins file `update` : Update antidote and its cloned bundles `purge` : Remove a cloned bundle `home` : Print where antidote is cloning bundles `list` : List cloned bundles `path` : Print the path of a cloned bundle `init` : Initialize the shell for dynamic bundles # EXAMPLES ## A Simple Config Create a _.zsh_plugins.txt_ file with a list of the plugins you want: | # ${ZDOTDIR:-\$HOME}/.zsh_plugins.txt | zsh-users/zsh-syntax-highlighting | zsh-users/zsh-history-substring-search | zsh-users/zsh-autosuggestions Now, simply load your newly created static plugins file in your _.zshrc_. | # ${ZDOTDIR:-\$HOME}/.zshrc | source /path/to/antidote/antidote.zsh | antidote load ## A More Advanced Config Your _.zsh_plugins.txt_ file supports annotations. Annotations tell antidote how to do things like load plugins from alternate paths. This lets you use plugins from popular frameworks like Oh-My-Zsh: | # ${ZDOTDIR:-\$HOME}/.zsh_plugins.txt | ohmyzsh/ohmyzsh path:lib | ohmyzsh/ohmyzsh path:plugins/git | ohmyzsh/ohmyzsh path:plugins/magic-enter | etc... ## Dynamic Bundling Users familiar with legacy plugin managers like Antigen might prefer to use dynamic bundling. With dynamic bundling you sacrifice some performance to avoid having separate plugin files. To use dynamic bundling, we need to change how **antidote bundle** handles your plugins. We do this by sourcing the output from **antidote init**. An example config might look like this: | source /path/to/antidote/antidote.zsh | source <(antidote init) | antidote bundle zsh-users/zsh-autosuggestions | antidote bundle ohmyzsh/ohmyzsh path:lib | antidote bundle ohmyzsh/ohmyzsh path:plugins/git Instead of calling **antidote bundle** over and over, you might prefer to load bundles with a HEREDOC. | source /path/to/antidote/antidote.zsh | source <(antidote init) | antidote bundle < # AUTHORS - Copyright (c) 2021-2024 Matt McElheny - antidote contributors: # LICENSE MIT antidote-1.9.7/man/man1/000077500000000000000000000000001464631051600147545ustar00rootroot00000000000000antidote-1.9.7/man/man1/antidote-bundle.1000066400000000000000000000107761464631051600201270ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-bundle" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote bundle\f[R] \- download a bundle and print its source line .SH SYNOPSIS .PP antidote bundle [\&...] .SH DESCRIPTION \f[B]antidote\-bundle\f[R] assembles your Zsh plugins. Bundles can be git repos, or local files or directories. If a plugin is a repo, it will be cloned if necessary. The zsh code necessary to load (source) the plugin is then printed. .PP \ \ antidote bundle gituser/gitrepo .PD 0 .P .PD \ \ antidote bundle $ZSH_CUSTOM/plugins/myplugin .PD 0 .P .PD \ \ antidote bundle ${ZDOTDIR:\-$HOME}/.zlibs/myfile.zsh .PP Bundles also support annotations. Annotations allow you have finer grained control over your plugins. Annotations are used in the form \[aq]keyword:value\[aq]. .TP \f[CR]kind\f[R] .IP \[bu] 2 \f[B]zsh\f[R]: A zsh plugin. This is the default kind of bundle. .IP \[bu] 2 \f[B]fpath\f[R]: Only add the plugin to your \f[I]$fpath\f[R]. .IP \[bu] 2 \f[B]path\f[R]: Add the plugin to your \f[I]$PATH\f[R]. .IP \[bu] 2 \f[B]clone\f[R]: Only clone a plugin, but don\[cq]t do anything else with it. .IP \[bu] 2 \f[B]defer\f[R]: Defers loading of a plugin using \[aq]romkatv/zsh\-defer\[aq]. .IP \[bu] 2 \f[B]autoload\f[R]: Autoload all the files in the plugin directory as zsh functions. .TP \f[CR]branch\f[R] The branch annotation allows you to change the default branch of a plugin\[cq]s repo from \f[B]main\f[R] to a branch of your choosing. .TP \f[CR]path\f[R] The path annotation allows you to use a subdirectory or file within a plugin\[cq]s structure instead of the root plugin (eg: \[aq]path:plugins/subplugin\[aq]). .TP \f[CR]conditional\f[R] The conditonal annotation allows you to wrap an \f[B]if\f[R] statement around a plugin\[cq]s load script. Supply the name of a zero argument zsh function to conditional to perform the test (eg: \[aq]conditional:is\-macos\[aq]). .TP \f[CR]pre\f[R] / \f[CR]post\f[R] The pre and post annotations allow you to call a function before or after a plugin\[cq]s load script. This is helpful when configuring plugins, since the configuration functions will only run for active plugins. Supply the name of a zero argument zsh function to pre or post. .TP \f[CR]autoload\f[R] The autoload annotation allows you to autoload a zsh functions directory in addition to however the plugin was loaded as specified by \[aq]kind\[aq]. Supply a relative path to autoload (eg: \[aq]autoload:functions\[aq]). .PP Cloned repo directory names can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] use\-friendly\-names \[aq]yes\[aq] .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [\f[I]\&...\f[R]] Zsh plugin bundles .SH EXAMPLES Using the \f[B]kind:\f[R] annotation\&... .PP \ \ # a regular plugin (kind:zsh is implied, so it\[cq]s unnecessary) .PD 0 .P .PD \ \ antidote bundle zsh\-users/zsh\-history\-substring\-search kind:zsh .PP \ \ # add prompt plugins to $fpath .PD 0 .P .PD \ \ antidote bundle sindresorhus/pure kind:fpath .PP \ \ # add utility plugins to $PATH .PD 0 .P .PD \ \ antidote bundle romkatv/zsh\-bench kind:path .PP \ \ # clone a repo for use in other ways .PD 0 .P .PD \ \ antidote bundle mbadolato/iTerm2\-Color\-Schemes kind:clone .PP \ \ # autoload a functions directory .PD 0 .P .PD \ \ antidote bundle sorin\-ionescu/prezto path:modules/utility/functions kind:autoload .PP \ \ # defer a plugin to speed up load times .PD 0 .P .PD \ \ antidote bundle olets/zsh\-abbr kind:defer .PP Using the \f[B]branch:\f[R] annotation\&... .PP \ \ # don\[cq]t use the main branch, use develop instead .PD 0 .P .PD \ \ antidote bundle zsh\-users/zsh\-autosuggestions branch:develop .PP Using the \f[B]path:\f[R] annotation\&... .PP \ \ # load oh\-my\-zsh .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/git .PP Using the \f[B]conditional:\f[R] annotation\&... .PP \ \ # define a conditional function prior to loading antidote .PD 0 .P .PD \ \ function is_macos { .PD 0 .P .PD \ \ \ \ [[ $OSTYPE == darwin* ]] || return 1 .PD 0 .P .PD \ \ } .PD 0 .P .PD .PD 0 .P .PD \ \ # conditionally load a plugin using the function you made .PD 0 .P .PD \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/macos conditional:is_macos .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-help.1000066400000000000000000000013061464631051600175730ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-help" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote help\f[R] \- show antidote documentation .SH SYNOPSIS .PP antidote help [] .SH DESCRIPTION \f[B]antidote\-help\f[R] is used to show context\-sensitive help for antidote and its commands. .SH OPTIONS .TP \-h, \-\-help Inception\-style meta\-help recursively. .TP [\f[I]\f[R]] Show help for a specific command. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-home.1000066400000000000000000000016301464631051600175730ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-home" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote home\f[R] \- print where antidote is cloning bundles .SH SYNOPSIS .PP antidote home .SH DESCRIPTION \f[B]antidote\-home\f[R] shows you where antidote stores its cloned repos. It is not the home of the antidote utility itself. .PP \ \ antidote home .PP You can override antidote\[cq]s default home directory by setting the \f[I]$ANTIDOTE_HOME\f[R] variable in your \f[B].zshrc\f[R]. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .SH EXAMPLES You can clear out all your cloned repos like so: .PP \ \ rm \-rfi $(antidote home) .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-init.1000066400000000000000000000023361464631051600176120ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-init" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote init\f[R] \- initialize the shell for dynamic bundles .SH SYNOPSIS .PP source <(antidote init) .SH DESCRIPTION \f[B]antidote\-init\f[R] changes how the \f[B]antidote\f[R] command works by causing \f[B]antidote bundle\f[R] to automatically source its own output instead of just generating the Zsh script for a static file. .PP This behavior exists mainly to support legacy antigen/antibody usage. Static bundling is highly recommended for the best performance. However, dynamic bundling may be preferable for some scenarios, so you can rely on this functionality remaining a key feature in \f[B]antidote\f[R] to support users preferring dynamic bundles. .PP Typical usage involves adding this snippet to your \f[B].zshrc\f[R] before using \f[B]antidote bundle\f[R] commands: .PP \ source <(antidote init) .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-install.1000066400000000000000000000036671464631051600203250ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-install" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote install\f[R] \- install a bundle .SH SYNOPSIS .PP antidote install [\-h|\-\-help] [\-k|\-\-kind ] [\-p|\-\-path ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-a|\-\-autoload ] [\-c|\-\-conditional ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-\-pre ] [\-\-post ] .PD 0 .P .PD \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-b|\-\-branch ] [] .SH DESCRIPTION \f[B]antidote\-install\f[R] clones a new bundle and adds it to your plugins file. .PP The default bundle file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] file /path/to/my/bundle_file.txt .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-k, \-\-kind The kind of bundle. Valid values: autoload, fpath, path, clone, defer, zsh. .TP \-p, \-\-path A relative subpath within the bundle where the plugin is located. .TP \-b, \-\-branch The git branch to use. .TP \-a, \-\-autoload A relative subpath within the bundle where autoload function files are located. .TP \-c, \-\-conditional A conditional function used to check whether to load the bundle. .TP \-\-pre A function to be called prior to loading the bundle. .TP \-\-post A function to be called after loading the bundle. .TP Bundle to be installed. .TP [] Bundle file to write to if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R] or zstyle setting. .SH EXAMPLES .PP \ \ antidote install zsh\-users/zsh\-history\-substring\-search .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-list.1000066400000000000000000000014371464631051600176230ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-list" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote list\f[R] \- list cloned bundles .SH SYNOPSIS .PP antidote list [\-h|\-\-help] [\-s|\-\-short] [\-d|\-\-dirs] [\-u|\-\-url] .SH DESCRIPTION \f[B]antidote\-list\f[R] lists the cloned bundles in \f[B]antidote home\f[R]. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-s, \-\-short Show shortened repos where possible. .TP \-d, \-\-dirs Show only bundle directories. .TP \-u, \-\-url Show bundle URLs. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-load.1000066400000000000000000000025521464631051600175660ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-load" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote load\f[R] \- statically source bundles .SH SYNOPSIS .PP antidote load [ []] .SH DESCRIPTION \f[B]antidote\-load\f[R] will turn the bundle file into a static load file and then source it. .PP The default bundle file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:bundle\[aq] file /path/to/my/bundle_file.txt .PP The default static file is \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.zsh\f[R]. This can be overridden with the following \f[B]zstyle\f[R]: .PP \ \ zstyle \[aq]:antidote:static\[aq] file /path/to/my/static_file.zsh .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [] The plugins file to source if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.txt\f[R] or zstyle setting. .TP [] The static plugins file to generate if not using the default. Defaults to \f[B]${ZDOTDIR:\-$HOME}/.zsh_plugins.zsh\f[R] or zstyle setting. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-path.1000066400000000000000000000012331464631051600175760ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-path" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote path\f[R] \- print the path of a cloned bundle .SH SYNOPSIS .PP antidote path .SH DESCRIPTION \f[B]antidote\-path\f[R] prints the path of a cloned bundle. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP [] The bundle whose cloned path will be printed. .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-purge.1000066400000000000000000000013411464631051600177640ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-purge" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote purge\f[R] \- remove a bundle .SH SYNOPSIS .PP antidote purge .SH DESCRIPTION \f[B]antidote\-purge\f[R] removes a cloned bundle. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-a, \-\-all Purge all cloned bundles. .TP Bundle to be purged. .SH EXAMPLES .PP \ \ antidote purge zsh\-users/zsh\-history\-substring\-search .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote-update.1000066400000000000000000000013501464631051600201240ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote\-update" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote update\f[R] \- update bundles .SH SYNOPSIS .PP antidote update [\-h|\-\-help] [\-s|\-\-self] [\-b|\-\-bundles] .SH DESCRIPTION \f[B]antidote\-update\f[R] updates antidote and its cloned bundles. .SH OPTIONS .TP \-h, \-\-help Show the help documentation. .TP \-s, \-\-self Update antidote. .TP \-b, \-\-bundles Update bundles. .SH EXAMPLES .PP antidote update .SH BUGS See GitHub Issues: \c .UR https://github.com/mattmc3/antidote/issues .UE \c .SH AUTHORS .IP \[bu] 2 Copyright (c) 2021\-2024 Matt McElheny .IP \[bu] 2 antidote contributors: \c .UR https://github.com/mattmc3/antidote/graphs/contributors .UE \c .SH LICENSE MIT antidote-1.9.7/man/man1/antidote.1000066400000000000000000000143311464631051600166470ustar00rootroot00000000000000.\" Automatically generated by Pandoc .\" .TH "antidote" "1" "" "" "Antidote Manual" .SH NAME \f[B]antidote\f[R] \- the cure to slow zsh plugin management .SH SYNOPSIS .PP antidote [\-v | \[en]version] [\-h | \[en]help] [ \&...] .SH DESCRIPTION \f[B]antidote\f[R] is a Zsh plugin manager made from the ground up thinking about performance. .PP It is fast because it can do things concurrently, and generates an ultra\-fast static plugin file that you can easily load from your Zsh config. .PP It is written natively in Zsh, is well tested, and picks up where Antigen and Antibody left off. .SH OPTIONS .TP \-h, \-\-help Show context\-sensitive help for antidote. .TP \-v, \-\-version Show currently installed antidote version. .SH COMMANDS .TP \f[CR]help\f[R] Show documentation .TP \f[CR]load\f[R] Statically source all bundles from the plugins file .TP \f[CR]bundle\f[R] Clone bundle(s) and generate the static load script .TP \f[CR]install\f[R] Clone a new bundle and add it to your plugins file .TP \f[CR]update\f[R] Update antidote and its cloned bundles .TP \f[CR]purge\f[R] Remove a cloned bundle .TP \f[CR]home\f[R] Print where antidote is cloning bundles .TP \f[CR]list\f[R] List cloned bundles .TP \f[CR]path\f[R] Print the path of a cloned bundle .TP \f[CR]init\f[R] Initialize the shell for dynamic bundles .SH EXAMPLES .SS A Simple Config Create a \f[I].zsh_plugins.txt\f[R] file with a list of the plugins you want: .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zsh_plugins.txt .PD 0 .P .PD \ \ \ zsh\-users/zsh\-syntax\-highlighting .PD 0 .P .PD \ \ \ zsh\-users/zsh\-history\-substring\-search .PD 0 .P .PD \ \ \ zsh\-users/zsh\-autosuggestions .PP Now, simply load your newly created static plugins file in your \f[I].zshrc\f[R]. .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zshrc .PD 0 .P .PD \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ antidote load .SS A More Advanced Config Your \f[I].zsh_plugins.txt\f[R] file supports annotations. Annotations tell antidote how to do things like load plugins from alternate paths. This lets you use plugins from popular frameworks like Oh\-My\-Zsh: .PP \ \ \ # ${ZDOTDIR:\-$HOME}/.zsh_plugins.txt .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:plugins/git .PD 0 .P .PD \ \ \ ohmyzsh/ohmyzsh path:plugins/magic\-enter .PD 0 .P .PD \ \ \ etc\&... .SS Dynamic Bundling Users familiar with legacy plugin managers like Antigen might prefer to use dynamic bundling. With dynamic bundling you sacrifice some performance to avoid having separate plugin files. To use dynamic bundling, we need to change how \f[B]antidote bundle\f[R] handles your plugins. We do this by sourcing the output from \f[B]antidote init\f[R]. .PP An example config might look like this: .PP \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ source <(antidote init) .PD 0 .P .PD \ \ \ antidote bundle zsh\-users/zsh\-autosuggestions .PD 0 .P .PD \ \ \ antidote bundle ohmyzsh/ohmyzsh path:lib .PD 0 .P .PD \ \ \ antidote bundle ohmyzsh/ohmyzsh path:plugins/git .PP Instead of calling \f[B]antidote bundle\f[R] over and over, you might prefer to load bundles with a HEREDOC. .PP \ \ \ source /path/to/antidote/antidote.zsh .PD 0 .P .PD \ \ \ source <(antidote init) .PD 0 .P .PD \ \ \ antidote bundle <] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles % ``` ## Version The `-v/--version` flag displays the current version: ```zsh % antidote --version antidote version 1.9.7 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/_setup.zsh000066400000000000000000000001261464631051600165330ustar00rootroot00000000000000# autoload test functions 0=${(%):-%N} autoload -U ${0:A:h}/functions/t_setup t_setup antidote-1.9.7/tests/functions/000077500000000000000000000000001464631051600165175ustar00rootroot00000000000000antidote-1.9.7/tests/functions/mockgit000066400000000000000000000040601464631051600200770ustar00rootroot00000000000000#!/bin/zsh #function mockgit { # handle these commands: # - `git -C "$dir" config remote.origin.url` # - `git -C "$dir" pull --quiet --ff --rebase --autostash` # - `git -C "$dir" rev-parse --short HEAD` # - `git clone --quiet --depth 1 --recurse-submodules --shallow-submodules --branch branch $url $dir` # - `git --version` emulate -L zsh; setopt local_options extended_glob local MATCH MBEGIN MEND; local -a match mbegin mend # appease 'warn_create_global' 0=${(%):-%x} local args=("$@[@]") local o_path o_quiet o_ff o_rebase o_autostash o_short local o_depth o_recurse_submodules o_shallow_submodules o_branch zparseopts -D -E -- \ C:=o_path \ -short=o_short \ -quiet=o_quiet \ -ff=o_ff \ -rebase=o_rebase \ -autostash=o_autostash \ -recurse-submodules=o_recurse_submodules \ -shallow-submodules=o_shallow_submodules \ -depth:=o_depth \ -branch:=o_branch || return 1 if [[ "$@" = "--version" ]]; then echo "0.0.0" elif [[ "$1" = "clone" ]]; then local giturl="$2" local bundledir="$3" local src="$ANTIDOTE_HOME/${bundledir:t}" if [[ -d $src ]]; then cp -r $src ${bundledir:h} elif ! (( $#o_quiet )); then echo "MOCKGIT: Cloning into '${url:t}'..." echo "MOCKGIT: Repository not found." echo "MOCKGIT: repository '$url' not found" fi elif [[ "$@" = "config remote.origin.url" ]]; then if [[ -e $bundledir/.git/config/remote.origin.url ]]; then cat $bundledir/.git/config/remote.origin.url else # un-sanitize dir into URL local url=$o_path[-1] url=${url:t} url=${url:gs/-AT-/\@} url=${url:gs/-COLON-/\:} url=${url:gs/-SLASH-/\/} echo "$url" fi elif [[ "$@" = "pull" ]]; then (( $#o_quiet )) || echo "MOCKGIT: Already up to date." elif [[ "$@" = "rev-parse HEAD" ]]; then #echo "a123456" echo "" else echo >&2 "mocking not implemented for git command: git $@" return 1 fi #} antidote-1.9.7/tests/functions/subenv000066400000000000000000000004461464631051600177500ustar00rootroot00000000000000#!/bin/zsh #function subenv { emulate -L zsh; setopt local_options if (( $# == 0 )); then set -- HOME fi local -a sedargs=(-e "s|\$HOME|$HOME|g") while (( $# )); do if [[ -v "$1" ]]; then sedargs+=(-e "s|${(P)1}|\$$1|g") fi shift done sed "$sedargs[@]" #} antidote-1.9.7/tests/functions/t_reset000066400000000000000000000001531464631051600201060ustar00rootroot00000000000000#!/bin/zsh #function t_reset { 0=${(%):-%x} t_teardown t_setup source ${0:A:h:h:h}/antidote.zsh #} antidote-1.9.7/tests/functions/t_setup000066400000000000000000000025551464631051600201340ustar00rootroot00000000000000#!/bin/zsh #function t_setup { emulate -L zsh setopt local_options extended_glob glob_dots 0=${(%):-%x} local prjdir="${0:A:h:h:h}" local testdir="${0:A:h:h}" # save path/fpath typeset -ga T_PREV_PATH=( $path ) typeset -ga T_PREV_FPATH=( $fpath ) # save zstyles, and clear them all for the test session typeset -ga T_PREV_ZSTYLES=( ${(@f)"$(zstyle -L ':antidote:*')"} ) source <(zstyle -L ':antidote:*' | awk '{print "zstyle -d",$2}') # setup test functions fpath+=( $testdir/functions ) autoload -Uz $testdir/functions/* # mock git function git { mockgit "$@" } # works with BSD and GNU gmktemp T_TEMPDIR=${$(mktemp -d -t t_antidote.XXXXXXXX):A} typeset -g T_PREV_HOME=$HOME typeset -g T_PREV_ZDOTDIR=$ZDOTDIR export HOME=$T_TEMPDIR export ZDOTDIR=$HOME/.zsh typeset -g ANTIDOTE_HOME=$HOME/.cache/antidote # put tmp_home into position for p in $testdir/tmp_home/*; do cp -rf $p $T_TEMPDIR done # rename .mockgit to .git local mockdir for mockdir in $T_TEMPDIR/**/.mock*; do mv $mockdir ${mockdir:s/.mock/.} done # our mock plugins use this typeset -ga plugins=() typeset -ga libs=() # setup antidote zstyle ':antidote:tests' set-warn-options 'on' zstyle ':antidote:tests' cloning 'off' zstyle ':antidote:bundle' use-friendly-names on zstyle ':antidote:defer' bundle 'getantidote/zsh-defer' #} antidote-1.9.7/tests/functions/t_setup_real000066400000000000000000000014241464631051600211310ustar00rootroot00000000000000#!/bin/zsh #function t_setup_real { 0=${(%):-%x} local testdir="${0:A:h:h}" local prjdir="${0:A:h:h:h}" # undo setup so we clone for real zstyle ':antidote:tests' cloning 'on' (( $+functions[git] )) && unfunction git # unset other testing zstyles zstyle -d ':antidote:defer' bundle # unset rupa/z (( $+aliases[z] )) && unalias z # replace .zsh_plugins.txt with real versions local file for file in .zsh_plugins.txt .zsh_plugins.zsh; do [[ -f $ZDOTDIR/$file ]] && command rm -f -- "$ZDOTDIR/$file" [[ -f $testdir/real/$file ]] && command rm -f -- "$testdir/real/$file" done # clean out antidote home [[ -d $ANTIDOTE_HOME ]] && command rm -rf -- "$ANTIDOTE_HOME" mkdir -p "$ANTIDOTE_HOME" # source antidote source $prjdir/antidote.zsh #} antidote-1.9.7/tests/functions/t_teardown000066400000000000000000000016071464631051600206140ustar00rootroot00000000000000#!/bin/zsh #function t_teardown { emulate -L zsh setopt local_options # reset current session HOME=$T_PREV_HOME ZDOTDIR=$T_PREV_ZDOTDIR # unfunction all antidote for fn in ${(k)functions}; do [[ $fn == *antidote* ]] && unfunction -- $fn done (( $+functions[git] )) && unfunction git # unfunction zsh-defer (( $+functions[zsh-defer] )) && unfunction zsh-defer # restore original path/fpath path=( $T_PREV_PATH ) fpath=( $T_PREV_FPATH ) # restore original zstyles source <(zstyle -L ':antidote:*' | awk '{print "zstyle -d",$2}') source <(printf '%s\n' $T_PREV_ZSTYLES) # remove tempdir [[ -d "$T_TEMPDIR" ]] && command rm -rf -- "$T_TEMPDIR" # remove vars for var in \ ANTIDOTE_HOME \ T_TEMPDIR \ T_PREV_HOME \ T_PREV_ZDOTDIR \ T_PREV_PATH \ T_PREV_FPATH \ plugins \ libs do [[ -v $var ]] && unset $var done #} antidote-1.9.7/tests/functions/t_unload_antidote000066400000000000000000000004471464631051600221430ustar00rootroot00000000000000#!/bin/zsh emulate -L zsh setopt local_options # unfunction all antidote for fn in ${(k)functions}; do [[ $fn == *antidote* ]] && [[ $fn != t_* ]] && unfunction -- $fn done (( $+functions[git] )) && unfunction git # unfunction zsh-defer (( $+functions[zsh-defer] )) && unfunction zsh-defer antidote-1.9.7/tests/test_alt_zsh_defer_bundle.md000066400000000000000000000014421464631051600222330ustar00rootroot00000000000000# antidote test alternative zsh-defer repo ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Customize zsh-defer If the user forks zsh-defer, support setting a zstyle for an alternative repo location. ### General ```zsh % zstyle ':antidote:bundle' use-friendly-names on % zstyle ':antidote:defer' bundle 'custom/zsh-defer' % antidote bundle 'zsh-users/zsh-autosuggestions kind:defer' 2>/dev/null if ! (( $+functions[zsh-defer] )); then fpath+=( $HOME/.cache/antidote/custom/zsh-defer ) source $HOME/.cache/antidote/custom/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $HOME/.cache/antidote/zsh-users/zsh-autosuggestions ) zsh-defer source $HOME/.cache/antidote/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_antidote.md000066400000000000000000000140501464631051600176770ustar00rootroot00000000000000# antidote bundle tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Version Show antidote's version: ```zsh % antidote --version antidote version 1.9.7 % ``` ## Help Show antidote's functionality: ```zsh % antidote --help antidote - the cure to slow zsh plugin management usage: antidote [] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles % ``` ## Bundling Bundle the foo/bar repo using old antibody style directories: ```zsh % zstyle ':antidote:bundle' use-friendly-names off % antidote bundle foo/bar # antidote cloning foo/bar... fpath+=( $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) source $HOME/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh % ``` Use new-style directory naming: ```zsh % zstyle ':antidote:bundle' use-friendly-names on % ``` Bundle a repo at https://github.com/foo/bar ```zsh % antidote bundle foo/bar fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % ``` Bundle a repo at git@bitbucket.org:foo/bar ```zsh % antidote bundle git@bitbucket.org:foo/bar fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % ``` Bundle a specific branch of a repo with `branch:`. ```zsh % antidote bundle foo/bar branch:dev fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % ``` ### Annotations: kind Bundles support a `kind:` annotation. The default is `kind:zsh`. ```zsh % antidote bundle foo/bar kind:zsh fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % ``` Bundle foo/bar with `kind:path` to add it to your `$PATH`. ```zsh % antidote bundle foo/bar kind:path export PATH="$HOME/.cache/antidote/foo/bar:$PATH" % ``` Bundle foo/bar with `kind:fpath` to add it to your `$fpath`. ```zsh % antidote bundle foo/bar kind:fpath fpath+=( $HOME/.cache/antidote/foo/bar ) % ``` Bundle foo/bar with `kind:clone` to just clone the repo, but do nothing to load it. ```zsh % antidote bundle foo/bar kind:clone % ``` Autoload a path within foo/bar with the `kind:autoload` annotation. ```zsh % antidote bundle foo/baz kind:autoload path:functions fpath+=( $HOME/.cache/antidote/foo/baz/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) % ``` Defer loading the foo/bar bundle with the `kind:defer` annotation. ```zsh % antidote bundle foo/baz kind:defer if ! (( $+functions[zsh-defer] )); then fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $HOME/.cache/antidote/foo/baz ) zsh-defer source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh % ``` ### Annotations: path Use the `path:` annotation to load subplugins. ```zsh % antidote bundle ohmy/ohmy path:plugins/docker fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh % ``` Use `path:` to load a whole directory full of files. ```zsh % antidote bundle ohmy/ohmy path:lib fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh % ``` Use `path:` to load a specific file. ```zsh % antidote bundle ohmy/ohmy path:custom/themes/pretty.zsh-theme source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme % ``` ### Annotations: conditional Use a existing boolean function to wrap a bundle in `if` logic: ```zsh % is-macos() { [[ "$OSTYPE" == "darwin"* ]]; } % antidote bundle foo/bar conditional:is-macos if is-macos; then fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fi % ``` ## Dynamic bundling If you run `source <(antidote init)`, antidote will emit a wrapper so that you can dynamically bundle. ```zsh % antidote init #!/usr/bin/env zsh function antidote { case "$1" in bundle) source <( antidote-main $@ ) || antidote-main $@ ;; *) antidote-main $@ ;; esac } % ``` ## Home Show where antidote stores its bundles: ```zsh % antidote home | subenv HOME $HOME/.cache/antidote % ``` ## List bundles List directories: ```zsh % antidote list --dirs | subenv HOME $HOME/.cache/antidote/foo/bar $HOME/.cache/antidote/foo/baz $HOME/.cache/antidote/foo/qux $HOME/.cache/antidote/getantidote/zsh-defer $HOME/.cache/antidote/ohmy/ohmy % ``` List repo URLs: ```zsh % antidote list --url git@github.com:foo/qux https://github.com/foo/bar https://github.com/foo/baz https://github.com/getantidote/zsh-defer https://github.com/ohmy/ohmy % ``` List short repos: ```zsh % antidote list --short foo/bar foo/baz getantidote/zsh-defer git@github.com:foo/qux ohmy/ohmy % ``` ## Bundle paths Show the path to a bundle: ```zsh % ZSH=$(antidote path ohmy/ohmy) % echo $ZSH | subenv HOME $HOME/.cache/antidote/ohmy/ohmy % ``` ## Update bundles ```zsh % antidote update Updating bundles... antidote: checking for updates: https://github.com/foo/bar antidote: checking for updates: https://github.com/foo/baz antidote: checking for updates: git@github.com:foo/qux antidote: checking for updates: https://github.com/getantidote/zsh-defer antidote: checking for updates: https://github.com/ohmy/ohmy Waiting for bundle updates to complete... Bundle updates complete. Updating antidote... antidote self-update complete. antidote version 1.9.7 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_antidote_core.md000066400000000000000000000036631464631051600207170ustar00rootroot00000000000000# antidote core tests fails gracefully when someone tries bash ```zsh % bash -c "source $PWD/antidote.zsh" antidote: Expecting zsh. Found 'bash'. % ``` ## Setup ```zsh % echo $+functions[antidote] 0 % source ./tests/_setup.zsh % source ./antidote.zsh % echo $+functions[antidote] 1 % git --version 0.0.0 % ``` ## General No args displays help: ```zsh % antidote antidote - the cure to slow zsh plugin management usage: antidote [] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles % ``` No arg exit status is 2: ```zsh % antidote >/dev/null; err=$? % echo $err 2 % ``` ## Help `-h` and `--help` work: ```zsh % antidote -h >/dev/null; err=$? % echo $err 0 % antidote --help >/dev/null; err=$? % echo $err 0 % ``` ## Version `-v` and `--version` work: ```zsh % antidote --version antidote version 1.9.7 % antidote -v >/dev/null; echo $? 0 % antidote --version >/dev/null; echo $? 0 % ``` ## Unrecognized options ```zsh % antidote --foo >/dev/null; err=$? #=> --regex (bad option|command not found) % echo $err 1 % ``` ## Unrecognized commands ```zsh % antidote foo; err=$? antidote: command not found 'foo' % echo $err 1 % ``` ## All commands ```zsh % cmds=( bundle help home init install list load path purge update script main null ) % for cmd in $cmds; echo $+functions[antidote-$cmd] 1 1 1 1 1 1 1 1 1 1 1 1 0 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_bundle_helpers.md000066400000000000000000000121441464631051600210650ustar00rootroot00000000000000# antidote bundle helper tests ## Setup ```zsh % TESTDATA=$PWD/tests/testdata % source ./tests/_setup.zsh % source ./antidote.zsh % antidote-bundle -h &>/dev/null % ``` ## Awk filter repos The repo parser pulls a list of all git URLs in a bundle file so that we can clone missing ones in parallel. ```zsh % __antidote_bulk_clone $TESTDATA/.zsh_plugins_repos.txt antidote-script --kind clone --branch baz foobar/foobar & antidote-script --kind clone bar/baz & antidote-script --kind clone getantidote/zsh-defer & antidote-script --kind clone git@github.com:user/repo & antidote-script --kind clone http://github.com/user/repo.git & antidote-script --kind clone https://github.com/foo/baz & antidote-script --kind clone https://github.com/foo/qux & antidote-script --kind clone https://github.com/user/repo & antidote-script --kind clone user/repo & wait % ``` Test empty ```zsh % __antidote_bulk_clone $TESTDATA/.zsh_plugins_empty.txt wait % ``` ## Awk Filter defers Test that only the first defer block is kept... ```zsh % __antidote_filter_defers $PWD/tests/testdata/.zsh_plugins_multi_defer.zsh | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh if is-macos; then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh/dracula.zsh-theme fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh/up.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf/tailf.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z/z.sh % ``` Test that with no defers, nothing is altered... ```zsh % __antidote_filter_defers $PWD/tests/testdata/.zsh_plugins_no_defer.zsh #=> --file testdata/.zsh_plugins_no_defer.zsh % ``` ## Awk Bundle parser Parse a simple repo: ```zsh % echo foo/bar | __antidote_parse_bundles antidote-script foo/bar % ``` ```zsh % echo 'https://github.com/foo/bar path:lib branch:dev' | __antidote_parse_bundles antidote-script --path lib --branch dev https://github.com/foo/bar % echo 'git@github.com:foo/bar.git kind:clone branch:main' | __antidote_parse_bundles antidote-script --kind clone --branch main git@github.com:foo/bar.git % echo 'foo/bar kind:fpath abc:xyz' | __antidote_parse_bundles antidote-script --kind fpath --abc xyz foo/bar % echo 'foo/bar path:plugins/myplugin kind:path # trailing comment' | __antidote_parse_bundles antidote-script --path plugins/myplugin --kind path foo/bar % ``` Handle funky whitespace ```zsh % cr=$'\r'; lf=$'\n'; tab=$'\t' % echo "foo/bar${tab}kind:path${cr}${lf}" | __antidote_parse_bundles antidote-script --kind path foo/bar % ``` The bundle parser is an awk script that turns the bundle DSL into antidote-script statements. ```zsh % __antidote_parse_bundles $ZDOTDIR/.zsh_plugins.txt antidote-script ~/foo/bar antidote-script --path plugins/myplugin \$ZSH_CUSTOM antidote-script foo/bar antidote-script git@github.com:foo/qux.git antidote-script --kind clone getantidote/zsh-defer antidote-script --kind zsh foo/bar antidote-script --kind fpath foo/bar antidote-script --kind path foo/bar antidote-script --path lib ohmy/ohmy antidote-script --path plugins/extract ohmy/ohmy antidote-script --path plugins/magic-enter --kind defer ohmy/ohmy antidote-script --path custom/themes/pretty.zsh-theme ohmy/ohmy % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_bundle.md000066400000000000000000000030131464631051600201610ustar00rootroot00000000000000# antidote bundle helper tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Test bundle command Many 'bundle' tests could just as well just be 'script' tests, so we rely on 'test_script.md' to find scripting issues and use this to test actual bundling, or things not handled by 'antidote script'. You can think of 'antidote script' as handling a single bundle, and 'antidote bundle' handling them in bulk. ### General ```zsh % # antidote bundle % ``` ```zsh % antidote bundle <$ZDOTDIR/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh % cat $ZDOTDIR/.zsh_plugins.zsh | subenv #=> --file testdata/.zsh_plugins.zsh % ``` ### Multiple ways to call bundle Test \|piping, \ --file testdata/script-foobar.zsh % echo 'foo/bar' | antidote bundle | subenv ANTIDOTE_HOME #=> --file testdata/script-foobar.zsh % echo 'foo/bar' >$ZDOTDIR/.zsh_plugins_simple.txt % antidote bundle <$ZDOTDIR/.zsh_plugins_simple.txt | subenv ANTIDOTE_HOME #=> --file testdata/script-foobar.zsh % zstyle ':antidote:bundle' use-friendly-names on % ANTIDOTE_HOME=$HOME/.cache/antidote % ``` ## Fails ```zsh % echo "foo/bar\nfoo/baz kind:whoops" | antidote bundle 2>&1 | subenv ANTIDOTE_HOME antidote: error: unexpected kind value: 'whoops' fpath+=( $ANTIDOTE_HOME/foo/bar ) source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_help.md000066400000000000000000000106271464631051600176510ustar00rootroot00000000000000# antidote help tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## General `antidote help` command exists ```zsh % antidote help &>/dev/null; echo $? 0 % ``` `antidote --h/--help` works ```zsh % antidote -h &>/dev/null; echo $? 0 % antidote --help &>/dev/null; echo $? 0 % ``` `antidote` man pages work ```zsh % PAGER=cat man antidote | head -n 1 | sed 's/ */ /g' antidote(1) Antidote Manual antidote(1) % ``` `antidote` man pages are in `$MANPATH` ```zsh % [[ "$MANPATH" == *"$PWD/man:"* ]] || echo 'MANPATH not set properly' % ``` ## antidote-bundle ```zsh % antidote help bundle | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % antidote bundle --help | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % antidote bundle -h | head -n 1 | sed 's/ */ /g' antidote-bundle(1) Antidote Manual antidote-bundle(1) % ``` ## antidote-help ```zsh % antidote help help | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % antidote help --help | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % antidote help -h | head -n 1 | sed 's/ */ /g' antidote-help(1) Antidote Manual antidote-help(1) % ``` ## antidote-home ```zsh % antidote help home | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % antidote home --help | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % antidote home -h | head -n 1 | sed 's/ */ /g' antidote-home(1) Antidote Manual antidote-home(1) % ``` ## antidote-init ```zsh % antidote help init | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % antidote init --help | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % antidote init -h | head -n 1 | sed 's/ */ /g' antidote-init(1) Antidote Manual antidote-init(1) % ``` ## antidote-install ```zsh % antidote help install | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % antidote install --help | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % antidote install -h | head -n 1 | sed 's/ */ /g' antidote-install(1) Antidote Manual antidote-install(1) % ``` ## antidote-list ```zsh % antidote help list | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % antidote list --help | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % antidote list -h | head -n 1 | sed 's/ */ /g' antidote-list(1) Antidote Manual antidote-list(1) % ``` ## antidote-load ```zsh % antidote help load | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % antidote load --help | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % antidote load -h | head -n 1 | sed 's/ */ /g' antidote-load(1) Antidote Manual antidote-load(1) % ``` ## antidote-path ```zsh % antidote help path | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % antidote path --help | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % antidote path -h | head -n 1 | sed 's/ */ /g' antidote-path(1) Antidote Manual antidote-path(1) % ``` ## antidote-update ```zsh % antidote help update | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % antidote update --help | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % antidote update -h | head -n 1 | sed 's/ */ /g' antidote-update(1) Antidote Manual antidote-update(1) % ``` ## antidote-script ```zsh % antidote help script No manual entry for antidote-script antidote - the cure to slow zsh plugin management usage: antidote [] [ ...] flags: -h, --help Show context-sensitive help -v, --version Show application version commands: help Show documentation load Statically source all bundles from the plugins file bundle Clone bundle(s) and generate the static load script install Clone a new bundle and add it to your plugins file update Update antidote and its cloned bundles purge Remove a cloned bundle home Print where antidote is cloning bundles list List cloned bundles path Print the path of a cloned bundle init Initialize the shell for dynamic bundles % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_home.md000066400000000000000000000030441464631051600176440ustar00rootroot00000000000000# antidote home tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## General `antidote home` command exists ```zsh % antidote home &>/dev/null; echo $? 0 % ``` `antidote home --h/--help` works ```zsh % antidote home -h &>/dev/null; echo $? 0 % antidote home --help &>/dev/null; echo $? 0 % ``` `$ANTIDOTE_HOME` is used if set... ```zsh % ANTIDOTE_HOME=$HOME/.cache/antidote % antidote home | subenv HOME $HOME/.cache/antidote % unset ANTIDOTE_HOME % ``` `antidote home` is `~/Library/Caches/antidote` on macOS ```zsh % OLD_OSTYPE=$OSTYPE; OSTYPE=darwin21.3.0 % antidote home | subenv HOME $HOME/Library/Caches/antidote % OSTYPE=$OLD_OSTYPE % ``` `antidote home` is `$LOCALAPPDATA/antidote` on msys ```zsh % OLD_OSTYPE=$OSTYPE; OSTYPE=msys % LOCALAPPDATA=$HOME/AppData % antidote home | subenv HOME $HOME/AppData/antidote % OSTYPE=$OLD_OSTYPE % ``` `antidote home` uses `$XDG_CACHE_HOME` on an OS that defines it. ```zsh % # Setup % OLD_OSTYPE=$OSTYPE; OSTYPE=foobar % OLD_XDG_CACHE_HOME=$XDG_CACHE_HOME; XDG_CACHE_HOME=$HOME/.xdg-cache % # Run test % antidote home | subenv XDG_CACHE_HOME $XDG_CACHE_HOME/antidote % # Teardown % OSTYPE=$OLD_OSTYPE; XDG_CACHE_HOME=$OLD_XDG_CACHE_HOME % ``` `antidote home` uses `$HOME/.cache` otherwise. ```zsh % # Setup % OLD_OSTYPE=$OSTYPE; OSTYPE=foobar % OLD_XDG_CACHE_HOME=$XDG_CACHE_HOME; XDG_CACHE_HOME= % # Run test % antidote home | subenv HOME $HOME/.cache/antidote % # Teardown % OSTYPE=$OLD_OSTYPE; XDG_CACHE_HOME=$OLD_XDG_CACHE_HOME % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_init.md000066400000000000000000000012571464631051600176630ustar00rootroot00000000000000# antidote init tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Init ```zsh % antidote init #!/usr/bin/env zsh function antidote { case "$1" in bundle) source <( antidote-main $@ ) || antidote-main $@ ;; *) antidote-main $@ ;; esac } % ``` Load plugins dynamically ```zsh % source <(antidote init) % antidote bundle foo/bar sourcing foo/bar... % antidote bundle foo/baz autoload:functions sourcing foo/baz... % antidote bundle $ZDOTDIR/custom/lib sourcing custom lib1.zsh... sourcing custom lib2.zsh... % echo $#plugins 2 % echo $#libs 2 % echo $+functions[baz] 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_install.md000066400000000000000000000021701464631051600203610ustar00rootroot00000000000000# antidote installs tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Install Command `antidote install` requires a `` argument. ```zsh % antidote install #=> --exit 1 antidote: error: required argument 'bundle' not provided, try --help % ``` Trying to install an existing bundle fails. ```zsh % antidote install foo/bar &>/dev/null #=> --exit 1 % antidote install foo/bar 2>&1 | subenv ANTIDOTE_HOME >&2 antidote: error: foo/bar already installed: $ANTIDOTE_HOME/foo/bar % ``` Install a bundle ```zsh % antidote install rupa/z | subenv ZDOTDIR # antidote cloning rupa/z... Adding bundle to '$ZDOTDIR/.zsh_plugins.txt': rupa/z % tail -n 1 $ZDOTDIR/.zsh_plugins.txt rupa/z % ``` Install a complicated bundle ```zsh % antidote install --path plugins/macos --conditional is-macos ohmyzsh/ohmyzsh | subenv ZDOTDIR # antidote cloning ohmyzsh/ohmyzsh... Adding bundle to '$ZDOTDIR/.zsh_plugins.txt': ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos % tail -n 1 $ZDOTDIR/.zsh_plugins.txt ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_list.md000066400000000000000000000024331464631051600176700ustar00rootroot00000000000000# antidote list tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## List Command ### Short `antidote list --short` ```zsh % antidote list --short | subenv ANTIDOTE_HOME foo/bar foo/baz getantidote/zsh-defer git@github.com:foo/qux ohmy/ohmy % ``` ### Directories `antidote list --dirs` ```zsh % antidote list --dirs | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar $ANTIDOTE_HOME/foo/baz $ANTIDOTE_HOME/foo/qux $ANTIDOTE_HOME/getantidote/zsh-defer $ANTIDOTE_HOME/ohmy/ohmy % ``` ### URLs `antidote list --url` ```zsh % antidote list --url git@github.com:foo/qux https://github.com/foo/bar https://github.com/foo/baz https://github.com/getantidote/zsh-defer https://github.com/ohmy/ohmy % ``` ### Full `antidote list` ```zsh % antidote list | subenv ANTIDOTE_HOME git@github.com:foo/qux $ANTIDOTE_HOME/foo/qux https://github.com/foo/bar $ANTIDOTE_HOME/foo/bar https://github.com/foo/baz $ANTIDOTE_HOME/foo/baz https://github.com/getantidote/zsh-defer $ANTIDOTE_HOME/getantidote/zsh-defer https://github.com/ohmy/ohmy $ANTIDOTE_HOME/ohmy/ohmy % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_load.md000066400000000000000000000030501464631051600176300ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ### General ```zsh % antidote load $ZDOTDIR/.zplugins_fake_load sourcing foo/bar... sourcing foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... sourcing getantidote/zsh-defer... sourcing magic-enter.plugin.zsh... sourcing pretty.zsh-theme... % cat $ZDOTDIR/.zplugins_fake_load.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh % # cleanup % t_reset % ``` ### zstyles ```zsh % cp $ZDOTDIR/.zplugins_fake_load $ZDOTDIR/.zplugins.txt % zstyle ':antidote:bundle' file $ZDOTDIR/.zplugins.txt % zstyle ':antidote:static' file $ZDOTDIR/.zplugins.txt % # the static file should be different % antidote load 2>&1 | subenv ZDOTDIR antidote: bundle file and static file are the same '$ZDOTDIR/.zplugins.txt'. % # fixed... % zstyle ':antidote:static' file $ZDOTDIR/.zplugins.static.zsh % # the static file should be different % antidote load sourcing foo/bar... sourcing foo/qux... sourcing foo/bar... sourcing ohmy/lib/lib1.zsh... sourcing ohmy/lib/lib2.zsh... sourcing ohmy/lib/lib3.zsh... sourcing extract.plugin.zsh... sourcing docker.plugin.zsh... sourcing docker.plugin.zsh... sourcing getantidote/zsh-defer... sourcing magic-enter.plugin.zsh... sourcing pretty.zsh-theme... % cat $ZDOTDIR/.zplugins.static.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_main.md000066400000000000000000000016051464631051600176410ustar00rootroot00000000000000# antidote main tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Test main Main is core to everything, so we don't need to test much here. ```zsh % antidote-main --version &>/dev/null #=> --exit 0 % ``` ## Lazy config Tests for lazy-loading antidote. - Fix [#54](https://github.com/mattmc3/antidote/issues/54) ```zsh % # Unload antidote % echo $+functions[antidote-main] 1 % t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load it and make sure it works % autoload -Uz $PWD/antidote % antidote -v &>/dev/null; echo $? 0 % # Now, tear down again % echo $+functions[antidote-main] 1 % t_unload_antidote % echo $+functions[antidote-main] 0 % # Now, lazy load from the functions dir % autoload -Uz $PWD/functions/antidote % antidote -v &>/dev/null; echo $? 0 % echo $+functions[antidote-main] 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_path.md000066400000000000000000000016641464631051600176560ustar00rootroot00000000000000# antidote path tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Path Command `antidote-path` prints path to bundle. ```zsh % antidote path foo/bar &>/dev/null #=> --exit 0 % antidote path foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar % ``` `antidote-path` fails on missing bundles ```zsh % antidote path bar/foo &>/dev/null #=> --exit 1 % antidote path bar/foo; err=$? antidote: error: bar/foo does not exist in cloned paths % echo $err 1 % ``` `antidote-path` accepts piped input ```zsh % antidote list -s | antidote path | sort | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar $ANTIDOTE_HOME/foo/baz $ANTIDOTE_HOME/foo/qux $ANTIDOTE_HOME/getantidote/zsh-defer $ANTIDOTE_HOME/ohmy/ohmy % ``` `antidote-path` expands vars ```zsh % ZSH_CUSTOM=$ZDOTDIR/custom % antidote path '$ZSH_CUSTOM/plugins/myplugin' | subenv $HOME/.zsh/custom/plugins/myplugin % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_purge.md000066400000000000000000000037161464631051600200440ustar00rootroot00000000000000# antidote purge tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Purge Command `antidote purge` requires a `` argument. ```zsh % antidote purge &>/dev/null #=> --exit 1 % antidote purge antidote: error: required argument 'bundle' not provided, try --help % ``` Trying to purge a missing bundle fails. ```zsh % antidote purge bar/foo &>/dev/null #=> --exit 1 % antidote purge bar/foo 2>&1 | subenv ANTIDOTE_HOME >&2 antidote: error: bar/foo does not exist at the expected location: $ANTIDOTE_HOME/bar/foo % ``` Purging a bundle deletes the directory and comments out instances of the bundle in `.zsh_plugins.txt`. ```zsh % # bundle dir exists % bundledir=$ANTIDOTE_HOME/foo/bar % test -d $bundledir #=> --exit 0 % # purge works % antidote purge foo/bar | subenv ZDOTDIR Removed 'foo/bar'. Bundle 'foo/bar' was commented out in '$ZDOTDIR/.zsh_plugins.txt'. % # bundle dir was removed % test -d $bundledir #=> --exit 1 % cat $ZDOTDIR/.zsh_plugins.txt #=> --file ./testdata/.zsh_plugins_purged.txt % ``` Test that `antidote purge --all` aborts when told "no". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'n' % antidote purge --all #=> --exit 1 % antidote list | subenv ANTIDOTE_HOME git@github.com:foo/qux $ANTIDOTE_HOME/foo/qux https://github.com/foo/baz $ANTIDOTE_HOME/foo/baz https://github.com/getantidote/zsh-defer $ANTIDOTE_HOME/getantidote/zsh-defer https://github.com/ohmy/ohmy $ANTIDOTE_HOME/ohmy/ohmy % ``` Test that `antidote purge --all` does the work when told "yes". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'y' % antidote purge --all | tail -n 1 Antidote purge complete. Be sure to start a new Zsh session. % antidote list | wc -l | awk '{print $1}' 0 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_script.md000066400000000000000000000203741464631051600202250ustar00rootroot00000000000000# antidote-script tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Script Command ### Fails ```zsh % antidote-script #=> --exit 1 antidote: error: bundle argument expected % ``` ### Arg style `antidote-script` accepts '--arg val', '--arg:val', '--arg=val' syntax ```zsh % antidote-script --kind zsh foo/bar #=> --exit 0 % antidote-script --kind:zsh foo/bar #=> --exit 0 % antidote-script --kind=zsh foo/bar #=> --exit 0 % antidote-script --kind+zsh foo/bar #=> --exit 1 % ``` ### Scripting types `antidote-script` works with local files and directories, as well as remote repos. Script a file: ```zsh % antidote-script $ZDOTDIR/aliases.zsh | subenv ZDOTDIR source $ZDOTDIR/aliases.zsh % ``` Script a lib directory: ```zsh % antidote-script $ZDOTDIR/custom/lib | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/lib ) source $ZDOTDIR/custom/lib/lib1.zsh source $ZDOTDIR/custom/lib/lib2.zsh % ``` Script a plugin directory: ```zsh % antidote-script $ZDOTDIR/custom/plugins/myplugin | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/myplugin ) source $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh % ``` Script repos in antibody style: ```zsh % zstyle ':antidote:bundle' use-friendly-names off % ANTIDOTE_HOME=$HOME/.cache/antibody % antidote-script foo/bar | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh % antidote-script https://github.com/foo/bar | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh % antidote-script https://github.com/foo/bar.git | subenv ANTIDOTE_HOME #=> --file ./testdata/script-foobar.zsh % antidote-script git@github.com:foo/qux.git | subenv ANTIDOTE_HOME #=> --file ./testdata/script-fooqux.zsh % zstyle ':antidote:bundle' use-friendly-names on % ANTIDOTE_HOME=$HOME/.cache/antidote % ``` ## Annotations ### kind:clone Nothing happens when the plugin already exists. ```zsh % antidote-script --kind clone foo/bar % ``` Clone a missing plugin. ```zsh % antidote-script --kind clone bar/foo # antidote cloning bar/foo... % ``` ### kind:zsh ```zsh % antidote-script --kind zsh foo/bar | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/foo/bar ) source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` ### kind:path ```zsh % antidote-script --kind path foo/bar | subenv ANTIDOTE_HOME export PATH="$ANTIDOTE_HOME/foo/bar:$PATH" % ``` ### kind:fpath ```zsh % antidote-script --kind fpath foo/bar | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/foo/bar ) % ``` ### kind:autoload ```zsh % antidote-script --kind autoload $ZDOTDIR/functions | subenv ZDOTDIR fpath+=( $ZDOTDIR/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) % ``` ### kind:defer ```zsh % antidote-script --kind defer foo/bar | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/foo/bar ) zsh-defer source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % ``` Test defer zstyle settings ```zsh % zstyle ':antidote:bundle:*' defer-options '-a' % zstyle ':antidote:bundle:foo/bar' defer-options '-p' % antidote-script --kind defer foo/bar | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/foo/bar ) zsh-defer -p source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % % # Uses different defer options due to zstyle matching % antidote-script --kind defer bar/baz | subenv ANTIDOTE_HOME if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/bar/baz ) zsh-defer -a source $ANTIDOTE_HOME/bar/baz/baz.plugin.zsh % # cleanup % t_reset % ``` ### path:plugin-dir ```zsh % antidote-script --path plugins/extract ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/extract ) source $ANTIDOTE_HOME/ohmy/ohmy/plugins/extract/extract.plugin.zsh % ``` ### path:file ```zsh % antidote-script --path lib/lib1.zsh ohmy/ohmy | subenv ANTIDOTE_HOME source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib1.zsh % ``` ### path:lib-dir ```zsh % antidote-script --path lib ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/lib ) source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib1.zsh source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib2.zsh source $ANTIDOTE_HOME/ohmy/ohmy/lib/lib3.zsh % ``` ### path:theme ```zsh % antidote-script --path themes/pretty.zsh-theme ohmy/ohmy | subenv ANTIDOTE_HOME source $ANTIDOTE_HOME/ohmy/ohmy/themes/pretty.zsh-theme % ``` ### conditional:testfunc ```zsh % antidote-script --conditional is-macos --path plugins/macos ohmy/ohmy | subenv ANTIDOTE_HOME if is-macos; then fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos ) source $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh fi % ``` ### autoload:funcdir ```zsh % antidote-script --path plugins/macos --autoload functions ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos ) source $ANTIDOTE_HOME/ohmy/ohmy/plugins/macos/macos.plugin.zsh % ``` ### fpath-rule:append/prepend ```zsh % # append % antidote-script --fpath-rule append --path plugins/docker ohmy/ohmy | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker ) source $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker/docker.plugin.zsh % # prepend % antidote-script --fpath-rule prepend --path plugins/docker ohmy/ohmy | subenv ANTIDOTE_HOME fpath=( $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker $fpath ) source $ANTIDOTE_HOME/ohmy/ohmy/plugins/docker/docker.plugin.zsh % # whoops % antidote-script --fpath-rule foobar --path plugins/docker ohmy/ohmy 2>&1 antidote: error: unexpected fpath rule: 'foobar' % ``` ### pre/post functions ```zsh % # pre % antidote-script --pre run_before foo/bar | subenv ANTIDOTE_HOME run_before fpath+=( $ANTIDOTE_HOME/foo/bar ) source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh % # post % antidote-script --post run_after foo/bar | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/foo/bar ) source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh run_after % ``` If a plugin is deferred, so is its post event ```zsh % antidote-script --pre pre-event --post post-event --kind defer foo/bar | subenv ANTIDOTE_HOME pre-event if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/getantidote/zsh-defer ) source $ANTIDOTE_HOME/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/foo/bar ) zsh-defer source $ANTIDOTE_HOME/foo/bar/bar.plugin.zsh zsh-defer post-event % ``` ## Private functions ### __antidote_initfiles setup ```zsh % # load __antidote_initfiles from private funcs in antidote-script % antidote-script -h &>/dev/null % PLUGINDIR=$T_TEMPDIR/initfiles/myplugin % mkdir -p $PLUGINDIR % touch $PLUGINDIR/myplugin.plugin.zsh % touch $PLUGINDIR/whatever.plugin.zsh % touch $PLUGINDIR/file.zsh % touch $PLUGINDIR/file.sh % touch $PLUGINDIR/file.bash % touch $PLUGINDIR/mytheme.zsh-theme % touch $PLUGINDIR/README.md % touch $PLUGINDIR/file % mkdir -p $PLUGINDIR/lib % touch $PLUGINDIR/lib/lib1.zsh % touch $PLUGINDIR/lib/lib2.zsh % touch $PLUGINDIR/lib/lib3.zsh % ``` myplugin.plugin.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/myplugin.plugin.zsh % rm $PLUGINDIR/myplugin.plugin.zsh % ``` whatever.plugin.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/whatever.plugin.zsh % rm $PLUGINDIR/whatever.plugin.zsh % ``` file.zsh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/file.zsh % rm $PLUGINDIR/file.zsh % ``` file.sh ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/file.sh % rm $PLUGINDIR/file.sh % ``` mytheme.zsh-theme ```zsh % __antidote_initfiles $PLUGINDIR | subenv PLUGINDIR $PLUGINDIR/mytheme.zsh-theme % rm $PLUGINDIR/mytheme.zsh-theme % ``` lib ```zsh % __antidote_initfiles $PLUGINDIR/lib | subenv PLUGINDIR $PLUGINDIR/lib/lib1.zsh $PLUGINDIR/lib/lib2.zsh $PLUGINDIR/lib/lib3.zsh % ``` FAIL: no files left that match ```zsh % __antidote_initfiles $PLUGINDIR #=> --exit 1 % ``` FAIL: Empty ```zsh % PLUGINDIR=$T_TEMPDIR/initfiles/foo % mkdir -p $PLUGINDIR % __antidote_initfiles $PLUGINDIR #=> --exit 1 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_cmd_update.md000066400000000000000000000012171464631051600201760ustar00rootroot00000000000000# antidote update tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Update ```zsh % antidote update Updating bundles... antidote: checking for updates: https://github.com/foo/bar antidote: checking for updates: https://github.com/foo/baz antidote: checking for updates: git@github.com:foo/qux antidote: checking for updates: https://github.com/getantidote/zsh-defer antidote: checking for updates: https://github.com/ohmy/ohmy Waiting for bundle updates to complete... Bundle updates complete. Updating antidote... antidote self-update complete. antidote version 1.9.7 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_fpath_rules.md000066400000000000000000000055571464631051600204200ustar00rootroot00000000000000# antidote bundle fpath-rule: ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` By default, fpath is appended to: ```zsh % antidote bundle foo/bar kind:fpath fpath+=( $HOME/.cache/antidote/foo/bar ) % ``` fpath can be told to explicitly append, but it's unnecessary ```zsh % antidote bundle foo/bar kind:zsh fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % fpath can be prepended with fpath-rule:prepend ```zsh % antidote bundle foo/bar kind:fpath fpath-rule:prepend fpath=( $HOME/.cache/antidote/foo/bar $fpath ) % fpath rules can only be append/prepend ```zsh % antidote bundle foo/bar kind:fpath fpath-rule:append #=> --exit 0 % antidote bundle foo/bar kind:fpath fpath-rule:prepend #=> --exit 0 % antidote bundle foo/bar kind:fpath fpath-rule:foo 2>&1 antidote: error: unexpected fpath rule: 'foo' % fpath rules are also used for `kind:autoload` ```zsh % antidote bundle foo/baz path:baz kind:autoload fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/baz/baz ) builtin autoload -Uz $fpath[-1]/*(N.:t) % antidote bundle foo/baz path:baz kind:autoload fpath-rule:prepend fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) builtin autoload -Uz $fpath[1]/*(N.:t) % ``` fpath rules are also used for `autoload:funcdir` ```zsh % # Append % antidote bundle foo/baz autoload:baz fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/baz/baz ) builtin autoload -Uz $fpath[-1]/*(N.:t) fpath+=( $HOME/.cache/antidote/foo/baz ) source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh % # Prepend % antidote bundle foo/baz autoload:baz fpath-rule:prepend fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) builtin autoload -Uz $fpath[1]/*(N.:t) fpath=( $HOME/.cache/antidote/foo/baz $fpath ) source $HOME/.cache/antidote/foo/baz/baz.plugin.zsh % ``` fpath rules can be set globally with a zstyle: `zstyle ':antidote:fpath' rule 'prepend'` ```zsh % zstyle ':antidote:fpath' rule 'prepend' % antidote bundle foo/bar fpath=( $HOME/.cache/antidote/foo/bar $fpath ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % antidote bundle foo/bar kind:fpath fpath=( $HOME/.cache/antidote/foo/bar $fpath ) % antidote bundle foo/baz path:baz kind:autoload fpath=( $HOME/.cache/antidote/foo/baz/baz $fpath ) builtin autoload -Uz $fpath[1]/*(N.:t) % ``` It is NOT recommended to do this, but if you choose to then explicit fpath-rules are still respected: ```zsh % zstyle ':antidote:fpath' rule 'prepend' % antidote bundle foo/bar fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh % antidote bundle foo/bar kind:fpath fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/bar ) % antidote bundle foo/baz path:baz kind:autoload fpath-rule:append fpath+=( $HOME/.cache/antidote/foo/baz/baz ) builtin autoload -Uz $fpath[-1]/*(N.:t) % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_helpers.md000066400000000000000000000121671464631051600175410ustar00rootroot00000000000000# antidote helper tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ## Safe removal Appease my paranoia and ensure that you can't remove a path you shouldn't be able to: ```zsh % __antidote_del -rf -- /foo/bar antidote: Blocked attempt to rm path: '/foo/bar'. % ``` ## Pretty print path ```zsh % __antidote_print_path /foo/bar /foo/bar % __antidote_print_path $HOME/foo/bar $HOME/foo/bar % zstyle ':antidote:compatibility-mode' 'antibody' 'on' % __antidote_print_path $HOME/foo/bar | subenv T_TEMPDIR $T_TEMPDIR/foo/bar % zstyle -d ':antidote:compatibility-mode' 'antibody' % ``` ## Bundle type ```zsh % __antidote_bundle_type $PWD/antidote.zsh file % __antidote_bundle_type $PWD/functions dir % __antidote_bundle_type '$PWD/antidote.zsh' file % __antidote_bundle_type \$PWD/functions dir % __antidote_bundle_type 'git@github.com:foo/bar.git' sshurl % __antidote_bundle_type 'https://github.com/foo/bar' url % __antidote_bundle_type 'https:/bad.com/foo/bar.git' ? % __antidote_bundle_type '' empty % __antidote_bundle_type ' ' empty % __antidote_bundle_type /foo/bar path % __antidote_bundle_type /foobar path % __antidote_bundle_type foobar/ relpath % __antidote_bundle_type '~/foo/bar' path % __antidote_bundle_type '$foo/bar' path % __antidote_bundle_type \$ZDOTDIR/foo path % __antidote_bundle_type \$ZDOTDIR/.zsh_plugins.txt file % touch ~/.zshenv % __antidote_bundle_type '~/.zshenv' file % __antidote_bundle_type '~/null' path % __antidote_bundle_type foo/bar repo % __antidote_bundle_type bar/baz.git repo % __antidote_bundle_type foo/bar/baz relpath % __antidote_bundle_type foobar word % __antidote_bundle_type foo bar baz word % __antidote_bundle_type 'foo bar baz' word % ``` ## Bundle name ```zsh % __antidote_bundle_name $HOME/.zsh/custom/lib/lib1.zsh $HOME/.zsh/custom/lib/lib1.zsh % __antidote_bundle_name $HOME/.zsh/plugins/myplugin $HOME/.zsh/plugins/myplugin % __antidote_bundle_name 'git@github.com:foo/bar.git' foo/bar % __antidote_bundle_name 'https://github.com/foo/bar' foo/bar % __antidote_bundle_name 'https:/bad.com/foo/bar.git' https:/bad.com/foo/bar.git % __antidote_bundle_name '' % __antidote_bundle_name /foo/bar /foo/bar % __antidote_bundle_name /foobar /foobar % __antidote_bundle_name foobar/ foobar/ % __antidote_bundle_name '~/foo/bar' $HOME/foo/bar % __antidote_bundle_name '$foo/bar' $foo/bar % __antidote_bundle_name foo/bar foo/bar % __antidote_bundle_name bar/baz.git bar/baz.git % __antidote_bundle_name foo/bar/baz foo/bar/baz % __antidote_bundle_name foobar foobar % __antidote_bundle_name foo bar baz foo % __antidote_bundle_name 'foo bar baz' foo bar baz % ``` ## Bundle dir ```zsh % zstyle ':antidote:bundle' use-friendly-names off % # short repo % __antidote_bundle_dir foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar % # repo url % __antidote_bundle_dir https://github.com/foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar % # repo url.git % __antidote_bundle_dir https://github.com/foo/bar.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar % # repo ssh % __antidote_bundle_dir git@github.com:foo/bar.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-bar % # local dir % __antidote_bundle_dir ~/foo/bar | subenv HOME $HOME/foo/bar % # another local dir % __antidote_bundle_dir $ZDOTDIR/bar/baz | subenv ZDOTDIR $ZDOTDIR/bar/baz % ``` Use friendly names ```zsh % # short repo - friendly name % zstyle ':antidote:bundle' use-friendly-names on % __antidote_bundle_dir foo/bar | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/bar % # repo url - friendly name % __antidote_bundle_dir https://github.com/bar/baz | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/bar/baz % # ssh repo - friendly name % __antidote_bundle_dir git@github.com:foo/qux.git | subenv ANTIDOTE_HOME $ANTIDOTE_HOME/foo/qux % ``` ### To URL Short repos: ```zsh % __antidote_tourl ohmyzsh/ohmyzsh https://github.com/ohmyzsh/ohmyzsh % __antidote_tourl sindresorhus/pure https://github.com/sindresorhus/pure % __antidote_tourl foo/bar https://github.com/foo/bar % ``` Proper URLs don't change: ```zsh % __antidote_tourl https://github.com/ohmyzsh/ohmyzsh https://github.com/ohmyzsh/ohmyzsh % __antidote_tourl http://github.com/ohmyzsh/ohmyzsh http://github.com/ohmyzsh/ohmyzsh % __antidote_tourl ssh://github.com/ohmyzsh/ohmyzsh ssh://github.com/ohmyzsh/ohmyzsh % __antidote_tourl git://github.com/ohmyzsh/ohmyzsh git://github.com/ohmyzsh/ohmyzsh % __antidote_tourl ftp://github.com/ohmyzsh/ohmyzsh ftp://github.com/ohmyzsh/ohmyzsh % __antidote_tourl git@github.com:sindresorhus/pure.git git@github.com:sindresorhus/pure.git % ``` ## Collect input If we \ --file tmp_home/.zsh/.zsh_plugins.txt % ``` If we \|pipe input it should output that. ```zsh % cat $ZDOTDIR/.zsh_plugins.txt | __antidote_collect_input #=> --file tmp_home/.zsh/.zsh_plugins.txt % ``` If we pass argument it should output that. ```zsh % __antidote_collect_input 'a\nb\nc\n' a b c % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_real.md000066400000000000000000000125221464631051600170150ustar00rootroot00000000000000# antidote tests for real ## antidote bundle ### Setup ```zsh % TESTDATA=$PWD/tests/testdata/real % source ./tests/_setup.zsh % # do it for real! % t_setup_real % ``` ### Config ```zsh % zstyle ':antidote:bundle:*' zcompile 'yes' % ``` ### Bundle Clone and generate bundle script ```zsh % antidote bundle <$TESTDATA/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh 2>/dev/null % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME #=> --file testdata/real/.zsh_plugins.zsh % ``` Check to see that everything cloned ```zsh % antidote list | subenv ANTIDOTE_HOME #=> --file testdata/real/repo-list.txt % ``` Test that everything compiled ```zsh % zwcfiles=($(ls $(antidote home)/**/*.zwc(N) | wc -l)) % test $zwcfiles -gt 100 #=> --exit 0 % ``` Test that everything updated ```zsh % rm -rf -- $(antidote home)/**/*.zwc(N) % antidote update &>/dev/null % zwcfiles=($(ls $(antidote home)/**/*.zwc(N) | wc -l)) % test $zwcfiles -gt 100 #=> --exit 0 % ``` Check to see that branch:br annotations properly changed the cloned branch ```zsh % branched_plugin="$ANTIDOTE_HOME/mattmc3/antidote" % git -C $branched_plugin branch --show-current 2>/dev/null pz % ``` Test that `antidote purge --all` aborts when told "no". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'n' % antidote purge --all #=> --exit 1 % antidote list | subenv ANTIDOTE_HOME #=> --file testdata/real/repo-list.txt % antidote list | wc -l | awk '{print $1}' 15 % test_exists $ZDOTDIR/.zsh_plugins.zsh(.N) #=> --exit 0 % test_exists $ZDOTDIR/.zsh_plugins*.bak(.N) #=> --exit 1 % ``` Test that `antidote purge --all` does the work when told "yes". ```zsh % function test_exists { [[ -e "$1" ]] } % zstyle ':antidote:purge:all' answer 'y' % antidote purge --all | tail -n 1 #=> --exit 0 Antidote purge complete. Be sure to start a new Zsh session. % antidote list | wc -l | awk '{print $1}' 0 % test_exists $ZDOTDIR/.zsh_plugins.zsh(.N) #=> --exit 1 % test_exists $ZDOTDIR/.zsh_plugins*.bak(.N) #=> --exit 0 % ``` ### Teardown ```zsh % zstyle -d ':antidote:purge:all' answer % t_teardown % ``` ## CRLF testing ### Redo setup ```zsh % TESTDATA=$PWD/tests/testdata/real % source ./tests/_setup.zsh % t_setup_real % ``` Clone and generate bundle script ```zsh % antidote bundle <$TESTDATA/.zsh_plugins.crlf.txt >$ZDOTDIR/.zsh_plugins.zsh 2>/dev/null % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/rupa/z ) source $ANTIDOTE_HOME/rupa/z/z.sh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting ) source $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-completions ) source $ANTIDOTE_HOME/zsh-users/zsh-completions/zsh-completions.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search ) source $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh % ``` Check to see that everything cloned ```zsh % antidote list | subenv ANTIDOTE_HOME https://github.com/rupa/z $ANTIDOTE_HOME/rupa/z https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-completions $ANTIDOTE_HOME/zsh-users/zsh-completions https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting % ``` ### Teardown ```zsh % t_teardown % ``` ## antidote load ### Redo setup ```zsh % TESTDATA=$PWD/tests/testdata/real % source ./tests/_setup.zsh % t_setup_real % ``` ### Load Load rupa/z ```zsh % zstyle ':antidote:bundle' use-friendly-names on % echo "rupa/z" > $ZDOTDIR/.zsh_plugins.txt % antidote load 2>&1 # antidote cloning rupa/z... % echo $+aliases[z] 1 % wc -l <$ZDOTDIR/.zsh_plugins.zsh | sed 's/ //g' 2 % (( ! $+aliases[z] )) || unalias z % ``` Load re-generates .zsh_plugins.zsh when .zsh_plugins.txt changes ```zsh % compdir=$ANTIDOTE_HOME/zsh-users/zsh-completions/src % (( $fpath[(Ie)$compdir] )) || echo "completions are not in fpath" completions are not in fpath % echo $+aliases[z] 0 % ``` ...add a new plugin ```zsh % wc -l <$ZDOTDIR/.zsh_plugins.txt | sed 's/ //g' 1 % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/rupa/z ) source $ANTIDOTE_HOME/rupa/z/z.sh % echo "zsh-users/zsh-completions path:src kind:fpath" >> $ZDOTDIR/.zsh_plugins.txt % # static cache file hasn't changed yet % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/rupa/z ) source $ANTIDOTE_HOME/rupa/z/z.sh % ``` ...now do `antidote load` and show that it actually loaded all plugins ```zsh % antidote load 2>&1 # antidote cloning zsh-users/zsh-completions... % cat $ZDOTDIR/.zsh_plugins.zsh | subenv ANTIDOTE_HOME fpath+=( $ANTIDOTE_HOME/rupa/z ) source $ANTIDOTE_HOME/rupa/z/z.sh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-completions/src ) % echo $+aliases[z] 1 % (( $fpath[(Ie)$compdir] )) && echo "completions are in fpath" completions are in fpath % % wc -l <$ZDOTDIR/.zsh_plugins.zsh | sed 's/ //g' 3 % ``` ### Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_setopts_special.md000066400000000000000000000013151464631051600212710ustar00rootroot00000000000000# antidote handles special Zsh options ## Setup Tests to handle special Zsh options. [#154](https://github.com/mattmc3/antidote/issues/154). ```zsh % source ./tests/_setup.zsh % setopt KSH_ARRAYS SH_GLOB % source ./antidote.zsh % ``` # Ensure bundle works ```zsh % antidote bundle <$ZDOTDIR/.zsh_plugins.txt >$ZDOTDIR/.zsh_plugins.zsh % cat $ZDOTDIR/.zsh_plugins.zsh | subenv #=> --file testdata/.zsh_plugins.zsh % ``` # Ensure options remained ```zsh % [[ -o KSH_ARRAYS ]] && echo KSH_ARRAYS KSH_ARRAYS % [[ -o SH_GLOB ]] && echo SH_GLOB SH_GLOB % # unset % unsetopt KSH_ARRAYS SH_GLOB % [[ -o KSH_ARRAYS ]] && echo KSH_ARRAYS % [[ -o SH_GLOB ]] && echo SH_GLOB % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_zcompile_bundle.md000066400000000000000000000030101464631051600212350ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ### General Ensure a compiled file does not exist: ```zsh % zstyle ':antidote:bundle:*' zcompile 'no' % ! test -e $ZDOTDIR/custom/lib/lib1.zsh.zwc #=> --exit 0 % antidote bundle $ZDOTDIR/custom/lib/lib1.zsh | subenv ZDOTDIR source $ZDOTDIR/custom/lib/lib1.zsh % ! test -e $ZDOTDIR/custom/lib/lib1.zsh.zwc #=> --exit 0 % antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/mytheme ) source $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme % ! test -e $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme.zwc #=> --exit 0 % ``` Ensure a compiled file exists: ```zsh % zstyle ':antidote:bundle:*' zcompile 'yes' % ! test -e $ZDOTDIR/custom/lib/lib2.zsh.zwc #=> --exit 0 % antidote bundle $ZDOTDIR/custom/lib/lib2.zsh | subenv ZDOTDIR source $ZDOTDIR/custom/lib/lib2.zsh % test -e $ZDOTDIR/custom/lib/lib2.zsh.zwc #=> --exit 0 % # plugin % antidote bundle $ZDOTDIR/custom/plugins/myplugin | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/myplugin ) source $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh % test -e $ZDOTDIR/custom/plugins/myplugin/myplugin.plugin.zsh.zwc #=> --exit 0 % # zsh-theme % antidote bundle $ZDOTDIR/custom/plugins/mytheme | subenv ZDOTDIR fpath+=( $ZDOTDIR/custom/plugins/mytheme ) source $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme % test -e $ZDOTDIR/custom/plugins/mytheme/mytheme.zsh-theme.zwc #=> --exit 0 % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_zcompile_static.md000066400000000000000000000021031464631051600212550ustar00rootroot00000000000000# antidote load tests ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` ### General Ensure a compiled file exists: ```zsh % zstyle ':antidote:static' zcompile 'yes' % zstyle ':antidote:static' file $ZDOTDIR/.zplugins_fake_zcompile_static.zsh % ! test -e $ZDOTDIR/.zplugins_fake_zcompile_static.zsh.zwc #=> --exit 0 % antidote load $ZDOTDIR/.zplugins_fake_load >/dev/null % cat $ZDOTDIR/.zplugins_fake_zcompile_static.zsh | subenv #=> --file testdata/.zplugins_fake_zcompile_static.zsh % test -e $ZDOTDIR/.zplugins_fake_zcompile_static.zsh.zwc #=> --exit 0 % t_reset % ``` Ensure a compiled file does not exist: ```zsh % zstyle ':antidote:static' zcompile 'no' % zstyle ':antidote:static' file $ZDOTDIR/.zplugins_fake_load.zsh % ! test -e $ZDOTDIR/.zplugins_fake_load.zsh.zwc #=> --exit 0 % antidote load $ZDOTDIR/.zplugins_fake_load >/dev/null % cat $ZDOTDIR/.zplugins_fake_load.zsh | subenv #=> --file testdata/.zplugins_fake_load.zsh % ! test -e $ZDOTDIR/.zplugins_fake_load.zsh.zwc #=> --exit 0 % t_reset % ``` ## Teardown ```zsh % t_teardown % ``` antidote-1.9.7/tests/test_zsetopts.md000066400000000000000000000036571464631051600177760ustar00rootroot00000000000000# antidote respects setopts ## Setup ```zsh % source ./tests/_setup.zsh % source ./antidote.zsh % ``` Set up a plugin that changes Zsh options ```zsh % plugin_file=$ANTIDOTE_HOME/lampoon/xmas/xmas.plugin.zsh % mkdir -p $plugin_file:h && touch $plugin_file % echo "unsetopt noaliases" >>$plugin_file % echo "setopt autocd" >>$plugin_file % echo "lampoon/xmas" >$ZDOTDIR/.zsh_plugins.txt % ``` ## Test that plugins that run setopts work Verify initial state ```zsh % setopt noaliases % set -o | grep noaliases noaliases on % set -o | grep autocd autocd off % ``` Load the plugins and see if the option took ```zsh % antidote load &>/dev/null #=> --exit 0 % set -o | grep noaliases noaliases off % set -o | grep autocd autocd on % # cleanup % setopt noaliases no_autocd % ``` Tests to ensure [#86](https://github.com/mattmc3/antidote/issues/86) stays fixed. Check that stderr is empty. ```zsh % setopt posix_identifiers % antidote -v 3>&1 2>&3 >/dev/null #=> --exit 0 % antidote -h 3>&1 2>&3 >/dev/null #=> --exit 0 % antidote help 3>&1 2>&3 >/dev/null #=> --exit 0 % # cleanup % unsetopt posix_identifiers % ``` ## Clark Grizwold lighting ceremony!

via GIPHY

```zsh % optcnt=$(setopt | wc -l | tr -d ' ') % echo $optcnt #=> --regex ^\d+$ % test $optcnt -lt 10 && echo "less than 10 enabled zsh opts" less than 10 enabled zsh opts % # now lets turn on all the lights % echo '$ZDOTDIR/custom/plugins/grizwold' >$ZDOTDIR/.zsh_plugins.txt % antidote load % optcnt=$(setopt | wc -l | tr -d ' ') % test $optcnt -gt 150 && echo "zillions of enabled zsh options (>150)" zillions of enabled zsh options (>150) % ``` ## Teardown ```zsh % unsetopt $grizwold_zopts % t_teardown % ``` antidote-1.9.7/tests/testdata/000077500000000000000000000000001464631051600163205ustar00rootroot00000000000000antidote-1.9.7/tests/testdata/.zplugins_fake_load.zsh000066400000000000000000000025331464631051600227670ustar00rootroot00000000000000fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/qux ) source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) export PATH="$HOME/.cache/antidote/foo/bar:$PATH" fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh fpath=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker $fpath ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme antidote-1.9.7/tests/testdata/.zplugins_fake_zcompile_static.zsh000066400000000000000000000031171464631051600252400ustar00rootroot00000000000000function { 0=${(%):-%x} local staticfile=${0:A} [[ -e ${staticfile} ]] || return 1 if [[ ! -s ${staticfile}.zwc || ${staticfile} -nt ${staticfile}.zwc ]]; then builtin autoload -Uz zrecompile zrecompile -pq ${staticfile} fi } fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/qux ) source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) export PATH="$HOME/.cache/antidote/foo/bar:$PATH" fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh fpath=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker $fpath ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/docker ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme antidote-1.9.7/tests/testdata/.zsh_plugins.zsh000066400000000000000000000023561464631051600214770ustar00rootroot00000000000000fpath+=( $HOME/foo/bar ) source $HOME/foo/bar/bar.plugin.zsh fpath+=( $ZSH_CUSTOM/plugins/myplugin ) source $ZSH_CUSTOM/plugins/myplugin/myplugin.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/qux ) source $HOME/.cache/antidote/foo/qux/qux.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) source $HOME/.cache/antidote/foo/bar/bar.plugin.zsh fpath+=( $HOME/.cache/antidote/foo/bar ) export PATH="$HOME/.cache/antidote/foo/bar:$PATH" fpath+=( $HOME/.cache/antidote/ohmy/ohmy/lib ) source $HOME/.cache/antidote/ohmy/ohmy/lib/lib1.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib2.zsh source $HOME/.cache/antidote/ohmy/ohmy/lib/lib3.zsh fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/extract ) source $HOME/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $HOME/.cache/antidote/getantidote/zsh-defer ) source $HOME/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter ) zsh-defer source $HOME/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh source $HOME/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme antidote-1.9.7/tests/testdata/.zsh_plugins_empty.txt000066400000000000000000000000321464631051600227150ustar00rootroot00000000000000# comments # nothing here antidote-1.9.7/tests/testdata/.zsh_plugins_multi_defer.zsh000066400000000000000000000053701464631051600240550ustar00rootroot00000000000000fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh if is-macos; then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh fi if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh/dracula.zsh-theme fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh/up.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf/tailf.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z/z.sh antidote-1.9.7/tests/testdata/.zsh_plugins_no_defer.zsh000066400000000000000000000037241464631051600233400ustar00rootroot00000000000000fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-history-substring-search/zsh-history-substring-search.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh if is-macos; then fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/macos.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-dracula-SLASH-zsh/dracula.zsh-theme fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-peterhurford-SLASH-up.zsh/up.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rummik-SLASH-zsh-tailf/tailf.plugin.zsh fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-rupa-SLASH-z/z.sh antidote-1.9.7/tests/testdata/.zsh_plugins_purged.txt000066400000000000000000000007501464631051600230540ustar00rootroot00000000000000# local plugins ~/foo/bar $ZSH_CUSTOM path:plugins/myplugin # repo plugins # foo/bar git@github.com:foo/qux.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh # foo/bar kind:zsh # kind:fpath # foo/bar kind:fpath # kind:path # foo/bar kind:path # subpath plugins ohmy/ohmy path:lib ohmy/ohmy path:plugins/extract # deferred ohmy/ohmy path:plugins/magic-enter kind:defer # theme ohmy/ohmy path:custom/themes/pretty.zsh-theme antidote-1.9.7/tests/testdata/.zsh_plugins_repos.txt000066400000000000000000000007201464631051600227130ustar00rootroot00000000000000# comments user/repo # blank lines # regular repos https://github.com/user/repo http://github.com/user/repo.git https://github.com/user/repo git@github.com:user/repo # annotations bar/baz path:plugins/qux bar/baz path:themes/qux.zsh-theme # branch foobar/foobar branch:baz # defer https://github.com/foo/qux kind:defer https://github.com/foo/baz kind:defer # non repos foo ~/.zplugins/bar $ZDOTDIR/plugins/bar # dupes user/repo https://github.com/user/repo antidote-1.9.7/tests/testdata/real/000077500000000000000000000000001464631051600172435ustar00rootroot00000000000000antidote-1.9.7/tests/testdata/real/.zsh_plugins.crlf.txt000066400000000000000000000002321464631051600233510ustar00rootroot00000000000000# CRLF file rupa/z zsh-users/zsh-syntax-highlighting zsh-users/zsh-completions zsh-users/zsh-autosuggestions zsh-users/zsh-history-substring-search antidote-1.9.7/tests/testdata/real/.zsh_plugins.txt000066400000000000000000000020461464631051600224310ustar00rootroot00000000000000# paths #$ZDOTDIR/aliases.zsh $ZSH_CUSTOM/plugins/myplugin # plugins zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-autosuggestions # git@ repo URLs aren't good for CI... revisit # git@github.com:zsh-users/zsh-completions.git # kind:zsh zsh-users/zsh-syntax-highlighting kind:zsh # kind:clone zsh-users/antigen kind:clone # kind:fpath sindresorhus/pure kind:fpath # kind:path romkatv/zsh-bench kind:path # kind:autoload mattmc3/zman path:functions kind:autoload # fpath-rule ohmyzsh/ohmyzsh path:plugins/gradle fpath-rule:prepend ohmyzsh/ohmyzsh path:plugins/docker fpath-rule:append # conditional ohmyzsh/ohmyzsh path:plugins/macos conditional:is-macos # branches mattmc3/antidote branch:pz # subpath plugins ohmyzsh/ohmyzsh path:lib/clipboard.zsh ohmyzsh/ohmyzsh path:plugins/extract ohmyzsh/ohmyzsh path:plugins/magic-enter ohmyzsh/ohmyzsh path:plugins/fancy-ctrl-z # deferred zdharma-continuum/fast-syntax-highlighting kind:defer # theme dracula/zsh # non-conforming plugins peterhurford/up.zsh rummik/zsh-tailf rupa/z antidote-1.9.7/tests/testdata/real/.zsh_plugins.zsh000066400000000000000000000045541464631051600224240ustar00rootroot00000000000000fpath+=( $ZSH_CUSTOM/plugins/myplugin ) source $ZSH_CUSTOM/plugins/myplugin/myplugin.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search ) source $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions ) source $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh fpath+=( $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting ) source $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/sindresorhus/pure ) export PATH="$ANTIDOTE_HOME/romkatv/zsh-bench:$PATH" fpath+=( $ANTIDOTE_HOME/mattmc3/zman/functions ) builtin autoload -Uz $fpath[-1]/*(N.:t) fpath=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/gradle $fpath ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/gradle/gradle.plugin.zsh fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/docker ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/docker/docker.plugin.zsh if is-macos; then fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/macos ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/macos/macos.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/mattmc3/antidote ) source $ANTIDOTE_HOME/mattmc3/antidote/pz.plugin.zsh source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/lib/clipboard.zsh fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/extract ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/extract/extract.plugin.zsh fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/magic-enter ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/magic-enter/magic-enter.plugin.zsh fpath+=( $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/fancy-ctrl-z ) source $ANTIDOTE_HOME/ohmyzsh/ohmyzsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh if ! (( $+functions[zsh-defer] )); then fpath+=( $ANTIDOTE_HOME/romkatv/zsh-defer ) source $ANTIDOTE_HOME/romkatv/zsh-defer/zsh-defer.plugin.zsh fi fpath+=( $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting ) zsh-defer source $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh fpath+=( $ANTIDOTE_HOME/dracula/zsh ) source $ANTIDOTE_HOME/dracula/zsh/dracula.zsh-theme fpath+=( $ANTIDOTE_HOME/peterhurford/up.zsh ) source $ANTIDOTE_HOME/peterhurford/up.zsh/up.plugin.zsh fpath+=( $ANTIDOTE_HOME/rummik/zsh-tailf ) source $ANTIDOTE_HOME/rummik/zsh-tailf/tailf.plugin.zsh fpath+=( $ANTIDOTE_HOME/rupa/z ) source $ANTIDOTE_HOME/rupa/z/z.sh antidote-1.9.7/tests/testdata/real/repo-list.txt000066400000000000000000000027601464631051600217270ustar00rootroot00000000000000https://github.com/dracula/zsh $ANTIDOTE_HOME/dracula/zsh https://github.com/mattmc3/antidote $ANTIDOTE_HOME/mattmc3/antidote https://github.com/mattmc3/zman $ANTIDOTE_HOME/mattmc3/zman https://github.com/ohmyzsh/ohmyzsh $ANTIDOTE_HOME/ohmyzsh/ohmyzsh https://github.com/peterhurford/up.zsh $ANTIDOTE_HOME/peterhurford/up.zsh https://github.com/romkatv/zsh-bench $ANTIDOTE_HOME/romkatv/zsh-bench https://github.com/romkatv/zsh-defer $ANTIDOTE_HOME/romkatv/zsh-defer https://github.com/rummik/zsh-tailf $ANTIDOTE_HOME/rummik/zsh-tailf https://github.com/rupa/z $ANTIDOTE_HOME/rupa/z https://github.com/sindresorhus/pure $ANTIDOTE_HOME/sindresorhus/pure https://github.com/zdharma-continuum/fast-syntax-highlighting $ANTIDOTE_HOME/zdharma-continuum/fast-syntax-highlighting https://github.com/zsh-users/antigen $ANTIDOTE_HOME/zsh-users/antigen https://github.com/zsh-users/zsh-autosuggestions $ANTIDOTE_HOME/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-history-substring-search $ANTIDOTE_HOME/zsh-users/zsh-history-substring-search https://github.com/zsh-users/zsh-syntax-highlighting $ANTIDOTE_HOME/zsh-users/zsh-syntax-highlighting antidote-1.9.7/tests/testdata/script-foobar.zsh000066400000000000000000000002611464631051600216170ustar00rootroot00000000000000fpath+=( $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar ) source $ANTIDOTE_HOME/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/bar.plugin.zsh antidote-1.9.7/tests/testdata/script-fooqux.zsh000066400000000000000000000002131464631051600216650ustar00rootroot00000000000000fpath+=( $ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-qux ) source $ANTIDOTE_HOME/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh antidote-1.9.7/tests/tmp_home/000077500000000000000000000000001464631051600163175ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/000077500000000000000000000000001464631051600174405ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/000077500000000000000000000000001464631051600212515ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/000077500000000000000000000000001464631051600275075ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgit/000077500000000000000000000000001464631051600312225ustar00rootroot00000000000000.gitkeep000066400000000000000000000000001464631051600325620ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/.mockgitantidote-1.9.7/tests/tmp_home/.cache/antibody/git-AT-github.com-COLON-foo-SLASH-qux/qux.plugin.zsh000066400000000000000000000000661464631051600323510ustar00rootroot00000000000000echo "sourcing foo/qux..." plugins=($plugins foo/qux) https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/000077500000000000000000000000001464631051600321565ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001464631051600336715ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar.gitkeep000066400000000000000000000000001464631051600353100ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bar/.mockgitbar.plugin.zsh000066400000000000000000000000661464631051600347470ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-barecho "sourcing foo/bar..." plugins=($plugins foo/bar) https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/000077500000000000000000000000001464631051600321665ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001464631051600337015ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz.gitkeep000066400000000000000000000000001464631051600353200ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/.mockgitbaz.plugin.zsh000066400000000000000000000000661464631051600347670ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-bazecho "sourcing foo/baz..." plugins=($plugins foo/baz) functions/000077500000000000000000000000001464631051600341765ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz_baz000066400000000000000000000000401464631051600350260ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions#!/bin/zsh echo _baz completion baz000066400000000000000000000000711464631051600346730ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-foo-SLASH-baz/functions#!/bin/zsh function baz { echo baz function } baz "$@" https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/000077500000000000000000000000001464631051600350255ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001464631051600365405ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer.gitkeep000066400000000000000000000000001464631051600401570ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer/.mockgitzsh-defer.plugin.zsh000066400000000000000000000001751464631051600407420ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-getantidote-SLASH-zsh-defer# fake foo/bar echo "sourcing getantidote/zsh-defer..." plugins=($plugins getantidote/zsh-defer) function zsh-defer { $@ } https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/000077500000000000000000000000001464631051600325575ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody.mockgit/000077500000000000000000000000001464631051600342725ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy.gitkeep000066400000000000000000000000001464631051600357110ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/.mockgitcustom/000077500000000000000000000000001464631051600340715ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmythemes/000077500000000000000000000000001464631051600353565ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custompretty.zsh-theme000066400000000000000000000001011464631051600405230ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themesecho "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) ugly.zsh-theme000066400000000000000000000000751464631051600401660ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/custom/themesecho "sourcing ugly.zsh-theme..." themes=($themes ohmy:ugly) lib/000077500000000000000000000000001464631051600333255ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmylib1.zsh000066400000000000000000000000741464631051600347030ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib1.zsh..." libs=($libs ohmy:lib1) lib2.zsh000066400000000000000000000000741464631051600347040ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib2.zsh..." libs=($libs ohmy:lib2) lib3.zsh000066400000000000000000000000741464631051600347050ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/libecho "sourcing ohmy/lib/lib3.zsh..." libs=($libs ohmy:lib2) oh-my.sh000066400000000000000000000000711464631051600341420ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmyecho "sourcing oh-my.sh..." plugins=($plugins ohmy/ohmy) plugins/000077500000000000000000000000001464631051600342405ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmydocker/000077500000000000000000000000001464631051600355075ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins_docker000066400000000000000000000000111464631051600370300ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/docker#compdef docker.plugin.zsh000066400000000000000000000000741464631051600410020ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/dockerecho "sourcing docker.plugin.zsh..." plugins+=(ohmy:docker) extract/000077500000000000000000000000001464631051600357125ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsextract.plugin.zsh000066400000000000000000000000761464631051600414120ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/extractecho "sourcing extract.plugin.zsh..." plugins+=(ohmy:extract) macos/000077500000000000000000000000001464631051600353425ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsfunctions/000077500000000000000000000000001464631051600373525ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macosmacos_func000066400000000000000000000001121464631051600414040ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macos/functions#!/bin/zsh function macos_func { echo macos_func "$@" } macos_func "$@" macos.plugin.zsh000066400000000000000000000000721464631051600404660ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/macosecho "sourcing macos.plugin.zsh..." plugins+=(ohmy:macos) magic-enter/000077500000000000000000000000001464631051600364335ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/pluginsmagic-enter.plugin.zsh000066400000000000000000000001061464631051600426460ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/plugins/magic-enterecho "sourcing magic-enter.plugin.zsh..." plugins+=(ohmy:magic-enter) themes/000077500000000000000000000000001464631051600340445ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmypretty.zsh-theme000066400000000000000000000001011464631051600372110ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-ohmy-SLASH-ohmy/themesecho "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.7/tests/tmp_home/.cache/antidote/000077500000000000000000000000001464631051600212475ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/000077500000000000000000000000001464631051600220325ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/bar/000077500000000000000000000000001464631051600225765ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/000077500000000000000000000000001464631051600243115ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/000077500000000000000000000000001464631051600255565ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/bar/.mockgit/config/remote.origin.url000066400000000000000000000000331464631051600310570ustar00rootroot00000000000000https://github.com/foo/bar antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/bar/bar.plugin.zsh000066400000000000000000000000661464631051600253670ustar00rootroot00000000000000echo "sourcing foo/bar..." plugins=($plugins foo/bar) antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/000077500000000000000000000000001464631051600226065ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/000077500000000000000000000000001464631051600243215ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/000077500000000000000000000000001464631051600255665ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/.mockgit/config/remote.origin.url000066400000000000000000000000331464631051600310670ustar00rootroot00000000000000https://github.com/foo/baz antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/baz.plugin.zsh000066400000000000000000000000661464631051600254070ustar00rootroot00000000000000echo "sourcing foo/baz..." plugins=($plugins foo/baz) antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/functions/000077500000000000000000000000001464631051600246165ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/functions/_baz000066400000000000000000000000401464631051600254460ustar00rootroot00000000000000#!/bin/zsh echo _baz completion antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/baz/functions/baz000066400000000000000000000000711464631051600253130ustar00rootroot00000000000000#!/bin/zsh function baz { echo baz function } baz "$@" antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/qux/000077500000000000000000000000001464631051600226475ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/000077500000000000000000000000001464631051600243625ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/000077500000000000000000000000001464631051600256275ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/qux/.mockgit/config/remote.origin.url000066400000000000000000000000271464631051600311330ustar00rootroot00000000000000git@github.com:foo/qux antidote-1.9.7/tests/tmp_home/.cache/antidote/foo/qux/qux.plugin.zsh000066400000000000000000000000661464631051600255110ustar00rootroot00000000000000echo "sourcing foo/qux..." plugins=($plugins foo/qux) antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/000077500000000000000000000000001464631051600235565ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/000077500000000000000000000000001464631051600254455ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/000077500000000000000000000000001464631051600271605ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/config/000077500000000000000000000000001464631051600304255ustar00rootroot00000000000000remote.origin.url000066400000000000000000000000511464631051600336470ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/.mockgit/confighttps://github.com/getantidote/zsh-defer antidote-1.9.7/tests/tmp_home/.cache/antidote/getantidote/zsh-defer/zsh-defer.plugin.zsh000066400000000000000000000001751464631051600313620ustar00rootroot00000000000000# fake foo/bar echo "sourcing getantidote/zsh-defer..." plugins=($plugins getantidote/zsh-defer) function zsh-defer { $@ } antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/000077500000000000000000000000001464631051600222235ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/000077500000000000000000000000001464631051600231775ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/000077500000000000000000000000001464631051600247125ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/000077500000000000000000000000001464631051600261575ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/.mockgit/config/remote.origin.url000066400000000000000000000000351464631051600314620ustar00rootroot00000000000000https://github.com/ohmy/ohmy antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/000077500000000000000000000000001464631051600245115ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/000077500000000000000000000000001464631051600257765ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/pretty.zsh-theme000066400000000000000000000001011464631051600311430ustar00rootroot00000000000000echo "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/custom/themes/ugly.zsh-theme000066400000000000000000000000751464631051600306060ustar00rootroot00000000000000echo "sourcing ugly.zsh-theme..." themes=($themes ohmy:ugly) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/000077500000000000000000000000001464631051600237455ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib1.zsh000066400000000000000000000000741464631051600253230ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib1.zsh..." libs=($libs ohmy:lib1) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib2.zsh000066400000000000000000000000741464631051600253240ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib2.zsh..." libs=($libs ohmy:lib2) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/lib/lib3.zsh000066400000000000000000000000741464631051600253250ustar00rootroot00000000000000echo "sourcing ohmy/lib/lib3.zsh..." libs=($libs ohmy:lib2) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/oh-my.sh000066400000000000000000000000711464631051600245620ustar00rootroot00000000000000echo "sourcing oh-my.sh..." plugins=($plugins ohmy/ohmy) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/000077500000000000000000000000001464631051600246605ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/000077500000000000000000000000001464631051600261275ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/_docker000066400000000000000000000000111464631051600274500ustar00rootroot00000000000000#compdef antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/docker/docker.plugin.zsh000066400000000000000000000000741464631051600314220ustar00rootroot00000000000000echo "sourcing docker.plugin.zsh..." plugins+=(ohmy:docker) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/000077500000000000000000000000001464631051600263325ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/extract/extract.plugin.zsh000066400000000000000000000000761464631051600320320ustar00rootroot00000000000000echo "sourcing extract.plugin.zsh..." plugins+=(ohmy:extract) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/000077500000000000000000000000001464631051600257625ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/000077500000000000000000000000001464631051600277725ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/functions/macos_func000066400000000000000000000001121464631051600320240ustar00rootroot00000000000000#!/bin/zsh function macos_func { echo macos_func "$@" } macos_func "$@" antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/macos/macos.plugin.zsh000066400000000000000000000000721464631051600311060ustar00rootroot00000000000000echo "sourcing macos.plugin.zsh..." plugins+=(ohmy:macos) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/000077500000000000000000000000001464631051600270535ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/plugins/magic-enter/magic-enter.plugin.zsh000066400000000000000000000001061464631051600332660ustar00rootroot00000000000000echo "sourcing magic-enter.plugin.zsh..." plugins+=(ohmy:magic-enter) antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/000077500000000000000000000000001464631051600244645ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.cache/antidote/ohmy/ohmy/themes/pretty.zsh-theme000066400000000000000000000001011464631051600276310ustar00rootroot00000000000000echo "sourcing pretty.zsh-theme..." themes=($themes ohmy:pretty) antidote-1.9.7/tests/tmp_home/.zsh/000077500000000000000000000000001464631051600172015ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/.zplugins_fake_load000066400000000000000000000010221464631051600230350ustar00rootroot00000000000000# repo plugins foo/bar git@github.com:foo/qux.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh foo/bar kind:zsh # kind:fpath foo/bar kind:fpath # kind:path foo/bar kind:path # subpath plugins ohmy/ohmy path:lib ohmy/ohmy path:plugins/extract # fpath-rule ohmy/ohmy path:plugins/docker fpath-rule:prepend ohmy/ohmy path:plugins/docker fpath-rule:append # deferred ohmy/ohmy path:plugins/magic-enter kind:defer # theme ohmy/ohmy path:custom/themes/pretty.zsh-theme antidote-1.9.7/tests/tmp_home/.zsh/.zsh_plugins.txt000066400000000000000000000007401464631051600223660ustar00rootroot00000000000000# local plugins ~/foo/bar $ZSH_CUSTOM path:plugins/myplugin # repo plugins foo/bar git@github.com:foo/qux.git # trailing comments # kind:clone getantidote/zsh-defer kind:clone # more trailing comments # kind:zsh foo/bar kind:zsh # kind:fpath foo/bar kind:fpath # kind:path foo/bar kind:path # subpath plugins ohmy/ohmy path:lib ohmy/ohmy path:plugins/extract # deferred ohmy/ohmy path:plugins/magic-enter kind:defer # theme ohmy/ohmy path:custom/themes/pretty.zsh-theme antidote-1.9.7/tests/tmp_home/.zsh/aliases.zsh000066400000000000000000000000371464631051600213500ustar00rootroot00000000000000echo "sourcing aliases.zsh..." antidote-1.9.7/tests/tmp_home/.zsh/custom/000077500000000000000000000000001464631051600205135ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/lib/000077500000000000000000000000001464631051600212615ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/lib/lib1.zsh000066400000000000000000000000741464631051600226370ustar00rootroot00000000000000echo "sourcing custom lib1.zsh..." libs=($libs custom:lib1) antidote-1.9.7/tests/tmp_home/.zsh/custom/lib/lib2.zsh000066400000000000000000000000741464631051600226400ustar00rootroot00000000000000echo "sourcing custom lib2.zsh..." libs=($libs custom:lib2) antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/000077500000000000000000000000001464631051600221745ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/grizwold/000077500000000000000000000000001464631051600240355ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/grizwold/grizwold.plugin.zsh000066400000000000000000000060431464631051600277240ustar00rootroot00000000000000() { setopt interactivecomments typeset -ga grizwold_zopts=( noaliases aliasfuncdef allexport noalwayslastprompt alwaystoend appendcreate noappendhistory autocd autocontinue noautolist noautomenu autonamedirs noautoparamkeys noautoparamslash autopushd noautoremoveslash autoresume nobadpattern nobanghist nobareglobqual bashautolist bashrematch nobeep nobgnice braceccl bsdecho nocaseglob nocasematch cbases cdablevars cdsilent chasedots chaselinks nocheckjobs nocheckrunningjobs # noclobber combiningchars completealiases completeinword continueonerror correct correctall cprecedences cshjunkiehistory cshjunkieloops cshjunkiequotes cshnullcmd cshnullglob nodebugbeforecmd dvorak emacs noequals # errexit # errreturn noevallineno # noexec extendedglob extendedhistory noflowcontrol # forcefloat nofunctionargzero noglob noglobalexport # noglobalrcs globassign globcomplete globdots globstarshort globsubst nohashcmds nohashdirs hashexecutablesonly nohashlistall histallowclobber nohistbeep histexpiredupsfirst histfcntllock histfindnodups histignorealldups histignoredups histignorespace histlexwords histnofunctions histnostore histreduceblanks nohistsavebycopy histsavenodups histsubstpattern histverify nohup ignorebraces ignoreclosebraces ignoreeof incappendhistory incappendhistorytime # interactive interactivecomments # ksharrays kshautoload kshglob # kshoptionprint kshtypeset kshzerosubscript nolistambiguous nolistbeep listpacked listrowsfirst nolisttypes localloops # localoptions localpatterns localtraps # login longlistjobs magicequalsubst mailwarning markdirs menucomplete # monitor nomultibyte nomultifuncdef nomultios nonomatch nonotify nullglob numericglobsort octalzeroes overstrike pathdirs pathscript pipefail posixaliases posixargzero posixbuiltins posixcd posixidentifiers posixjobs # posixstrings posixtraps printeightbit printexitvalue # privileged promptbang nopromptcr # nopromptpercent nopromptsp promptsubst pushdignoredups pushdminus pushdsilent pushdtohome rcexpandparam rcquotes # norcs recexact rematchpcre # restricted rmstarsilent rmstarwait sharehistory shfileexpansion shglob # shinstdin shnullcmd shoptionletters noshortloops shwordsplit # singlecommand singlelinezle # sourcetrace sunkeyboardhack transientrprompt trapsasync typesetsilent nounset # verbose # vi warncreateglobal warnnestedvar # xtrace # zle ) setopt $grizwold_zopts } antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/myplugin/000077500000000000000000000000001464631051600240405ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/myplugin/myplugin.plugin.zsh000066400000000000000000000001061464631051600277240ustar00rootroot00000000000000# fake foo/bar echo "sourcing myplugin..." plugins+=(custom:myplugin) antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/mytheme/000077500000000000000000000000001464631051600236445ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/custom/plugins/mytheme/mytheme.zsh-theme000066400000000000000000000000651464631051600271430ustar00rootroot00000000000000echo "sourcing mytheme..." plugins+=(custom:mytheme) antidote-1.9.7/tests/tmp_home/.zsh/functions/000077500000000000000000000000001464631051600212115ustar00rootroot00000000000000antidote-1.9.7/tests/tmp_home/.zsh/functions/myfunc000066400000000000000000000000761464631051600224400ustar00rootroot00000000000000#!/bin/zsh function myfunc { echo myfunc "$@" } myfunc "$@" antidote-1.9.7/tools/000077500000000000000000000000001464631051600145055ustar00rootroot00000000000000antidote-1.9.7/tools/buildman000077500000000000000000000020651464631051600162310ustar00rootroot00000000000000#!/usr/bin/env zsh # https://pandoc.org/demo/pandoc.1.md # https://eddieantonio.ca/blog/2015/12/18/authoring-manpages-in-markdown-with-pandoc/ # https://jeromebelleman.gitlab.io/posts/publishing/manpages/ 0=${(%):-%x} BASEDIR=${0:a:h:h} TMPDIR=$BASEDIR/.tmp/buildman [[ -d $TMPDIR ]] && command rm -rf $TMPDIR mkdir -p $TMPDIR sedi() { sed --version &> /dev/null && sed -i -- "$@" || sed -i "" "$@" } for manpage in $BASEDIR/man/*.md; do case ${manpage:t:r} in footer|example) continue ;; esac print "Building ${manpage:t:r} manpage..." [[ -d $BASEDIR/man/man1 ]] || mkdir -p $BASEDIR/man/man1 mdfile=$TMPDIR/${manpage:t}.md cat ${manpage} > $mdfile print "" >> $mdfile cat $BASEDIR/man/footer.md >> $mdfile manfile=$BASEDIR/man/man1/${manpage:t:r}.1 pandoc --standalone --to man ${mdfile} -o $manfile # strip pandoc version so that every manpage build doesn't need to # result in a new commit just b/c pandoc has a minor point release. pandoc_ver=$(pandoc -v | awk 'NR==1{print $2}') sedi "s/Pandoc $pandoc_ver/Pandoc/g" $manfile done antidote-1.9.7/tools/bumpver000077500000000000000000000004321464631051600161120ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} bumpversion --allow-dirty ${1:-revision} newver=$(grep 'current_version' ${0:h:h}/.bumpversion.cfg | sed -E 's/^[^0-9]+(.*)$/\1/') print "Version bumped to $newver." print "Now run:" print " git commit -am 'Bump version to $newver'" | tee >(pbcopy) antidote-1.9.7/tools/run-clitests000077500000000000000000000015641464631051600170750ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} setopt extended_glob cd ${0:A:h:h} local o_unit o_rev zparseopts -D -M -- -unit=o_unit -rev=o_rev || return 1 testfiles=() if (( $# > 0 )); then testfiles=($@) elif (( $#o_unit )); then testfiles=($PWD/tests/*.md~*test_real*~*foo*) else testfiles=($PWD/tests/*.md) fi # if tests are run in reverse order, I can catch places where I didn't teardown properly if (( $#o_rev )); then testfiles=(${(O)testfiles}) fi # foo example test command # env -i PATH=$PATH FPATH=$FPATH \ # zsh -f -- =clitest --list-run --progress dot --prompt '%' --color always $PWD/tests/foo.md env -i PATH=$PATH FPATH=$FPATH PAGER=cat \ zsh -f -- \ =clitest \ --list-run --progress dot --prompt '%' \ --color always \ --pre-flight 'git --version; print $PWD $VENDOR $OSTYPE =zsh $ZSH_VERSION $ZSH_PATCHLEVEL' \ -- $testfiles antidote-1.9.7/tools/sloc000077500000000000000000000005111464631051600153700ustar00rootroot00000000000000#!/usr/bin/env zsh 0=${(%):-%x} BASEDIR=${0:h:h} cd $BASEDIR print "loc:" wc -l antidote.zsh ./functions/*(.) print "sloc:" for file in antidote.zsh ./functions/*(.); do lines=$(awk '/^ *[^#]+$/{print}' $file | wc -l) print $lines $file done print "sloc total:" awk '/^ *[^#]+$/{print}' antidote.zsh ./functions/*(.) | wc -l