pax_global_header00006660000000000000000000000064132212116160014505gustar00rootroot0000000000000052 comment=8f14b4850d8e410f00db92afcd87b88c0c90f771 zplug-2.4.2/000077500000000000000000000000001322121161600126535ustar00rootroot00000000000000zplug-2.4.2/.github/000077500000000000000000000000001322121161600142135ustar00rootroot00000000000000zplug-2.4.2/.github/CONTRIBUTING.md000066400000000000000000000021451322121161600164460ustar00rootroot00000000000000Thank you for helping improve zplug! To make sure we can quickly assist you with any bugs, we have three requests: ## 1. Remove the cache file and zcompdump Before moving on to the next step, make sure you have cleared the cache file with `zplug clear` and removed the zcompdump file with `rm -f $ZPLUG_HOME/zcompdump`. ## 2. Reproduce the bug with a minimal **.zshrc** Remove as many lines in your **.zshrc** as possible, for example, if there's a problem with `zsh-syntax-highlighting`, try something like: ```zsh # Example minimal zshrc source ~/.zplug/init.zsh zplug "zsh-users/zsh-syntax-highlighting" zplug check || zplug install zplug load ``` Sometimes the problem only manifests when there are two different plugins loaded. Knowing which two plugins will greatly help us come up with a fix. ## 3. Share some system information By pasting the output of these three commands in your bug report, we can be certain we are testing the right thing for your setup: - [ ] `uname -a` - [ ] `cat ~/.zshrc` - [ ] `zsh --version` By following these two steps, we can assist with any problem much faster! zplug-2.4.2/.github/ISSUE_TEMPLATE.md000066400000000000000000000032231322121161600167200ustar00rootroot00000000000000 - Type: - [ ] Bug - [ ] Enhancement - [ ] Feature Request - [ ] Question --- - `zplug --version`: - `zsh --version`: - `uname -a`: zplug-2.4.2/.gitignore000066400000000000000000000003541322121161600146450ustar00rootroot00000000000000# zplug bin/* !bin/zplug-env repos/* .cache cache log .gitignore.d/* .error_log # zsh zcompdump **/zcompdump zcompdump.zwc **/zcompdump.zwc # a2x (man page) *.xml **/*.xml # vim *~ **/*~ *.swp **/*.swp # OS X .DS_Store **/.DS_Store zplug-2.4.2/.travis.yml000066400000000000000000000015731322121161600147720ustar00rootroot00000000000000git: depth: 1 branches: only: - master addons: apt: packages: - zsh sudo: false before_script: - zsh --version script: - TEST_TARGET=test/all.t make test notifications: slack: secure: t60Xlx634DaOWN1VRaIFPfXTAUb5188pR1IFrvIoYWqBMY0vP8AihxQP80fwnaOQGaIcbjDLjlU6CV8R2J/uXw4QKOsF0VF93X1NdNyuu3wRC/Kqe/FERYTwhMy2/b9Sf2fWe5eEE4fcpnX2GtJnDzzGoesLe5GvRL+mqJLN+sgAnszQp9++aybktZ0lkpaEMYWu0V96sZOdKqsxxOF4wpMt4Z3hBPi0mA3OgwxIh+0sg55czIcMl7ZLtAtm4fCSDHKojQvbaBUSfsRR6LjTb6a5b6hQBtL9n5xRzHN3J82T5noPLlj2zg+EWlLIwD5pGdkSpPAfQUb+/pNHALGijEXXDfosPGOJWI4EU1EhC1/H7zzkOPcPzEX6X+s3vx8ruObg3vvVsOYU3hqNcxz63zgw0NDLVVVnOV4+VusIDI5rxKUaVtFBH7nJf5cLu9+AF6RjVgZyuozlHvsecinl3YdyenD3saYkqRMJn3mQaWND1c2PnZWtNoclJbRwcilf3OFkl+LGskq39HluYZ8VTVE95FkfuGtN9P1v/C7XPSD1/VPKY+3hWbMpfKFQpNgy2D67mVuuiRtHAszTw80qq0IPEcdX1nYtJrzNclUb9FTXpy6etUHyQbkND8B9brw580sYgdJfavgaaKLF7usZrUlOcayzMd6j6eEPmN7b1QY= zplug-2.4.2/Makefile000066400000000000000000000015111322121161600143110ustar00rootroot00000000000000ZPLUG_ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) SHOVE_URL := https://github.com/key-amb/shove SHOVE_DIR := $(ZPLUG_ROOT)/.gitignore.d/shove TEST_TARGET ?= test .DEFAULT_GOAL := help .PHONY: all install shove test release help all: install: ## Install zplug to your machine shove: # Grab shove from GitHub and grant execution @if [ ! -d $(SHOVE_DIR) ]; then \ git clone $(SHOVE_URL) $(SHOVE_DIR); \ chmod 755 $(SHOVE_DIR)/bin/shove; \ fi test: shove ## Unit test for zplug ZPLUG_ROOT=$(ZPLUG_ROOT) $(SHOVE_DIR)/bin/shove -r $(TEST_TARGET) -s zsh release: ## Create new GitHub Releases @zsh $(ZPLUG_ROOT)/misc/dev/release.zsh help: ## Self-documented Makefile @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | sort \ | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' zplug-2.4.2/README.md000066400000000000000000000363331322121161600141420ustar00rootroot00000000000000:us: [:jp:](./doc/guide/ja/README.md) > Zsh Plugin Manager [![Travis][travis-badge]][travis-link] [![Latest][latest-badge]][latest-link] [![Slack][slack-badge]][slack-link]

## Pros. - Can manage everything - Zsh plugins/UNIX commands on [GitHub](https://github.com) and [Bitbucket](https://bitbucket.org) - Gist files ([gist.github.com](https://gist.github.com)) - Externally managed plugins e.g., [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and [prezto](https://github.com/sorin-ionescu/prezto) plugins/themes - Binary artifacts on [GitHub Releases](https://help.github.com/articles/about-releases/) - Local plugins - etc. (you can add your [own sources](https://github.com/zplug/zplug/blob/master/doc/guide/External-Sources.md)!) - Super-fast parallel installation/update - Support for lazy-loading - Branch/tag/commit support - Post-update, post-load hooks - Dependencies between packages - Unlike [antigen](https://github.com/zsh-users/antigen), no ZSH plugin file (`*.plugin.zsh`) required - Interactive interface ([fzf](https://github.com/junegunn/fzf), [peco](https://github.com/peco/peco), [zaw](https://github.com/zsh-users/zaw), and so on) - Cache mechanism for reducing [the startup time](#vs) ***DEMO:*** [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/demo.gif)][repo] ## Installation latest | stable ---|--- [![Latest][latest-badge]][latest-link] | [![Stable][stable-badge]][stable-link] ### The best way ```console $ curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh| zsh ``` If you wonder this installation, please check it out: - [zplug/installer](https://github.com/zplug/installer/blob/master/installer.zsh) ### Using [Homebrew](https://github.com/Homebrew/brew) (OS X) ```console $ brew install zplug ``` ### Manually Cloning from GitHub, and source `init.zsh`: ```console $ export ZPLUG_HOME=/path/to/.zplug $ git clone https://github.com/zplug/zplug $ZPLUG_HOME ``` ## Requirements - `zsh`: version 4.3.9 or higher - `git`: version 1.7 or higher - `awk`: An AWK variant that's **not** `mawk` ## Usage Add a zplug section to your `.zshrc`: 1. List the packages with `zplug` commands 2. `zplug load` to source the plugins and add commands to your `$PATH` ### Example [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/example.png)][repo] ```zsh source ~/.zplug/init.zsh # Make sure to use double quotes zplug "zsh-users/zsh-history-substring-search" # Use the package as a command # And accept glob patterns (e.g., brace, wildcard, ...) zplug "Jxck/dotfiles", as:command, use:"bin/{histuniq,color}" # Can manage everything e.g., other person's zshrc zplug "tcnksm/docker-alias", use:zshrc # Disable updates using the "frozen" tag zplug "k4rthik/git-cal", as:command, frozen:1 # Grab binaries from GitHub Releases # and rename with the "rename-to:" tag zplug "junegunn/fzf-bin", \ from:gh-r, \ as:command, \ rename-to:fzf, \ use:"*darwin*amd64*" # Supports oh-my-zsh plugins and the like zplug "plugins/git", from:oh-my-zsh # Also prezto zplug "modules/prompt", from:prezto # Load if "if" tag returns true zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]" # Run a command after a plugin is installed/updated # Provided, it requires to set the variable like the following: # ZPLUG_SUDO_PASSWORD="********" zplug "jhawthorn/fzy", \ as:command, \ rename-to:fzy, \ hook-build:"make && sudo make install" # Supports checking out a specific branch/tag/commit zplug "b4b4r07/enhancd", at:v1 zplug "mollifier/anyframe", at:4c23cb60 # Can manage gist file just like other packages zplug "b4b4r07/79ee61f7c140c63d2786", \ from:gist, \ as:command, \ use:get_last_pane_path.sh # Support bitbucket zplug "b4b4r07/hello_bitbucket", \ from:bitbucket, \ as:command, \ use:"*.sh" # Rename a command with the string captured with `use` tag zplug "b4b4r07/httpstat", \ as:command, \ use:'(*).sh', \ rename-to:'$1' # Group dependencies # Load "emoji-cli" if "jq" is installed in this example zplug "stedolan/jq", \ from:gh-r, \ as:command, \ rename-to:jq zplug "b4b4r07/emoji-cli", \ on:"stedolan/jq" # Note: To specify the order in which packages should be loaded, use the defer # tag described in the next section # Set the priority when loading # e.g., zsh-syntax-highlighting must be loaded # after executing compinit command and sourcing other plugins # (If the defer tag is given 2 or above, run after compinit command) zplug "zsh-users/zsh-syntax-highlighting", defer:2 # Can manage local plugins zplug "~/.zsh", from:local # Load theme file zplug 'dracula/zsh', as:theme # Install plugins if there are plugins that have not been installed if ! zplug check --verbose; then printf "Install? [y/N]: " if read -q; then echo; zplug install fi fi # Then, source plugins and add commands to $PATH zplug load --verbose ``` Finally, use `zplug install` to install your plugins and reload `.zshrc`. ### 1. Options for `zplug` | Option | Description | |-----------------|-------------| | `--help` | Display the help message | | `--rollback` | Rollback a failed package | | `--self-manage` | Self management of zplug | | `--version` | Display the version of zplug | | `--log` | Show the report of zplug errors | ### 2. Commands for `zplug` | Command | Description | Options | |-----------|-------------|---------| | `install` | Install packages in parallel | (None) | | `load` | Source installed plugins and add installed commands to `$PATH` | `--verbose` | | `list` | List installed packages (more specifically, view the associative array `$zplugs`) | `--select`,`--installed`,`--loaded` | | `update` | Update installed packages in parallel | `--select`,`--force` | | `check` | Return true if all packages are installed, false otherwise | `--verbose` | | `status` | Check if the remote repositories are up to date | `--select` | | `clean` | Remove repositories which are no longer managed | `--force`,`--select` | | `clear` | Remove the cache file | (None) | | `info` | Show the information such as the source URL and tag values for the given package | (None) | #### Take a closer look ```zsh # zplug check returns true if all packages are installed # Therefore, when it returns false, run zplug install if ! zplug check; then zplug install fi # source plugins and add commands to the PATH zplug load # zplug check returns true if the given repository exists if zplug check b4b4r07/enhancd; then # setting if enhancd is available export ENHANCD_FILTER=fzf-tmux fi ``` #### Let zplug manage zplug To manage zplug itself like other packages, write the following in your `.zshrc`. ```zsh zplug 'zplug/zplug', hook-build:'zplug --self-manage' ``` All that's left is to run `zplug update`. ### 3. Tags for `zplug` `truthy` is any of `true`, `yes`, `on`, `1` and `falsy` is any of `false`, `no`, `off`, `0`. | Tag | Description | Value (default) | Example | |-----|-------------|-----------------|---------| | `as` | Specify whether to register the package as plugins or commands | `plugin`,`command`,`theme` (`plugin`) | `as:command` | | `use` | Specify the pattern of the files to source (for `plugin`) or the relative path to add to the `$PATH` (for `command`) / With `from:gh-r`, zplug tries to guess which file to use from your OS and architecture. You can manually specify `use:"*darwin*{amd,386}*"` if that doesn't get the right file. | *glob* (`use:"*.zsh"`) | `use:bin`,`use:"*.sh"`, `use:*darwin*` | | `ignore` | Similar to `use` tag, but specify pattern of files you want to ignore (see also [#56](https://github.com/zplug/zplug/issues/56)) | *glob* (-) | `ignore:"some_*.zsh"` | | `from` | Specify where to get the package from | `github`,`bitbucket`,
`gh-r`,`gist`,
`oh-my-zsh`,`prezto`,`local` (`github`) | `from:gh-r` | | `at` | Specify branch/tag/commit to install | *revision* (`master`) | `at:v1.5.6` | | `rename-to` | Specify the filename you want to rename the command to (use this only with `as:command`) | *filename* (-) | `rename-to:fzf` | | `dir` | Installed directory of the package | **READ ONLY** | `dir:/path/to/user/repo` | | `if` | Specify the conditions under which to install and use the package | *boolean* (-) | `if:"[ -d ~/.zsh ]"` | | `hook-build` | Commands to after installation/update | *commands* (-) | `hook-build:"make install"` | | `hook-load` | Commands to after loading | *commands* (-) | `hook-load:"echo 'Loaded!'"` | | `frozen` | Do not update unless explicitly specified | truthy,falsy (false) | `frozen:1` | | `on` | Load this package only if a different package is installed | *package* | `on:user/repo` | | `defer` | Defers the loading of a package. If the value is 2 or above, zplug will source the plugin after `compinit` (see also [#26](https://github.com/zplug/zplug/issues/26)) | 0..3 (0) | `defer:2` | | `lazy` | Whether it is an autoload function or not | truthy,falsy (false) | `lazy:true` | | `depth` | The number of commits to include in the cloned repository. 0 means the whole history. | Any non-negative integer | `depth:10` | #### Changing the defaults You can use `zstyle` to change the default value. The format is: ```zsh zstyle ":zplug:tag" tag_name new_default_value ``` For example, if you have a lot of commands and not so many plugins, (i.e. if you find yourself specifying `as:command` often), you can do: ```zsh zstyle ":zplug:tag" as command ``` The default value for all tags can be changed in this way. #### Available on CLI You can register packages to zplug from the command-line. If you use zplug from the command-line, it is possible to add stuff more easily with the help of powerful zsh completions. In this case, zplug spit out its settings to `$ZPLUG_LOADFILE` instead of `.zshrc`. If you launch new zsh process, `zplug load` command automatically search this file and run `source` command. See [`ZPLUG_LOADFILE`](#zplug_loadfile) for other usage of `ZPLUG_LOADFILE`. ### 4. Environment variables for `zplug` #### `ZPLUG_HOME` Defaults to `~/.zplug`. `zplug` will store/load packages in this directory. The directory structure is shown below. ``` $ZPLUG_HOME |-- bin | `-- some_command -> ../repos/username_A/reponame1/some_command `-- repos |-- username_A | |-- reponame1 | | |-- README.md | | `-- some_command | `-- reponame2 | |-- README.md | `-- some_plugin.zsh `-- username_B `-- reponame1 ``` If you specify `as:command`, zplug will see the package as a command and create a symbolic link of the same name (if you want to rename it, use the `rename-to:` tag) in `$ZPLUG_BIN`. Because zplug adds `$ZPLUG_BIN` to the `$PATH`, you can run that command from anywhere. #### `ZPLUG_THREADS` The number of threads zplug uses when installing/updating. The default value is 16. #### `ZPLUG_PROTOCOL` Defaults to HTTPS. Valid options are `HTTPS` and `SSH`. Unless you have a specific reason, you should use the HTTPS protocol. For more information, see also [**Which remote URL should I use?** - GitHub Help](https://help.github.com/articles/which-remote-url-should-i-use/) #### `ZPLUG_FILTER` Defaults to `fzf-tmux:fzf:peco:percol:zaw`. When `--select` option is specified, the first element in the colon-separated list that exists in the `$PATH` will be used by zplug as the interactive filter. You can also use spaces and double quotes in `ZPLUG_FILTER` like: `fzf-tmux -d "10%":/path/to/peco:my peco`. #### `ZPLUG_LOADFILE` Defaults to `$ZPLUG_HOME/packages.zsh`. This file is used to add plugins from zplug on the command-line. It is also a useful place to isolate your packages list from `.zshrc`. Rather than cluttering your `.zshrc` with many lines enumerating packages, you can put them in a separate file and set `ZPLUG_LOADFILE` to its path. #### `ZPLUG_USE_CACHE` Defaults to `true`. If this variable is true, zplug will use cache files to speed up the load process. The cache files are saved under the `$ZPLUG_CACHE_DIR` directory. If you want to clear the cache, please run `zplug clear` or do the following: ```console $ ZPLUG_USE_CACHE=false zplug load ``` #### `ZPLUG_CACHE_DIR` Defaults to `$ZPLUG_HOME/.cache`. You can change where the cache file is saved, for example, `~/.cache/zplug`. #### `ZPLUG_REPOS` Defaults to `$ZPLUG_HOME/repos`. You can change where the repositories are cloned in case you want to manage them separately. #### `ZPLUG_SUDO_PASSWORD` Defaults to `''`. You can set sudo password for zplug's `hook-build` tag. However, this variable should not be managed in dotfiles and so on. ```zsh # your .zshrc source ~/.zshrc_secret zplug "some/command", hook-build:"make && sudo make install" ``` #### `ZPLUG_BIN` Defaults to `$ZPLUG_HOME/bin`. You can change the save destination of the command's symbolic link, e.g. `~/bin`. ### External commands zplug, like `git(1)`, supports external commands. These are executable scripts that reside somewhere in the PATH, named `zplug-cmdname`, which can be invoked with `zplug cmdname`. This allows you to create your own commands without modifying zplug's internals. Instructions for creating your own commands can be found in the [docs](https://github.com/zplug/zplug/blob/master/doc/zplug/External-Commands.md). Check out the sample [`zplug-env`](https://github.com/zplug/zplug/blob/master/bin/zplug-env) external command for an example. ## V.S. zplug is the fastest among the famous zsh plugin managers. Numbers? Here they are: [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/time.png)][repo] ## Note - Not antigen :syringe: but **zplug** :hibiscus: will be here for you from now on. - :hibiscus: It was heavily inspired by [vim-plug](https://github.com/junegunn/vim-plug), [neobundle.vim](https://github.com/Shougo/neobundle.vim) and the like. ## Other resources [awesome-zsh-plugins](https://github.com/unixorn/awesome-zsh-plugins) is a list of ZSH plugins, themes and completions that you can use with zplug. For migration from antigen, zgen, or zplug v1, check out the [wiki page](https://github.com/zplug/zplug/wiki/Migration). ## License [MIT][license] (c) [@b4b4r07](https://github.com/b4b4r07) [repo]: https://github.com/zplug/zplug [license]: http://b4b4r07.mit-license.org [travis-link]: https://travis-ci.org/zplug/zplug [travis-badge]: https://img.shields.io/travis/zplug/zplug.svg?style=flat-square [latest-badge]: https://img.shields.io/badge/latest-v2.4.2-ca7f85.svg?style=flat-square [latest-link]: https://github.com/zplug/zplug/releases/latest [stable-badge]: https://img.shields.io/badge/stable-v2.3.2-e9a326.svg?style=flat-square [stable-link]: https://github.com/zplug/zplug/releases/tag/2.3.2 [slack-link]: https://zplug.herokuapp.com [slack-badge]: https://img.shields.io/badge/slack-join-ca7f85.svg?style=flat-square zplug-2.4.2/autoload/000077500000000000000000000000001322121161600144635ustar00rootroot00000000000000zplug-2.4.2/autoload/commands/000077500000000000000000000000001322121161600162645ustar00rootroot00000000000000zplug-2.4.2/autoload/commands/__check__000066400000000000000000000047671322121161600200760ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Return true if all packages are installed, false otherwise local is_verbose=false is_debug=false local arg repo local -aU repos not_installed_repos not_found_repos local -A tags local -i ret=0 while (( $# > 0 )) do arg="$1" case "$arg" in --verbose) is_verbose=true ;; --debug) is_debug=true ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done if (( $#repos == 0 )); then repos=( "${(k)zplugs[@]:gs:@::}" ) fi for repo in "${repos[@]}" do # Evaluate IF tag and bypass existence check if conditions are not met tags[if]="$(__zplug::core::core::run_interfaces 'if' "$repo")" if [[ -n $tags[if] ]]; then if ! eval "$tags[if]" 2> >(__zplug::log::capture::error) >/dev/null; then $is_verbose && __zplug::io::print::die "$fg[red]$repo$reset_color: (bypassed check)\n" continue fi fi tags[from]="$(__zplug::core::core::run_interfaces 'from' "$repo")" if [[ -z "$tags[from]" ]]; then not_installed_repos+=( "$repo" ) continue fi if __zplug::core::sources::is_handler_defined "check" "$tags[from]"; then __zplug::core::sources::use_handler \ "check" \ "$tags[from]" \ "$repo" if (( $status != 0 )); then if [[ $tags[from] == 'local' ]]; then # FIXME: use $_ZPLUG_STATUS_* not_found_repos+=( "$repo" ) else not_installed_repos+=( "$repo" ) fi fi fi done if (( $#not_found_repos > 0 )); then if $is_verbose; then __zplug::io::print::put \ "- $fg[red]%s$reset_color: no such directory\n" \ "${not_found_repos[@]}" fi ret=0 fi # Initialize if (( $#not_installed_repos > 0 )); then # Share not installed repos information # e.g. for __install__ command #reply=( "${not_installed_repos[@]}" ) if $is_debug; then echo "$not_installed_repos[@]" return 0 fi if $is_verbose; then __zplug::io::print::put \ "- $fg[red]%s$reset_color: not installed\n" \ "${not_installed_repos[@]}" fi ret=1 fi return $ret zplug-2.4.2/autoload/commands/__clean__000066400000000000000000000057131322121161600200730ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Remove repositories which are no longer managed local repo filter local is_force="" is_select=false local -a repos remove_repos local -A tags local -i ret=0 while (( $# > 0 )) do arg="$1" case "$arg" in --force) is_force=true ;; --select) is_select=true ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done if $is_select; then __zplug::utils::shell::search_commands \ "$ZPLUG_FILTER" \ | read filter if [[ -z $filter ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "There is no available filter in ZPLUG_FILTER\n" return 1 fi repos=( ${(@f)"$(echo "${(Fk)zplugs[@]}" | eval "$filter")"} ) # Cace of type Ctrl-C if (( $#repos == 0 )); then return 0 fi fi if (( $#repos == 0 )); then # If no argument is given: # search the repositories that have not been already managed by zplug repos=( "$ZPLUG_REPOS"/*/*(N-/) ) for repo in "${repos[@]}" do if ! __zplug::base::base::zpluged "${repo:h:t}/${repo:t}"; then remove_repos+=("$repo") fi done else # If the arguments are given or selected by the filter for repo in "${repos[@]}" do tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" \ 2> >(__zplug::log::capture::error) )" if [[ -d $tags[dir] ]]; then case "$tags[from]" in "oh-my-zsh") remove_repos+=( "${tags[dir]:F[2]h}" ) ;; *) remove_repos+=( "$tags[dir]" ) ;; esac else __zplug::io::print::f \ --die \ --zplug \ --func \ "$repo: no such package\n" ret=1 fi done fi # Remove packages from $ZPLUG_REPOS for repo in "${remove_repos[@]}" do __zplug::io::print::put \ "${${is_force:+"Removed"}:-"Remove? (y/N)"} ${(qq)repo} " if ${(z)is_force:-"read -q"}; then # Remove directories rm -rf "$repo" rmdir "${repo:h}" # Clear cache __zplug::core::core::run_interfaces 'clear' fi \ 2> >(__zplug::log::capture::error) >/dev/null __zplug::io::print::put "\n" done # Remove packages from $zplugs repos=( $(__zplug::core::core::run_interfaces 'check' '--debug') ) for repo in "${repos[@]}" do unset "zplugs[$repo]" done # Remove broken symlinks __zplug::utils::shell::remove_deadlinks "$ZPLUG_BIN"/*(@N) return $ret zplug-2.4.2/autoload/commands/__clear__000066400000000000000000000010411322121161600200650ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Remove the cache file local arg while (( $# > 0 )) do arg="$1" case "$arg" in -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) # Unexpect return 1 ;; *) return 1 ;; esac shift done rm -rf \ "$ZPLUG_CACHE_DIR" \ "$ZPLUG_HOME/zcompdump" \ "$ZPLUG_HOME/zcompdump.zwc" zplug-2.4.2/autoload/commands/__info__000066400000000000000000000026731322121161600177460ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Show the information such as the source URL and tag values for the given package local arg="$1" repo key local -a repos local -A tags while (( $# > 0 )) do arg="$1" case "$arg" in -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) __zplug::io::print::f \ --die \ --zplug \ --error \ "$arg: invalid argument\n" return 1 ;; esac shift done # If no argument is given if (( $#repos == 0 )); then __zplug::io::print::put \ "%d plugs, %s\n" \ $#zplugs \ "$(du -ch "$ZPLUG_REPOS" | awk '$2 == "total"{print $1}')" return 1 fi for repo in "${repos[@]}" do if ! __zplug::base::base::zpluged "$repo"; then __zplug::io::print::f \ --die \ --zplug \ --func \ "$repo: no such package\n" return 1 fi __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) for key in "${(k)tags[@]}" do __zplug::io::print::put \ "$fg[red]-$reset_color $fg[blue]$key$reset_color: " __zplug::io::print::put \ "$fg[yellow]${(qqq)tags[$key]}$reset_color\n" done done zplug-2.4.2/autoload/commands/__install__000066400000000000000000000037041322121161600204550ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Install packages in parallel local repo arg local -A repo_pids proc_states hook_build hook_finished hook_pids status_codes local -A tags local -F SECONDS=0 local -aU repos local -i status_code=0 while (( $# > 0 )) do arg="$1" case "$arg" in -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done if ! __zplug::job::parallel::init "$repos[@]"; then # Since the initialization has failed, this command is terminated. # The error message etc. should be done within that function. return 1 fi repos=( "$reply[@]" ) for repo in "$repos[@]" do __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) # Run the installation in background { if [[ -n $tags[if] ]] && ! eval "${tags[if]}" 2> >(__zplug::log::capture::error) >/dev/null; then status_code=$_zplug_status[skip_if] else if __zplug::core::sources::is_handler_defined "install" "$tags[from]"; then __zplug::core::sources::use_handler \ "install" \ "$tags[from]" \ "$repo" status_code=$status fi fi # Manage the status codes in a file # to lock the file in order to write asynchronously __zplug::job::handle::flock \ "$_zplug_log[install]" \ "repo:$repo\tstatus:$status_code" } & repo_pids[$repo]=$(builtin printf $!) # for zsh 5.3 hook_build[$repo]="$tags[hook-build]" hook_finished[$repo]=false proc_states[$repo]="created" status_codes[$repo]="" __zplug::job::handle::wait done __zplug::job::handle::elapsed_time $SECONDS __zplug::job::parallel::deinit zplug-2.4.2/autoload/commands/__list__000066400000000000000000000053751322121161600177700ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # List installed packages (more specifically, view the associative array $zplugs) local arg repo tag filter local is_loaded=false is_installed=false is_select=false local -aU repos tag="${(kj:|:)_zplug_tags[@]}" while (( $# > 0 )) do arg="$1" case "$arg" in --select) is_select=true ;; --loaded) is_loaded=true ;; --installed) is_installed=true ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) # Do nothing ;; *) # Do nothing ;; esac shift done # If assosiate array "zplugs" is empty, # it means there are no packages that are managed by zplug if (( $#zplugs == 0 )); then __zplug::io::print::f \ --die --zplug \ "no package managed by zplug\n" return 1 fi if $is_loaded; then if [[ -s $_zplug_load_log[success] ]]; then repos=( ${(u@f)"$(<"$_zplug_load_log[success]")":gs:@:} ) else __zplug::io::print::f \ --die --zplug \ "First, you have to run 'zplug load'\n" __zplug::log::write::info "$_zplug_load_log[success]: not found or empty\n" return 1 fi elif $is_installed; then # By using a file glob, it's checked whether it really exists # A slash is added to the end, but delete it since it's unnecessary repos=( "$ZPLUG_REPOS"/*/*(/:gs:"$ZPLUG_REPOS"/:) ) repos=( "${repos[@]%/}" ) else repos=( "${(uk)zplugs[@]:gs:@::}" ) fi if $is_select; then __zplug::utils::shell::search_commands \ "$ZPLUG_FILTER" \ | read filter if [[ -z $filter ]]; then __zplug::io::print::f \ --die --zplug \ "There is no available filter in ZPLUG_FILTER\n" return 1 fi repos=( ${(@f)"$(print -l "$repos[@]" | ${=filter})"} ) fi if __zplug::utils::shell::is_atty; then # Disply tag information in color # when connected to the terminal for repo in "$repos[@]" do builtin printf "$fg[green]$repo$reset_color" builtin printf "$fg[blue] => $reset_color" builtin printf "${zplugs[$repo]:-"$fg[red]none"}\n" done \ | sed -E 's/('"$tag"'):/'"$fg[yellow]"'\1'"$reset_color"':/g' \ | sed -E 's/:/:"/g;s/, /", /g;/none$/!s/$/"/g' # quotes tag printf "$reset_color" else # When not connected to the termianl, # e.g. piped with the grep command (`zplug list | grep zsh`) # don't display tag information for repo ("$repos[@]") echo "$repo" fi # Returns true if a length of repos is greater than zero return !$#repos zplug-2.4.2/autoload/commands/__load__000066400000000000000000000031061322121161600177220ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Source installed plugins and add installed commands to $PATH __zplug::core::load::prepare local repo arg local -a repos local -A tags repos=( "${(k)zplugs[@]}" ) while (( $# > 0 )) do arg="$1" case "$arg" in --verbose) zstyle ':zplug:core:load' 'verbose' yes ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done # Check if cache is up-to-date if __zplug::core::cache::diff; then __zplug::core::load::from_cache return $status fi for repo in "${repos[@]}" do # Generate cache for each as:type in parallel { tags[as]="$(__zplug::core::core::run_interfaces 'as' "$repo")" case "$tags[as]" in "plugin") __zplug::core::cache::plugins "$repo" ;; "command") __zplug::core::cache::commands "$repo" ;; "theme") __zplug::core::cache::themes "$repo" ;; *) __zplug::io::print::f \ --die \ --zplug \ --func \ "as tag is invalid value (%s)\n" \ "$fg[green]$repo$reset_color" ;; esac } & done wait __zplug::core::load::from_cache return $status zplug-2.4.2/autoload/commands/__status__000066400000000000000000000043571322121161600203370ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Check if the remote repositories are up to date local state arg repo local -A repo_pids proc_states hook_build hook_finished hook_pids status_codes local -A tags local -F SECONDS=0 local -a repos while (( $# > 0 )) do arg="$1" case "$arg" in --select) zstyle ':zplug:core:status' 'select' yes ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done if ! __zplug::job::parallel::init "$repos[@]"; then # Since the initialization has failed, this command is terminated. # The error message etc. should be done within that function. return 1 fi repos=( "$reply[@]" ) for repo in "${repos[@]}" do # Run in parallel { __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) if [[ -d $tags[dir] ]]; then # Get the package status in subprocess # Change the directory to get the remote status __zplug::utils::shell::cd "$tags[dir]" case "$tags[from]" in "local") status_code=$_zplug_status[skip_local] ;; "gh-r") __zplug::utils::releases::get_state "$tags[name]" "$tags[dir]" status_code=$status ;; *) __zplug::utils::git::get_state "$tags[name]" "$tags[dir]" status_code=$status ;; esac else status_code=$_zplug_status[repo_not_found] fi # Manage the status codes in a file # to lock the file in order to write asynchronously __zplug::job::handle::flock \ "$_zplug_log[status]" \ "repo:$repo\tstatus:$status_code" } & repo_pids[$repo]=$(builtin printf $!) # for zsh 5.3 proc_states[$repo]="created" status_codes[$repo]="" __zplug::job::handle::wait done __zplug::job::handle::elapsed_time $SECONDS __zplug::job::parallel::deinit zplug-2.4.2/autoload/commands/__update__000066400000000000000000000045061322121161600202720ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Update installed packages in parallel local is_force=false local repo arg local -A repo_pids proc_states hook_build hook_finished hook_pids status_codes local -A tags local -F SECONDS=0 local -aU repos local -i status_code=0 while (( $# > 0 )) do arg="$1" case "$arg" in --select) zstyle ':zplug:core:update' 'select' yes ;; --force) is_force=true ;; -*|--*) __zplug::core::options::unknown "$arg" return $status ;; "") # Invalid return 1 ;; */*) repos+=( "${arg:gs:@::}" ) ;; *) return 1 ;; esac shift done if ! __zplug::job::parallel::init "$repos[@]"; then # Since the initialization has failed, this command is terminated. # The error message etc. should be done within that function. return 1 fi repos=( "$reply[@]" ) for repo in "$repos[@]" do __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) # Run the updating in subprocess { if [[ -d $tags[dir] ]]; then if ! $is_force && (( $_zplug_boolean_true[(I)$tags[frozen]] )); then status_code=$_zplug_status[skip_frozen] else if __zplug::core::sources::is_handler_defined "update" "$tags[from]"; then __zplug::core::sources::use_handler \ "update" \ "$tags[from]" \ "$repo" status_code=$status else status_code=$_zplug_status[skip_local] fi fi else status_code=$_zplug_status[repo_not_found] fi # Manage the status codes in a file # to lock the file in order to write asynchronously __zplug::job::handle::flock \ "$_zplug_log[update]" \ "repo:$repo\tstatus:$status_code" } & repo_pids[$repo]=$(builtin printf $!) # for zsh 5.3 hook_build[$repo]="$tags[hook-build]" hook_finished[$repo]=false proc_states[$repo]="created" status_codes[$repo]="" __zplug::job::handle::wait done __zplug::job::handle::elapsed_time $SECONDS __zplug::job::parallel::deinit zplug-2.4.2/autoload/init.zsh000066400000000000000000000005521322121161600161560ustar00rootroot00000000000000# This file just loads some files within autoload directory # Also, load the body of zplug fpath=( "$ZPLUG_ROOT"/autoload(N-/) "$ZPLUG_ROOT"/autoload/*(N-/) "$fpath[@]" ) autoload -Uz regexp-replace autoload -Uz add-zsh-hook autoload -Uz colors autoload -Uz compinit autoload -Uz zplug colors zmodload zsh/system zmodload zsh/datetime zmodload zsh/parameter zplug-2.4.2/autoload/options/000077500000000000000000000000001322121161600161565ustar00rootroot00000000000000zplug-2.4.2/autoload/options/__help__000066400000000000000000000036331322121161600176320ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Display the help message local f arg local -a fs args local -A opts cmds local obj opt cmd local -i max=0 while (( $# > 0 )) do arg="$1" case "$arg" in -*|--*) break ;; "") ;; *) fs=( "$(echo $ZPLUG_HOME/doc/man/man(1|5)/(zplug-|)${arg}.(1|5)(N))" ) # Non-existing man page if [[ $fs[1] == "" ]]; then __zplug::io::print::f \ --die \ --zplug \ "$arg: no such subcommand or tag\n" return 1 fi # List all hits pages for f in "${fs[@]}" do if [[ -f $f ]]; then args+=( "$f" ) fi done ;; esac shift done if (( $#args > 0 )); then man "${args[@]}" return $status fi # Measure max length { cmds=( "${(kv)_zplug_commands[@]}" ) for opt in "${(k)_zplug_options[@]}" do opts[--$opt]="$_zplug_options[$opt]" done for obj in "${(k)cmds[@]}" "${(k)opts[@]}" do if (( $#obj > $max )); then max=$#obj fi done } # Help message format { printf "usage: zplug [OPTIONS] [COMMANDS [options] [args]]\n" printf " zplug is a next-generation plugin manager for zsh\n" for obj in \ OPTIONS "${(k)opts[@]}" \ COMMANDS "${(k)cmds[@]}"; do \ case "$obj" in OPTIONS | COMMANDS) printf "\n$obj:\n" ;; *) desc="(None)" [[ -n $opts[$obj] ]] && desc="$opts[$obj]" [[ -n $cmds[$obj] ]] && desc="$cmds[$obj]" printf " %-${max}s %s\n" \ "$obj" \ "$desc" ;; esac done printf "\n" } >&2 return 1 zplug-2.4.2/autoload/options/__log__000066400000000000000000000030361322121161600174600ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Show the report of zplug errors if [[ ! -f $_zplug_log[trace] ]] || [[ ! -s $_zplug_log[trace] ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ "The trace log is not found or empty\n" return 1 fi local arg while (( $# > 0 )) do arg="$1" case "$arg" in edit) ${=${2:+$2}:-${EDITOR:-vim}} "$_zplug_log[trace]" return $status ;; jq) if (( ! $+commands[jq] )); then return 1 fi cat "$_zplug_log[trace]" \ | sed -e 's/[[:cntrl:]]//g' \ | jq ${=${2:+"$argv[2,-1]"}:-"."} return $status ;; less | more) # $PAGER cat "$_zplug_log[trace]" | ${=arg} return $status ;; clear) rm -i "$_zplug_log[trace]" return $status ;; count) cat "$_zplug_log[trace]" | grep -c '' return $status ;; latest) cat "$_zplug_log[trace]" \ | tail -n ${${2:+"$argv[2,-1]"}:-1} \ | ${=${${commands[jq]:+"jq ."}:-"cat -"}} return $status ;; "") ;; *) __zplug::io::print::f \ --die \ --zplug \ --func \ "$arg: invalid arguments\n" return 1 ;; esac shift done cat "$_zplug_log[trace]" zplug-2.4.2/autoload/options/__rollback__000066400000000000000000000012221322121161600204630ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Rollback a failed package local arg while (( $# > 0 )) do arg="$1" case "$arg" in build) __zplug::job::rollback::build return $status ;; "") __zplug::io::print::f \ --die \ --zplug \ "argument is required\n" return $_zplug_status[failure] ;; *) __zplug::io::print::f \ --die \ --zplug \ "$arg: no such rollback operation\n" return $_zplug_status[failure] ;; esac shift done zplug-2.4.2/autoload/options/__self-manage__000066400000000000000000000004751322121161600210620ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Self management of zplug if ! __zplug::base::base::zpluged "zplug/zplug"; then __zplug::io::print::f \ --die \ --zplug \ "zplug/zplug: not managed yet\n" return 1 fi ln -snf \ "$ZPLUG_REPOS/zplug/zplug/init.zsh" \ "$ZPLUG_HOME/init.zsh" zplug-2.4.2/autoload/options/__version__000066400000000000000000000001721322121161600203620ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Display the version of zplug __zplug::io::print::put "$_ZPLUG_VERSION\n" return 0 zplug-2.4.2/autoload/tags/000077500000000000000000000000001322121161600154215ustar00rootroot00000000000000zplug-2.4.2/autoload/tags/__as__000066400000000000000000000023231322121161600165430ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Specify whether to register the package as plugins or commands local arg="$1" package local -a parsed_zplugs local as local default="plugin" local -a candidates candidates=( "$default" "command" "theme" ) package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) as="${parsed_zplugs[(k)as:*]#as:*}" if [[ -z $as ]]; then zstyle -t ":zplug:tag" as "${candidates[@]}" case $status in 0) # ok zstyle -s ":zplug:tag" as as ;; 1) __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "as tag must be [%s] ($fg[green]%s$reset_color)\n" \ "${(j:, :)candidates[*]}" \ "$arg" return 1 ;; 2) # undefined ;; esac fi : ${as:=$default} if [[ ! $as =~ ^(${(j:|:)candidates[@]})$ ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "as tag must be [%s] ($fg[green]%s$reset_color)\n" \ "${(j:, :)candidates[*]}" \ "$arg" return 1 fi echo "$as" zplug-2.4.2/autoload/tags/__at__000066400000000000000000000010551322121161600165450ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Branch, tag, or commit to use local arg="$1" package local -a parsed_zplugs local at local default="master" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) at="${parsed_zplugs[(k)at:*]#at:*}" if [[ -z $at ]]; then zstyle -s ":zplug:tag" at at fi local from __zplug::core::core::run_interfaces \ 'from' \ "$arg" \ | read from if [[ $from == "gh-r" ]]; then default="latest" if [[ -n $at ]]; then at="tag/$at" fi fi echo "${at:-$default}" zplug-2.4.2/autoload/tags/__commit__000066400000000000000000000000401322121161600174220ustar00rootroot00000000000000#!/usr/bin/env zsh # DEPRECATED zplug-2.4.2/autoload/tags/__defer__000066400000000000000000000012261322121161600172260ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Defers the loading of a package local arg="$1" package local -a parsed_zplugs local defer local -i default=0 package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) defer="${parsed_zplugs[(k)defer:*]#defer:*}" if [[ -z $defer ]]; then zstyle -s ":zplug:tag" defer defer fi : ${defer:=$default} if [[ $defer =~ ^[[:digit:]]+$ ]] && \ (( $defer >= 0 )) && (( $defer <= 3 )); then : else __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "defer tag must be {0..3} ($fg[green]$arg$reset_color)\n" return 1 fi echo "$defer" zplug-2.4.2/autoload/tags/__depth__000066400000000000000000000014141322121161600172440ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # The number of commits to include in the cloned repository local arg="$1" package local -a parsed_zplugs local depth local -i default=0 package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) depth="${parsed_zplugs[(k)depth:*]#depth:*}" if [[ -z $depth ]]; then zstyle -s ":zplug:tag" depth depth fi : ${depth:=$default} case $depth in <->) #depth_option="--depth=$tag_depth" : ;; *) # not integer __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "depth tag must be a positive number\n" \ "but, if zero, no shallow clone.\n" return 1 ;; esac echo "$depth" zplug-2.4.2/autoload/tags/__dir__000066400000000000000000000012701322121161600167160ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Installation directory which is managed by zplug local arg="${1:gs:@::}" package local -a parsed_zplugs local dir local default="$ZPLUG_REPOS/$arg" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) dir="${parsed_zplugs[(k)dir:*]#dir:*}" if [[ -z $dir ]]; then zstyle -s ":zplug:tag" dir dir fi local from __zplug::core::core::run_interfaces \ 'from' \ "$arg" \ | read from case "$from" in "oh-my-zsh") dir="$ZPLUG_REPOS/$_ZPLUG_OHMYZSH" ;; "prezto") dir="$ZPLUG_REPOS/$_ZPLUG_PREZTO" ;; "local") dir="$arg" ;; esac echo ${~dir:-$default} zplug-2.4.2/autoload/tags/__do__000066400000000000000000000000401322121161600165340ustar00rootroot00000000000000#!/usr/bin/env zsh # DEPRECATED zplug-2.4.2/autoload/tags/__file__000066400000000000000000000000401322121161600170510ustar00rootroot00000000000000#!/usr/bin/env zsh # DEPRECATED zplug-2.4.2/autoload/tags/__from__000066400000000000000000000023561322121161600171110ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Specify the service from which you install local arg="$1" package local -a parsed_zplugs local from local default="github" local -a candidates candidates=( "$ZPLUG_ROOT/base/sources/"*.zsh ) candidates=( ${${candidates%.zsh}:t} ) package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) from="${parsed_zplugs[(k)from:*]#from:*}" if [[ -z $from ]]; then zstyle -t ":zplug:tag" from "${candidates[@]}" case $status in 0) # ok zstyle -s ":zplug:tag" from from ;; 1) __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "from tag must be [%s] ($fg[green]%s$reset_color)\n" \ "${(j:, :)candidates[*]}" \ "$arg" ;; 2) # undefined ;; esac fi : ${from:=$default} if [[ ! $from =~ ^(${(j:|:)candidates[@]})$ ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "from tag must be [%s] ($fg[green]%s$reset_color)\n" \ "${(j:, :)candidates[*]}" \ "$arg" return 1 fi echo "$from" zplug-2.4.2/autoload/tags/__frozen__000066400000000000000000000026451322121161600174520ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Do not update unless explicitly specified local arg package local -a parsed_zplugs local frozen local default="no" arg="$1" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) frozen="${parsed_zplugs[(k)frozen:*]#frozen:*}" if [[ -z $frozen ]]; then zstyle -t ":zplug:tag" frozen case $status in 0) # word that means true zstyle -b ":zplug:tag" frozen frozen ;; 1) # word that means false if [[ $frozen =~ ^("${(j:|:)_zplug_boolean_true[@]}|${(j:|:)_zplug_boolean_false[@]}")$ ]]; then # ok (false words) : else __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "frozen tag must be a boolean ($fg[green]%s$reset_color)\n" \ "$arg" return 1 fi ;; 2) # undefined ;; esac fi : ${frozen:=$default} if [[ $frozen =~ ^("${(j:|:)_zplug_boolean_true[@]}|${(j:|:)_zplug_boolean_false[@]}")$ ]]; then : else __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "frozen tag must be a boolean ($fg[green]%s$reset_color)\n" \ "$arg" return 1 fi echo "$frozen" zplug-2.4.2/autoload/tags/__hook-build__000066400000000000000000000006511322121161600201770ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Commands to run after installation/update local arg="$1" package local -a parsed_zplugs local hook_build local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) hook_build="${parsed_zplugs[(k)hook-build:*]#hook-build:*}" if [[ -z $hook_build ]]; then zstyle -s ":zplug:tag" hook-build hook_build fi echo "${hook_build:-$default}" zplug-2.4.2/autoload/tags/__hook-load__000066400000000000000000000006251322121161600200200ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Commands to run after loading local arg="$1" package local -a parsed_zplugs local hook_load local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) hook_load="${parsed_zplugs[(k)hook-load:*]#hook-load:*}" if [[ -z $hook_load ]]; then zstyle -s ":zplug:tag" hook-load hook_load fi echo "${hook_load:-$default}" zplug-2.4.2/autoload/tags/__if__000066400000000000000000000005741322121161600165440ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # The conditions under which to install and/or use the package local arg="$1" package local -a parsed_zplugs local if local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) if="${parsed_zplugs[(k)if:*]#if:*}" if [[ -z $if ]]; then zstyle -s ":zplug:tag" if if fi echo "${if:-$default}" zplug-2.4.2/autoload/tags/__ignore__000066400000000000000000000006361322121161600174300ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Specify exception pattern of files that you don't want to load local arg="$1" package local -a parsed_zplugs local ignore local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) ignore="${parsed_zplugs[(k)ignore:*]#ignore:*}" if [[ -z $ignore ]]; then zstyle -s ":zplug:tag" ignore ignore fi echo "${ignore:-$default}" zplug-2.4.2/autoload/tags/__lazy__000066400000000000000000000024731322121161600171250ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Lazy-load local arg="$1" package local -a parsed_zplugs local lazy local default="no" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) lazy="${parsed_zplugs[(k)lazy:*]#lazy:*}" if [[ -z $lazy ]]; then zstyle -t ":zplug:tag" lazy case $status in 0) # word that means true zstyle -b ":zplug:tag" lazy lazy ;; 1) # word that means false if [[ $lazy =~ ^("${(j:|:)_zplug_boolean_true[@]}|${(j:|:)_zplug_boolean_false[@]}")$ ]]; then # ok (false words) : else __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "lazy tag must be a boolean ($fg[green]$arg$reset_color)\n" return 1 fi ;; 2) # undefined ;; esac fi : ${lazy:=$default} if [[ $lazy =~ ^("${(j:|:)_zplug_boolean_true[@]}|${(j:|:)_zplug_boolean_false[@]}")$ ]]; then : else __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "lazy tag must be a boolean ($fg[green]$arg$reset_color)\n" return 1 fi echo "$lazy" zplug-2.4.2/autoload/tags/__nice__000066400000000000000000000000401322121161600170500ustar00rootroot00000000000000#!/usr/bin/env zsh # DEPRECATED zplug-2.4.2/autoload/tags/__of__000066400000000000000000000000401322121161600165360ustar00rootroot00000000000000#!/usr/bin/env zsh # DEPRECATED zplug-2.4.2/autoload/tags/__on__000066400000000000000000000005141322121161600165540ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Dependencies local arg="$1" package local -a parsed_zplugs local on local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) on="${parsed_zplugs[(k)on:*]#on:*}" if [[ -z $on ]]; then zstyle -s ":zplug:tag" on on fi echo "${on:-$default}" zplug-2.4.2/autoload/tags/__rename-to__000066400000000000000000000006421322121161600200310ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Specify the filename you want to rename to local arg="$1" package local -a parsed_zplugs local rename_to local default="" package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) rename_to="${parsed_zplugs[(k)rename-to:*]#rename-to:*}" if [[ -z $rename_to ]]; then zstyle -s ":zplug:tag" rename-to rename_to fi echo "${rename_to:-$default}" zplug-2.4.2/autoload/tags/__use__000066400000000000000000000016151322121161600167370ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: # Specify the pattern of the files to source or add to `$PATH` local arg="$1" package local -a parsed_zplugs local use local default="*.zsh" local -A tags package="${arg}, ${zplugs[$arg]%, }" parsed_zplugs=(${(s/, /)package/, */, }) use="${parsed_zplugs[(k)use:*]#use:*}" if [[ -z $use ]]; then zstyle -s ":zplug:tag" use use fi tags[from]="$( __zplug::core::core::run_interfaces \ 'from' \ "$arg" )" tags[as]="$( __zplug::core::core::run_interfaces \ 'as' \ "$arg" )" if [[ $tags[from] == "gh-r" ]]; then default="" if [[ -n $use ]]; then use="$(__zplug::utils::shell::glob2regexp "$use")" else use="$(__zplug::base::base::get_os)" if __zplug::base::base::is_osx; then use="(darwin|osx)" fi fi fi if [[ $tags[as] == "theme" ]]; then default="" fi echo "${use:-$default}" zplug-2.4.2/autoload/zplug000066400000000000000000000010301322121161600155410ustar00rootroot00000000000000#!/usr/bin/env zsh local arg="$1" case "$arg" in -* | --*) __zplug::core::options::parse "$argv[@]" ;; check | install | update | list | clean | status | clear | load | info) shift __zplug::core::core::run_interfaces \ "$arg" \ "$argv[@]" ;; */*) __zplug::core::add::to_zplugs "$argv[@]" ;; "") __zplug::core::arguments::none ;; *) __zplug::core::arguments::exec "$argv[@]" ;; esac return $status zplug-2.4.2/base/000077500000000000000000000000001322121161600135655ustar00rootroot00000000000000zplug-2.4.2/base/base/000077500000000000000000000000001322121161600144775ustar00rootroot00000000000000zplug-2.4.2/base/base/base.zsh000066400000000000000000000070571322121161600161500ustar00rootroot00000000000000__zplug::base::base::is_cli() { # Return true if you run from cli [[ $- =~ s ]] return $status } __zplug::base::base::zpluged() { local arg="$1" zplug repo local -A zspec if [[ -z $arg ]]; then (( $+zplugs )) return $status else if [[ $arg == $_ZPLUG_OHMYZSH ]]; then for zplug in "${(k)zplugs[@]}" do __zplug::core::tags::parse "$zplug" zspec=( "${reply[@]}" ) case "$zspec[from]" in "oh-my-zsh") return 0 ;; esac done else repo="$arg" fi (( $+zplugs[$repo] )) return $status fi } __zplug::base::base::version_requirement() { local -i idx local -a min val local a="$1" op="$2" b="$3" [[ $a == $b ]] && return 0 val=("${(s:.:)a}") min=("${(s:.:)b}") case "$op" in ">") for (( idx=1; idx <= $#val; idx++ )) do if (( val[$idx] > ${min[$idx]:-0} )); then return 0 elif (( val[$idx] < ${min[$idx]:-0} )); then return 1 fi done ;; "<") for (( idx=1; idx <= $#val; idx++ )) do if (( val[$idx] < ${min[$idx]:-0} )); then return 0 elif (( val[$idx] > ${min[$idx]:-0} )); then return 1 fi done ;; *) ;; esac return 1 } __zplug::base::base::valid_semver() { local prev="$1" next="$2" if [[ $prev == $next ]]; then # e.g. NG: prev 2.4.1, next 2.4.1 return 1 fi if __zplug::base::base::version_requirement "$prev" ">" "$next"; then # e.g. NG: prev 2.4.1, next 2.4.0 return 1 fi prev_elements=("${(s:.:)prev}") next_elements=("${(s:.:)next}") if (( $#next_elements != 3 )); then # e.g. NG: next 2.4 return 1 fi # TODO: more complex # prev_flat="${prev//./}" # next_flat="${next//./}" # if (( $(($next_flat - $prev_flat)) != 1 )); then # # e.g. NG: prev 2.4.1, next 2.4.3 # return 1 # fi return 0 } __zplug::base::base::git_version() { # Return false if git command doesn't exist if (( ! $+commands[git] )); then return 1 fi __zplug::base::base::version_requirement \ ${(M)${(z)"$(git --version)"}:#[0-9]*[0-9]} ">" "${@:?}" return $status } __zplug::base::base::zsh_version() { __zplug::base::base::version_requirement \ "$ZSH_VERSION" ">" "${@:?}" return $status } __zplug::base::base::osx_version() { (( $+commands[sw_vers] )) || return 1 __zplug::base::base::version_requirement \ ${${(M)${(@f)"$(sw_vers)"}:#ProductVersion*}[2]} ">" "${@:?}" return $status } __zplug::base::base::get_os() { typeset -gx PLATFORM local os os="${(L)OSTYPE-"$(uname)"}" case "$os" in *'linux'*) PLATFORM='linux' ;; *'darwin'*) PLATFORM='darwin' ;; *'bsd'*) PLATFORM='bsd' ;; *) PLATFORM='unknown' ;; esac echo "$PLATFORM" } __zplug::base::base::is_osx() { [[ ${(L)OSTYPE:-"$(uname)"} == *darwin* ]] } __zplug::base::base::is_linux() { [[ ${(L)OSTYPE:-"$(uname)"} == *linux* ]] } __zplug::base::base::packaging() { local k print -l "${(k)zplugs[@]}" \ | awk \ -f "$_ZPLUG_AWKPATH/packaging.awk" \ -v pkg="${1:?}" } zplug-2.4.2/base/core/000077500000000000000000000000001322121161600145155ustar00rootroot00000000000000zplug-2.4.2/base/core/add.zsh000066400000000000000000000050231322121161600157730ustar00rootroot00000000000000__zplug::core::add::to_zplugs() { local name="$1" local tag key val local -a tags local -a re_tags # DEPRECATED: pipe if [[ -p /dev/stdin ]]; then __zplug::core::migration::pipe return $status fi # In the case of "from:local", it accepts multiple slashes if [[ ! $name =~ [~$/] ]] && [[ ! $name =~ "^[^/]+/[^/]+$" ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ "${(qq)name} is invalid package name\n" return 1 fi if __zplug::base::base::is_cli; then # register a package to ZPLUG_LOADFILE __zplug::core::add::on_cli "$argv[@]" fi # Parse argv tags=( ${(s/, /)argv[@]:gs/, */, } ) name="$(__zplug::core::add::proc_at-sign "$tags[1]")" tags[1]=() # Reconstruct the tag information for tag in "${tags[@]}" do key=${${(s.:.)tag}[1]} val=${${(s.:.)tag}[2]} if (( $+_zplug_tags[$key] )); then case $key in "of" | "file" | "commit" | "do" | "nice") # DEPRECATED: old tags __zplug::core::migration::tags "$key" ;; "from") __zplug::core::sources::call "$val" ;; esac re_tags+=( "$key:$val" ) else __zplug::io::print::f \ --die \ --zplug \ "$tag: '$key' is invalid tag name\n" return 1 fi done # In case of that 'from' tag is default value __zplug::core::sources::use_default # Add to zplugs (hash array) # "$name" "$re_tags[@]" (<-- "key" "value") # \ `-- '"as:plugin, from:github"' # `-- e.g. 'enhancd' zplugs+=("$name" "${(j:, :)re_tags[@]:-}") } __zplug::core::add::proc_at-sign() { local name="$1" key local -i max=0 for key in "${(k)zplugs[@]}" do if [[ $key =~ ^$name@*$ ]] && (( $max < $#key )); then max=$#key name="${key}@" fi done echo "$name" } __zplug::core::add::on_cli() { local name local -a tags tags=( ${(s/, /)argv[@]:gs/, */, } ) name="$tags[1]" tags[1]=() if __zplug::base::base::zpluged "$name"; then __zplug::io::print::f \ --die \ --zplug \ "$name: already managed\n" return 1 fi echo "zplug ${(qqq)name}${tags[@]:+", ${(j:, :)${(q)tags[@]}}"}" \ >>|"$ZPLUG_LOADFILE" } zplug-2.4.2/base/core/arguments.zsh000066400000000000000000000042051322121161600172510ustar00rootroot00000000000000__zplug::core::arguments::exec() { local arg="$1" shift reply=() __zplug::core::commands::user_defined # User-defined command if [[ -n ${(M)reply[@]:#$arg} ]]; then eval "$commands[zplug-$arg]" "$argv[@]" return $status fi # User-defined function if (( $+functions[zplug-$arg] )); then zplug-$arg "$argv[@]" return $status fi # Fuzzy match if ! __zplug::core::arguments::auto_correct "$arg"; then return 1 fi zplug "$reply[1]" "$argv[@]" } __zplug::core::arguments::auto_correct() { local arg="$1" local -i ret=0 local -a cmds reply_cmds reply_cmds=() # Add user-defined commands __zplug::core::commands::user_defined reply_cmds+=( "${reply[@]}" ) # Add zplug subcommands __zplug::core::commands::get --key reply_cmds+=( "${reply[@]}" ) cmds=( ${(@f)"$(awk \ -f "$_ZPLUG_AWKPATH/fuzzy.awk" \ -v search_string="$arg" \ <<<"${(F)reply_cmds:gs:_:}" )":-} ) case $#cmds in 0) __zplug::io::print::f \ --die \ --zplug \ "$arg: no such command\n" ret=1 ;; 1) __zplug::io::print::f \ --die \ --zplug \ --warn \ "You called a zplug command named '%s', which does not exist.\n" \ "Continuing under the assumption that you meant '%s'.\n" \ -- \ "$arg" \ "$fg[green]$cmds[1]$reset_color" reply=( "$cmds[1]" ) ;; *) __zplug::io::print::f \ --die \ --zplug \ --warn \ "'%s' is not a zplug command. see 'zplug --help'.\n" \ "Did you mean one of these?\n" \ -- \ "$arg" __zplug::io::print::die \ "$fg[yellow]\t- $reset_color%s\n" \ "${cmds[@]}" ret=1 ;; esac return $ret } __zplug::core::arguments::none() { # TODO : } zplug-2.4.2/base/core/cache.zsh000066400000000000000000000136651322121161600163210ustar00rootroot00000000000000__zplug::core::cache::set_file() { local file="${1:?}" if (( ! $+_zplug_cache[$file] )); then return 1 fi # Keep compatible with version 2.3.3 or lower __zplug::core::migration::cache_file_dir rm -f "$_zplug_cache[$file]" touch "$_zplug_cache[$file]" } __zplug::core::cache::expose() { if [[ -f $_zplug_cache[interface] ]]; then cat "$_zplug_cache[interface]" fi } __zplug::core::cache::update() { __zplug::core::interface::expose \ >|"$_zplug_cache[interface]" } __zplug::core::cache::commit() { local pkg pair hook local -A hook_load local -A reply_hash local -A load_commands local -aU load_plugins load_fpaths lazy_plugins \ defer_1_plugins \ defer_2_plugins \ defer_3_plugins local -aU unclassified_plugins local repo param params reply_hash=( "$argv[@]" ) lazy_plugins=( ${(@f)reply_hash[lazy_plugins]} ) load_fpaths=( ${(@f)reply_hash[load_fpaths]} ) load_plugins=( ${(@f)reply_hash[load_plugins]} ) load_themes=( ${(@f)reply_hash[load_themes]} ) defer_1_plugins=( ${(@f)reply_hash[defer_1_plugins]} ) defer_2_plugins=( ${(@f)reply_hash[defer_2_plugins]} ) defer_3_plugins=( ${(@f)reply_hash[defer_3_plugins]} ) unclassified_plugins=( ${(@f)reply_hash[unclassified_plugins]} ) for pair (${(@f)reply_hash[load_commands]}) load_commands+=( ${(@s:\0:)pair} ) for pair in ${reply_hash[hook_load]} do hook="${${(@s:\0:)pair}[2,-1]}" done repo="$reply_hash[repo]" # Common parameter param="--repo ${(qqq)repo}" if [[ -n $hook ]]; then param+=" --hook ${(qqq)hook}" fi # Record packages to cache file for pkg in "$load_plugins[@]" do params="$param ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[plugin]" "__zplug::core::load::as_plugin $params" done for pkg in "$defer_1_plugins[@]" do params="$param ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[defer_1_plugin]" "__zplug::core::load::as_plugin $params" done for pkg in "$defer_2_plugins[@]" do params="$param ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[defer_2_plugin]" "__zplug::core::load::as_plugin $params" done for pkg in "$defer_3_plugins[@]" do params="$param ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[defer_3_plugin]" "__zplug::core::load::as_plugin $params" done for pkg in "$lazy_plugins[@]" do params="$param ${(qqq)pkg} --lazy" __zplug::job::handle::flock "$_zplug_cache[lazy_plugin]" "__zplug::core::load::as_plugin $params" done for pkg in "$load_fpaths[@]" do __zplug::job::handle::flock "$_zplug_cache[fpath]" "$pkg" done for pkg in "${(k)load_commands[@]}" do params="$param --path ${(qqq)load_commands[$pkg]} ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[command]" "__zplug::core::load::as_command $params" done for pkg in "$load_themes[@]" do params="$param ${(qqq)pkg}" __zplug::job::handle::flock "$_zplug_cache[theme]" "__zplug::core::load::as_theme $params" done } __zplug::core::cache::diff() { local key file local is_verbose zstyle -s ':zplug:core:load' 'verbose' is_verbose $ZPLUG_USE_CACHE || return 2 if [[ -d $ZPLUG_CACHE_DIR ]]; then 2> >(__zplug::log::capture::error) >/dev/null \ diff -b \ <(__zplug::core::cache::expose) \ <(__zplug::core::interface::expose) case $status in 0) # same if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::f --zplug "Loaded from cache ($ZPLUG_CACHE_DIR)\n" fi return 0 ;; 1) # differ ;; 2) # error ;; esac fi for file in "${(k)_zplug_cache[@]}" do __zplug::core::cache::set_file "$file" done # if cache file doesn't find, # returns non-zero exit code return 1 } __zplug::core::cache::plugins() { local repo="${1:?}" local -A tags __zplug::core::load::skip_condition "$repo" && return 0 tags[from]="$(__zplug::core::core::run_interfaces "from" "$repo")" # Switch to the revision specified by its tags __zplug::utils::git::checkout "$repo" if __zplug::core::sources::is_handler_defined "load_plugin" "$tags[from]"; then # Custom handler for loading __zplug::core::sources::use_handler \ "load_plugin" \ "$tags[from]" \ "$repo" __zplug::core::cache::commit repo "$repo" "$reply[@]" fi } __zplug::core::cache::commands() { local repo="${1:?}" local -A tags __zplug::core::load::skip_condition "$repo" && return 0 tags[from]="$(__zplug::core::core::run_interfaces "from" "$repo")" # Switch to the revision specified by its tags __zplug::utils::git::checkout "$repo" if __zplug::core::sources::is_handler_defined "load_command" "$tags[from]"; then __zplug::core::sources::use_handler \ "load_command" \ "$tags[from]" \ "$repo" __zplug::core::cache::commit repo "$repo" "$reply[@]" fi } __zplug::core::cache::themes() { local repo="${1:?}" local -A tags __zplug::core::load::skip_condition "$repo" && return 0 tags[from]="$(__zplug::core::core::run_interfaces "from" "$repo")" # Switch to the revision specified by its tags __zplug::utils::git::checkout "$repo" if __zplug::core::sources::is_handler_defined "load_theme" "$tags[from]"; then # Custom handler for loading __zplug::core::sources::use_handler \ "load_theme" \ "$tags[from]" \ "$repo" __zplug::core::cache::commit repo "$repo" "$reply[@]" fi setopt prompt_subst } zplug-2.4.2/base/core/commands.zsh000066400000000000000000000006211322121161600170430ustar00rootroot00000000000000__zplug::core::commands::get() { __zplug::core::core::get_interfaces \ "commands" \ "$argv[@]" } __zplug::core::commands::user_defined() { local -a user_cmds # reset reply=() user_cmds=( ${^path[@]}/zplug-*(N-.:t:gs:zplug-:) ) if (( $#user_cmds > 0 )); then # Be unique reply+=( "${(u)user_cmds[@]}" ) return 0 fi return 1 } zplug-2.4.2/base/core/core.zsh000066400000000000000000000213421322121161600161750ustar00rootroot00000000000000__zplug::core::core::get_interfaces() { local arg name desc local target local -a targets local interface local -A interfaces local is_key=false is_prefix=false while (( $# > 0 )) do arg="$1" case "$arg" in --key) is_key=true ;; --prefix) is_prefix=true ;; -* | --*) ;; "") ;; *) targets+=( "$arg" ) ;; esac shift done # Initialize reply=() for target in "${targets[@]}" do interfaces=() for interface in "$ZPLUG_ROOT/autoload/$target"/__*__(N-.) do # TODO: /^.*desc(ription)?: ?/ name="${interface:t:gs:_:}" if $is_prefix; then name="__${name}__" fi desc="" while IFS= read -r line do if [[ "$line" =~ "# Description:" ]]; then IFS= read -r desc regexp-replace desc "^# *" "" break fi done < "$interface" interfaces[$name]="$desc" done if $is_key; then reply+=( "${(k)interfaces[@]}" ) else reply+=( "${(kv)interfaces[@]}" ) fi done } __zplug::core::core::run_interfaces() { local arg="$1"; shift local interface local -i ret=0 interface="__${arg:gs:_:}__" # Do autoload if not exists in $functions if (( ! $+functions[$interface] )); then autoload -Uz "$interface" fi # Execute ${=interface} "$argv[@]" ret=$status # It may be discarded unfunction "$interface" &>/dev/null return $ret } __zplug::core::core::prepare() { # Unique array typeset -gx -U path typeset -gx -U fpath # Add to the PATH path=( ${ZPLUG_ROOT:+"$ZPLUG_ROOT/bin"} ${ZPLUG_BIN:+"$ZPLUG_BIN"} "$path[@]" ) # Add to the FPATH fpath=( "$ZPLUG_ROOT"/misc/completions(N-/) "$ZPLUG_ROOT/base/sources" "$fpath[@]" ) # Check whether you meet the requirements for using zplug # 1. zsh 4.3.9 or more # 2. git # 3. nawk or gawk { if ! __zplug::base::base::zsh_version 4.3.9; then __zplug::io::print::f \ --die \ --zplug \ --error \ "zplug does not work this version of zsh $ZSH_VERSION.\n" \ "You must use zsh 4.3.9 or later.\n" return 1 fi if ! __zplug::base::base::git_version 1.7; then __zplug::io::print::f \ --die \ --zplug \ --error \ "git command not found in \$PATH\n" \ "zplug depends on git 1.7 or later.\n" return 1 fi if ! __zplug::utils::awk::available; then __zplug::io::print::f \ --die \ --zplug \ --error \ 'No available AWK variant in your $PATH\n' return 1 fi } # Release zplug variables and export __zplug::core::core::variable || return 1 mkdir -p "$ZPLUG_HOME"/{,log} mkdir -p "$ZPLUG_BIN" mkdir -p "$ZPLUG_CACHE_DIR" mkdir -p "$ZPLUG_REPOS" touch "$_zplug_log[trace]" # Run compinit if zplug comp file hasn't load if (( ! $+functions[_zplug] )); then compinit -C -d "$ZPLUG_HOME/zcompdump" fi } __zplug::core::core::variable() { # for 'autoload -Uz zplug' in another subshell export FPATH="$ZPLUG_ROOT/autoload:$FPATH" typeset -gx ZPLUG_HOME=${ZPLUG_HOME:-~/.zplug} typeset -gx -i ZPLUG_THREADS=${ZPLUG_THREADS:-16} typeset -gx ZPLUG_PROTOCOL=${ZPLUG_PROTOCOL:-HTTPS} typeset -gx ZPLUG_FILTER=${ZPLUG_FILTER:-"fzf-tmux:fzf:peco:percol:fzy:zaw"} typeset -gx ZPLUG_LOADFILE=${ZPLUG_LOADFILE:-$ZPLUG_HOME/packages.zsh} typeset -gx ZPLUG_USE_CACHE=${ZPLUG_USE_CACHE:-true} typeset -gx ZPLUG_SUDO_PASSWORD typeset -gx ZPLUG_ERROR_LOG=${ZPLUG_ERROR_LOG:-$ZPLUG_HOME/.error_log} typeset -gx ZPLUG_BIN=${ZPLUG_BIN:-$ZPLUG_HOME/bin} typeset -gx ZPLUG_CACHE_DIR=${ZPLUG_CACHE_DIR:-$ZPLUG_HOME/cache} typeset -gx ZPLUG_REPOS=${ZPLUG_REPOS:-$ZPLUG_HOME/repos} typeset -gx _ZPLUG_VERSION="2.4.2" typeset -gx _ZPLUG_URL="https://github.com/zplug/zplug" typeset -gx _ZPLUG_OHMYZSH="robbyrussell/oh-my-zsh" typeset -gx _ZPLUG_PREZTO="sorin-ionescu/prezto" typeset -gx _ZPLUG_AWKPATH="$ZPLUG_ROOT/misc/contrib" # user-defined exit code 64..113 typeset -gx -A _zplug_status _zplug_status=( # compatible "success" 0 "failure" 1 "true" 0 "false" 1 "self_return" 101 # based on bash scripting # - http://tldp.org/LDP/abs/html/exitcodes.html "error" 1 "builtin_error" 2 "diff_binary" 2 "command_not_executable" 126 "command_not_found" 127 "exit_syntax_error" 128 "error_signal_hup" 129 "error_signal_int" 130 "error_signal_kill" 137 "up_to_date" 10 "out_of_date" 11 "unknown" 12 "repo_not_found" 13 "skip_if" 14 "skip_frozen" 15 "skip_local" 16 "not_git_repo" 17 "not_on_branch" 18 "detached_head" 18 "revision_lock" 19 ) typeset -gx -A _zplug_log _zplug_build_log _zplug_load_log _zplug_log=( "trace" "$ZPLUG_HOME/log/trace.log" "install" "$ZPLUG_HOME/log/install.log" "update" "$ZPLUG_HOME/log/update.log" "status" "$ZPLUG_HOME/log/status.log" ) _zplug_build_log=( "success" "$ZPLUG_HOME/log/build_success.log" "failure" "$ZPLUG_HOME/log/build_failure.log" "timeout" "$ZPLUG_HOME/log/build_timeout.log" "rollback" "$ZPLUG_HOME/log/build_rollback.log" ) _zplug_load_log=( "success" "$ZPLUG_HOME/log/load_success.log" "failure" "$ZPLUG_HOME/log/load_failure.log" ) typeset -gx -A _zplug_cache _zplug_cache=( "interface" "$ZPLUG_CACHE_DIR/interface" "plugin" "$ZPLUG_CACHE_DIR/plugin.zsh" "lazy_plugin" "$ZPLUG_CACHE_DIR/lazy_plugin.zsh" "theme" "$ZPLUG_CACHE_DIR/theme.zsh" "command" "$ZPLUG_CACHE_DIR/command.zsh" "fpath" "$ZPLUG_CACHE_DIR/fpath.zsh" "defer_1_plugin" "$ZPLUG_CACHE_DIR/defer_1_plugin.zsh" "defer_2_plugin" "$ZPLUG_CACHE_DIR/defer_2_plugin.zsh" "defer_3_plugin" "$ZPLUG_CACHE_DIR/defer_3_plugin.zsh" ) typeset -gx -A _zplug_lock _zplug_lock=( "job" "$ZPLUG_HOME/log/job.lock" ) if (( $+ZPLUG_SHALLOW )); then __zplug::io::print::f \ --die \ --zplug \ --warn \ "ZPLUG_SHALLOW is deprecated. " \ "Please use 'zstyle :zplug:tag depth 1' instead.\n" fi if (( $+ZPLUG_CACHE_FILE )); then __zplug::io::print::f \ --die \ --zplug \ --warn \ "ZPLUG_CACHE_FILE is deprecated. " \ "Please use 'ZPLUG_CACHE_DIR' instead.\n" fi if (( $+ZPLUG_CLONE_DEPTH )); then __zplug::io::print::f \ --die \ --zplug \ --warn \ "ZPLUG_CLONE_DEPTH is deprecated. " \ "Please use 'zstyle :zplug:tag depth $ZPLUG_CLONE_DEPTH' instead.\n" fi # zplug core variables { typeset -gx -A -U \ _zplug_options \ _zplug_commands \ _zplug_tags __zplug::core::options::get; _zplug_options=( "${reply[@]}" ) __zplug::core::commands::get; _zplug_commands=( "${reply[@]}" ) __zplug::core::tags::get; _zplug_tags=( "${reply[@]}" ) } # boolean { typeset -gx -a \ _zplug_boolean_true \ _zplug_boolean_false _zplug_boolean_true=("true" "yes" "on" 1) _zplug_boolean_false=("false" "no" "off" 0) } # context ":zplug:config:setopt" { local -a only_subshell typeset -gx _ZPLUG_CONFIG_SUBSHELL=":" zstyle -a ":zplug:config:setopt" \ only_subshell \ only_subshell zstyle -t ":zplug:config:setopt" \ same_curshell if (( $_zplug_boolean_true[(I)$same_curshell] )); then only_subshell=( "${only_subshell[@]:gs:_:}" $(setopt) ) fi if (( $#only_subshell > 0 )); then _ZPLUG_CONFIG_SUBSHELL="setopt ${(u)only_subshell[@]}" fi } zmodload zsh/terminfo typeset -gx -A em em[under]="$terminfo[smul]" em[bold]="$terminfo[bold]" } zplug-2.4.2/base/core/interface.zsh000066400000000000000000000003731322121161600172060ustar00rootroot00000000000000__zplug::core::interface::expose() { local name for name in "${(ok)zplugs[@]}" do # In order to sort $zplugs[$name], # do not quate this string echo "${name}${zplugs[$name]:+, ${(os:, :)zplugs[$name]}}" done } zplug-2.4.2/base/core/load.zsh000066400000000000000000000140711322121161600161650ustar00rootroot00000000000000__zplug::core::load::prepare() { setopt nomonitor zstyle ':zplug:core:load' 'verbose' no __zplug::io::file::rm_touch "$_zplug_load_log[success]" __zplug::io::file::rm_touch "$_zplug_load_log[failure]" } __zplug::core::load::from_cache() { local is_verbose zstyle -s ':zplug:core:load' 'verbose' is_verbose # Default # setopt monitor __zplug::core::cache::update # Load the cache in order { fpath=( ${(@f)"$(<$_zplug_cache[fpath])"} "$fpath[@]" ) source "$_zplug_cache[plugin]" source "$_zplug_cache[lazy_plugin]" source "$_zplug_cache[theme]" source "$_zplug_cache[command]" # Plugins with defer-level set source "$_zplug_cache[defer_1_plugin]" compinit -d "$ZPLUG_HOME/zcompdump" if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::f \ --zplug "$fg[yellow]Run compinit$reset_color\n" fi source "$_zplug_cache[defer_2_plugin]" source "$_zplug_cache[defer_3_plugin]" } if [[ -s $_zplug_load_log[failure] ]]; then # If there are repos that failed to load, # show those repos and return false __zplug::io::print::f \ --zplug \ "These repos have failed to load:\n$fg_bold[red]" print -l -- "- $fg[red]"${^${(u@f)"$(<"$_zplug_load_log[failure]")":gs:@:}}"$reset_color" __zplug::io::print::f "$reset_color" return 1 fi } __zplug::core::load::as_plugin() { local key value repo load_path hook is_lazy=false local is_verbose msg local -i status_code=0 zstyle -s ':zplug:core:load' 'verbose' is_verbose while (( $#argv > 0 )) do case "$argv[1]" in --repo) repo="$argv[2]" shift ;; --hook) hook="$argv[2]" shift ;; --lazy) is_lazy=true ;; *) load_path="$argv[1]" ;; esac shift done # Special measure if [[ $repo == 'zplug/zplug' ]]; then # In the case of zplug, don't load it exceptionally return 0 fi if [[ $load_path =~ $_ZPLUG_OHMYZSH ]]; then # Check if omz is loaded and set some necessary settings if [[ -z $ZSH ]]; then export ZSH="$ZPLUG_REPOS/$_ZPLUG_OHMYZSH" export ZSH_CACHE_DIR="$ZSH/cache/" fi fi if $is_lazy; then msg="Lazy" autoload -Uz "${load_path:t}" status_code=$status else msg="Load" source "$load_path" 2> >(__zplug::log::capture::error) status_code=$status fi if (( $_zplug_boolean_true[(I)$is_verbose] )); then if (( $status_code == 0 )); then __zplug::io::print::f " $msg ${(qqq)load_path/$HOME/~} ($repo)\n" else __zplug::io::print::f --warn " Failed to load ${(qqq)load_path/$HOME/~} ($repo)\n" fi fi if (( $status_code == 0 )); then if [[ -n $hook ]]; then eval ${=hook} fi __zplug::job::handle::flock "$_zplug_load_log[success]" "$repo" else __zplug::job::handle::flock "$_zplug_load_log[failure]" "$repo" fi return $status_code } __zplug::core::load::as_command() { local key value repo load_path _path hook local is_verbose local -i status_code=0 zstyle -s ':zplug:core:load' 'verbose' is_verbose while (( $#argv > 0 )) do case "$argv[1]" in --repo) repo="$argv[2]" shift ;; --hook) hook="$argv[2]" shift ;; --path) _path="$argv[2]" shift ;; *) load_path="$argv[1]" ;; esac shift done { chmod 755 "$load_path" ln -snf "$load_path" "$_path" } &>/dev/null status_code=$status if (( $_zplug_boolean_true[(I)$is_verbose] )); then if (( $status_code == 0 )); then __zplug::io::print::f " Link ${(qqq)load_path/$HOME/~} ($repo)\n" else __zplug::io::print::f --warn " Failed to link ${(qqq)load_path/$HOME/~} ($repo)\n" fi fi if (( $status_code == 0 )); then if [[ -n $hook ]]; then eval ${=hook} fi __zplug::job::handle::flock "$_zplug_load_log[success]" "$repo" else __zplug::job::handle::flock "$_zplug_load_log[failure]" "$repo" fi return $status_code } __zplug::core::load::as_theme() { local -i ret=0 __zplug::core::load::as_plugin "$argv[@]" ret=$status if [[ ! -o prompt_subst ]]; then setopt prompt_subst fi return $ret } __zplug::core::load::skip_condition() { # Returns true if there are conditions to skip, # returns false otherwise local repo="${1:?}" is_verbose local -A tags zstyle -s ':zplug:core:load' 'verbose' is_verbose __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) if __zplug::core::sources::is_handler_defined check "$tags[from]"; then if ! __zplug::core::sources::use_handler check "$tags[from]" "$repo"; then return 0 fi else if [[ ! -d $tags[dir] ]]; then return 0 fi fi if [[ -n $tags[if] ]]; then if ! eval "$tags[if]" 2> >(__zplug::log::capture::error) >/dev/null; then if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::die "$tags[name]: (not loaded)\n" fi return 0 fi fi if [[ -n $tags[on] ]]; then __zplug::core::core::run_interfaces \ 'check' \ ${~tags[on]} if (( $status != 0 )); then if (( $_zplug_boolean_true[(I)$is_verbose] )); then __zplug::io::print::die "$tags[name]: (not loaded)\n" fi return 0 fi fi return 1 } zplug-2.4.2/base/core/migration.zsh000066400000000000000000000024321322121161600172350ustar00rootroot00000000000000__zplug::core::migration::tags() { local key="$1" new_key case "$key" in "of") new_key="use" ;; "file") new_key="rename-to" ;; "commit") new_key="at" ;; "do") new_key="hook-build" ;; "nice") new_key="defer" ;; *) # Not old tag __zplug::io::print::f \ --die \ --zplug \ "$key: this tag is still good\n" return 1 esac __zplug::io::print::f \ --die \ --zplug \ --warn \ "'%s' tag is deprecated. Please use '%s' tag instead (%s).\n" \ "$fg[blue]$key$reset_color" \ "$fg[blue]$new_key$reset_color" \ "$fg[green]${name:gs:@::}$reset_color" return 1 } __zplug::core::migration::pipe() { __zplug::io::print::f \ --die \ --zplug \ --warn \ "pipe syntax is deprecated! Please use '%s' tag instead.\n" \ "$fg[blue]on$reset_color" return 1 } __zplug::core::migration::cache_file_dir() { # If ZPLUG_CACHE_FILE is defined if [[ -f $ZPLUG_CACHE_DIR ]]; then rm -f "$ZPLUG_CACHE_DIR" fi mkdir -p "$ZPLUG_CACHE_DIR" } zplug-2.4.2/base/core/options.zsh000066400000000000000000000034201322121161600167350ustar00rootroot00000000000000__zplug::core::options::get() { __zplug::core::core::get_interfaces \ "options" \ "$argv[@]" } __zplug::core::options::parse() { local arg local -i ret=1 while (( $# > 0 )) do arg="$1" case "$arg" in "--") # TODO ;; "-") # TODO ;; --*) __zplug::core::options::long \ "$arg" \ ${2:+"$argv[2,-1]"} ret=$status ;; -*) __zplug::core::options::short \ "$arg" \ ${2:+"$argv[2,-1]"} ret=$status ;; *) # Impossible condition ;; esac shift done return $ret } __zplug::core::options::short() { __zplug::core::options::unknown "$arg" return $status } __zplug::core::options::long() { local key value local -a args opts __zplug::utils::shell::getopts "$argv[@]" \ | while read key value; \ do case "$key" in _) args+=( "$value" ) ;; *) opts+=( "$key" ) args+=( "$value" ) ;; esac done opt="$opts[1]" if [[ -f $ZPLUG_ROOT/autoload/options/__${opt}__ ]]; then __zplug::core::core::run_interfaces \ "$opt" \ "$args[@]" return $status else __zplug::core::options::unknown "$argv[1]" return $status fi } __zplug::core::options::unknown() { local arg="$1" __zplug::io::print::f \ --die \ --zplug \ "$arg: unknown option\n" return 1 } zplug-2.4.2/base/core/self.zsh000066400000000000000000000045331322121161600162010ustar00rootroot00000000000000__zplug::core::self::init() { local repo="zplug/zplug" local src="$ZPLUG_REPOS/$repo/init.zsh" local dst="$ZPLUG_HOME/init.zsh" if [[ ! -f $src ]]; then __zplug::log::write::error \ "$src: no such file or directory" return 1 fi # Link ln -snf "$src" "$dst" } __zplug::core::self::update() { local ret=0 local HEAD if ! __zplug::base::base::zpluged "zplug/zplug"; then __zplug::io::print::f \ --die \ --zplug \ "zplug/zplug: no package managed by zplug\n" return 1 fi # If there is a difference in the remote and local # re-install zplug by itself and initialize if ! __zplug::core::self::info --up-to-date; then # TODO: "DONE" #__zplug::core::core::run_interfaces \ # "update" \ # "zplug/zplug" # ^-- Leave these codes just in case for a while __zplug::sources::github::update "zplug/zplug" ret=$status if (( $ret == $_zplug_status[up_to_date] )); then ret=$_zplug_status[self_return] fi return $ret fi __zplug::core::self::info --HEAD \ | read HEAD __zplug::io::print::f \ --die \ --zplug \ "%s (v%s) %s\n" \ "$fg[white]up-to-date$reset_color" \ "$_ZPLUG_VERSION" \ "$em[under]$HEAD[1,8]$reset_color" __zplug::log::write::info "zplug is up-to-date" return $_zplug_status[self_return] } __zplug::core::self::load() { __zplug::core::self::init } __zplug::core::self::info() { local arg local -A revisions __zplug::utils::git::status "zplug/zplug" revisions=( "$reply[@]" ) while (( $# > 0 )) do arg="$1" case "$arg" in --up-to-date) # local and origin/master are the same if [[ $revisions[local] == $revisions[master] ]]; then return 0 fi return 1 ;; --local) echo "$revisions[local]" ;; --HEAD) echo "$revisions[master]" ;; --version) echo "$revisions[$_ZPLUG_VERSION^\{\}]" ;; -*|--*) return 1 ;; esac shift done } zplug-2.4.2/base/core/sources.zsh000066400000000000000000000027401322121161600167310ustar00rootroot00000000000000__zplug::core::sources::is_exists() { local source_name="$1" [[ -f $ZPLUG_ROOT/base/sources/$source_name.zsh ]] return $status } __zplug::core::sources::is_handler_defined() { local subcommand="$1" source_name="$2" handler_name handler_name="__zplug::sources::$source_name::$subcommand" if ! __zplug::core::sources::is_exists "$source_name"; then return $_zplug_status[failure] fi (( $+functions[$handler_name] )) return $status } # Call the handler of the external source if defined __zplug::core::sources::use_handler() { local \ subcommand="$1" \ source_name="$2" \ repo="$3" local handler_name="__zplug::sources::$source_name::$subcommand" if ! __zplug::core::sources::is_handler_defined "$subcommand" "$source_name"; then # Callback function is undefined return $_zplug_status[failure] fi eval "$handler_name '$repo'" return $status } __zplug::core::sources::call() { local val="$1" if __zplug::core::sources::is_exists "$val"; then { # Directory '/base/sources' needs to be included in FPATH autoload -Uz "$val.zsh" eval "$val.zsh" unfunction "$val.zsh" } \ 2> >(__zplug::log::capture::error) >/dev/null fi } __zplug::core::sources::use_default() { local val # Get the default value val="$(__zplug::core::core::run_interfaces 'from')" __zplug::core::sources::call "$val" } zplug-2.4.2/base/core/tags.zsh000066400000000000000000000010011322121161600161710ustar00rootroot00000000000000__zplug::core::tags::get() { __zplug::core::core::get_interfaces \ "tags" \ "$argv[@]" } __zplug::core::tags::parse() { local arg="$1" tag val local -A tags local -a pairs __zplug::core::tags::get tags=( "${reply[@]}" ) pairs=("name" "$arg") for tag in "${(k)tags[@]}" do val="$( __zplug::core::core::run_interfaces \ "$tag" \ "$arg" )" pairs+=("$tag" "$val") done reply=( "$pairs[@]" ) } zplug-2.4.2/base/init.zsh000066400000000000000000000017671322121161600152710ustar00rootroot00000000000000__zplug::base() { local load_file arg local -aU load_files while (( $# > 0 )) do arg="$1" case "$arg" in -*|--*) return 1 ;; */'*') # e.g. 'base/*' load_files+=( "$ZPLUG_ROOT/base/${arg:h}"/*.zsh(N-.) ) ;; */*) # e.g. 'core/add' load_files+=( "$ZPLUG_ROOT/base/${arg}.zsh"(N-.) ) ;; *) return 1 ;; esac shift done # invalid format if (( $#load_files == 0 )); then return 1 fi fpath=( "${load_files[@]:h}" "${fpath[@]}" ) for load_file in "${load_files[@]}" do if (( $+functions[$load_file] )); then # already defined continue fi autoload -Uz "${load_file:t}" && eval "${load_file:t}" && unfunction "${load_file:t}" done } zplug-2.4.2/base/io/000077500000000000000000000000001322121161600141745ustar00rootroot00000000000000zplug-2.4.2/base/io/file.zsh000066400000000000000000000022501322121161600156400ustar00rootroot00000000000000__zplug::io::file::load() { if [[ ! -f ${~ZPLUG_LOADFILE} ]]; then __zplug::log::write::info \ "ZPLUG_LOADFILE is not found" return 0 fi source "$ZPLUG_LOADFILE" return $status } __zplug::io::file::generate() { if [[ -f $ZPLUG_LOADFILE ]]; then return 0 fi cat <<-TEMPLATE >$ZPLUG_LOADFILE #!/usr/bin/env zsh # -*- mode: zsh -*- # vim:ft=zsh # # *** ZPLUG EXTERNAL FILE *** # You can register plugins or commands to zplug on the # command-line. If you use zplug on the command-line, # it is possible to write more easily its settings # by grace of the command-line completion. # In this case, zplug spit out its settings to # $ZPLUG_LOADFILE instead of .zshrc. # If you launch new zsh process, zplug load command # automatically search this file and run source command. # # # Example: # zplug "b4b4r07/enhancd", as:plugin, use:"*.sh" # zplug "rupa/z", as:plugin, use:"*.sh" # TEMPLATE } __zplug::io::file::rm_touch() { local filepath="${argv:?}" # For shorten the calculation time if [[ ! -d ${filepath:h} ]]; then mkdir -p "${filepath:h}" fi rm -f "$filepath" touch "$filepath" } zplug-2.4.2/base/io/print.zsh000066400000000000000000000076531322121161600160710ustar00rootroot00000000000000__zplug::io::print::put() { LC_ALL=POSIX command printf -- "$@" } __zplug::io::print::die() { LC_ALL=POSIX command printf -- "$@" >&2 } __zplug::io::print::f() { local -i lines=0 local w pre_format post_format format func local -a pre_formats post_formats local -a formats texts local arg text local -i fd=1 local \ is_end=false \ is_multi=false local \ is_end_specified=false \ is_per_specified=false local \ is_log=false local i if (( $argv[(I)--] )); then is_end_specified=true fi if (( $argv[(I)*%*] )); then is_per_specified=true fi while (( $# > 0 )) do arg="$1" case "$arg" in --put | -1) fd=1 ;; --die | -2) is_log=true fd=2 ;; --func) func="$funcstack[2]" if [[ -n $func ]]; then # if $func is commands or tags # trim underscores if [[ $func =~ __$ ]]; then func="${func:gs:_:}" fi pre_formats+=( "|$em[bold]$func$reset_color|" ) fi ;; --multi) is_multi=true ;; --zplug) pre_formats+=( "[zplug]" ) ;; --warn) pre_formats+=( "$fg[red]$em[under]WARNING$reset_color:" ) ;; --error) pre_formats+=( "$fg[red]ERROR$reset_color:" ) ;; --) is_end=true ;; "") ;; *) # Check if the double hyphens exist in args if $is_end_specified; then # Divide if $is_end; then texts+=( "$arg" ) else post_formats+=( "$arg" ) fi else texts+=( "$arg" ) fi ;; esac shift done # Change the output destination by the value of $fd { echo "${pre_formats[*]}" \ | __zplug::utils::ansi::remove \ | read pre_format repeat $#pre_format; do w="$w "; done if $is_end_specified; then printf "${post_formats[*]}" \ | grep -c "" \ | read lines for (( i = 1; i <= $#post_formats; i++ )) do if (( $lines == $#post_formats )); then if ! $is_multi && (( $i > 1 )); then pre_formats=( "$w" ) fi else if (( $i > 1 )); then pre_formats=() fi fi formats[$i]="${pre_formats[*]} $post_formats[$i]" done command printf -- "${(j::)formats[@]}" "${texts[@]}" elif $is_per_specified; then command printf -- "${pre_formats[*]:+${pre_formats[*]} }${texts[@]}" else format="${pre_formats[*]}" printf "${texts[*]}" \ | grep -c "" \ | read lines for (( i = 1; i <= $#texts; i++ )) do if (( $lines == $#texts )); then if ! $is_multi && (( $i > 1 )); then format="$w" fi else if (( $i > 1 )); then format= fi fi formats[$i]="${format:+$format }$post_formats[$i]" command printf -- "$formats[$i]$texts[$i]" done fi } >&$fd if $is_log; then __zplug::log::write::error \ "$texts[@]" fi } zplug-2.4.2/base/job/000077500000000000000000000000001322121161600143375ustar00rootroot00000000000000zplug-2.4.2/base/job/handle.zsh000066400000000000000000000224531322121161600163260ustar00rootroot00000000000000__zplug::job::handle::flock() { local -i retry=0 max=15 cant_lock local is_escape=false local -a args local file contents while (( $#argv > 0 )) do case "$argv[1]" in --escape) is_escape=true ;; -*|--*) ;; *) args+=( "$argv[1]" ) ;; esac shift done if (( $#args < 2 )); then return 1 fi file="$args[1]" contents="$args[2]" # TODO: Temporary fix to solve #334 if [[ ! -f $file ]]; then __zplug::log::write::info \ "create $file because it does not exist" touch "$file" fi ( until zsystem flock -t 3 "$file" do cant_lock=$status if (( (++retry) > max )); then if (( cant_lock > 0 )); then { printf "Can't acquire lock for ${file}." if (( cant_lock == 2 )); then printf " timeout." fi printf "\n" } #1> >(__zplug::log::capture::error) return 1 fi return 1 fi done # Save the status code with LTSV if $is_escape; then print -r "$contents" >>|"$file" else print "$contents" >>|"$file" fi >>|"$file" ) } __zplug::job::handle::state() { local repo="$argv[1]" caller="$argv[2]" local message # Save status code for process cache if [[ -z $status_codes[$repo] ]]; then status_codes[$repo]="$(__zplug::job::process::get_status_code "$repo" "$caller")" fi case $status_codes[$repo] in $_zplug_status[success]) case "$caller" in install) message="Installed!" ;; update) message="Updated!" ;; esac __zplug::job::message::green "$repo" "$message" ;; $_zplug_status[up_to_date]) __zplug::job::message::white "$repo" "Up-to-date" ;; $_zplug_status[skip_local]) __zplug::job::message::yellow "$repo" "Skip local repo" ;; $_zplug_status[skip_frozen]) __zplug::job::message::yellow "$repo" "Skip frozen repo" ;; $_zplug_status[skip_if]) __zplug::job::message::yellow "$repo" "Skip due to if" ;; $_zplug_status[revision_lock]) __zplug::job::message::yellow "$repo" "Revision locked" ;; $_zplug_status[failure]) __zplug::job::message::red "$repo" "Failed to $caller" ;; $_zplug_status[out_of_date]) __zplug::job::message::red "$repo" "Local out of date" ;; $_zplug_status[not_on_branch]) __zplug::job::message::red "$repo" "Not on any branch" ;; $_zplug_status[not_git_repo]) __zplug::job::message::red "$repo" "Not git repo" ;; $_zplug_status[repo_not_found]) __zplug::job::message::red "$repo" "Repo not found" ;; $_zplug_status[unknown] | *) __zplug::job::message::red "$repo" "Unknown error" ;; esac } __zplug::job::handle::wait() { local caller="${${(M)funcstack[@]:#__*__}:gs:_:}" local -i screen_size=$(($#repo_pids + 2)) local -i spinner_idx=1 sub_spinner_idx=1 local -a spinners sub_spinners local -F latency=0.1 spinners=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏) sub_spinners=(⠁ ⠁ ⠉ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠤ ⠄ ⠄ ⠤ ⠠ ⠠ ⠤ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋ ⠉ ⠈ ⠈) if __zplug::job::queue::is_overflow || __zplug::job::queue::is_within_range; then repeat $screen_size; do builtin printf "\n"; done # # Multiple progress bars # # Use printf command (not builtin) instead of __zplug::io::print::f function, # because this loop is run the processing by interval of 0.1 second # and there is a need to be called faster while __zplug::job::process::is_running "$repo_pids[@]" "$hook_pids[@]" || (( ${(k)#proc_states[(R)running]} > 0 )) do sleep "$latency" __zplug::utils::ansi::cursor_up $screen_size # Count up within spinners index if (( ( spinner_idx+=1 ) > $#spinners )); then spinner_idx=1 fi # Count up within sub_spinners index if (( ( sub_spinner_idx+=1 ) > $#sub_spinners )); then sub_spinner_idx=1 fi # Processing pids for repo in "${(k)repo_pids[@]}" do if __zplug::job::process::is_running "$repo_pids[$repo]"; then __zplug::job::handle::running "$repo" "$caller" proc_states[$repo]="running" else if [[ -n $hook_build[$repo] ]]; then __zplug::job::handle::hook "$repo" "$caller" # If the repo has a hook-build, # it can not be said that the processing has ended yet, # so do not set a flag. # ==> proc_states[$repo]="terminated" else __zplug::job::handle::state "$repo" "$caller" proc_states[$repo]="terminated" fi fi done __zplug::utils::ansi::erace_current_line if __zplug::job::process::is_running "$repo_pids[@]" "$hook_pids[@]"; then builtin printf "\n" __zplug::io::print::f \ --zplug \ "Finished: %d/%d plugins\n" \ ${(k)#proc_states[(R)terminated]} \ $#repos else repo_pids=() fi done fi } __zplug::job::handle::running() { local repo="$argv[1]" caller="$argv[2]" local message case "$caller" in install) message="Installing..." ;; update) message="Updating..." ;; status) message="Fetching..." ;; esac __zplug::job::message::spinning "$repo" "$message" "$spinners[$spinner_idx]" } __zplug::job::handle::hook() { local repo="$argv[1]" caller="$argv[2]" local -i timeout=60 local message case "$caller" in install) message="Installed!" ;; update) message="Updated!" ;; esac # Save status code for process cache if [[ -z $status_codes[$repo] ]]; then status_codes[$repo]="$(__zplug::job::process::get_status_code "$repo" "$caller")" fi # If the installation or updating fails in the first place, # exits the loop here to stop the hook-build if [[ $status_codes[$repo] != 0 ]]; then __zplug::job::handle::state "$repo" "$caller" proc_states[$repo]="terminated" continue fi if ! $hook_finished[$repo]; then hook_finished[$repo]=true # Run the hook-build in background { __zplug::job::hook::build "$repo" if (( $status > 0 )); then builtin printf "$repo\n" >>|"$_zplug_build_log[failure]" builtin printf "$repo\n" >>|"$_zplug_build_log[rollback]" else builtin printf "$repo\n" >>|"$_zplug_build_log[success]" fi } & hook_pids[$repo]=$! # Run the timeout process in background { touch "$_zplug_lock[job]" # kill the process for hook-build after sleeping # during the number of seconds that has been set as a timeout sleep "$timeout" # Check if $repo_pids don't run # and check if the process ($hook_pids[$repo]) that has should be killed if __zplug::job::process::is_running "$hook_pids[$repo]" && ! __zplug::job::process::is_running "$repo_pids[@]"; then __zplug::job::process::kill "$hook_pids[$repo]" builtin printf "$repo\n" >>|"$_zplug_build_log[timeout]" builtin printf "$repo\n" >>|"$_zplug_build_log[rollback]" fi rm -f "$_zplug_lock[job]" } & fi __zplug::utils::ansi::erace_current_line if __zplug::job::process::is_running "$hook_pids[$repo]"; then __zplug::job::message::green \ "$repo" "$message" "$spinners[$spinner_idx]" "$sub_spinners[$sub_spinner_idx]" else if __zplug::job::hook::build_failure "$repo"; then __zplug::job::message::green \ "$repo" "$message" "" "failure" elif __zplug::job::hook::build_timeout "$repo"; then __zplug::job::message::green \ "$repo" "$message" "" "timeout" else __zplug::job::message::green \ "$repo" "$message" "" "success" fi proc_states[$repo]="terminated" fi } __zplug::job::handle::elapsed_time() { local -F elapsed_time="$1" __zplug::utils::ansi::erace_current_line builtin printf "\n" LC_ALL=POSIX __zplug::io::print::f \ --zplug \ "Elapsed time: %.4f sec.\n" \ $elapsed_time } zplug-2.4.2/base/job/hook.zsh000066400000000000000000000027031322121161600160270ustar00rootroot00000000000000__zplug::job::hook::service() { local repo="$1" hook="$2" local -A tags __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) # There is no $hook file in /autoload/tags directory if (( ! $+tags[$hook] )); then __zplug::io::print::f \ --die \ --zplug \ "'%s' is not defined as a hook (%s)\n" \ "$hook" \ "$fg[green]$repo$reset_color" return 1 fi if [[ -n $tags[$hook] ]]; then ( __zplug::utils::shell::cd "$tags[dir]" alias sudo=__zplug::utils::shell::sudo # Save a result to the log file (stdout/stderr) eval "$tags[$hook]" \ 2> >(__zplug::log::capture::error) \ 1> >(__zplug::log::capture::debug) return $status ) fi } __zplug::job::hook::build() { local repo="$1" __zplug::job::hook::service \ "$repo" \ "hook-build" return $status } __zplug::job::hook::load() { local repo="$1" __zplug::job::hook::service \ "$repo" \ "hook-load" return $status } __zplug::job::hook::build_failure() { local repo="$1" [[ -f $_zplug_build_log[failure] ]] && grep -x "$repo" "$_zplug_build_log[failure]" &>/dev/null return $status } __zplug::job::hook::build_timeout() { local repo="$1" [[ -f $_zplug_build_log[timeout] ]] && grep -x "$repo" "$_zplug_build_log[timeout]" &>/dev/null return $status } zplug-2.4.2/base/job/message.zsh000066400000000000000000000025501322121161600165130ustar00rootroot00000000000000__zplug::job::message::spinning() { local repo="$1" message="$2" spinner="$3" builtin printf " $fg[white]%s$reset_color %s %s\n" \ "$spinner" \ ${(r,20,):-"$message"} \ "$repo" } __zplug::job::message::green() { local repo="$1" message="$2" spinner="$3" hook="$4" local color=white case "$hook" in success) color=green ;; failure) color=red ;; timeout) color=yellow ;; cancel) color=red ;; esac builtin printf " $fg_bold[white]${spinner:-\U2714}$reset_color $fg[green]%s$reset_color %s" \ ${(r,20,):-"$message"} \ "$repo" if [[ -n $hook ]]; then builtin printf " --> hook-build: $fg[$color]%s$reset_color\n" "$hook" else builtin printf "\n" fi } __zplug::job::message::white() { local repo="$1" message="$2" builtin printf " $fg[white]\U2714$reset_color %s %s\n" \ ${(r,20,):-"$message"} \ "$repo" } __zplug::job::message::red() { local repo="$1" message="$2" builtin printf " $fg_bold[red]\U2718$reset_color $fg[red]%s$reset_color %s\n" \ ${(r,20,):-"$message"} \ "$repo" } __zplug::job::message::yellow() { local repo="$1" message="$2" builtin printf " $fg_bold[yellow]\U279C$reset_color $fg[yellow]%s$reset_color %s\n" \ ${(r,20,):-"$message"} \ "$repo" } zplug-2.4.2/base/job/parallel.zsh000066400000000000000000000141071322121161600166640ustar00rootroot00000000000000__zplug::job::parallel::init() { local caller="${${(M)funcstack[@]:#__*__}:gs:_:}" local is_parallel=false is_select=false local filter repo starting_message local -aU repos status_ok repos=( "$argv[@]" ) case "$caller" in install) starting_message="install" # If no argument is given, # use non-installed plugins as an installation target if (( $#repos == 0 )); then repos=( $(__zplug::core::core::run_interfaces 'check' '--debug') ) if (( $#repos == 0 )); then __zplug::io::print::f \ --zplug --die \ "no packages to install\n" return 1 fi fi rm -f \ "$_zplug_build_log[success]" \ "$_zplug_build_log[failure]" \ "$_zplug_build_log[timeout]" \ "$_zplug_log[install]" touch "$_zplug_log[install]" ;; update) starting_message="update" zstyle -s ':zplug:core:update' 'select' is_select zstyle ':zplug:core:update' 'select' no rm -f \ "$_zplug_build_log[success]" \ "$_zplug_build_log[failure]" \ "$_zplug_build_log[timeout]" \ "$_zplug_log[update]" touch "$_zplug_log[update]" ;; status) starting_message="get remote status" zstyle -s ':zplug:core:status' 'select' is_select zstyle ':zplug:core:status' 'select' no rm -f "$_zplug_log[status]" touch "$_zplug_log[status]" ;; *) return 1 ;; esac if (( $_zplug_boolean_true[(I)$is_select] )); then filter="$( __zplug::utils::shell::search_commands \ "$ZPLUG_FILTER" )" if [[ -z $filter ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ --func \ "There is no available filter in ZPLUG_FILTER\n" return 1 fi repos+=( ${(@f)"$(echo "${(Fk)zplugs[@]}" | eval "$filter")"} ) # Cace of type Ctrl-C if (( $#repos == 0 )); then return 1 fi fi if (( $#repos == 0 )); then repos=( "${(k)zplugs[@]:gs:@::}" ) fi # Check the number of arguments if (( $#repos > 1 )); then is_parallel=true fi for repo in "${repos[@]}" do if ! __zplug::base::base::zpluged "$repo"; then __zplug::io::print::f \ --die \ --zplug \ "$repo: no such package\n" return 1 fi done # Suppress outputs setopt nonotify nomonitor # Hide the cursor tput civis __zplug::io::print::f \ --zplug \ "Start to %s %d plugin${is_parallel:+"s"} %s\n\n" \ "$starting_message" \ $#repos \ "${is_parallel:+"in parallel"}" reply=("$repos[@]") } __zplug::job::parallel::deinit() { local caller="${${(M)funcstack[@]:#__*__}:gs:_:}" case "$caller" in update) if (( ${(k)#status_codes[(R)$_zplug_status[failure]]} == 0 )); then builtin printf "$fg_bold[default] ==> Updating finished successfully!$reset_color\n" else builtin printf "$fg_bold[red] ==> Updating failed for following packages:$reset_color\n" # Listing the packages that have failed to update for repo in "${(k)status_codes[@]}" do if [[ $status_codes[$repo] == $_zplug_status[failure] ]]; then builtin printf " - %s\n" "$repo" fi done fi # Run rollback if hook-build failed __zplug::job::rollback::message # Cache clear automatically after running update command status_ok=( ${(@f)"$(cat "$_zplug_log[update]" 2>/dev/null \ | __zplug::utils::awk::ltsv 'key("status")==0')"} ) if (( $#status_ok > 0 )); then __zplug::core::core::run_interfaces 'clear' fi ;; install) if (( ${(k)#status_codes[(R)$_zplug_status[failure]]} == 0 )); then builtin printf "$fg_bold[default] ==> Installation finished successfully!$reset_color\n" else builtin printf "$fg_bold[red] ==> Installation failed for following packages:$reset_color\n" # Listing the packages that have failed to install for repo in "${(k)status_codes[@]}" do if [[ $status_codes[$repo] == $_zplug_status[failure] ]]; then builtin printf " - %s\n" "$repo" fi done fi # Run rollback if hook-build failed __zplug::job::rollback::message # Cache clear automatically after running install command status_ok=( ${(@f)"$(cat "$_zplug_log[install]" 2>/dev/null \ | __zplug::utils::awk::ltsv 'key("status")==0')"} ) if (( $#status_ok > 0 )); then __zplug::core::core::run_interfaces 'clear' fi ;; status) if (( ${(k)#status_codes[(R)$_zplug_status[out_of_date]]} == 0 )); then builtin printf "$fg_bold[default] ==> All packages are up-to-date!$reset_color\n" else builtin printf "$fg_bold[red] ==> Run 'zplug update'. These packages are local out of date:$reset_color\n" # Listing the packages that have failed to install for repo in "${(k)status_codes[@]}" do if [[ $status_codes[$repo] == $_zplug_status[out_of_date] ]]; then builtin printf " - %s\n" "$repo" fi done fi ;; esac # Display the cursor tput cnorm } zplug-2.4.2/base/job/polling.zsh000066400000000000000000000005451322121161600165350ustar00rootroot00000000000000export PERIOD=30 __zplug::job::polling::periodic() { if [[ -f $_zplug_lock[job] ]]; then setopt nomonitor else if [[ -o monitor ]]; then return 0 fi if setopt monitor; then __zplug::log::write::info "turn monitor on" fi fi } add-zsh-hook periodic __zplug::job::polling::periodic zplug-2.4.2/base/job/process.zsh000066400000000000000000000013601322121161600165430ustar00rootroot00000000000000__zplug::job::process::is_running() { local job for job in "$argv[@]" do [[ $job == "" ]] && return 1 if kill -0 "$job" &>/dev/null; then return 0 fi done return 1 } __zplug::job::process::get_status_code() { local repo="${1:?}" target="${2:?}" if [[ ! -f $_zplug_log[$target] ]]; then # TODO return 1 fi cat "$_zplug_log[$target]" \ | __zplug::utils::awk::ltsv \ 'key("repo")=="'"$repo"'"{print key("status")}' return $status } __zplug::job::process::kill() { local pid="${1:?}" if ! __zplug::job::process::is_running "$pid"; then # TODO return $status fi kill -9 $pid &>/dev/null return $status } zplug-2.4.2/base/job/queue.zsh000066400000000000000000000020351322121161600162110ustar00rootroot00000000000000__zplug::job::queue::is_overflow() { local -i queue_max=$ZPLUG_THREADS # Keep the number of processes to be generated concurrently # to the number specified by the ZPLUG_THREADS variable. # When there is the number of repositories exceeding the upper limit number, # the next process is not generated until all the generated processes are finished. # For example, wait for every 16 processes (the default value of ZPLUG_THREADS) # when processing 40 repositories. # In this example, the third wait captures the remaining 8 processes. if (( $#repos >= $queue_max )); then if (( $#repo_pids >= $queue_max )) || (( $#status_codes == $#repos )); then return 0 fi fi return 1 } __zplug::job::queue::is_within_range() { local -i queue_max=$ZPLUG_THREADS # If the number of repositories is less than the upper limit number, # wait for all processes immediately. if (( $#repos < $queue_max )) && (( $#repo_pids == $#repos )); then return 0 fi return 1 } zplug-2.4.2/base/job/rollback.zsh000066400000000000000000000040611322121161600166570ustar00rootroot00000000000000__zplug::job::rollback::build() { local repo local -a failed if [[ ! -f $_zplug_build_log[rollback] ]] || [[ ! -s $_zplug_build_log[rollback] ]]; then __zplug::io::print::f \ --die \ --zplug \ "There is no package which have to be rollbacked.\n" return 1 fi tput civis while read repo do if [[ -z $repo ]]; then continue fi printf "$fg_bold[default]%s$reset_color %s\n" \ ${(r,20,):-"Building..."} \ "$repo" __zplug::utils::ansi::cursor_up 1 __zplug::job::hook::build "$repo" if (( $status > 0 )); then failed+=( "$repo" ) printf "$fg[red]%s$reset_color %s\n" \ ${(r,20,):-"Failed to build!"} \ "$repo" else printf "$fg[green]%s$reset_color %s\n" \ ${(r,20,):-"Built successfully!"} \ "$repo" fi done <"$_zplug_build_log[rollback]" tput cnorm # Overwrite if (( $#failed == 0 )); then rm -f "$_zplug_build_log[rollback]" return 0 fi printf "%s\n" "$failed[@]" >|"$_zplug_build_log[rollback]" printf "Run '$fg_bold[default]zplug --log$reset_color' if you find cause of the failure of these build\n" } __zplug::job::rollback::message() { if [[ -s $_zplug_build_log[rollback] ]]; then if [[ -f $_zplug_build_log[failure] ]] || [[ -f $_zplug_build_log[timeout] ]]; then __zplug::io::print::f \ --zplug \ "$fg_bold[red]These hook-build were failed to run:$reset_color\n" # Listing the packages that have failed to build { sed 's/^/ - /g' "$_zplug_build_log[failure]" sed 's/^/ - /g' "$_zplug_build_log[timeout]" } 2>/dev/null __zplug::io::print::f \ --zplug \ "To retry these hook-build, please run '$fg_bold[default]%s$reset_color'.\n" \ "zplug --rollback=build" fi fi } zplug-2.4.2/base/log/000077500000000000000000000000001322121161600143465ustar00rootroot00000000000000zplug-2.4.2/base/log/capture.zsh000066400000000000000000000014031322121161600165350ustar00rootroot00000000000000__zplug::log::capture::error() { local message="$(<&0)" if [[ -z $message ]]; then return 0 fi __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "ERROR" "$message")" } __zplug::log::capture::debug() { local message="$(<&0)" if [[ -z $message ]]; then return 0 fi __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "DEBUG" "$message")" } __zplug::log::capture::info() { local message="$(<&0)" if [[ -z $message ]]; then return 0 fi __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "INFO" "$message")" } zplug-2.4.2/base/log/format.zsh000066400000000000000000000016611322121161600163700ustar00rootroot00000000000000__zplug::log::format::with_json() { local -i i=1 local level="${1:-"INFO"}" message="$2" local is_message_json=false # Spit out to JSON builtin printf '{' builtin printf '"pid":%d,' "$$" builtin printf '"shlvl":%d,' "$SHLVL" builtin printf '"level":"%s",' "$level" builtin printf '"dir":"%s",' "$PWD" builtin printf '"message":' if $is_message_json; then builtin printf "$message" else builtin printf "$message" \ | __zplug::utils::ansi::remove \ | __zplug::utils::shell::json_escape \ | tr -d '\n' fi builtin printf ',' builtin printf '"trace":[' for ((i = 1; i < $#functrace; i++)) do builtin printf '"%s",' "$functrace[$i]" done builtin printf '"%s"' "$functrace[$#functrace]" builtin printf "]," builtin printf '"date":"%s"' "$(strftime "%FT%T%z" $EPOCHSECONDS)" builtin printf "}\n" } zplug-2.4.2/base/log/print.zsh000066400000000000000000000012541322121161600162320ustar00rootroot00000000000000__zplug::log::print::error() { # No problem since this function ignores # unrelated arguments passed __zplug::log::format::with_json \ --level "ERROR" \ --message "$argv[1]" \ "$argv[2,-1]" } __zplug::log::print::debug() { # No problem since this function ignores # unrelated arguments passed __zplug::log::format::with_json \ --level "DEBUG" \ --message "$argv[1]" \ "$argv[2,-1]" } __zplug::log::print::info() { # No problem since this function ignores # unrelated arguments passed __zplug::log::format::with_json \ --level "INFO" \ --message "$argv[1]" \ "$argv[2,-1]" } zplug-2.4.2/base/log/write.zsh000066400000000000000000000010011322121161600162160ustar00rootroot00000000000000__zplug::log::write::error() { __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "ERROR" "$argv[@]")" } __zplug::log::write::debug() { __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "DEBUG" "$argv[@]")" } __zplug::log::write::info() { __zplug::job::handle::flock --escape \ "$_zplug_log[trace]" \ "$(__zplug::log::format::with_json "INFO" "$argv[@]")" } zplug-2.4.2/base/sources/000077500000000000000000000000001322121161600152505ustar00rootroot00000000000000zplug-2.4.2/base/sources/.gitignore000066400000000000000000000001331322121161600172350ustar00rootroot00000000000000*.zsh !bitbucket.zsh !gh-r.zsh !gist.zsh !github.zsh !local.zsh !oh-my-zsh.zsh !prezto.zsh zplug-2.4.2/base/sources/bitbucket.zsh000066400000000000000000000017421322121161600177560ustar00rootroot00000000000000__zplug::sources::bitbucket::check() { __zplug::sources::github::check "$argv[@]" } __zplug::sources::bitbucket::install() { __zplug::sources::github::install "$argv[@]" } __zplug::sources::bitbucket::update() { __zplug::sources::github::update "$argv[@]" } __zplug::sources::bitbucket::get_url() { local repo="$1" url_format case "$ZPLUG_PROTOCOL" in HTTPS | https) # https://git::@bitbucket.org/%s.git url_format="https://git::@bitbucket.org/${repo}.git" ;; SSH | ssh) # git@bitbucket.org:%s.git url_format="git@bitbucket.org:${repo}.git" ;; esac echo "$url_format" } __zplug::sources::bitbucket::load_plugin() { __zplug::sources::github::load_plugin "$argv[@]" } __zplug::sources::bitbucket::load_command() { __zplug::sources::github::load_command "$argv[@]" } __zplug::sources::bitbucket::load_theme() { __zplug::sources::github::load_theme "$argv[@]" } zplug-2.4.2/base/sources/gh-r.zsh000066400000000000000000000034211322121161600166330ustar00rootroot00000000000000__zplug::sources::gh-r::check() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" # Repo's directory is not found and # INDEX file is not found if [[ ! -d $tags[dir] ]] && [[ ! -f $tags[dir]/INDEX ]]; then return 1 fi return 0 } __zplug::sources::gh-r::install() { local repo="$1" url url="$( __zplug::utils::releases::get_url \ "$repo" )" __zplug::utils::releases::get "$url" return $status } __zplug::sources::gh-r::update() { local repo="$1" index url local -A tags tags[dir]="$(__zplug::core::core::run_interfaces 'dir' "$repo")" tags[use]="$(__zplug::core::core::run_interfaces 'use' "$repo")" tags[at]="$(__zplug::core::core::run_interfaces 'at' "$repo")" __zplug::utils::shell::cd \ "$tags[dir]" || return $_zplug_status[repo_not_found] url="$( __zplug::utils::releases::get_url \ "$repo" )" if [[ -d $tags[dir] ]]; then # Update if [[ -f $tags[dir]/INDEX ]]; then index="$(cat "$tags[dir]/INDEX" 2>/dev/null)" if [[ $tags[at] == "latest" ]]; then if grep -q "$index" <<<"$url"; then # up-to-date return $_zplug_status[up_to_date] else __zplug::sources::gh-r::install "$repo" return $status fi else # up-to-date return $_zplug_status[up_to_date] fi fi else return $_zplug_status[repo_not_found] fi return $_zplug_status[success] } __zplug::sources::gh-r::load_command() { __zplug::sources::github::load_command "$argv[@]" } zplug-2.4.2/base/sources/gist.zsh000066400000000000000000000022451322121161600167470ustar00rootroot00000000000000__zplug::sources::gist::check() { __zplug::sources::github::check "$argv[@]" } __zplug::sources::gist::install() { __zplug::sources::github::install "$argv[@]" } __zplug::sources::gist::update() { __zplug::sources::github::update "$argv[@]" } __zplug::sources::gist::get_url() { local repo="$1" url_format case "$ZPLUG_PROTOCOL" in HTTPS | https) # https://git::@github.com/%s.git url_format="https://git::@gist.github.com/${repo}.git" if __zplug::base::base::git_version 2.3; then # (git 2.3+) https://gist.github.com/%s.git export GIT_TERMINAL_PROMPT=0 url_format="https://gist.github.com/${repo}.git" fi ;; SSH | ssh) # git@github.com:%s.git url_format="git@gist.github.com:${repo}.git" ;; esac echo "$url_format" } __zplug::sources::gist::load_plugin() { __zplug::sources::github::load_plugin "$@" } __zplug::sources::gist::load_command() { __zplug::sources::github::load_command "$@" } __zplug::sources::gist::load_theme() { __zplug::sources::github::load_theme "$argv[@]" } zplug-2.4.2/base/sources/github.zsh000066400000000000000000000240471322121161600172670ustar00rootroot00000000000000__zplug::sources::github::check() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" [[ -d $tags[dir] ]] return $status } __zplug::sources::github::install() { local repo="$1" __zplug::utils::git::clone "$repo" return $status } __zplug::sources::github::update() { local repo="$1" local rev_local rev_remote rev_base local -A tags tags[dir]="$(__zplug::core::core::run_interfaces 'dir' "$repo")" tags[at]="$(__zplug::core::core::run_interfaces 'at' "$repo")" __zplug::utils::git::merge \ --dir "$tags[dir]" \ --branch "$tags[at]" \ --repo "$repo" return $status } __zplug::sources::github::get_url() { local repo="$1" url_format case "$ZPLUG_PROTOCOL" in HTTPS | https) # Create the format of URL used to git clone # When vim-plug clones a repository, it injects git::@ into the URL # It's a little hack to avoid username/password prompt # from git when the repository doesn't exist. # Such thing can happen when there's a typo in the argument, # or when the repository is removed from GitHub # For more information, see also vim-plug wiki. # https://git::@github.com/%s.git url_format="https://git::@github.com/${repo}.git" # However, Git 2.3.0 introduced $GIT_TERMINAL_PROMPT # which can be used to suppress user prompt if __zplug::base::base::git_version 2.3; then # (git 2.3+) https://github.com/%s.git export GIT_TERMINAL_PROMPT=0 url_format="https://github.com/${repo}.git" fi ;; SSH | ssh) # git@github.com:%s.git url_format="git@github.com:${repo}.git" ;; esac echo "$url_format" } __zplug::sources::github::load_plugin() { local repo="${1:?}" local -A tags default_tags local -a \ unclassified_plugins \ load_fpaths \ defer_1_plugins \ defer_2_plugins \ defer_3_plugins \ load_plugins \ lazy_plugins __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" load_fpaths=() # If that is an autoload plugin if (( $_zplug_boolean_true[(I)$tags[lazy]] )); then if [[ $tags[use] == $default_tags[use] ]]; then unclassified_plugins+=( \ "$tags[dir]"/${repo:t}(N.) \ "$tags[dir]/autoload"/*(N.) \ "$tags[dir]/functions"/*(N.) \ ) load_fpaths+=( \ "$tags[dir]"(N/) \ "$tags[dir]/autoload"(N/) \ "$tags[dir]/functions"(N/) \ ) else unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]" "(N-.)" )"} ) load_fpaths+=( $unclassified_plugins:h(N/) ) fi else if [[ $tags[use] == $default_tags[use] ]]; then unclassified_plugins+=( "$tags[dir]"/*.plugin.zsh(N-.) ) fi if (( $#unclassified_plugins == 0 )); then unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]" "(N-.)" )"} ) # If $tags[use] is a directory, # expect to expand to $tags[dir]/*.zsh if (( $#unclassified_plugins == 0 )); then unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]/$default_tags[use]" "(N-.)" )"} ) # Add the parent directory to fpath load_fpaths+=( "$tags[dir]/$tags[use]"/_*(N.:h) ) fi fi load_fpaths+=( "$tags[dir]"/_*(N.:h) ) fi # unclassified_plugins -> {defer_N_plugins,lazy_plugins,load_plugins} # the order of loading of plugin files case "$tags[defer]" in 0) if (( $_zplug_boolean_true[(I)$tags[lazy]] )); then lazy_plugins+=( "${unclassified_plugins[@]}" ) else load_plugins+=( "${unclassified_plugins[@]}" ) fi ;; 1) defer_1_plugins+=( "${unclassified_plugins[@]}" ) ;; 2) defer_2_plugins+=( "${unclassified_plugins[@]}" ) ;; 3) defer_3_plugins+=( "${unclassified_plugins[@]}" ) ;; *) : # Error ;; esac unclassified_plugins=() if [[ -n $tags[ignore] ]]; then ignore_patterns=( $( zsh -c "$_ZPLUG_CONFIG_SUBSHELL; echo ${tags[dir]}/${~tags[ignore]}" \ 2> >(__zplug::log::capture::error) )(N) ) for ignore in "${ignore_patterns[@]}" do # Commands if [[ -n $load_commands[(i)$ignore] ]]; then unset "load_commands[$ignore]" fi # Plugins load_plugins=( "${(R)load_plugins[@]:#$ignore}" ) defer_1_plugins=( "${(R)defer_1_plugins[@]:#$ignore}" ) defer_2_plugins=( "${(R)defer_2_plugins[@]:#$ignore}" ) defer_3_plugins=( "${(R)defer_3_plugins[@]:#$ignore}" ) lazy_plugins=( "${(R)lazy_plugins[@]:#$ignore}" ) # fpath load_fpaths=( "${(R)load_fpaths[@]:#$ignore}" ) done fi reply=() [[ -n $load_plugins ]] && reply+=( "load_plugins" "${(F)load_plugins}" ) [[ -n $defer_1_plugins ]] && reply+=( "defer_1_plugins" "${(F)defer_1_plugins}" ) [[ -n $defer_2_plugins ]] && reply+=( "defer_2_plugins" "${(F)defer_2_plugins}" ) [[ -n $defer_3_plugins ]] && reply+=( "defer_3_plugins" "${(F)defer_3_plugins}" ) [[ -n $lazy_plugins ]] && reply+=( "lazy_plugins" "${(F)lazy_plugins}" ) [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") } __zplug::sources::github::load_command() { local repo="${1:?}" local -A tags default_tags local src dst local -a sources local -a load_fpaths load_commands local -A rename_hash __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" tags[dir]="${tags[dir]%/}" load_commands=() load_fpaths=() # Append dst to each element so that load_commands becomes: # # load_commands=( # path/to/cmd1\0dst # path/to/cmd2\0dst # ... # ) # # where \0 is a null character used to separate the two strings. # # In the caller function (__load__), each line is decomposed into an # element in an associative array, thus, in the example above, the line: # # path/to/cmd1\0dst # # becomes an element where the key is "path/to/cmd" and the value is # "dst". if [[ $tags[use] == *(*)* && $tags[rename-to] == *\$* ]]; then # If it's captured by `use` tag and referenced by `rename-to` tag, # it's expanded with `__zplug::utils::shell::zglob` if (( $#rename_hash == 0 )) && [[ -n $tags[rename-to] ]]; then rename_hash=( $(__zplug::utils::shell::zglob \ "$tags[dir]/$tags[use]" \ "$ZPLUG_BIN/$tags[rename-to]") ) fi else if [[ $tags[use] == $default_tags[use] ]]; then # If no $tags[use] is given by the user, # automatically add repo's basename to load-path # if it exists as executable file if [[ -f $tags[dir]/${repo:t} ]]; then sources=( "$tags[dir]/${repo:t}"(N-.) ) fi else if [[ $tags[use] == $default_tags[use] || $tags[from] == "gh-r" ]]; then tags[use]="*(N-*)" fi sources=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]" "(N-.)" )"} ) fi dst=${${tags[rename-to]:+$ZPLUG_BIN/$tags[rename-to]}:-"$ZPLUG_BIN"} for src in "$sources[@]" do chmod 755 "$src" rename_hash+=("$src" "$dst") done fi for src in "${(k)rename_hash[@]}" do load_commands+=("$src\0$rename_hash[$src]") done if (( $#rename_hash == 0 )); then __zplug::log::write::info \ "$repo: no matches found, rename_hash is empty" fi # Add parent directories to fpath if any files starting in _* exist load_fpaths+=("$tags[dir]"/{_*,/**/_*}(N-.:h)) reply=() [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $load_commands ]] && reply+=( "load_commands" "${(F)load_commands}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") return 0 } __zplug::sources::github::load_theme() { local repo="${1:?}" local -A tags default_tags local -a themes_ext local -a load_themes load_fpaths __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) themes_ext=("zsh-theme" "theme-zsh") load_themes=() load_fpaths=() if [[ -n $tags[use] ]]; then # e.g. zplug 'foo/bar', as:theme, use:'*.zsh' load_themes=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]" "(N-.)" )"} ) if (( $#load_themes == 0 )); then # e.g. zplug 'foo/bar', as:theme, use:dir load_themes=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[use]/*.${^themes_ext}" "(N-.)" )"} ) fi else # e.g. zplug 'foo/bar', as:theme load_themes+=( "$tags[dir]"/*.${^themes_ext}(N-.) ) fi load_fpaths+=( "$tags[dir]"/_*(N.:h) ) reply=() [[ -n $load_themes ]] && reply+=( "load_themes" "${(F)load_themes}" ) [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") } zplug-2.4.2/base/sources/gitlab.zsh000066400000000000000000000017011322121161600172370ustar00rootroot00000000000000__zplug::sources::gitlab::check() { __zplug::sources::github::check "$argv[@]" } __zplug::sources::gitlab::install() { __zplug::sources::github::install "$argv[@]" } __zplug::sources::gitlab::update() { __zplug::sources::github::update "$argv[@]" } __zplug::sources::gitlab::get_url() { local repo="$1" url_format case "$ZPLUG_PROTOCOL" in HTTPS | https) # https://git::@gitlab.com/%s.git url_format="https://git::@gitlab.com/${repo}.git" ;; SSH | ssh) # git@gitlab.com:%s.git url_format="git@gitlab.com:${repo}.git" ;; esac echo "$url_format" } __zplug::sources::gitlab::load_plugin() { __zplug::sources::github::load_plugin "$argv[@]" } __zplug::sources::gitlab::load_command() { __zplug::sources::github::load_command "$argv[@]" } __zplug::sources::gitlab::load_theme() { __zplug::sources::github::load_theme "$argv[@]" } zplug-2.4.2/base/sources/local.zsh000066400000000000000000000016441322121161600170750ustar00rootroot00000000000000__zplug::sources::local::check() { local repo="$1" local -A tags local expanded_path local -a expanded_paths __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) # Note: $tags[dir] can be a dir name or a file name expanded_paths=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]" )"} ) # Okay if at least one expanded path exists for expanded_path in ${expanded_paths[@]} do if [[ -e $expanded_path ]]; then return 0 fi done __zplug::log::write::error \ "no matching file or directory in $tags[dir]" return 1 } __zplug::sources::local::load_plugin() { __zplug::sources::github::load_plugin "$argv[@]" } __zplug::sources::local::load_command() { __zplug::sources::github::load_command "$argv[@]" } __zplug::sources::local::load_theme() { __zplug::sources::github::load_theme "$argv[@]" } zplug-2.4.2/base/sources/oh-my-zsh.zsh000066400000000000000000000142651322121161600176410ustar00rootroot00000000000000__zplug::sources::oh-my-zsh::check() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" [[ -n $tags[dir] ]] && [[ -d $tags[dir] ]] return $status } __zplug::sources::oh-my-zsh::install() { local repo="$1" # Already cloned if __zplug::sources::oh-my-zsh::check "$repo"; then return 0 fi __zplug::utils::git::clone \ "$_ZPLUG_OHMYZSH" return $status } __zplug::sources::oh-my-zsh::update() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" tags[at]="$( __zplug::core::core::run_interfaces \ 'at' \ "$repo" )" __zplug::utils::git::merge \ --dir "$tags[dir]" \ --branch "$tags[at]" \ --repo "$repo" return $status } __zplug::sources::oh-my-zsh::get_url() { __zplug::sources::github::get_url "$_ZPLUG_OHMYZSH" } __zplug::sources::oh-my-zsh::load_plugin() { local repo="${1:?}" local -A tags default_tags local -a \ unclassified_plugins \ load_fpaths \ load_plugins \ lazy_plugins \ defer_1_plugins \ defer_2_plugins \ defer_3_plugins \ load_themes local -a themes_ext __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" unclassified_plugins=() load_fpaths=() load_plugins=() lazy_plugins=() defer_1_plugins=() defer_2_plugins=() defer_3_plugins=() load_themes=() themes_ext=("zsh-theme" "theme-zsh") case "$repo" in plugins/*) unclassified_plugins=( ${(@f)"$(__zplug::utils::omz::depends "$tags[name]")"} ) # No USE tag specified if [[ $tags[use] == $default_tags[use] ]]; then unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[name]/*.plugin.zsh" "(N-.)" )"} ) else unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[name]/$tags[use]" "(N-.)" )"} ) fi ;; themes/*) unclassified_plugins=( ${(@f)"$(__zplug::utils::omz::depends "$tags[name]")"} ) load_themes=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[name].${^themes_ext}" "(N-.)" )"} ) ;; lib/*) unclassified_plugins+=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/$tags[name].zsh" "(N-.)" )"} ) ;; esac load_fpaths+=( "$tags[dir]/$tags[name]"/{_*,**/_*}(N-.:h) ) # unclassified_plugins -> {defer_N_plugins,lazy_plugins,load_plugins} # the order of loading of plugin files case "$tags[defer]" in 0) if (( $_zplug_boolean_true[(I)$tags[lazy]] )); then lazy_plugins+=( "${unclassified_plugins[@]}" ) else load_plugins+=( "${unclassified_plugins[@]}" ) fi ;; 1) defer_1_plugins+=( "${unclassified_plugins[@]}" ) ;; 2) defer_2_plugins+=( "${unclassified_plugins[@]}" ) ;; 3) defer_3_plugins+=( "${unclassified_plugins[@]}" ) ;; *) : # Error ;; esac unclassified_plugins=() if [[ -n $tags[ignore] ]]; then ignore_patterns=( $( zsh -c "$_ZPLUG_CONFIG_SUBSHELL; echo ${tags[dir]}/${~tags[ignore]}" \ 2> >(__zplug::log::capture::error) )(N) ) for ignore in "${ignore_patterns[@]}" do # Commands if [[ -n $load_commands[(i)$ignore] ]]; then unset "load_commands[$ignore]" fi # Plugins load_plugins=( "${(R)load_plugins[@]:#$ignore}" ) defer_1_plugins=( "${(R)defer_1_plugins[@]:#$ignore}" ) defer_2_plugins=( "${(R)defer_2_plugins[@]:#$ignore}" ) defer_3_plugins=( "${(R)defer_3_plugins[@]:#$ignore}" ) lazy_plugins=( "${(R)lazy_plugins[@]:#$ignore}" ) # fpath load_fpaths=( "${(R)load_fpaths[@]:#$ignore}" ) done fi reply=() [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $load_plugins ]] && reply+=( "load_plugins" "${(F)load_plugins}" ) [[ -n $lazy_plugins ]] && reply+=( "lazy_plugins" "${(F)lazy_plugins}" ) [[ -n $defer_1_plugins ]] && reply+=( "defer_1_plugins" "${(F)defer_1_plugins}" ) [[ -n $defer_2_plugins ]] && reply+=( "defer_2_plugins" "${(F)defer_2_plugins}" ) [[ -n $defer_3_plugins ]] && reply+=( "defer_3_plugins" "${(F)defer_3_plugins}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") [[ -n $load_themes ]] && reply+=( "load_themes" "${(F)load_themes}" ) return 0 } __zplug::sources::oh-my-zsh::load_theme() { local repo="$1" local -A tags default_tags local -a load_themes load_fpaths local -a themes_ext tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" themes_ext=("zsh-theme" "theme-zsh") load_fpaths=() load_themes=() # Check if omz is loaded and set some necessary settings if [[ -z $ZSH ]]; then export ZSH="$ZPLUG_REPOS/$_ZPLUG_OHMYZSH" export ZSH_CACHE_DIR="$ZSH/cache/" fi case "$repo" in themes/*) load_themes=( ${(@f)"$(__zplug::utils::omz::depends "$repo")"} ${(@f)"$( \ __zplug::utils::shell::expand_glob "$tags[dir]/${repo}.${^themes_ext}" "(N-.)" )"} ) ;; esac reply=() [[ -n $load_themes ]] && reply+=( "load_themes" "${(F)load_themes}" ) [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") return 0 } zplug-2.4.2/base/sources/prezto.zsh000066400000000000000000000126511322121161600173260ustar00rootroot00000000000000__zplug::sources::prezto::check() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" [[ -n $tags[dir] ]] && [[ -d $tags[dir] ]] return $status } __zplug::sources::prezto::install() { local repo="$1" # Already cloned if __zplug::sources::prezto::check "$repo"; then return 0 fi __zplug::utils::git::clone \ "$_ZPLUG_PREZTO" return $status } __zplug::sources::prezto::update() { local repo="$1" local -A tags tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" tags[at]="$( __zplug::core::core::run_interfaces \ 'at' \ "$repo" )" __zplug::utils::git::merge \ --dir "$tags[dir]" \ --branch "$tags[at]" \ --repo "$repo" return $status } __zplug::sources::prezto::get_url() { __zplug::sources::github::get_url "$_ZPLUG_PREZTO" } __zplug::sources::prezto::load_plugin() { local repo="${1:?}" local -A tags local -A default_tags local module_name local dependency local -a \ unclassified_plugins \ load_fpaths \ load_plugins \ lazy_plugins \ defer_1_plugins \ defer_2_plugins \ defer_3_plugins __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" unclassified_plugins=() load_fpaths=() load_plugins=() lazy_plugins=() defer_1_plugins=() defer_2_plugins=() defer_3_plugins=() if [[ ! -d $tags[dir] ]]; then zstyle ":prezto:module:$module_name" loaded "no" return 1 fi if (( ! $+functions[pmodload] )) { pmodload() { # Do nothing } } # module/command-not-found -> command-not-found module_name="${tags[name]#*/}" for dependency in ${(@f)"$(__zplug::utils::prezto::depends "$module_name")"} do unclassified_plugins+=( "$tags[dir]/modules/$dependency"/init.zsh(N-.) ) done # modules/prompt's init.zsh must be sourced AFTER fpath is added (i.e. # after compinit in __load__) if [[ $tags[name] == modules/prompt ]]; then defer_2_plugins+=( "$tags[dir]/$tags[name]"/init.zsh(N-.) ) else # Default modules if [[ $tags[use] != $default_tags[use] ]]; then unclassified_plugins+=( "$tags[dir]"/${~tags[use]}(N-.) ) elif [[ -f $tags[dir]/$tags[name]/init.zsh ]]; then unclassified_plugins+=( "$tags[dir]/$tags[name]"/init.zsh(N-.) ) fi fi # Add functions directory to FPATH if it exists if [[ -d $tags[dir]/$tags[name]/functions ]]; then load_fpaths+=( "$tags[dir]/$tags[name]"/functions(N-/) ) # autoload functions # Taken from prezto's init.zsh function { setopt local_options extended_glob local pfunction_glob='^([_.]*|prompt_*_setup|README*)(-.N:t)' lazy_plugins=( "$tags[dir]/$tags[name]/functions"/${~pfunction_glob} ) } fi zstyle ":prezto:module:$module_name" loaded "yes" if [[ $TERM == dumb ]]; then zstyle ":prezto:*:*" color "no" zstyle ":prezto:module:prompt" theme "off" fi # unclassified_plugins -> {defer_N_plugins,lazy_plugins,load_plugins} # the order of loading of plugin files case "$tags[defer]" in 0) if (( $_zplug_boolean_true[(I)$tags[lazy]] )); then lazy_plugins+=( "${unclassified_plugins[@]}" ) else load_plugins+=( "${unclassified_plugins[@]}" ) fi ;; 1) defer_1_plugins+=( "${unclassified_plugins[@]}" ) ;; 2) defer_2_plugins+=( "${unclassified_plugins[@]}" ) ;; 3) defer_3_plugins+=( "${unclassified_plugins[@]}" ) ;; *) : # Error ;; esac unclassified_plugins=() if [[ -n $tags[ignore] ]]; then ignore_patterns=( $( zsh -c "$_ZPLUG_CONFIG_SUBSHELL; echo ${tags[dir]}/${~tags[ignore]}" \ 2> >(__zplug::log::capture::error) )(N) ) for ignore in "${ignore_patterns[@]}" do # Commands if [[ -n $load_commands[(i)$ignore] ]]; then unset "load_commands[$ignore]" fi # Plugins load_plugins=( "${(R)load_plugins[@]:#$ignore}" ) defer_1_plugins=( "${(R)defer_1_plugins[@]:#$ignore}" ) defer_2_plugins=( "${(R)defer_2_plugins[@]:#$ignore}" ) defer_3_plugins=( "${(R)defer_3_plugins[@]:#$ignore}" ) lazy_plugins=( "${(R)lazy_plugins[@]:#$ignore}" ) # fpath load_fpaths=( "${(R)load_fpaths[@]:#$ignore}" ) done fi reply=() [[ -n $load_fpaths ]] && reply+=( "load_fpaths" "${(F)load_fpaths}" ) [[ -n $load_plugins ]] && reply+=( "load_plugins" "${(F)load_plugins}" ) [[ -n $lazy_plugins ]] && reply+=( "lazy_plugins" "${(F)lazy_plugins}" ) [[ -n $defer_1_plugins ]] && reply+=( "defer_1_plugins" "${(F)defer_1_plugins}" ) [[ -n $defer_2_plugins ]] && reply+=( "defer_2_plugins" "${(F)defer_2_plugins}" ) [[ -n $defer_3_plugins ]] && reply+=( "defer_3_plugins" "${(F)defer_3_plugins}" ) [[ -n $tags[hook-load] ]] && reply+=( "hook_load" "$tags[name]\0$tags[hook-load]") return 0 } zplug-2.4.2/base/utils/000077500000000000000000000000001322121161600147255ustar00rootroot00000000000000zplug-2.4.2/base/utils/ansi.zsh000066400000000000000000000003261322121161600164060ustar00rootroot00000000000000__zplug::utils::ansi::remove() { perl -pe 's/\e\[?.*?[\@-~]//g' } __zplug::utils::ansi::erace_current_line() { printf "\033[2K\r" } __zplug::utils::ansi::cursor_up() { printf "\033[%sA" "${1:-"1"}" } zplug-2.4.2/base/utils/awk.zsh000066400000000000000000000035511322121161600162410ustar00rootroot00000000000000__zplug::utils::awk::path() { local awk_path local -a awk_paths local awk variant # Look up all awk from PATH for awk_path in ${^path[@]}/{g,n,m,}awk do if [[ -x $awk_path ]]; then awk_paths+=( "$awk_path" ) fi done # There is no awk execute file in this PATH if (( $#awk_paths == 0 )); then __zplug::log::write::error \ "gawk or nawk is not found" return 1 fi # Detect awk variant from available awk list for awk_path in "${awk_paths[@]}" do if ${=awk_path} --version 2>&1 | grep -q "GNU Awk"; then # GNU Awk variant="gawk" awk="$awk_path" # Use gawk if it's already installed break elif ${=awk_path} -Wv 2>&1 | grep -q "mawk"; then # mawk variant=${variant:-"mawk"} echo $awk:$variant else # nawk variant="nawk" awk="$awk_path" # Search another variant if awk is nawk continue fi done if [[ $awk == "" || $variant == "mawk" ]]; then __zplug::log::write::error \ "gawk or nawk is not found" return 1 fi echo "$awk" } __zplug::utils::awk::available() { local awk_path __zplug::utils::awk::path \ | read awk_path # AWK is available if [[ -n $awk_path ]]; then return 0 else return 1 fi } __zplug::utils::awk::ltsv() { local \ user_awk_script="$1" \ ltsv_awk_script ltsv_awk_script=$(cat <<-'EOS' function key(name) { for (i = 1; i <= NF; i++) { match($i, ":"); xs[substr($i, 0, RSTART)] = substr($i, RSTART+1); }; return xs[name":"]; } EOS ) awk -F'\t' \ "${ltsv_awk_script} ${user_awk_script}" } zplug-2.4.2/base/utils/git.zsh000066400000000000000000000242541322121161600162450ustar00rootroot00000000000000__zplug::utils::git::clone() { local repo="$1" local depth_option url_format local -i ret=1 local -A tags default_tags # A validation of ZPLUG_PROTOCOL # - HTTPS (recommended) # - SSH if [[ ! $ZPLUG_PROTOCOL =~ ^(HTTPS|https|SSH|ssh)$ ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ "ZPLUG_PROTOCOL is an invalid protocol.\n" return 1 fi __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) if [[ -d $tags[dir] ]]; then return $_zplug_status[already] fi if [[ $tags[depth] == 0 ]]; then depth_option="" else depth_option="--depth=$tags[depth]" fi # If an 'at' tag has been specified, do a deep clone to allow any commit to be # checked out. default_tags[at]="$( __zplug::core::core::run_interfaces \ 'at' )" if [[ $tags[at] != $default_tags[at] ]]; then depth_option="" fi # Assemble a URL for cloning from its handler if __zplug::core::sources::is_handler_defined "get_url" "$tags[from]"; then __zplug::core::sources::use_handler \ "get_url" \ "$tags[from]" \ "$repo" \ | read url_format if [[ -z $url_format ]]; then __zplug::io::print::f \ --die \ --zplug \ --error \ "$repo is an invalid 'user/repo' format.\n" return 1 fi GIT_TERMINAL_PROMPT=0 \ git clone \ --quiet \ --recursive \ ${=depth_option} \ "$url_format" "$tags[dir]" \ 2> >(__zplug::log::capture::error) >/dev/null ret=$status fi # The revison (hash/branch/tag) lock # NOTE: Since it's logged in `__zplug::utils::git::checkout` function, # there is no problem even if it's discarded /dev/null file here __zplug::utils::git::checkout "$repo" &>/dev/null if (( $ret == 0 )); then return $_zplug_status[success] else return $_zplug_status[failure] fi } __zplug::utils::git::checkout() { local repo="$1" local -a do_not_checkout local -A tags local lock_name tags[at]="$(__zplug::core::core::run_interfaces 'at' "$repo")" tags[dir]="$(__zplug::core::core::run_interfaces 'dir' "$repo")" tags[from]="$(__zplug::core::core::run_interfaces 'from' "$repo")" do_not_checkout=( "gh-r" ) if [[ ! -d $tags[dir]/.git ]]; then do_not_checkout+=( "local" ) fi if (( $do_not_checkout[(I)$tags[from]] )); then return 0 fi # Try not to be affected by directory changes # by running in subshell ( # For doing `git checkout` if ! __zplug::utils::shell::cd "$tags[dir]"; then __zplug::io::print::f \ --die \ --zplug \ --error \ "no such directory '$tags[dir]' ($repo)\n" return 1 fi if ! __zplug::utils::git::have_cloned; then return 0 fi lock_name="${(j:/:)${(s:/:)tags[dir]}[-2, -1]}" if (( $_zplug_checkout_locks[(I)${lock_name}] )); then return 0 fi # Acquire lock _zplug_checkout_locks+=( $lock_name ) git checkout -q "$tags[at]" \ 2> >(__zplug::log::capture::error) >/dev/null # Release lock _zplug_checkout_locks=( ${_zplug_checkout_lock:#${lock_name}} ) if (( $status != 0 )); then __zplug::io::print::f \ --die \ --zplug \ --error \ "pathspec '$tags[at]' (at tag) did not match ($repo)\n" fi ) } __zplug::utils::git::have_cloned() { git rev-parse --is-inside-work-tree &>/dev/null && [[ "$(git rev-parse HEAD 2>/dev/null)" != "HEAD" ]] } # TODO: # - __zplug::utils::git::fetch # - __zplug::utils::git::pull __zplug::utils::git::merge() { local key value local opt arg local failed=false local -A git __zplug::utils::shell::getopts "$argv[@]" \ | while read key value; \ do case "$key" in dir) git[dir]="$value" ;; branch) git[branch]="$value" ;; repo) git[repo]="$value" ;; esac done __zplug::utils::shell::cd \ "$git[dir]" || return $_zplug_status[repo_not_found] { if [[ -e $git[dir]/.git/shallow ]]; then git fetch --unshallow else git fetch fi git checkout -q "$git[branch]" } 2> >(__zplug::log::capture::error) >/dev/null __zplug::utils::git::get_state case "$status" in $_zplug_status[not_on_branch]) # detached HEAD (due to revision lock with at tag) return $_zplug_status[revision_lock] ;; esac git[local]="$(git rev-parse HEAD)" git[upstream]="$(git rev-parse "@{upstream}" 2> >(__zplug::log::capture::error))" git[base]="$(git merge-base HEAD "@{upstream}" 2> >(__zplug::log::capture::error))" if [[ -z $git[upstream] || -z $git[base] ]]; then # > git merge-base HEAD "@{upstream} # >fatal: HEAD does not point to a branch # the same status as $_zplug_status[revision_lock] # but return as detached_head explicitly return $_zplug_status[detached_head] fi if [[ $git[local] == $git[upstream] ]]; then # up-to-date return $_zplug_status[up_to_date] elif [[ $git[local] == $git[base] ]]; then # need to pull { git reset --hard HEAD git merge --ff-only "origin/$git[branch]" if (( $status != 0 )); then failed=true fi git submodule update --init --recursive if (( $status != 0 )); then failed=true fi } 2> >(__zplug::log::capture::error) >/dev/null elif [[ $git[upstream] == $git[base] ]]; then # need to push failed=true else # Diverged (e.g. conflicts) __zplug::utils::shell::cd "$HOME" rm -rf "$git[dir]" __zplug::core::core::run_interfaces \ "install" \ "$git[repo]" &>/dev/null fi if $failed; then return $_zplug_status[failure] fi return $_zplug_status[success] } __zplug::utils::git::status() { local repo="$1" local key val line local -A tags revisions git ls-remote --heads --tags https://github.com/"$repo".git \ | awk '{print $2,$1}' \ | sed -E 's@^refs/(heads|tags)/@@g' \ | while read line; do key=${${(s: :)line}[1]} val=${${(s: :)line}[2]} revisions[$key]="$val" done tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" # TODO: git rev-parse git \ --git-dir="$tags[dir]/.git" \ --work-tree="$tags[dir]" \ log \ --oneline \ --pretty="format:%H" \ --max-count=1 \ | read val revisions[local]="$val" reply=( "${(kv)revisions[@]}" ) } __zplug::utils::git::get_head_branch_name() { local head_branch if __zplug::base::base::git_version 1.7.10; then head_branch="$(git symbolic-ref -q --short HEAD)" else head_branch="${$(git symbolic-ref -q HEAD)#refs/heads/}" fi if [[ -z $head_branch ]]; then git rev-parse --short HEAD return 1 fi printf "$head_branch\n" } __zplug::utils::git::get_remote_name() { local branch="$1" remote_name remote_name="$(git config branch.${branch}.remote)" if [[ -z $remote_name ]]; then __zplug::log::write::error \ "no remote repository" return 1 fi echo "$remote_name" } __zplug::utils::git::get_remote_state() { local remote_name branch local merge_branch remote_show local state url local -a behind_ahead local -i behind ahead branch="$1" remote_name="$(__zplug::utils::git::get_remote_name "$branch")" if (( $status == 0 )); then merge_branch="${$(git config branch.${branch}.merge)#refs/heads/}" remote_show="$(git remote show "$remote_name")" state="$(grep "^ *$branch *pushes" <<<"$remote_show" | sed 's/.*(\(.*\)).*/\1/')" if [[ -z $state ]]; then behind_ahead=( ${(@f)"$(git rev-list \ --left-right \ --count \ "$remote_name/$merge_branch"...$branch)"} ) behind=$behind_ahead[1] ahead=$behind_ahead[2] if (( $behind > 0 )); then state="local out of date" else origin_head="${$(git ls-remote origin HEAD)[1]}" git rev-parse -q "$origin_head" \ 2> >(__zplug::log::capture::error) >/dev/null if (( $status != 0 )); then state="local out of date" elif (( $ahead > 0 )); then state="fast-forwardable" else state="up to date" fi fi fi url="$(grep '^ *Push' <<<"$remote_show" | sed 's/^.*URL: \(.*\)$/\1/')" else state="$remote_name" fi echo "$state" echo "$url" } __zplug::utils::git::get_state() { local branch local -a res local state url if [[ ! -e .git ]]; then return $_zplug_status[not_git_repo] fi state="not on any branch" branch="$(__zplug::utils::git::get_head_branch_name)" if (( $status == 0 )); then res=( ${(@f)"$(__zplug::utils::git::get_remote_state "$branch")"} ) state="$res[1]" url="$res[2]" fi case "$state" in "up to date") return $_zplug_status[up_to_date] ;; "local out of date") return $_zplug_status[out_of_date] ;; "not on any branch") return $_zplug_status[not_on_branch] ;; *) return $_zplug_status[unknown] ;; esac } __zplug::utils::git::remote_url() { # Check if it has git directory [[ -e .git ]] || return 1 git remote -v \ | sed -n '1p' \ | awk '{print $2}' } zplug-2.4.2/base/utils/omz.zsh000066400000000000000000000022701322121161600162610ustar00rootroot00000000000000__zplug::utils::omz::depends() { local lib_f func_name dep local -a target local -a -U depends local -a func_names local -A omz_libs local omz_repo="$ZPLUG_REPOS/$_ZPLUG_OHMYZSH" for lib_f in "$omz_repo"/lib/*.zsh(.) do # List funcname in the library file func_names=( ${(@f)"$( \ grep "^function" "$lib_f" \ | sed 's/^function *//g' \ | sed 's/() {$//g' \ | sed 's/ {$//g' \ | grep -v " " \ )"} ) # Make list that consists of the funcname and filename for func_name in "${func_names[@]}" do omz_libs[$func_name]="$lib_f" done done target=( "$omz_repo/$1"{.zsh-theme,/*.plugin.zsh}(N-.) ) for lib_f in "${(k)omz_libs[@]}" do for t in "${target[@]}" do [[ -f $t ]] || continue sed '/^ *#/d' "$t" \ | egrep "(^|\s|['\"(\`])$lib_f($|\s|[\\\\'\")\`])" \ 2> >(__zplug::log::capture::error) >/dev/null && depends+=( "$omz_libs[$lib_f]" ) done done # Return dependency list print -l "${depends[@]}" } zplug-2.4.2/base/utils/prezto.zsh000066400000000000000000000011111322121161600167700ustar00rootroot00000000000000__zplug::utils::prezto::depends() { local module="$1" local -a -U dependencies local prezto_repo="$ZPLUG_REPOS/$_ZPLUG_PREZTO" dependencies=() # Note: Probably the only match is init.zsh, but just in case for module_f in "$prezto_repo"/modules/$module/*.zsh(N) do dependencies+=( ${(@s: :)"$( \ grep "\bpmodload\b" "$module_f" 2>/dev/null \ | sed 's/pmodload *'// \ | sed "s/['\"]//g" )"} ) done for dep in "${dependencies[@]}" do echo "$dep" done } zplug-2.4.2/base/utils/releases.zsh000066400000000000000000000126201322121161600172570ustar00rootroot00000000000000__zplug::utils::releases::get_latest() { local repo="$1" local cmd url url="https://github.com/$repo/releases/latest" if (( $+commands[curl] )); then cmd="command curl -fsSL" elif (( $+commands[wget] )); then cmd="command wget -qO -" fi eval "$cmd $url" \ 2>/dev/null \ | grep -o '/'"$repo"'/releases/download/[^"]*' \ | awk -F/ '{print $6}' \ | sort \ | uniq } __zplug::utils::releases::get_state() { local state name="$1" dir="$2" if [[ "$(__zplug::utils::releases::get_latest "$name")" == "$(cat "$dir/INDEX" 2>/dev/null)" ]]; then state="up to date" else state="local out of date" fi case "$state" in "up to date") return $_zplug_status[up_to_date] ;; "local out of date") return $_zplug_status[out_of_date] ;; *) return $_zplug_status[unknown] ;; esac } __zplug::utils::releases::is_64() { uname -m | grep -q "64$" } __zplug::utils::releases::is_arm() { uname -m | grep -q "^arm" } __zplug::utils::releases::get_url() { local repo="$1" result local -A tags local cmd url local arch local -a candidates { tags[use]="$( __zplug::core::core::run_interfaces \ 'use' \ "$repo" )" tags[at]="$( __zplug::core::core::run_interfaces \ 'at' \ "$repo" )" #if [[ $tags[use] == '*.zsh' ]]; then # tags[use]= #fi #if [[ $tags[at] == "master" ]]; then # tags[at]="latest" #fi #if [[ -n $tags[at] && $tags[at != "latest" ]]; then # tags[at]="tag/$tags[at" #else # tags[at]="latest" #fi #if [[ -n $tags[use] ]]; then # tags[use]="$(__zplug::utils::shell::glob2regexp "$tags[use")" #else # tags[use]="$(__zplug::base::base::get_os)" # if __zplug::base::base::is_osx; then # tags[use]="(darwin|osx)" # fi #fi } # Get machine information if __zplug::utils::releases::is_64; then arch="64" elif __zplug::utils::releases::is_arm; then arch="arm" else arch="386" fi url="https://github.com/$repo/releases/$tags[at]" if (( $+commands[curl] )); then cmd="command curl -fsSL" elif (( $+commands[wget] )); then cmd="command wget -qO -" fi candidates=( ${(@f)"$( eval "$cmd $url" \ 2>/dev/null \ | grep -o '/'"$repo"'/releases/download/[^"]*' )"} ) if (( $#candidates == 0 )); then __zplug::io::print::f \ --die \ --zplug \ "$repo: there are no available releases\n" return 1 fi candidates=( $( echo "${(F)candidates[@]}" | grep -E "${tags[use]:-}" ) ) if (( $#candidates > 1 )); then candidates=( $( echo "${(F)candidates[@]}" | grep "$arch" ) ) fi result="${candidates[1]}" if [[ -z $result ]]; then __zplug::io::print::f \ --die \ --zplug \ "$repo: repository not found\n" return 1 fi echo "https://github.com$result" } __zplug::utils::releases::get() { local url="$1" local repo dir header artifact cmd local -A tags # make 'username/reponame' style repo="${url:s-https://github.com/--:F[4]h}" tags[dir]="$( __zplug::core::core::run_interfaces \ 'dir' \ "$repo" )" header="${url:h:t}" artifact="${url:t}" if (( $+commands[curl] )); then cmd="command curl -s -L -O" elif (( $+commands[wget] )); then cmd="command wget" fi ( __zplug::utils::shell::cd \ --force \ "$tags[dir]" # Grab artifact from G-R eval "$cmd $url" \ &>/dev/null __zplug::utils::releases::index \ "$repo" \ "$artifact" \ &>/dev/null && echo "$header" >|"$tags[dir]/INDEX" ) return $status } __zplug::utils::releases::index() { local repo="$1" artifact="$2" local cmd="${repo:t}" local -a binaries case "$artifact" in *.zip) unzip "$artifact" rm -f "$artifact" ;; *.tar.bz2) tar jxvf "$artifact" rm -f "$artifact" ;; *.tar.gz|*.tgz) tar xvf "$artifact" rm -f "$artifact" ;; *.*) return 1 ;; *) # Through ;; esac # TODO: more strictly binaries=() binaries+=(**/*$cmd*(N-.)) # contains $cmd name files binaries+=(**/*(N-*)) # contains executable files binaries+=( $(file **/*(N-.) | awk -F: '$2 ~ /executable/{print $1}') ) if (( $#binaries == 0 )); then # Failed to grab binaries from GitHub Releases" # TODO: logging return 1 fi # For debug if (( $#binaries > 1 )); then __zplug::io::print::die "$cmd: Found ${(qqqj:,:)binaries[@]} in $repo\n" fi mv -f "$binaries[1]" "$cmd" chmod 755 "$cmd" rm -rf *~"$cmd"(N) if [[ ! -x $cmd ]]; then __zplug::io::print::die \ "$repo: Failed to install\n" return 1 fi __zplug::io::print::put \ "$repo: Installed successfully\n" return 0 } zplug-2.4.2/base/utils/shell.zsh000066400000000000000000000127421322121161600165700ustar00rootroot00000000000000__zplug::utils::shell::remove_deadlinks() { local link for link in "$@" do if [[ -L $link ]] && [[ ! -e $link ]]; then rm -f "$link" fi done } __zplug::utils::shell::search_commands() { local -a args local arg element cmd_name local is_verbose=true while (( $# > 0 )) do arg="$1" case "$arg" in --verbose) is_verbose=true ;; --silent) is_verbose=false ;; -*|--*) return 1 ;; *) args+=( "$arg" ) ;; esac shift done for arg in "${args[@]}" do for element in "${(s.:.)arg}" do # Extract the first argument sparated by a space cmd_name="${element%% *}" # Check if cmd_name is available if (( $+commands[$cmd_name] )); then if $is_verbose; then echo "$cmd_name" fi return 0 else continue fi done done return 1 } __zplug::utils::shell::glob2regexp() { local -i i=0 local glob="$1" char printf "^" for ((; i < $#glob; i++)) do char="${glob:$i:1}" case "$char" in \*) printf '.*' ;; .) printf '\.' ;; "{") printf '(' ;; "}") printf ')' ;; ,) printf '|' ;; "?") printf '.' ;; \\) printf '\\\\' ;; *) printf "$char" ;; esac done printf "$\n" } __zplug::utils::shell::sudo() { local pw="$ZPLUG_SUDO_PASSWORD" if [[ -z $pw ]]; then __zplug::log::write::error \ "ZPLUG_SUDO_PASSWORD: is an invalid value\n" return 1 fi sudo -k echo "$pw" \ | sudo -S -p '' "$argv[@]" } __zplug::utils::shell::unansi() { perl -pe 's/\e\[?.*?[\@-~]//g' } __zplug::utils::shell::cd() { local dir arg local -a dirs local is_force=false while (( $# > 0 )) do arg="$1" case "$arg" in --force) is_force=true ;; -*|--*) return 1 ;; "") ;; *) dirs+=( "$arg" ) ;; esac shift done for dir in "$dirs[@]" do if $is_force; then [[ -d $dir ]] || mkdir -p "$dir" fi builtin cd "$dir" &>/dev/null return $status done return 1 } __zplug::utils::shell::getopts() { printf "%s\n" "$argv[@]" \ | awk -f "$ZPLUG_ROOT/misc/contrib/getopts.awk" } __zplug::utils::shell::pipestatus() { local _status="${pipestatus[*]-}" [[ ${_status//0 /} == 0 ]] return $status } __zplug::utils::shell::expand_glob() { local pattern="$1" file # Modifiers to use if $pattern does not include modifiers local default_modifiers="${2:-(N)}" local -a matches # Modifiers not specified (by user) if [[ ! $pattern =~ '[^/]\([^)]*\)$' ]]; then pattern+="$default_modifiers" fi # Try expanding ~ and * matches=( ${~pattern} ) # Use subshell for brace expansion if (( $#matches <= 1 )); then matches=( $( \ zsh -c "$_ZPLUG_CONFIG_SUBSHELL; echo $pattern" \ 2> >(__zplug::log::capture::error) \ ) ) fi for file in "${matches[@]}" do [[ -e ${~file} ]] && echo ${~file} done } __zplug::utils::shell::zglob() { ( emulate -RL zsh setopt localoptions extendedglob local f g match mbegin mend p_dir1 p_dir2 local MATCH MBEGIN MEND local pat repl fpat local -a files targets local -A from to p_dir1=${~1:h} p_dir2=${~2:h} builtin cd $p_dir1 pat=${1:t} repl=${2:t} shift 2 if [[ $pat = (#b)(*)\((\*\*##/)\)(*) ]]; then fpat="$match[1]$match[2]$match[3]" setopt localoptions bareglobqual fpat="${fpat}(odon)" else fpat=$pat fi files=(${~fpat}(N)) for f in $files[@] do if [[ $pat = (#b)(*)\(\*\*##/\)(*) ]]; then pat="$match[1](*/|)$match[2]" fi [[ -e $f && $f = (#b)${~pat} ]] || continue set -- "$match[@]" g=${(Xe)repl} 2>/dev/null from[$g]=$f to[$f]=$g done for f in $files[@] do [[ -z $to[$f] ]] && continue targets=($p_dir1/$f $p_dir2/$to[$f]) print -r -- ${(q-)targets} done ) } __zplug::utils::shell::eval() { local cmd # Report stderr to error log eval "${=cmd}" 2> >(__zplug::log::capture::error) >/dev/null return $status } __zplug::utils::shell::json_escape() { if (( $+commands[python] )) && python -c 'import json' 2> /dev/null; then python -c ' from __future__ import print_function import json,sys print(json.dumps(sys.stdin.read()))' \ 2> >(__zplug::log::capture::error) else echo "(Not available: python with json required)" fi } __zplug::utils::shell::is_atty() { if [[ -t 0 && -t 1 ]]; then # terminal return 0 else # pipeline return 1 fi } zplug-2.4.2/base/utils/theme.zsh000066400000000000000000000172651322121161600165700ustar00rootroot00000000000000# Import oh-my-zsh/lib/git.zsh # # Outputs current branch info in prompt format git_prompt_info() { local ref hide_status hide_status="$(git config --get oh-my-zsh.hide-status 2>/dev/null)" if [[ $hide_status != 1 ]]; then ref="$(git symbolic-ref HEAD 2>/dev/null)" || ref="$(git rev-parse --short HEAD 2>/dev/null)" || return 0 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" fi } # Checks if working tree is dirty parse_git_dirty() { local _status hide_dirty local -a flags flags=('--porcelain') hide_dirty="$(git config --get oh-my-zsh.hide-dirty)" if [[ $hide_dirty != "1" ]]; then if __zplug::base::base::git_version 1.7.2; then flags+=('--ignore-submodules=dirty') fi if [[ $DISABLE_UNTRACKED_FILES_DIRTY == true ]]; then flags+=('--untracked-files=no') fi _status="$(git status "$flags[@]" | tail -n 1)" fi if [[ -n $_status ]]; then echo "$ZSH_THEME_GIT_PROMPT_DIRTY" else echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } # Gets the difference between the local and remote branches git_remote_status() { local remote ahead behind git_remote_status git_remote_status_detailed remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/} if [[ -n $remote ]]; then ahead="$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)" behind="$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)" if [[ $ahead == 0 ]] && [[ $behind == 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE" elif [[ $ahead == 0 ]] && [[ $behind == 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}" elif [[ $behind -gt 0 ]] && [[ $ahead == 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE" git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}" fi if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX" fi echo "$git_remote_status" fi } # Outputs the name of the current branch # Usage example: git pull origin $(git_current_branch) # Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if # it's not a symbolic ref, but in a Git repo. git_current_branch() { local ref ref="$(git symbolic-ref --quiet HEAD 2>/dev/null)" local ret=$? if [[ $ret != 0 ]]; then [[ $ret == 128 ]] && return 0 # no git repo ref=$(git rev-parse --short HEAD 2>/dev/null) || return 0 fi echo "${ref#refs/heads/}" } # Gets the number of commits ahead from remote git_commits_ahead() { if git rev-parse --git-dir &>/dev/null; then local commits="$(git rev-list --count @{upstream}..HEAD)" if [[ $commits != 0 ]]; then echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" fi fi } # Gets the number of commits behind remote git_commits_behind() { if git rev-parse --git-dir &>/dev/null; then local commits="$(git rev-list --count HEAD..@{upstream})" if [[ $commits != 0 ]]; then echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX" fi fi } # Outputs if current branch is ahead of remote git_prompt_ahead() { if [[ -n "$(git rev-list origin/$(git_current_branch)..HEAD 2>/dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } # Outputs if current branch is behind remote git_prompt_behind() { if [[ -n "$(git rev-list HEAD..origin/$(git_current_branch) 2>/dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_BEHIND" fi } # Outputs if current branch exists on remote or not git_prompt_remote() { if [[ -n "$(git show-ref origin/$(git_current_branch) 2>/dev/null)" ]]; then echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS" else echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING" fi } # Formats prompt string for current git commit short sha git_prompt_short_sha() { local sha sha="$(git rev-parse --short HEAD 2>/dev/null)" && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$sha$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } # Formats prompt string for current git commit long sha git_prompt_long_sha() { local sha sha="$(git rev-parse HEAD 2>/dev/null)" && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$sha$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } # Get the status of the working tree git_prompt_status() { local INDEX _status INDEX="$(git status --porcelain -b 2>/dev/null)" _status="" if echo "$INDEX" | grep -E '^\?\? ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_UNTRACKED$_status" fi if echo "$INDEX" | grep '^A ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_ADDED$_status" elif echo "$INDEX" | grep '^M ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_ADDED$_status" fi if echo "$INDEX" | grep '^ M ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_MODIFIED$_status" elif echo "$INDEX" | grep '^AM ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_MODIFIED$_status" elif echo "$INDEX" | grep '^ T ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_MODIFIED$_status" fi if echo "$INDEX" | grep '^R ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_RENAMED$_status" fi if echo "$INDEX" | grep '^ D ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_DELETED$_status" elif echo "$INDEX" | grep '^D ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_DELETED$_status" elif echo "$INDEX" | grep '^AD ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_DELETED$_status" fi if git rev-parse --verify refs/stash &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_STASHED$_status" fi if echo "$INDEX" | grep '^UU ' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_UNMERGED$_status" fi if echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_AHEAD$_status" fi if echo "$INDEX" | grep '^## [^ ]\+ .*behind' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_BEHIND$_status" fi if echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &>/dev/null; then _status="$ZSH_THEME_GIT_PROMPT_DIVERGED$_status" fi echo "$_status" } # Compares the provided version of git to the version installed and on path # Outputs -1, 0, or 1 if the installed version is less than, equal to, or # greater than the input version, respectively. git_compare_version() { if __zplug::base::base::git_version "$@"; then echo 1 return 0 fi echo -1 } # Outputs the name of the current user # Usage example: $(git_current_user_name) git_current_user_name() { git config user.name } # Outputs the email of the current user # Usage example: $(git_current_user_email) git_current_user_email() { git config user.email } zplug-2.4.2/base/utils/yaml.zsh000066400000000000000000000023331322121161600164160ustar00rootroot00000000000000typeset -gx -A _zplug_yaml __zplug::utils::yaml::tokenizer() { local prefix="$1" local s='[[:space:]]*' local w='[a-zA-Z0-9_]*' local fs="$(echo '@' | tr '@' '\034')" sed -ne "s|^\($s\):|\1|" \ -e "s|^\($s\)\($w\)$s:[[:space:]]*[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" \ | awk -F "$fs" \ ' { indent = length($1) / 2; vname[indent] = $2; for (i in vname) { if (i > indent) { fidelete vname[i] } } if (length($3) > 0) { vn = ""; for (i = 0; i < indent; i++) { vn=(vn)(vname[i])("_"); } #printf("%s%s%s=\"%s\"\n", "'$prefix'", vn, $2, $3); printf("%s%s%s\n%s\n", "'$prefix'", vn, $2, $3); } }' } __zplug::utils::yaml::parser() { local yaml="$1" key local -A parsed_yaml _zplug_yaml=() parsed_yaml=( "${(@f)$( if [[ -f "$yaml" ]]; then cat "$yaml" else cat <&0 fi \ | __zplug::utils::yaml::tokenizer )}" ) for key in "${(k)parsed_yaml[@]}" do _zplug_yaml[$key]="$parsed_yaml[$key]" done } zplug-2.4.2/bin/000077500000000000000000000000001322121161600134235ustar00rootroot00000000000000zplug-2.4.2/bin/zplug-env000077500000000000000000000004471322121161600153050ustar00rootroot00000000000000#!/usr/bin/env zsh # Description: The environment variables of zplug # ^-- This description is used as complete message # This is a sample zplug script # For more information, see man page of zplug(1) env \ | grep -E "^_?ZPLUG_" \ | perl -pe 's/^(\w+)(=)(.*)$/\033[32m$1\033[m $2 $3/' zplug-2.4.2/doc/000077500000000000000000000000001322121161600134205ustar00rootroot00000000000000zplug-2.4.2/doc/AUTHORS000066400000000000000000000000341322121161600144650ustar00rootroot00000000000000b4b4r07 zplug-2.4.2/doc/CHANGELOG.md000066400000000000000000000000001322121161600152170ustar00rootroot00000000000000zplug-2.4.2/doc/CONTRIBUTORS000066400000000000000000000000721322121161600152770ustar00rootroot00000000000000# With a heartful gratitude NigoroJr zplug-2.4.2/doc/LICENSE-MIT.txt000066400000000000000000000021241322121161600156710ustar00rootroot00000000000000The MIT License (MIT) Copyright © 2016 Masaki Ishiyama 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. zplug-2.4.2/doc/VERSION000066400000000000000000000000061322121161600144640ustar00rootroot000000000000002.4.2 zplug-2.4.2/doc/guide/000077500000000000000000000000001322121161600145155ustar00rootroot00000000000000zplug-2.4.2/doc/guide/Badges-and-references.md000066400000000000000000000040401322121161600211010ustar00rootroot00000000000000# Badges [![][travis-badge]][travis-link] [![][latest-badge]][latest-link] [![][slack-badge]][slack-link] [![][homebrew-badge]][homebrew-link] [![][aur-version-badge]][aur-version-link] [![][aur-votes-badge]][aur-votes-link] [![][tag-badge]][tag-link] [![][release-badge]][release-link] [![][commits-since-badge]][commits-since-link] [![][website-badge]][website-link] [![][stable-badge]][stable-link] [travis-badge]: https://img.shields.io/travis/zplug/zplug.svg?style=flat-square [latest-badge]: https://img.shields.io/badge/latest-v2.1.0-ca7f85.svg?style=flat-square [slack-badge]: https://img.shields.io/badge/slack-join-ca7f85.svg?style=flat-square [homebrew-badge]: https://img.shields.io/homebrew/v/zplug.svg?style=flat-square [aur-version-badge]: https://img.shields.io/aur/version/zplug.svg?style=flat-square [aur-votes-badge]: https://img.shields.io/aur/votes/zplug.svg?style=flat-square [tag-badge]: https://img.shields.io/github/tag/zplug/zplug.svg?style=flat-square [release-badge]: https://img.shields.io/github/release/zplug/zplug.svg?style=flat-square [commits-since-badge]: https://img.shields.io/github/commits-since/zplug/zplug/2.1.0.svg?style=flat-square [website-badge]: https://img.shields.io/website-up-down-green-red/http/zplug.sh.svg?style=flat-square [stable-badge]: https://img.shields.io/badge/stable-2.1.0-00CCFF.svg?style=flat-square [travis-link]: https://travis-ci.org/zplug/zplug [latest-link]: https://github.com/zplug/zplug/releases [slack-link]: https://zplug.herokuapp.com [homebrew-link]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zplug.rb [aur-version-link]: https://aur.archlinux.org/packages/zplug [aur-votes-link]: https://aur.archlinux.org/packages/zplug [tag-link]: https://github.com/zplug/zplug/tags [release-link]: https://github.com/zplug/zplug/releases [commits-since-link]: https://github.com/zplug/zplug/compare/2.1.0...master [website-link]: http://zplug.sh [stable-link]: https://github.com/zplug/zplug/releases/tag/2.1.0 [repo]: https://github.com/zplug/zplug [license]: http://b4b4r07.mit-license.org zplug-2.4.2/doc/guide/External-Commands.md000066400000000000000000000022631322121161600203630ustar00rootroot00000000000000# External Commands zplug, like `git(1)`, supports external commands. This lets you create new commands that can be run like: ```console $ zplug mycommand --option1 --option2 package ``` without modifying zplug's internals. ## How to write commands As long as the external command is executable (`chmod +x`) and live somewhere in `$PATH`, any language will do (e.g. shell script, ruby script, etc.). Example: ```zsh #!/usr/bin/env zsh # description: my new zplug command echo "Hello, zplug" ``` when saving as zplug-foo, the command can be invoked like zplug foo. In addition, the description line (line 2) is used as the description in the completion. ```console % zplug Completing zplug commands check --> Check whether an update or installation is available clean --> Remove deprecated repositories clear --> Remove cache file foo --> [User-defined] my new zplug command install --> Install described items (plugins/commands) in parallel list --> Show all of the zplugs in the current shell load --> Load installed items status --> Check if remote branch is up-to-date update --> Update items in parallel ``` ## Sample script - [zplug-env](../../bin/zplug-env) zplug-2.4.2/doc/guide/External-Sources.md000066400000000000000000000134471322121161600202530ustar00rootroot00000000000000# Adding Sources If there is a service/framework you want to install from that's not supported by zplug (yet!), you can add your own. We call these "sources." [GitHub](https://github.com), [Bitbucket](https://bitbucket.org), [GitHub Gist](https://gist.github.com), GitHub releases, [Gitlab](https://gitlab.com), [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), and [prezto](https://github.com/sorin-ionescu/prezto) are supported by default. Sources are what you specify with the `from` tag (e.g. `from:bitbucket`), so you will be able to do `from:my-foo-source`. Writing your own sources brings you the benefit of being able to tailor pre and post installation/loading actions. ## What you need to do Let's suppose we want a `foobar` source, that loads the content of the file specified by the `use` tag or `$HOME/boo.zsh` if it exists. The first step is to create a `foobar.zsh` in `$ZPLUG_ROOT/base/sources/`. The following list shows the name of the functions that can be defined in this file. - `__zplug::sources::foobar::load_plugin` - `__zplug::sources::foobar::check` - `__zplug::sources::foobar::install` - `__zplug::sources::foobar::update` - `__zplug::sources::foobar::get_url` - `__zplug::sources::foobar::load_plugin` Replace `foobar` with the name of your source. ## Add as a valid source Add the name of your source to the `candidates` array in `$ZPLUG_ROOT/autoload/tags/__from__`. ## Handlers ### `__zplug::foobar::check` This function defines whether a package is currently installed or not. In our case, we check that simply by looking at `$HOME/boo.zsh`. This function should return 0 if the package is installed, and any other number (typically 1) otherwise. ```zsh __zplug::foobar::check() { local repo="$1" local -A tags tags[use]="$( __zplug::core::core::run_interfaces \ 'use' \ "$repo" )" [[ -e $tags[use] ]] || [[ -e $HOME/boo.zsh ]] return $status } ``` You can access the tag information using `__zplug::core::core::run_interfaces` as shown above. ### `__zplug::foobar::install` You can define how you want to install a package. ```zsh __zplug::foobar::install() { local repo="$1" local -A tags tags[use]="$( __zplug::core::core::run_interfaces \ 'use' \ "$repo" )" tags[as]="$( __zplug::core::core::run_interfaces \ 'as' \ "$repo" )" # Output to $zspec[use] if not empty, otherwise to boo.zsh echo "echo 'hi there'" > "$HOME/${tags[use]:-boo.zsh}" if [[ $tags[as] == command ]]; then chmod 755 "$HOME/${tags[use]:-boo.zsh}" fi return $status } ``` ### `__zplug::foobar::load_plugin` This function is called when `as:plugin` is used. Following shows an example of loading `$HOME/boo.zsh` as a plugin: ```zsh __zplug::foobar::load_plugin() { local repo="$1" local -A tags local -A default_tags local -a unclassified_plugins # Unused here, but can be useful in some cases local -a load_fpaths local -a load_plugins local -a nice_plugins local -a lazy_plugins __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" if [[ $tags[use] == $default_tags[use] ]]; then tags[use]="$HOME/boo.zsh" fi unclassified_plugins=( \ __zplug::utils::shell::expand_glob "${tags[use]}" \ ) reply=() [[ -n $unclassified_plugins ]] && reply+=( unclassified_plugins "${(F)unclassified_plugins}" ) return $status } ``` Note the variables `unclassified_plugins`, `load_fpaths`, `load_plugins`, `nice_plugins`, and `lazy_plugins`. Most of the times you should only need to put the files you want to `source` into `unclassified_plugins`, because after returning from this function the files will be organized into `load_plugins` (for packages with `nice < 10`. Gets `source`d before `compinit`), `nice_plugins` (`nice >= 10` packages. `source` after `compinit`), or `lazy_plugins` (for `lazy:true` packages). Directories in `load_fpaths` will be added to `fpath`. When you want to expand a path that contains glob expressions, use `__zplug::utils::shell::expand_glob "$path_to_expand"`. This takes care of the details such as whether or not to use a sub-shell and whatnot. You can also use the optional second argument to specify the default modifiers (like `(N-.)`) that will be used in case the first argument doesn't contain one. ### `__zplug::foobar::load_command` The idea of loading packages with `as:command` is pretty much the same as `as:plugin`. The only difference is that you need to include the source and the destination that will be used when linking the file. The destination in almost all cases are `$ZPLUG_HOME/bin`. ``` __zplug::foobar::load_plugin() { local repo="$1" local -A tags local -A default_tags local dst local -a load_fpaths load_commands local -a sources __zplug::core::tags::parse "$repo" tags=( "${reply[@]}" ) default_tags[use]="$(__zplug::core::core::run_interfaces 'use')" dst=${${tags[rename-to]:+$ZPLUG_HOME/bin/$tags[rename-to]}:-"$ZPLUG_HOME/bin"} # Add parent directories to fpath if any files starting in _* exist load_fpaths+=(${tags[dir]}/{_*,/**/_*}(N-.:h)) sources=( ${(@f)"$( \ __zplug::utils::shell::expand_glob "${tags[use]}" "(N-)" )"} ) for src in "${sources[@]}" do load_commands+=("$src\0$dst") done reply=() [[ -n $load_fpaths ]] && reply+=( load_fpaths "${(F)load_fpaths}" ) [[ -n $load_commands ]] && reply+=( load_commands "${(F)load_commands}" ) return $status } ``` In the for loop, the source (path to the file) and the destination are concatenated with a `\0`. Other sources can be found in `$ZPLUG_ROOT/base/sources`. Please take a look at the existing sources and see how other handlers are written. zplug-2.4.2/doc/guide/How-to-make-zsh-plugins.md000066400000000000000000000025431322121161600214140ustar00rootroot00000000000000# How to make zsh plugins ## Plugins adaptively-optimized for zplug ### autoload plugins ***Pattern 1***: ``` . ├── autoload │   └── plugin <=[main file] └── doc ├── man │   └── man1 │   └── plugin.1 └── plugin.txt 4 directories, 3 files ``` zplug can manage zsh plugins with lazy loading. When you specify `zplug "package", lazy:1`, zplug search the `autoload` directory within the plugin directory and load it with lazy. ***Pattern 2***: Of cource, you don't need to make `autoload` directory but in this case, you must specify `of` tag like `zplug "package", lazy:1, of:"plugin/plugin"` to tell a plugin file to zplug. ``` . ├── doc │   ├── man │   │   └── man1 │   │   └── plugin.txt │   └── plugin.txt ├── init.zsh <=[trigger file] └── plugin └── plugin <=[main file] 4 directories, 4 files ``` `init.zsh`: ```zsh local this="${${(%):-%N}:A:h}" fpath=( $this/plugin(N-/) $fpath ) unset this autoload -Uz plugin ``` However, if you prepare `init.zsh` that is trigger of loading the plugin, `of` tag doesn't require because zplug scan `*.zsh` file automatically in the top directory and load it. - [sample plugin](https://github.com/b4b4r07/zsh_plugin) ### normal plugins ... ### commands ... zplug-2.4.2/doc/guide/ja/000077500000000000000000000000001322121161600151075ustar00rootroot00000000000000zplug-2.4.2/doc/guide/ja/README.md000066400000000000000000000432041322121161600163710ustar00rootroot00000000000000[:us:](../../../README.md) :jp: > Zsh のプラグインマネージャー [![Travis][travis-badge]][travis-link] [![Latest][latest-badge]][latest-link] [![Slack][slack-badge]][slack-link]

## メリット - 何でも管理できる - [GitHub](https://github.com) や [Bitbucket](https://bitbucket.org) にあるプラグインや UNIX コマンド - Gist ファイル ([gist.github.com](https://gist.github.com)) - 外部フレームワークなどのプラグイン (例: [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) や [prezto](https://github.com/sorin-ionescu/prezto) のプラグイン・テーマ) - [GitHub Releases](https://help.github.com/articles/about-releases/) のバイナリファイル - ローカルプラグイン - その他 ([カスタムソース](https://github.com/zplug/zplug/blob/master/doc/zplug/External-Sources.md)によって追加できる) - 高速インストール・高速アップデート - 遅延読み込みに対応 - リビジョンロック(ブランチやタグを固定する機能) - `post-update` 等のフック機能 - パッケージ間の依存管理 - [antigen](https://github.com/zsh-users/antigen) とは違って、`*.plugin.zsh` を必要としない - 対話的インターフェイス([fzf](https://github.com/junegunn/fzf), [peco](https://github.com/peco/peco), [zaw](https://github.com/zsh-users/zaw) など) - キャッシュ機能による読み込み高速化 ([起動時間](#vs)) ***DEMO:*** [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/demo.gif)][repo] ## インストール 最新版 | 安定版 ---|--- [![Latest][latest-badge]][latest-link] | [![Stable][stable-badge]][stable-link] ### 推奨方法 ```console $ curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh| zsh ``` インストーラの実態: - [zplug/installer](https://github.com/zplug/installer/blob/master/installer.zsh) ### [Homebrew](https://github.com/Homebrew/brew) から (OS X) ```console $ brew install zplug ``` ### git から GitHub からクローンしてきて `init.zsh` を読み込む: ```console $ export ZPLUG_HOME=/path/to/.zplug $ git clone https://github.com/zplug/zplug $ZPLUG_HOME ``` ## 必要条件 - `zsh`: バージョン 4.3.9 以上 - `git`: バージョン 1.7 以上 - `awk`: `mawk` 以外の AWK 処理系 ## 利用方法 `.zshrc` に以下を書き込む: 1. `zplug` commands でインストールするパッケージについて書く 2. `zplug load` によりプラグインを読み込み、コマンドを `$PATH` に追加するようにする ### Example [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/example.png)][repo] ```zsh source ~/.zplug/init.zsh # ダブルクォーテーションで囲うと良い zplug "zsh-users/zsh-history-substring-search" # コマンドも管理する # グロブを受け付ける(ブレースやワイルドカードなど) zplug "Jxck/dotfiles", as:command, use:"bin/{histuniq,color}" # こんな使い方もある(他人の zshrc) zplug "tcnksm/docker-alias", use:zshrc # frozen タグが設定されているとアップデートされない zplug "k4rthik/git-cal", as:command, frozen:1 # GitHub Releases からインストールする # また、コマンドは rename-to でリネームできる zplug "junegunn/fzf-bin", \ from:gh-r, \ as:command, \ rename-to:fzf, \ use:"*darwin*amd64*" # oh-my-zsh をサービスと見なして、 # そこからインストールする zplug "plugins/git", from:oh-my-zsh # if タグが true のときのみインストールされる zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]" # prezto のプラグインやテーマを使用する zplug "modules/osx", from:prezto, if:"[[ $OSTYPE == *darwin* ]]" zplug "modules/prompt", from:prezto # zstyle は zplug load の前に設定する zstyle ':prezto:module:prompt' theme 'sorin' # インストール・アップデート後に実行されるフック # この場合は以下のような設定が別途必要 # ZPLUG_SUDO_PASSWORD="********" zplug "jhawthorn/fzy", \ as:command, \ rename-to:fzy, \ hook-build:"make && sudo make install" # リビジョンロック機能を持つ zplug "b4b4r07/enhancd", at:v1 zplug "mollifier/anyframe", at:4c23cb60 # Gist ファイルもインストールできる zplug "b4b4r07/79ee61f7c140c63d2786", \ from:gist, \ as:command, \ use:get_last_pane_path.sh # bitbucket も zplug "b4b4r07/hello_bitbucket", \ from:bitbucket, \ as:command, \ use:"*.sh" # `use` タグでキャプチャした文字列でリネームする zplug "b4b4r07/httpstat", \ as:command, \ use:'(*).sh', \ rename-to:'$1' # 依存管理 # "emoji-cli" は "jq" があるときにのみ読み込まれる zplug "stedolan/jq", \ from:gh-r, \ as:command, \ rename-to:jq zplug "b4b4r07/emoji-cli", \ on:"stedolan/jq" # ノート: 読み込み順序を遅らせるなら defer タグを使いましょう # 読み込み順序を設定する # 例: "zsh-syntax-highlighting" は compinit の後に読み込まれる必要がある # (2 以上は compinit 後に読み込まれるようになる) zplug "zsh-users/zsh-syntax-highlighting", defer:2 # ローカルプラグインも読み込める zplug "~/.zsh", from:local # テーマファイルを読み込む zplug 'dracula/zsh', as:theme # 未インストール項目をインストールする if ! zplug check --verbose; then printf "Install? [y/N]: " if read -q; then echo; zplug install fi fi # コマンドをリンクして、PATH に追加し、プラグインは読み込む zplug load --verbose ``` 最後に、 `zplug install` でプラグインをインストールし、`.zshrc`をリロードする ### 1. オプション | オプション | 説明 | |-----------------|------| | `--help` | ヘルプを表示する | | `--rollback` | インストールに失敗したパッケージをロールバックする | | `--self-manage` | zplug自身をzplugで管理する | | `--version` | バージョン情報を表示する | | `--log` | ログを見る(開発者向け) | ### 2. サブコマンド | サブコマンド | 説明 | そのオプション | |-----------|-------------|---------| | `install` | 並列インストール | (なし) | | `load` | インストール済みプラグインを読み込み、インストール済みコマンドを `$PATH` に追加する | `--verbose` | | `list` | インストール済みパッケージを表示する (端的に連想配列 `$zplugs` を表示する) | `--select`,`--installed`,`--loaded` | | `update` | インストール済みパッケージを並列でアップデートする | `--select`,`--force` | | `check` | 未インストールなパッケージがないなら真を返し、そうでなければ偽を返す | `--verbose` | | `status` | パッケージが最新かどうか確認する| `--select` | | `clean` | 管理されていないパッケージを削除する | `--force`,`--select` | | `clear` | キャッシュを削除する | (なし) | | `info` | パッケージのタグ情報などを個別に表示する | (なし) | #### 実用例 ```zsh # zplug check はインストールするものがないときに真を返す # ゆえにそうでないとき zplug install する if ! zplug check; then zplug install fi # プラグインを読み込み、コマンドを実行可能にする zplug load # zplug check は引数に与えられたリポジトリがインストールされているなら真を返す if zplug check b4b4r07/enhancd; then # enhancd がインストールされている場合のみ設定する export ENHANCD_FILTER=fzf-tmux fi ``` #### zplug を zplug で管理する 他のパッケージと同様に zplug を管理するには `.zshrc` に以下を書き込む。 ```zsh zplug 'zplug/zplug', hook-build:'zplug --self-manage' ``` あとは `zplug update` を実行するだけ。 ### 3. タグ `truthy` は `true`, `yes`, `on`, `1` で、 `falsy` は `false`, `no`, `off`, `0` を意味する。 | タグ | 説明 | 値 (デフォルト値) | 例 | |-----|-------------|-----------------|---------| | `as` | プラグインとして、またはコマンドとして追加するか指定する | `plugin`,`command`,`theme` (`plugin`) | `as:command` | | `use` | 読み込むファイルパターンを指定する (`plugin` のとき) か `$PATH` に追加したいコマンドの相対パスを指定する (`command` のとき) / `from:gh-r` の場合は zplug が自動で OS のアーキテクチャを判別するが、意図しない結果の場合 `use:"*darwin*{amd,386}*"` のようにすると良い | *グロブ・パターン* (`use:"*.zsh"`) | `use:bin`,`use:"*.sh"`, `use:*darwin*` | | `ignore` | `use` タグと似ているが無視したいファイルパターンを指定する ([#56](https://github.com/zplug/zplug/issues/56) 参照) | *グロブ・パターン* (-) | `ignore:"some_*.zsh"` | | `from` | どこからインストールするか指定する | `github`,`bitbucket`,
`gh-r`,`gist`,
`oh-my-zsh`,`prezto`,`local` (`github`) | `from:gh-r` | | `at` | branch/tag/commit を指定して固定する | *リビジョン* (`master`) | `at:v1.5.6` | | `rename-to` | リンクするときに変更したいファイル名を指定する (`as:command` のときのみ有効) | *ファイル名* (-) | `rename-to:fzf` | | `dir` | パッケージのインストール先 | **READ ONLY** | `dir:/path/to/user/repo` | | `if` | パッケージをインストールするときの条件を指定する | *真偽値* (-) | `if:"[ -d ~/.zsh ]"` | | `hook-build` | インストール・アップデート後に実行するコマンド | *コマンド* (-) | `hook-build:"make install"` | | `hook-load` | ロード後に実行するコマンド | *コマンド* (-) | `hook-load:"echo 'Loaded!'"` | | `frozen` | 明示的に指定するとアップデート対象から省く | truthy または falsy (false) | `frozen:1` | | `on` | 指定されたパッケージがインストールされているときのみロードする | *package* | `on:user/repo` | | `defer` | プラグインの読み込みを遅らせる。 2 以上を指定すると、`compinit` コマンドの実行後に読まれることになる ([#26](https://github.com/zplug/zplug/issues/26) 参照) | 0 から 3 (0) | `defer:2` | | `lazy` | 遅延読み込みするかどうかを指定する | truthy または falsy (false) | `lazy:true` | | `depth` | リポジトリをクローンするときのヒストリサイズ。0 はすべてのヒストリをクローンする | 0 と正の整数 | `depth:10` | #### デフォルト値を一括変更する `zstyle` によってデフォルト値を変更できる。フォーマットは次のように: ```zsh zstyle ":zplug:tag" tag_name new_default_value ``` 例えば、もしプラグインよりコマンドを利用することが多いなら (具体的に言うと`as:command` とするほうが多い場合) こう書くことができる: ```zsh zstyle ":zplug:tag" as command ``` こうすることでデフォルト値を変更することができる。`as` タグ以外のタグも同様に。 #### コマンドライン上から利用する コマンドライン上から zplug パッケージを追加できる。もしコマンドライン上から追加することがあるのなら、zsh 補完を利用してより簡単でパワフルに追加できる。 この場合、`.zshrc` でなく `$ZPLUG_LOADFILE` に設定が記述される。また、新しく zsh を立ち上げるときに、`zplug load` の際にこのファイルもロードする。 [`ZPLUG_LOADFILE`](#zplug_loadfile) の使い方については後述を参照。 ### 4. 環境変数 #### `ZPLUG_HOME` デフォルトでは `~/.zplug`。`zplug` はこのディレクトリ以下に配置される。ディレクトリ構成は以下である。 ``` $ZPLUG_HOME |-- bin | `-- some_command -> ../repos/username_A/reponame1/some_command `-- repos |-- username_A | |-- reponame1 | | |-- README.md | | `-- some_command | `-- reponame2 | |-- README.md | `-- some_plugin.zsh `-- username_B `-- reponame1 ``` `as:command` を指定したとき、zplug はパッケージをコマンドとみなし、同名のシンボリックリンクを `$ZPLUG_BIN` に作成する (違う名前で作成したい場合、`rename-to:` タグを使う)。`$ZPLUG_BIN` は `$PATH` に追加されるので、インストールしたコマンドはいつでもどこからでも実行可能になる。 #### `ZPLUG_THREADS` インストール・アップデート時に立ち上がるプロセス数の制限値。デフォルトは 16. #### `ZPLUG_PROTOCOL` デフォルトは HTTPS。取りうる値は `HTTPS` と `SSH`のみ。特別な理由がない限り、 `HTTPS` を推奨する。 詳細やその理由については [**Which remote URL should I use?** - GitHub Help](https://help.github.com/articles/which-remote-url-should-i-use/) を参照のこと。 #### `ZPLUG_FILTER` デフォルトは `fzf-tmux:fzf:peco:percol:zaw`。`--select` オプションを指定すると、`$PATH` にあるコロンで区切られた最初の要素(この例では fzf-tmux)が zplug で使われる対話フィルタとして使用される。`ZPLUG_FILTER` は次のようにスペースや、ダブルクォーテーションを使用することができる: `fzf-tmux -d "10%":/path/to/peco:my peco` #### `ZPLUG_LOADFILE` デフォルトは `$ZPLUG_HOME/packages.zsh`。このファイルはコマンドライン上からパッケージの追加を行うときに使用される。これを利用することで `.zshrc` から分離してパッケージリストを管理することができる。 #### `ZPLUG_USE_CACHE` デフォルトは `true`。true の場合、zplug はロードの高速化のためにキャッシュを利用するようになる。キャッシュファイルは `$ZPLUG_CACHE_DIR` に保存されている。キャッシュをクリアする場合は、`zplug clear` を実行するか以下のようにすると良い: ```console $ ZPLUG_USE_CACHE=false zplug load ``` #### `ZPLUG_CACHE_DIR` デフォルトは `$ZPLUG_HOME/.cache`。キャッシュの保存先を変更することができる。例えば `~/.cache/zplug` とか。 #### `ZPLUG_REPOS` デフォルトは `$ZPLUG_HOME/repos`。パッケージのクローン先かつ保存先の場所を設定することができる。 #### `ZPLUG_SUDO_PASSWORD` 設定しておくと `hook-build` などのときに sudo コマンドが使えるようになる。しかし、セキュアな変数なので取扱に注意すること。 ```zsh # dotfiles で管理していないファイルに切り出すなどする source ~/.zshrc_secret zplug "some/command", hook-build:"make && sudo make install" ``` #### `ZPLUG_BIN` デフォルトは `$ZPLUG_HOME/bin`。コマンドのシンボリックリンクの保存先を変更することができる。例えば `~/bin` とか。 ### 外部コマンド zplug では `git(1)` のように外部コマンド機能が利用できる。 `$PATH` のいずれかにある `zplug-cmdname` の規則を持つ実行ファイルは、まるでサブコマンドのように `zplug cmdname` の形で利用することができる。 これにより自由に自分で zplug のコマンドを追加したり拡張することができる。 作成方法や利用ガイドラインの詳細については [docs](https://github.com/zplug/zplug/blob/master/doc/zplug/External-Commands.md) ディレクトリ以下にあるので参照のこと。実際の外部コマンドのサンプルには [`zplug-env`](https://github.com/zplug/zplug/blob/master/bin/zplug-env) を参照すると良い。 ## V.S. zplug は他の有名な zsh プラグインマネージャーよりも速い: [![](https://raw.githubusercontent.com/b4b4r07/screenshots/master/zplug/time.png)][repo] ## メモ - antigen :syringe: はもうおしまい。これからは **zplug** :hibiscus: を使おう - :hibiscus: zplug は [vim-plug](https://github.com/junegunn/vim-plug) や [neobundle.vim](https://github.com/Shougo/neobundle.vim) を参考に設計された ## その他 zplug などから利用できる zsh プラグインは [awesome-zsh-plugins](https://github.com/unixorn/awesome-zsh-plugins) にあるので参考になる。 antigen や zgen、もしくは zplug v1 から移行するための情報は [zplug の公式 wiki](https://github.com/zplug/zplug/wiki/Migration) にある。 ## ライセンス [MIT][license] (c) [@b4b4r07](https://github.com/b4b4r07) [repo]: https://github.com/zplug/zplug [license]: http://b4b4r07.mit-license.org [travis-link]: https://travis-ci.org/zplug/zplug [travis-badge]: https://img.shields.io/travis/zplug/zplug.svg?style=flat-square [latest-badge]: https://img.shields.io/badge/latest-v2.4.2-ca7f85.svg?style=flat-square [latest-link]: https://github.com/zplug/zplug/releases/latest [stable-badge]: https://img.shields.io/badge/stable-v2.3.2-e9a326.svg?style=flat-square [stable-link]: https://github.com/zplug/zplug/releases/tag/2.3.2 [slack-link]: https://zplug.herokuapp.com [slack-badge]: https://img.shields.io/badge/slack-join-ca7f85.svg?style=flat-square zplug-2.4.2/doc/man/000077500000000000000000000000001322121161600141735ustar00rootroot00000000000000zplug-2.4.2/doc/man/man1/000077500000000000000000000000001322121161600150275ustar00rootroot00000000000000zplug-2.4.2/doc/man/man1/ZPLUG_HOME.1000077700000000000000000000000001322121161600211072../man1/zplug.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man1/zplug-check.1000066400000000000000000000043561322121161600173350ustar00rootroot00000000000000'\" t .\" Title: zplug-check .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-CHECK" "1" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-check \- Return true if all packages are installed, false otherwise .SH "SYNOPSIS" .sp .nf \fIzplug check\fR [\-\-verbose] [\fI"username/reponame"\fR] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp It\(cqs possible to confirm whether the package is installed\&. Besides, if no packages are given as the arguments, check command checks whether there is a package that has not been installed\&. .SH "OPTIONS" .PP \fB\-\-verbose\fR .RS 4 Be verbose\&. .RE .SH "EXAMPLES" .sp Installation check: .sp .if n \{\ .RS 4 .\} .nf if ! zplug check \-\-verbose; then printf "Install? [y/N]: " if read \-q; then echo; zplug install fi fi .fi .if n \{\ .RE .\} .sp The above code means that the packages will be installed if there is a package that has not been installed\&. .sp Installation check from CLI: .sp .if n \{\ .RS 4 .\} .nf $ zplug check \-\-verbose \'some_author/some_repo\' \- some_author/some_repo: not installed .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR, \fBzplug\-status(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-clean.1000066400000000000000000000045141322121161600173360ustar00rootroot00000000000000'\" t .\" Title: zplug-clean .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-CLEAN" "1" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-clean \- Remove repositories which are no longer managed .SH "SYNOPSIS" .sp .nf \fIzplug clean\fR [\-\-force] [\-\-select] [\fI"username/reponame"\fR] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Remove the packages that is installed in the \fB$ZPLUG_HOME/repos\fR directory but not described in your \fB\&.zshrc\fR or config file for zplug\&. Otherwise, remove the packages you want to uninstall expressly\&. .SH "OPTIONE" .PP \fB\-\-force\fR .RS 4 Forcibly\&. By default, to confirm whether you want to delete by yes/no prompt\&. .RE .PP \fB\-\-select\fR .RS 4 Remove to choose from the list of installed packages\&. .RE .SH "EXAMPLES" .sp Remove the packages that is installed but not described with the prompt: .sp .if n \{\ .RS 4 .\} .nf $ zplug clean .fi .if n \{\ .RE .\} .sp Same as above, without the prompt: .sp .if n \{\ .RS 4 .\} .nf $ zplug clean \-\-force .fi .if n \{\ .RE .\} .sp Remove a particular package: .sp .if n \{\ .RS 4 .\} .nf $ zplug clean \'some_author/some_repo\' Remove? (y/N) \'~/\&.zplug/repos/some_author/some_repo\' .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-clear.1000066400000000000000000000031101322121161600173310ustar00rootroot00000000000000'\" t .\" Title: zplug-clear .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-CLEAR" "1" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-clear \- Remove the cache file .SH "SYNOPSIS" .sp .nf \fIzplug clear\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Remove the cache file\&. .SH "OPTIONS" .PP \fB(None)\fR .RS 4 no options .RE .SH "EXAMPLES" .sp Remove the cache file: .sp .if n \{\ .RS 4 .\} .nf $ zplug clear .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-info.1000066400000000000000000000041061322121161600172040ustar00rootroot00000000000000'\" t .\" Title: zplug-info .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/03/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-INFO" "1" "12/03/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-info \- Show the information such as the source URL and tag values for the given package .SH "SYNOPSIS" .sp .nf \fIzplug info\fR \fI"username/reponame"\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp List the all tags of that package and show more details\&. .SH "OPTIONS" .PP \fB(None)\fR .RS 4 no options .RE .SH "EXAMPLES" .sp Show the information: .sp .if n \{\ .RS 4 .\} .nf $ zplug info b4b4r07/enhancd ==> ~/enhancd \- \- \- \- use:"init\&.sh" \- as:"plugin" \- at:"master" \- ignore:"" \- lazy:"no" \- commit:"" \- dir:"/Users/b4b4r07/enhancd" \- of:"" \- rename\-to:"" \- from:"local" \- do:"" \- hook\-load:"" \- file:"" \- name:"~/enhancd" \- defer:"0" \- if:"" \- depth:"0" \- frozen:"no" \- on:"" \- hook\-build:"" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-install.1000066400000000000000000000046631322121161600177270ustar00rootroot00000000000000'\" t .\" Title: zplug-install .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-INSTALL" "1" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-install \- Install packages in parallel .SH "SYNOPSIS" .sp .nf \fIzplug install\fR [\fI"username/reponame"\fR] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Install the package that has not yet been installed, even though it is described in the file\&. .SH "OPTIONS" .PP \fB(None)\fR .RS 4 no options .RE .SH "EXAMPLES" .sp Install all not\-installed packages: .sp .if n \{\ .RS 4 .\} .nf $ zplug install .fi .if n \{\ .RE .\} .sp Install a particular package verbosely: .sp .if n \{\ .RS 4 .\} .nf $ zplug install \'some_author/some_repo\' Installing\&.\&.\&. some_author/some_repo Installed! some_author/some_repo (2\&.59s) ==> Installation finished successfully! zplug: total wall\-time 2\&.664253 sec\&. .fi .if n \{\ .RE .\} .SH "ENVIRONMENT VARIABLES" .PP \fIZPLUG_THREADS\fR .RS 4 The maximum number of threads zplug should use when installing/updating\&. The default value is 16\&. .RE .PP \fIZPLUG_PROTOCOL\fR .RS 4 Defaults to HTTPS\&. Valid options for $ZPLUG_PROTOCOL are HTTPS or SSH\&. Unless you have a specific reason, you should use the HTTPS protocol\&. For more information, see also Which remote URL should I use? \- GitHub Help .RE .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-list.1000066400000000000000000000043331322121161600172260ustar00rootroot00000000000000'\" t .\" Title: zplug-list .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/03/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-LIST" "1" "12/03/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-list \- List installed packages .SH "SYNOPSIS" .sp .nf \fIzplug list\fR [\-\-select] [\fI"username/reponame"\fR] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp List installed packages\&. .SH "OPTIONS" .PP \fB\-\-select\fR .RS 4 List package information chosen from the list\&. .RE .SH "EXAMPLES" .sp List: .sp .if n \{\ .RS 4 .\} .nf $ zplug list zplug/zplug => nil /Users/b4b4r07/\&.modules => from:local, use:*\&.sh b4b4r07/zsh\-gomi => as:command, use:bin/gomi glidenote/hub\-zsh\-completion => nil peco/peco => as:command, from:gh\-r, frozen:1 so\-fancy/diff\-so\-fancy => as:command, use:diff\-so\-fancy b4b4r07/zgit => as:command, use:bin, on:junegunn/fzf\-bin ~/enhancd => use:init\&.sh, from:local Jxck/dotfiles => as:command, use:bin/l mrowa44/emojify => as:command .fi .if n \{\ .RE .\} .sp List a particular package: .sp .if n \{\ .RS 4 .\} .nf $ zplug list \'mrowa44/emojify\' mrowa44/emojify => as:command .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-load.1000066400000000000000000000052511322121161600171720ustar00rootroot00000000000000'\" t .\" Title: zplug-load .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/01/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-LOAD" "1" "12/01/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-load \- Source installed plugins and add installed commands to `$PATH` .SH "SYNOPSIS" .sp .nf \fIzplug load\fR [\-\-verbose] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Be able to use a package that has been installed on the current shell\&. .SH "OPTIONS" .PP \fB\-\-verbose\fR .RS 4 Be verbose\&. .RE .SH "EXAMPLES" .sp Installation check: .sp .if n \{\ .RS 4 .\} .nf $ zplug load .fi .if n \{\ .RE .\} .SH "ENVIRONMENT VARIABLES" .PP \fIZPLUG_LOADFILE\fR .RS 4 Defaults to $ZPLUG_HOME/packages\&.zsh\&. This file is used to add packages from zplug on the command\-line\&. This is a useful feature when you want to isolate your zplug configurations from your \&.zshrc\&. Note that you don\(cqt need to add packages from the command line to use this feature: you can manually edit this file, and it\(cqll work just fine! .RE .PP \fIZPLUG_USE_CACHE\fR .RS 4 Defaults to true\&. If this variable is true, zplug uses a cache file to speed up the loading process\&. The cache file is located at $ZPLUG_CACHE_DIR ($ZPLUG_HOME/\&.cache by default)\&. If you want to clear the cache, please run zplug clear or do the following: .RE .sp .if n \{\ .RS 4 .\} .nf $ ZPLUG_USE_CACHE=false zplug load .fi .if n \{\ .RE .\} .PP \fIZPLUG_CACHE_DIR\fR .RS 4 Defaults to $ZPLUG_HOME/\&.cache\&. Specifies where to save the cache\&. For example, you can set this to $HOME/\&.cache/zplug/cache to follow XDG Base Directory Specification .RE .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-status.1000066400000000000000000000061741322121161600176030ustar00rootroot00000000000000'\" t .\" Title: zplug-status .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-STATUS" "1" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-status \- Check if the remote repositories are up to date .SH "SYNOPSIS" .sp .nf \fIzplug status\fR [\-\-select] [\fI"username/reponame"\fR] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Check if the remote repositories are up to date\&. .SH "OPTIONS" .PP \fB\-\-verbose\fR .RS 4 Be verbose\&. .RE .SH "EXAMPLES" .sp Check if the package is up to date: .sp .if n \{\ .RS 4 .\} .nf $ zplug status Fetching the status of packages \&.\&.\&. Packages with from:\'local\' are skipped\&. === b4b4r07/emoji\-cli (up to date) \'https://github\&.com/b4b4r07/emoji\-cli\&.git\' b4b4r07/zsh\-vimode\-visual (up to date) \'https://github\&.com/b4b4r07/zsh\-vimode\-visual\&.git\' b4b4r07/http_code (up to date) \'https://github\&.com/b4b4r07/http_code\&.git\' b4b4r07/zsh\-gomi (up to date) \'https://github\&.com/b4b4r07/zsh\-gomi\&.git\' zplug/zplug (local out of date) \'https://github\&.com/zplug/zplug\&.git\' so\-fancy/diff\-so\-fancy (local out of date) \'https://github\&.com/so\-fancy/diff\-so\-fancy\&.git\' zsh\-users/zaw (up to date) \'https://github\&.com/zsh\-users/zaw\&.git\' stedolan/jq (up to date) \'https://github\&.com/stedolan/jq/releases\' peco/peco (up to date) \'https://github\&.com/peco/peco/releases\' junegunn/fzf\-bin (local out of date) \'https://github\&.com/junegunn/fzf\-bin/releases\' b4b4r07/zgit (up to date) \'https://github\&.com/b4b4r07/zgit\&.git\' Jxck/dotfiles (local out of date) \'https://github\&.com/Jxck/dotfiles\&.git\' mrowa44/emojify (up to date) \'https://github\&.com/mrowa44/emojify\&.git\' === Finished 6\&.323036 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug-update.1000066400000000000000000000047231322121161600175400ustar00rootroot00000000000000'\" t .\" Title: zplug-update .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/22/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-UPDATE" "1" "12/22/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-update \- Update installed packages in parallel .SH "SYNOPSIS" .sp .nf \fIzplug update\fR [\-\-force] [\-\-select [\fI"username/reponame"\fR]] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp Update installed packages and zplug by itself\&. .SH "OPTIONS" .PP \fB\-\-select\fR .RS 4 Choose the package that is not updated from the list and update it\&. .RE .PP \fB\-\-force\fR .RS 4 Forcibly\&. To update as it is frozen repo without confirmation .RE .SH "EXAMPLES" .sp Update: .sp .if n \{\ .RS 4 .\} .nf $ zplug update Updating\&.\&.\&. mollifier/zload Updating\&.\&.\&. stedolan/jq Updating\&.\&.\&. glidenote/hub\-zsh\-completion Frozen repo junegunn/fzf\-bin (0\&.42s) Frozen repo stedolan/jq (0\&.47s) Up\-to\-date b4b4r07/http_code (2\&.29s) Up\-to\-date b4b4r07/zsh\-vimode\-visual (2\&.29s) Up\-to\-date b4b4r07/emoji\-cli (2\&.68s) Up\-to\-date mollifier/zload (2\&.69s) Updated! b4b4r07/ssh\-keyreg (2\&.84s) Updated! zsh\-users/zsh\-completions (4\&.00s) .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man1/zplug.1000066400000000000000000000405571322121161600162650ustar00rootroot00000000000000'\" t .\" Title: zplug .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/22/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG" "1" "12/22/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug \- A next\-generation plugin manager for zsh .SH "SYNOPSIS" .sp .nf \fIzplug\fR [\fI"username/reponame"\fR[, \fItag:"value"\fR[,\&...]]] [ [] [<\fIpackage\fR>]] .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp zplug is a super\-fast next\-generation plugin manager for zsh\&. zplug can manage everything including: zsh plugins, UNIX commands, Gist files, GitHub Releases, local plugins and so on\&. Unlike antigen, zplug requires no ZSH plugin file (*\&.plugin\&.zsh)\&. It\(cqs such a fantabulous piece of software\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Can manage everything .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Zsh plugins/UNIX commands on GitHub, Gitlab and Bitbucket .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Gist file (gist\&.github\&.com) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Third\-party sources e\&.g\&., oh\-my\-zsh and prezto plugins/themes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Binary artifacts on GitHub Releases .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Local plugins .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} etc\&. (you can add your own sources!) .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Super\-fast parallel installation/update .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Support for lazy\-loading .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Branch/tag/commit support .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Post\-update, post\-load hooks .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Dependencies between packages .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Unlike antigen, no ZSH plugin file (*\&.plugin\&.zsh) required .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Interactive interface (fzf, peco, zaw, and so on) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Cache mechanism for reducing the startup time .RE .SH "OPTIONS" .PP \fB\-\-help\fR .RS 4 Print the synopsis and a list of all available commands\&. .RE .PP \fB\-\-version\fR .RS 4 Print zplug\(cqs version\&. .RE .PP \fB\-\-log\fR .RS 4 Show the error log\&. .RE .SH "COMMANDS" .PP \fBcheck\fR [\-\-verbose] [\fIpackage\fR] .RS 4 Check whether there is at least one item that\(cqs not installed\&. If \fIpackage\fR (username/reponame) is given, check if \fIpackage\fR is installed\&. If the \-\-verbose option is given, print extra debugging information\&. .RE .PP \fBclean\fR [\-\-force] [\-\-select] [\fIpackage\fR] .RS 4 Remove unused packages that are in $ZPLUG_HOME/repos after showing a yes/no prompt\&. If \fIpackage\fR is given, uninstall that particular \fIpackage\fR\&. If \-\-force option is given, suppress the prompt and uninstall \fIpackage\fR\&. If the \-\-select option is given, by using the filter specified in $ZPLUG_FILTER, interactively select the \fIpackage\fR you want to uninstall\&. .RE .PP \fBclear\fR .RS 4 Remove the cache file\&. .RE .PP \fBinstall\fR [\fIpackage\fR] .RS 4 Install \fIpackage\fR\&. .RE .PP \fBlist\fR [\-\-verbose] [\-\-select] [\fIpackage\fR] .RS 4 List installed packages\&. \-\-select do the same as what\(cqs described above\&. .RE .PP \fBload\fR [\-\-verbose] .RS 4 Load packages\&. All packages registered with \fIas:plugin\fR are sourced into the current zsh process, and its parent directory is added to $fpath\&. In addition, all packages with \fIas:command\fR are linked to $ZPLUG_HOME/bin and the bin directory is added to $PATH\&. \-\-verbose does the same as what\(cqs described above\&. .RE .PP \fBinfo\fR .RS 4 Show the information such as source URL and tag values of the \fIpackage\fR\&. .RE .PP \fBstatus\fR [\-\-select] .RS 4 Fetch the newest version of the installed packages by zplug\&. \-\-select does the same as what\(cqs described above\&. .RE .PP \fBupdate\fR [\-\-select] [\-\-force] [\fIpackage\fR] .RS 4 Update \fIpackage\fR\&. If no package is given, updates all registered packages\&. \-\-select does the same as what\(cqs described above\&. .RE .SH "TAGS" .sp Values \fItruthy\fR and \fIfalsy\fR mean any of "true, yes, on, 1" and "false, no, off, 0", respectively\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug list of available tags .TS allbox tab(:); ltB ltB ltB ltB. T{ Tag T}:T{ Description T}:T{ Value (default) T}:T{ Example T} .T& lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp \fBas\fR T}:T{ .sp Whether to register the package as commands or as plugins T}:T{ .sp plugin,command,theme (plugin) T}:T{ .sp as:command T} T{ .sp \fBuse\fR T}:T{ .sp Specify the pattern of the files to source (for plugin) or the relative path from the package root of the file to add to $PATH (for command) / Useful, for example, with from:gh\-r you can specify use:"*darwin*{amd,386}*" and so on\&. If you want to use extended glob, see later section for setting the zstyle\&. T}:T{ .sp \fBglob\fR (use:"*\&.zsh") T}:T{ .sp use:bin,use:"*\&.sh", use:"*darwin*" T} T{ .sp \fBfrom\fR T}:T{ .sp Specify the service from which you install T}:T{ .sp github,gitlab,bitbucket,gh\-r,gist, oh\-my\-zsh,prezto,local (github) T}:T{ .sp from:gh\-r T} T{ .sp \fBat\fR T}:T{ .sp Branch, tag, or commit to use T}:T{ .sp \fBrevision\fR (master) T}:T{ .sp at:v1\&.5\&.6 T} T{ .sp \fBrename\-to\fR T}:T{ .sp Specify the filename you want to rename to (only valid with as:command) T}:T{ .sp \fBfilename\fR (\-) T}:T{ .sp rename\-to:fzf T} T{ .sp \fBdir\fR T}:T{ .sp Installation directory which is managed by zplug T}:T{ .sp \fBREAD ONLY\fR T}:T{ .sp dir:/path/to/user/repo T} T{ .sp \fBif\fR T}:T{ .sp The conditions under which to install and/or use the package T}:T{ .sp \fBcommands\fR (\-) T}:T{ .sp if:"[ \-d ~/\&.zsh ]" T} T{ .sp \fBhook\-build\fR T}:T{ .sp Commands to run after installation/update T}:T{ .sp \fBcommands\fR (\-) T}:T{ .sp hook\-build:"make install" T} T{ .sp \fBhook\-load\fR T}:T{ .sp Commands to run after loading T}:T{ .sp \fBcommands\fR (\-) T}:T{ .sp hook\-load:"echo \'Boo!\'" T} T{ .sp \fBfrozen\fR T}:T{ .sp Do not update unless explicitly specified T}:T{ .sp truthy,falsy (no) T}:T{ .sp frozen:true T} T{ .sp \fBon\fR T}:T{ .sp Dependencies T}:T{ .sp \fBpackage\fR (\-) T}:T{ .sp on:user/repo T} T{ .sp \fBlazy\fR T}:T{ .sp Lazy\-load T}:T{ .sp \fBtruthy,falsy\fR (no) T}:T{ .sp lazy:true T} T{ .sp \fBdepth\fR T}:T{ .sp The number of commits to include in the cloned repository\&. 0 means the whole history\&. T}:T{ .sp Any non\-negative integer T}:T{ .sp depth:10 T} T{ .sp T}:T{ .sp \fBdefer\fR T}:T{ .sp Defers the loading of a package\&. If the value is 2 or above, zplug will source the plugin after compinit (see also #26) T}:T{ .sp 0\&.\&.3 (0) T} T{ .sp defer:2 T}:T{ .sp \fBignore\fR T}:T{ .sp Similar to use, but specify exception pattern of files that you don\(cqt want to load (see also #56) T}:T{ .sp \fBglob\fR (\-) T} .TE .sp 1 .sp You can register packages for zplug from the command line\&. If you use zplug on the command line, you can take advantage of the command line completions\&. When using this method, zplug writes out the package settings to $ZPLUG_LOADFILE\&. If you launch a new zsh process, zplug load command will automatically use this file\&. Note that you can also use $ZPLUG_LOADFILE to isolate your zplug package listing from your \&.zshrc\&. .SH "ENVIRONMENT VARIABLES" .sp Various zplug commands use the following environment variables: .PP \fIZPLUG_HOME\fR .RS 4 Defaults to ~/\&.zplug\&. zplug will store/load plugins in this directory\&. The directory structure is below\&. .RE .sp .if n \{\ .RS 4 .\} .nf $ZPLUG_HOME |\-\- bin | `\-\- some_command \-> \&.\&./repos/username_A/reponame1/some_command `\-\- repos |\-\- username_A | |\-\- reponame1 | | |\-\- README\&.md | | `\-\- some_command | `\-\- reponame2 | |\-\- README\&.md | `\-\- some_plugin\&.zsh `\-\- username_B `\-\- reponame1 .fi .if n \{\ .RE .\} .sp If you specify \fIas:command\fR when registering the package, zplug will recognize the plugin as a command and create a symbolic link of the same name (if you want to rename it, use rename\-to) in $ZPLUG_HOME/bin\&. Because zplug adds $ZPLUG_HOME/bin to the $PATH, you can run that command from anywhere just like any other commands\&. .PP \fIZPLUG_THREADS\fR .RS 4 The maximum number of threads zplug should use when installing/updating\&. The default value is 16\&. .RE .PP \fIZPLUG_PROTOCOL\fR .RS 4 Defaults to HTTPS\&. Valid options for $ZPLUG_PROTOCOL are HTTPS or SSH\&. Unless you have a specific reason, you should use the HTTPS protocol\&. For more information, see also Which remote URL should I use? \- GitHub Help .RE .PP \fIZPLUG_FILTER\fR .RS 4 Defaults to fzf\-tmux:fzf:peco:percol:zaw\&. When \-\-select option is specified in a subcommand, starting from the first element of the colon\-separated list, whatever filter found will be used by zplug as the interactive filter\&. The ZPLUG_FILTER also accepts arguments (e\&.g\&. fzf\-tmux \-d "10%":/path/to/peco:my peco)\&. .RE .PP \fIZPLUG_LOADFILE\fR .RS 4 Defaults to $ZPLUG_HOME/packages\&.zsh\&. This file is used to add packages from zplug on the command\-line\&. This is a useful feature when you want to isolate your zplug configurations from your \&.zshrc\&. Note that you don\(cqt need to add packages from the command line to use this feature: you can manually edit this file, and it\(cqll work just fine! .RE .PP \fIZPLUG_USE_CACHE\fR .RS 4 Defaults to true\&. If this variable is true, zplug uses a cache file to speed up the loading process\&. The cache file is located at $ZPLUG_CACHE_DIR ($ZPLUG_HOME/\&.cache by default)\&. If you want to clear the cache, please run zplug clear or do the following: .RE .sp .if n \{\ .RS 4 .\} .nf $ ZPLUG_USE_CACHE=false zplug load .fi .if n \{\ .RE .\} .PP \fIZPLUG_CACHE_DIR\fR .RS 4 Defaults to $ZPLUG_HOME/\&.cache\&. Specifies where to save the cache\&. For example, you can set this to $HOME/\&.cache/zplug to follow XDG Base Directory Specification .RE .PP \fIZPLUG_REPOS\fR .RS 4 Defaults to $ZPLUG_HOME/repos\&. You can change where the repositories are cloned in case you want to manage them separately\&. .RE .PP \fIZPLUG_SUDO_PASSWORD\fR .RS 4 Defaults to \'\'\&. You can set sudo password for zplug\(cqs hook\-build tag\&. However, this variable shoud not be managed in dotfiles and so on\&. .RE .sp .if n \{\ .RS 4 .\} .nf # your \&.zshrc source ~/\&.zshrc_secret zplug "some/command", hook\-build:"make && sudo make install" .fi .if n \{\ .RE .\} .SH "USING ZSTYLE" .sp You can use zstyle to change the default values for each tag\&. The format is: zstyle ":zplug:tag" tag_name new_default_value\&. For example, if you have a lot of commands and not so many plugins, (i\&.e\&. if you find yourself specifying as:command often), you can do: zstyle ":zplug:tag" as command\&. .sp You can also specify what options to enable in sub shells\&. Sub shells are used when expanding glob expressions\&. If you want to use the \fIextended_glob\fR for example, you can do: zstyle ":zplug:config:setopt" only_subshell extended_glob\&. If you set :zplug:config:setopt same_curshell to a truthy value (i\&.e\&. true, 1, yes), zplug will enable the options enabled at the point of sourcing zplug (i\&.e\&. at the point of source $ZPLUG_HOME/init\&.zsh)\&. .SH "EXTERNAL COMMANDS" .sp zplug, like \fIgit(1)\fR, supports external commands\&. These are executable scripts that reside somewhere in the PATH, named zplug\-cmdname, which can be invoked with zplug cmdname\&. This allows you to create your own commands without modifying zplug\(cqs internals\&. Instructions for creating your own commands can be found in the docs: https://github\&.com/zplug/zplug/blob/master/doc/zplug/External\-Commands\&.md Check out the sample zplug\-env external command for an example\&. .SH "CONFIGURATION" .sp Add a zplug section to your \&.zshrc (or $ZPLUG_LOADFILE): .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Register packages with the zplug command (zplug "username/reponame") .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} zplug load to source the plugins and add its commands to your $PATH .RE .sp .if n \{\ .RS 4 .\} .nf source ~/\&.zplug/zplug # Make sure you use double quotes zplug "zsh\-users/zsh\-history\-substring\-search" # Can manage a plugin as a command # And accept glob patterns (e\&.g\&., brace, wildcard, \&.\&.\&.) zplug "Jxck/dotfiles", as:command, use:"bin/{histuniq,color}" # Can manage everything e\&.g\&., other person\'s zshrc zplug "tcnksm/docker\-alias", use:zshrc # Prohibit updates to a plugin by using the "frozen:" tag zplug "k4rthik/git\-cal", as:command, frozen:1 # Grab binaries from GitHub Releases # and rename using the "rename\-to:" tag zplug "junegunn/fzf\-bin", \e as:command, \e from:gh\-r, \e rename\-to:fzf, \e use:"*darwin*amd64*" # Support oh\-my\-zsh plugins and the like zplug "plugins/git", from:oh\-my\-zsh, if:"(( $+commands[git] ))" zplug "themes/duellj", from:oh\-my\-zsh, as:theme zplug "lib/clipboard", from:oh\-my\-zsh, if:"[[ $OSTYPE == *darwin* ]]" # Also supports prezto plugins zplug "modules/osx", from:prezto, if:"[[ $OSTYPE == *darwin* ]]" zplug "modules/prompt", from:prezto # Set zstyle before zplug load zstyle \':prezto:module:prompt\' theme \'sorin\' # Run a command after a plugin is installed/updated zplug "tj/n", hook\-build:"make install" # Support checking out a specific branch/tag/commit of a plugin zplug "b4b4r07/enhancd", at:v1 zplug "mollifier/anyframe", commit:4c23cb60 # Install if "if:" tag returns true zplug "hchbaw/opp\&.zsh", if:"(( ${ZSH_VERSION%%\&.*} < 5 ))" # Can manage gist file just like other plugins zplug "b4b4r07/79ee61f7c140c63d2786", \e as:command, \e from:gist, \e use:get_last_pane_path\&.sh # Support bitbucket zplug "b4b4r07/hello_bitbucket", \e as:command, \e from:bitbucket, \e hook\-build:"chmod 755 *\&.sh", \e use:"*\&.sh" # Support Gitlab zplug "willemmali-sh/chegit", \e as:command, \e from:gitlab # Group dependencies, emoji\-cli depends on jq in this example zplug "stedolan/jq", \e as:command, \e from:gh\-r \e rename\-to:jq, \e on:"b4b4r07/emoji\-cli" # Defers the loading of a package # e\&.g\&., zsh\-syntax\-highlighting must be loaded # after executing compinit command and sourcing other plugins zplug "zsh\-users/zsh\-syntax\-highlighting", defer:3 # Can manage local plugins zplug "~/\&.zsh", from:local # Load theme file zplug \'dracula/zsh\', as:theme # Install plugins if there are plugins that have not been installed if ! zplug check \-\-verbose; then printf "Install? [y/N]: " if read \-q; then echo; zplug install fi fi # Then, source plugins and add commands to $PATH zplug load \-\-verbose .fi .if n \{\ .RE .\} .sp Finally, use zplug install to install your plugins and reload \&.zshrc\&. .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/000077500000000000000000000000001322121161600150335ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_CACHE_FILE.5000077700000000000000000000000001322121161600227062../man1/zplug-load.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_CLONE_DEPTH.5000077700000000000000000000000001322121161600222122zplug-depth.5ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_FILTER.5000077700000000000000000000000001322121161600213542../man1/zplug.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_HOME.5000077700000000000000000000000001322121161600211172../man1/zplug.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_LOADFILE.5000077700000000000000000000000001322121161600224632../man1/zplug-load.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_PROTOCOL.5000077700000000000000000000000001322121161600232742../man1/zplug-install.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_ROOT.5000077700000000000000000000000001322121161600211522../man1/zplug.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_THREADS.5000077700000000000000000000000001322121161600231252../man1/zplug-install.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/ZPLUG_USE_CACHE.5000077700000000000000000000000001322121161600226232../man1/zplug-load.1ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/zplug-as.5000066400000000000000000000046101322121161600166640ustar00rootroot00000000000000'\" t .\" Title: zplug-as .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-AS" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-as \- Specify whether to register the package as plugins or commands .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIas:plugin\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using as tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug as tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp plugin, command, theme T}:T{ .sp plugin T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" as command .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp As a plugin: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd", \e as:plugin, \e use:enhancd\&.sh .fi .if n \{\ .RE .\} .sp As a command: .sp .if n \{\ .RS 4 .\} .nf $ zplug "stedolan/jq" \e as:command, \e from:gh\-r, \e use:"*darwin*" .fi .if n \{\ .RE .\} .sp As a theme: .sp .if n \{\ .RS 4 .\} .nf $ zplug \'themes/apple\', \e as:theme, \e from:oh\-my\-zsh .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-at.5000066400000000000000000000043101322121161600166620ustar00rootroot00000000000000'\" t .\" Title: zplug-at .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-AT" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-at \- Branch, tag, or commit to use .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIat:v2\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using at tag, you can choose the revision (branch/tag/commit) you want to try/lock\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug at tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (revision) T}:T{ .sp master T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" at develop .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Branch lock: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd", \e as:plugin, \e use:enhancd\&.sh, \e at:develop .fi .if n \{\ .RE .\} .sp Revision lock: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd", \e as:plugin, \e use:enhancd\&.sh, \e at:22d124b .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-commit.5000077700000000000000000000000001322121161600213742zplug-at.5ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/zplug-defer.5000066400000000000000000000041051322121161600173450ustar00rootroot00000000000000'\" t .\" Title: zplug-defer .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/03/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-DEFER" "5" "12/03/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-defer \- Defers the loading of a package .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIdefer:1\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using defer tag, you can set the priority of loading the packages\&. If the value is 2 or above, zplug will source the plugin after compinit\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug defer tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp 0\&.\&.3 T}:T{ .sp 0 T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" defer 1 .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Priority: .sp .if n \{\ .RS 4 .\} .nf $ zplug "~/\&.zsh", \e as:plugin, \e defer:1 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-depth.5000066400000000000000000000042251322121161600173670ustar00rootroot00000000000000'\" t .\" Title: zplug-depth .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-DEPTH" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-depth \- The number of commits to include in the cloned repository .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIdepth:10\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using depth tag, you can create a shallow clone with a history truncated to the specified number of commits\&. Depth 0 means the whole history\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug detph tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (non\-negative number) T}:T{ .sp 0 T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" depth 10 .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Shallow clone: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd", \e as:plugin, \e use:enhancd\&.sh \e depth:1 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-dir.5000066400000000000000000000033351322121161600170420ustar00rootroot00000000000000'\" t .\" Title: zplug-dir .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-DIR" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-dir \- Installation directory which is managed by zplug .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp READ ONLY .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug detph tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (READ ONLY) T}:T{ .sp $ZPLUG_HOME/repos/user/repo T} .TE .sp 1 .SH "EXAMPLES" .sp \fB(None)\fR .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-do.5000077700000000000000000000000001322121161600221372zplug-hook-build.5ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/zplug-from.5000066400000000000000000000046671322121161600172400ustar00rootroot00000000000000'\" t .\" Title: zplug-from .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-FROM" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-from \- Specify the service from which you install .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIfrom:plugin\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using from tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug from tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp github, gitlab, bitbucket, gh\-r, gist, oh\-my\-zsh, local T}:T{ .sp github T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" from local .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Install from oh\-my\-zsh: .sp .if n \{\ .RS 4 .\} .nf $ zplug "plugins/git", \e as:plugin, \e from:oh\-my\-zsh .fi .if n \{\ .RE .\} .sp Install from gist: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/79ee61f7c140c63d2786" \e as:command, \e from:gist .fi .if n \{\ .RE .\} .sp Install from local: .sp .if n \{\ .RS 4 .\} .nf $ zplug "~/\&.zsh/plugins/brew" \e from:local, \e use:"*\&.sh" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-frozen.5000066400000000000000000000045431322121161600175710ustar00rootroot00000000000000'\" t .\" Title: zplug-frozen .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-FROZEN" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-frozen \- Do not update unless explicitly specified .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIfrozen:yes\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using frozen tag, you cant skip update of the repo when executing zplug command\&. In particular, this tag is particularly useful if you can describe the package with from:gh\-r tag since it\(cqs so heavy\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug frozen tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (truthy, falsy) T}:T{ .sp no T} .TE .sp 1 .sp Values \fItruthy\fR and \fIfalsy\fR mean any of "true, yes, on, 1" and "false, no, off, 0", respectively\&. .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" frozen true .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Skip the update: .sp .if n \{\ .RS 4 .\} .nf $ zplug "stedolan/jq" \e as:command, \e from:gh\-r, \e use:"*darwin*", \e frozen:1, \e .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR, \fBzplug\-update(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-hook-build.5000066400000000000000000000043711322121161600203220ustar00rootroot00000000000000'\" t .\" Title: zplug-hook-build .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-HOOK\-BUILD" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-hook-build \- Commands to run after installation/update .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIhook\-build:"make install"\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using hook\-build tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug hook-build tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (shell commands) T}:T{ .sp (none) T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" hook\-build "echo build" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Grant a right to execute: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/79ee61f7c140c63d2786" \e as:command, \e from:gist, \e hook\-build:"chmod 755 my_script\&.sh" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR, \fBzplug\-hook\-load(5)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-hook-load.5000066400000000000000000000043271322121161600201430ustar00rootroot00000000000000'\" t .\" Title: zplug-hook-load .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-HOOK\-LOAD" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-hook-load \- Commands to run after loading .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIhook\-load:some_command\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using hook\-load tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug hook-load tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (shell commands) T}:T{ .sp (none) T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" hook\-load "echo load" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Grant a right to execute: .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd" \e as:command, \e use:enhancd\&.sh, \e hook\-load:"builtin cd $OLDPWD" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR, \fBzplug\-hook\-build(5)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-if.5000066400000000000000000000042671322121161600166670ustar00rootroot00000000000000'\" t .\" Title: zplug-if .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-IF" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-if \- The conditions under which to install and/or use the package .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIif:(( $+commands[git] ))\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using if tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug if tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp plugin, command T}:T{ .sp plugin T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" if "[[ $OSTYPE == *darwin* ]]" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Load if the local directory exists: .sp .if n \{\ .RS 4 .\} .nf $ zplug "~/\&.zsh" \e from:local, \e use:"*\&.{sh,zsh}", \e if:"[ \-d ~/\&.zsh ]" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-ignore.5000066400000000000000000000043631322121161600175510ustar00rootroot00000000000000'\" t .\" Title: zplug-ignore .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-IGNORE" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-ignore \- Specify exception pattern of files that you don\'t want to load .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIignore:plugin\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using ignore tag, you can choose whether the package you want to install will be installed ignore the plugin or ignore the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug ignore tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (glob patterns) T}:T{ .sp (none) T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" ignore "*\&.plugin\&.zsh" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Ignore oh\-my\-zsh main file: .sp .if n \{\ .RS 4 .\} .nf $ zplug "plugins/brew", \e from:oh\-my\-zsh, \e if:"[[ ${(L)OSTYPE} == *darwin* ]]", \e ignore:oh\-my\-zsh\&.sh .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR, \fBzplug\-use(5)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-lazy.5000066400000000000000000000042341322121161600172420ustar00rootroot00000000000000'\" t .\" Title: zplug-lazy .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-LAZY" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-lazy \- Lazy\-load .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIlazy:on\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using lazy tag, you can choose whether the package you want to install will be installed as the plugin or as the command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug lazy tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (truthy, falsy) T}:T{ .sp no T} .TE .sp 1 .sp Values \fItruthy\fR and \fIfalsy\fR mean any of "true, yes, on, 1" and "false, no, off, 0", respectively\&. .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" lazy yes .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Lazy\-loading: .sp .if n \{\ .RS 4 .\} .nf $ zplug "foo/bar" \e from:bitbucket, \e lazy:1, \e .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-of.5000077700000000000000000000000001322121161600207002zplug-use.5ustar00rootroot00000000000000zplug-2.4.2/doc/man/man5/zplug-on.5000066400000000000000000000042221322121161600166740ustar00rootroot00000000000000'\" t .\" Title: zplug-on .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-ON" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-on \- Dependencies .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIon:another_user/another_repo\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using on tag, you can manage the repository dependencies\&. zplug "a/b", on:"c/d" means that \fBa/b\fR depends on \fBc/d\fR\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug on tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (package) T}:T{ .sp (none) T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" on "~/\&.zsh" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Group dependencies: .sp .if n \{\ .RS 4 .\} .nf $ zplug "stedolan/jq", \e from:gh\-r \e as:command, \e rename\-to:jq $ zplug "b4b4r07/emoji\-cli", \e on:"stedolan/jq" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-rename-to.5000066400000000000000000000045001322121161600201460ustar00rootroot00000000000000'\" t .\" Title: zplug-rename-to .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 12/28/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-RENAME\-TO" "5" "12/28/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-rename-to \- Specify the filename you want to rename to .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIrename\-to:a\&.sh\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using rename\-to tag, you can rename the package to what you want to change\&. It\(cqs only valid with as:command\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug rename-to tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (rename) T}:T{ .sp (none) T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value but it\(cqs impractical\&. .SH "EXAMPLES" .sp Rename fzf\-bin to fzf: .sp .if n \{\ .RS 4 .\} .nf $ zplug \'junegunn/fzf\-bin\', \e from:gh\-r, \e as:command, \e rename\-to:fzf, \e use:\'*darwin*amd64*\' .fi .if n \{\ .RE .\} .sp Rename a command with the string captured with use tag .sp .if n \{\ .RS 4 .\} .nf zplug \'b4b4r07/httpstat\', \e as:command, \e use:\'(*)\&.sh\', \e rename\-to:\'$1\' .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/man/man5/zplug-use.5000066400000000000000000000047751322121161600170710ustar00rootroot00000000000000'\" t .\" Title: zplug-use .\" Author: [see the "Authors" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 11/21/2016 .\" Manual: ZPLUG Manual .\" Source: ZPLUG Manual .\" Language: English .\" .TH "ZPLUG\-USE" "5" "11/21/2016" "ZPLUG Manual" "ZPLUG Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zplug-use \- Specify the pattern of the files to source or add to `$PATH` .SH "SYNOPSIS" .sp .nf \fIzplug\fR \fI"username/reponame"\fR, \fIuse:plugin\fR .fi .sp .nf The word \'package\' refers to the string in the format: "username/reponame"\&. .fi .SH "DESCRIPTION" .sp By using use tag, you can choose files that you want to load\&. Specify the pattern of the files to source (for plugin) or the relative path from the package root of the file to add to $PATH (for command) / Useful, for example, with from:gh\-r you can specify use:"*darwin*{amd,386}*" and so on\&. If you want to use extended glob, see later section for setting the zstyle\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&zplug use tag .TS allbox tab(:); ltB ltB. T{ Possive Values T}:T{ Default value T} .T& lt lt. T{ .sp (file patterns) T}:T{ .sp *\&.zsh T} .TE .sp 1 .sp Besides, by using zstyle command, you can change default value: .sp .if n \{\ .RS 4 .\} .nf $ zstyle ":zplug:tag" use "*\&.sh" .fi .if n \{\ .RE .\} .SH "EXAMPLES" .sp Case of : .sp .if n \{\ .RS 4 .\} .nf $ zplug "b4b4r07/enhancd" \e as:plugin, \e use:"*\&.sh" .fi .if n \{\ .RE .\} .sp Case of GitHub Release: .sp .if n \{\ .RS 4 .\} .nf $ zplug "peco/peco" \e as:command, \e from:gh\-r, \e use:"*darwin*" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzplug(1)\fR .SH "FURTHER DOCUMENTATION" .sp See the references in official wiki page to get started using zplug\&. The wiki may perhaps be overwhelming for first\-time users\&. .SH "AUTHORS" .sp zplug was originally written by Masaki Ishiyama (a\&.k\&.a @b4b4r07)\&. Many people have contributed to it\&. .SH "COPYING" .sp Copyright (C) 2015\-2016 Masaki Ishiyama .sp MIT License .SH "REPORTING BUGS" .sp Report bugs to the zplug issues zplug-2.4.2/doc/txt/000077500000000000000000000000001322121161600142375ustar00rootroot00000000000000zplug-2.4.2/doc/txt/zplug-as.txt000066400000000000000000000032371322121161600165470ustar00rootroot00000000000000zplug-as(5) =========== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-as - Specify whether to register the package as plugins or commands SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'as:plugin' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `as` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug as tag [options="header"] |======================================= | Possive Values | Default value | plugin, command, theme | plugin |======================================= Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" as command ------------ EXAMPLES -------- As a plugin: ------------ $ zplug "b4b4r07/enhancd", \ as:plugin, \ use:enhancd.sh ------------ As a command: ------------ $ zplug "stedolan/jq" \ as:command, \ from:gh-r, \ use:"*darwin*" ------------ As a theme: ------------ $ zplug 'themes/apple', \ as:theme, \ from:oh-my-zsh ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-at.txt000066400000000000000000000027521322121161600165510ustar00rootroot00000000000000zplug-at(5) =========== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-at - Branch, tag, or commit to use SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'at:v2' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `at` tag, you can choose the revision (branch/tag/commit) you want to try/lock. .zplug at tag [options="header"] |================================ | Possive Values | Default value | `(revision)` | master |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" at develop ------------ EXAMPLES -------- Branch lock: ------------ $ zplug "b4b4r07/enhancd", \ as:plugin, \ use:enhancd.sh, \ at:develop ------------ Revision lock: ------------ $ zplug "b4b4r07/enhancd", \ as:plugin, \ use:enhancd.sh, \ at:22d124b ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-check.txt000066400000000000000000000031211322121161600172110ustar00rootroot00000000000000zplug-check(1) ============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-check - Return true if all packages are installed, false otherwise SYNOPSIS -------- [verse] 'zplug check' [--verbose] ['"username/reponame"'] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- It's possible to confirm whether the package is installed. Besides, if no packages are given as the arguments, check command checks whether there is a package that has not been installed. OPTIONS ------- *--verbose*:: Be verbose. EXAMPLES -------- Installation check: ------------ if ! zplug check --verbose; then printf "Install? [y/N]: " if read -q; then echo; zplug install fi fi ------------ The above code means that the packages will be installed if there is a package that has not been installed. Installation check from CLI: ------------ $ zplug check --verbose 'some_author/some_repo' - some_author/some_repo: not installed ------------ SEE ALSO -------- *zplug(1)*, *zplug-status(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-clean.txt000066400000000000000000000032101322121161600172150ustar00rootroot00000000000000zplug-clean(1) ============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-clean - Remove repositories which are no longer managed SYNOPSIS -------- [verse] 'zplug clean' [--force] [--select] ['"username/reponame"'] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Remove the packages that is installed in the *$ZPLUG_HOME/repos* directory but not described in your *.zshrc* or config file for zplug. Otherwise, remove the packages you want to uninstall expressly. OPTIONe ------- *--force*:: Forcibly. By default, to confirm whether you want to delete by yes/no prompt. *--select*:: Remove to choose from the list of installed packages. EXAMPLES -------- Remove the packages that is installed but not described with the prompt: ------------ $ zplug clean ------------ Same as above, without the prompt: ------------ $ zplug clean --force ------------ Remove a particular package: ------------ $ zplug clean 'some_author/some_repo' Remove? (y/N) '~/.zplug/repos/some_author/some_repo' ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-clear.txt000066400000000000000000000017461322121161600172350ustar00rootroot00000000000000zplug-clear(1) ============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-clear - Remove the cache file SYNOPSIS -------- [verse] 'zplug clear' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Remove the cache file. OPTIONS ------- *(None)*:: no options EXAMPLES -------- Remove the cache file: ------------ $ zplug clear ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-defer.txt000066400000000000000000000026141322121161600172270ustar00rootroot00000000000000zplug-defer(5) ============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-defer - Defers the loading of a package SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'defer:1' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `defer` tag, you can set the priority of loading the packages. If the value is 2 or above, zplug will source the plugin after `compinit`. .zplug defer tag [options="header"] |================================ | Possive Values | Default value | 0..3 | 0 |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" defer 1 ------------ EXAMPLES -------- Priority: ------------ $ zplug "~/.zsh", \ as:plugin, \ defer:1 ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-depth.txt000066400000000000000000000027211322121161600172450ustar00rootroot00000000000000zplug-depth(5) ============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-depth - The number of commits to include in the cloned repository SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'depth:10' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `depth` tag, you can create a shallow clone with a history truncated to the specified number of commits. Depth 0 means the whole history. .zplug detph tag [options="header"] |================================ | Possive Values | Default value | (non-negative number) | 0 |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" depth 10 ------------ EXAMPLES -------- Shallow clone: ------------ $ zplug "b4b4r07/enhancd", \ as:plugin, \ use:enhancd.sh \ depth:1 ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-dir.txt000066400000000000000000000021231322121161600167130ustar00rootroot00000000000000zplug-dir(5) ============ Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-dir - Installation directory which is managed by zplug SYNOPSIS -------- [verse] 'zplug' '"username/reponame"' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- `READ ONLY` .zplug detph tag [options="header"] |================================ | Possive Values | Default value | (READ ONLY) | `$ZPLUG_HOME/repos/user/repo` |================================ EXAMPLES -------- *(None)* SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-from.txt000066400000000000000000000034601322121161600171050ustar00rootroot00000000000000zplug-from(5) ============= Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-from - Specify the service from which you install SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'from:plugin' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `from` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug from tag [options="header"] |========================================================================= | Possive Values | Default value | github, gitlab, bitbucket, gh-r, gist, oh-my-zsh, local | github |========================================================================= Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" from local ------------ EXAMPLES -------- Install from oh-my-zsh: ------------ $ zplug "plugins/git", \ as:plugin, \ from:oh-my-zsh ------------ Install from gist: ------------ $ zplug "b4b4r07/79ee61f7c140c63d2786" \ as:command, \ from:gist ------------ Install from local: ------------ $ zplug "~/.zsh/plugins/brew" \ from:local, \ use:"*.sh" ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-frozen.txt000066400000000000000000000032151322121161600174430ustar00rootroot00000000000000zplug-frozen(5) =============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-frozen - Do not update unless explicitly specified SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'frozen:yes' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `frozen` tag, you cant skip update of the repo when executing `zplug command`. In particular, this tag is particularly useful if you can describe the package with `from:gh-r` tag since it's so heavy. .zplug frozen tag [options="header"] |================================ | Possive Values | Default value | (truthy, falsy) | no |================================ Values 'truthy' and 'falsy' mean any of "true, yes, on, 1" and "false, no, off, 0", respectively. Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" frozen true ------------ EXAMPLES -------- Skip the update: ------------ $ zplug "stedolan/jq" \ as:command, \ from:gh-r, \ use:"*darwin*", \ frozen:1, \ ------------ SEE ALSO -------- *zplug(1)*, *zplug-update(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-hook-build.txt000066400000000000000000000030541322121161600201760ustar00rootroot00000000000000zplug-hook-build(5) =================== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-hook-build - Commands to run after installation/update SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'hook-build:"make install"' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `hook-build` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug hook-build tag [options="header"] |================================ | Possive Values | Default value | (shell commands)| (none) |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" hook-build "echo build" ------------ EXAMPLES -------- Grant a right to execute: ------------ $ zplug "b4b4r07/79ee61f7c140c63d2786" \ as:command, \ from:gist, \ hook-build:"chmod 755 my_script.sh" ------------ SEE ALSO -------- *zplug(1)*, *zplug-hook-load(5)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-hook-load.txt000066400000000000000000000030121322121161600200100ustar00rootroot00000000000000zplug-hook-load(5) ================== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-hook-load - Commands to run after loading SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'hook-load:some_command' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `hook-load` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug hook-load tag [options="header"] |================================ | Possive Values | Default value | (shell commands)| (none) |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" hook-load "echo load" ------------ EXAMPLES -------- Grant a right to execute: ------------ $ zplug "b4b4r07/enhancd" \ as:command, \ use:enhancd.sh, \ hook-load:"builtin cd $OLDPWD" ------------ SEE ALSO -------- *zplug(1)*, *zplug-hook-build(5)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-if.txt000066400000000000000000000027611322121161600165430ustar00rootroot00000000000000zplug-if(5) =========== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-if - The conditions under which to install and/or use the package SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'if:(( $+commands[git] ))' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `if` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug if tag [options="header"] |================================ | Possive Values | Default value | plugin, command | plugin |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" if "[[ $OSTYPE == *darwin* ]]" ------------ EXAMPLES -------- Load if the local directory exists: ------------ $ zplug "~/.zsh" \ from:local, \ use:"*.{sh,zsh}", \ if:"[ -d ~/.zsh ]" ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-ignore.txt000066400000000000000000000030411322121161600174200ustar00rootroot00000000000000zplug-ignore(5) =============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-ignore - Specify exception pattern of files that you don't want to load SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'ignore:plugin' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `ignore` tag, you can choose whether the package you want to install will be installed ignore the plugin or ignore the command. .zplug ignore tag [options="header"] |================================ | Possive Values | Default value | (glob patterns) | (none) |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" ignore "*.plugin.zsh" ------------ EXAMPLES -------- Ignore oh-my-zsh main file: ------------ $ zplug "plugins/brew", \ from:oh-my-zsh, \ if:"[[ ${(L)OSTYPE} == *darwin* ]]", \ ignore:oh-my-zsh.sh ------------ SEE ALSO -------- *zplug(1)*, *zplug-use(5)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-info.txt000066400000000000000000000027001322121161600170710ustar00rootroot00000000000000zplug-info(1) ============= Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-info - Show the information such as the source URL and tag values for the given package SYNOPSIS -------- [verse] 'zplug info' '"username/reponame"' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- List the all tags of that package and show more details. OPTIONS ------- *(None)*:: no options EXAMPLES -------- Show the information: ------------ $ zplug info b4b4r07/enhancd ==> ~/enhancd - - - - use:"init.sh" - as:"plugin" - at:"master" - ignore:"" - lazy:"no" - commit:"" - dir:"/Users/b4b4r07/enhancd" - of:"" - rename-to:"" - from:"local" - do:"" - hook-load:"" - file:"" - name:"~/enhancd" - defer:"0" - if:"" - depth:"0" - frozen:"no" - on:"" - hook-build:"" ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-install.txt000066400000000000000000000035421322121161600176110ustar00rootroot00000000000000zplug-install(1) ================ Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-install - Install packages in parallel SYNOPSIS -------- [verse] 'zplug install' ['"username/reponame"'] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Install the package that has not yet been installed, even though it is described in the file. OPTIONS ------- *(None)*:: no options EXAMPLES -------- Install all not-installed packages: ------------ $ zplug install ------------ Install a particular package verbosely: ------------ $ zplug install 'some_author/some_repo' Installing... some_author/some_repo Installed! some_author/some_repo (2.59s) ==> Installation finished successfully! zplug: total wall-time 2.664253 sec. ------------ ENVIRONMENT VARIABLES --------------------- 'ZPLUG_THREADS':: The maximum number of threads zplug should use when installing/updating. The default value is 16. 'ZPLUG_PROTOCOL':: Defaults to HTTPS. Valid options for `$ZPLUG_PROTOCOL` are `HTTPS` or `SSH`. Unless you have a specific reason, you should use the HTTPS protocol. For more information, see also https://help.github.com/articles/which-remote-url-should-i-use/[Which remote URL should I use? - GitHub Help] SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-lazy.txt000066400000000000000000000027161322121161600171240ustar00rootroot00000000000000zplug-lazy(5) ============= Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-lazy - Lazy-load SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'lazy:on' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `lazy` tag, you can choose whether the package you want to install will be installed as the plugin or as the command. .zplug lazy tag [options="header"] |================================ | Possive Values | Default value | (truthy, falsy) | no |================================ Values 'truthy' and 'falsy' mean any of "true, yes, on, 1" and "false, no, off, 0", respectively. Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" lazy yes ------------ EXAMPLES -------- Lazy-loading: ------------ $ zplug "foo/bar" \ from:bitbucket, \ lazy:1, \ ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-list.txt000066400000000000000000000031041322121161600171100ustar00rootroot00000000000000zplug-list(1) ============= Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-list - List installed packages SYNOPSIS -------- [verse] 'zplug list' [--select] ['"username/reponame"'] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- List installed packages. OPTIONS ------- *--select*:: List package information chosen from the list. EXAMPLES -------- List: ------------ $ zplug list zplug/zplug => nil /Users/b4b4r07/.modules => from:local, use:*.sh b4b4r07/zsh-gomi => as:command, use:bin/gomi glidenote/hub-zsh-completion => nil peco/peco => as:command, from:gh-r, frozen:1 so-fancy/diff-so-fancy => as:command, use:diff-so-fancy b4b4r07/zgit => as:command, use:bin, on:junegunn/fzf-bin ~/enhancd => use:init.sh, from:local Jxck/dotfiles => as:command, use:bin/l mrowa44/emojify => as:command ------------ List a particular package: ------------ $ zplug list 'mrowa44/emojify' mrowa44/emojify => as:command ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-load.txt000066400000000000000000000040601322121161600170560ustar00rootroot00000000000000zplug-load(1) ============= Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-load - Source installed plugins and add installed commands to `$PATH` SYNOPSIS -------- [verse] 'zplug load' [--verbose] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Be able to use a package that has been installed on the current shell. OPTIONS ------- *--verbose*:: Be verbose. EXAMPLES -------- Installation check: ------------ $ zplug load ------------ ENVIRONMENT VARIABLES --------------------- 'ZPLUG_LOADFILE':: Defaults to `$ZPLUG_HOME/packages.zsh`. This file is used to add packages from zplug on the command-line. This is a useful feature when you want to isolate your zplug configurations from your `.zshrc`. Note that you don't need to add packages from the command line to use this feature: you can manually edit this file, and it'll work just fine! 'ZPLUG_USE_CACHE':: Defaults to `true`. If this variable is true, zplug uses a cache file to speed up the loading process. The cache file is located at `$ZPLUG_CACHE_DIR` (`$ZPLUG_HOME/.cache` by default). If you want to clear the cache, please run `zplug clear` or do the following: ------------ $ ZPLUG_USE_CACHE=false zplug load ------------ 'ZPLUG_CACHE_DIR':: Defaults to `$ZPLUG_HOME/.cache`. Specifies where to save the cache. For example, you can set this to `$HOME/.cache/zplug/cache` to follow XDG Base Directory Specification SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-on.txt000066400000000000000000000027131322121161600165560ustar00rootroot00000000000000zplug-on(5) =========== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-on - Dependencies SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'on:another_user/another_repo' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `on` tag, you can manage the repository dependencies. `zplug "a/b", on:"c/d"` means that *a/b* depends on *c/d*. .zplug on tag [options="header"] |================================ | Possive Values | Default value | (package) | (none) |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" on "~/.zsh" ------------ EXAMPLES -------- Group dependencies: ------------ $ zplug "stedolan/jq", \ from:gh-r \ as:command, \ rename-to:jq $ zplug "b4b4r07/emoji-cli", \ on:"stedolan/jq" ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-rename-to.txt000066400000000000000000000031451322121161600200310ustar00rootroot00000000000000zplug-rename-to(5) ================== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-rename-to - Specify the filename you want to rename to SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'rename-to:a.sh' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `rename-to` tag, you can rename the package to what you want to change. It's only valid with `as:command`. .zplug rename-to tag [options="header"] |================================ | Possive Values | Default value | (rename) | (none) |================================ Besides, by using `zstyle` command, you can change default value but it's impractical. EXAMPLES -------- Rename fzf-bin to fzf: ------------ $ zplug 'junegunn/fzf-bin', \ from:gh-r, \ as:command, \ rename-to:fzf, \ use:'*darwin*amd64*' ------------ Rename a command with the string captured with `use` tag ------------ zplug 'b4b4r07/httpstat', \ as:command, \ use:'(*).sh', \ rename-to:'$1' ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-status.txt000066400000000000000000000046521322121161600174710ustar00rootroot00000000000000zplug-status(1) =============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-status - Check if the remote repositories are up to date SYNOPSIS -------- [verse] 'zplug status' [--select] ['"username/reponame"'] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Check if the remote repositories are up to date. OPTIONS ------- *--verbose*:: Be verbose. EXAMPLES -------- Check if the package is up to date: ------------ $ zplug status Fetching the status of packages ... Packages with from:'local' are skipped. === b4b4r07/emoji-cli (up to date) 'https://github.com/b4b4r07/emoji-cli.git' b4b4r07/zsh-vimode-visual (up to date) 'https://github.com/b4b4r07/zsh-vimode-visual.git' b4b4r07/http_code (up to date) 'https://github.com/b4b4r07/http_code.git' b4b4r07/zsh-gomi (up to date) 'https://github.com/b4b4r07/zsh-gomi.git' zplug/zplug (local out of date) 'https://github.com/zplug/zplug.git' so-fancy/diff-so-fancy (local out of date) 'https://github.com/so-fancy/diff-so-fancy.git' zsh-users/zaw (up to date) 'https://github.com/zsh-users/zaw.git' stedolan/jq (up to date) 'https://github.com/stedolan/jq/releases' peco/peco (up to date) 'https://github.com/peco/peco/releases' junegunn/fzf-bin (local out of date) 'https://github.com/junegunn/fzf-bin/releases' b4b4r07/zgit (up to date) 'https://github.com/b4b4r07/zgit.git' Jxck/dotfiles (local out of date) 'https://github.com/Jxck/dotfiles.git' mrowa44/emojify (up to date) 'https://github.com/mrowa44/emojify.git' === Finished 6.323036 ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-update.txt000066400000000000000000000034431322121161600174250ustar00rootroot00000000000000zplug-update(1) =============== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-update - Update installed packages in parallel SYNOPSIS -------- [verse] 'zplug update' [--force] [--select ['"username/reponame"']] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- Update installed packages and zplug by itself. OPTIONS ------- *--select*:: Choose the package that is not updated from the list and update it. *--force*:: Forcibly. To update as it is frozen repo without confirmation EXAMPLES -------- Update: ------------ $ zplug update Updating... mollifier/zload Updating... stedolan/jq Updating... glidenote/hub-zsh-completion Frozen repo junegunn/fzf-bin (0.42s) Frozen repo stedolan/jq (0.47s) Up-to-date b4b4r07/http_code (2.29s) Up-to-date b4b4r07/zsh-vimode-visual (2.29s) Up-to-date b4b4r07/emoji-cli (2.68s) Up-to-date mollifier/zload (2.69s) Updated! b4b4r07/ssh-keyreg (2.84s) Updated! zsh-users/zsh-completions (4.00s) ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug-use.txt000066400000000000000000000034401322121161600167340ustar00rootroot00000000000000zplug-use(5) ============ Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug-use - Specify the pattern of the files to source or add to `$PATH` SYNOPSIS -------- [verse] 'zplug' '"username/reponame"', 'use:plugin' The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- By using `use` tag, you can choose files that you want to load. Specify the pattern of the files to source (for `plugin`) or the relative path from the package root of the file to add to `$PATH` (for `command`) / Useful, for example, with `from:gh-r` you can specify `use:"*darwin*{amd,386}*"` and so on. If you want to use extended glob, see later section for setting the zstyle. .zplug use tag [options="header"] |================================ | Possive Values | Default value | (file patterns) | *.zsh |================================ Besides, by using `zstyle` command, you can change default value: ------------ $ zstyle ":zplug:tag" use "*.sh" ------------ EXAMPLES -------- Case of : ------------ $ zplug "b4b4r07/enhancd" \ as:plugin, \ use:"*.sh" ------------ Case of GitHub Release: ------------ $ zplug "peco/peco" \ as:command, \ from:gh-r, \ use:"*darwin*" ------------ SEE ALSO -------- *zplug(1)* Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/txt/zplug.txt000077700000000000000000000000001322121161600202512../zplug.txtustar00rootroot00000000000000zplug-2.4.2/doc/zplug.txt000066400000000000000000000334431322121161600153310ustar00rootroot00000000000000zplug(1) ======== Masaki Ishiyama b4b4r07@gmail.com :man manual: ZPLUG Manual NAME ---- zplug - A next-generation plugin manager for zsh SYNOPSIS -------- [verse] 'zplug' ['"username/reponame"'[, 'tag:"value"'[,...]]] [ [] [<'package'>]] The word 'package' refers to the string in the format: "username/reponame". DESCRIPTION ----------- zplug is a super-fast next-generation plugin manager for zsh. zplug can manage everything including: zsh plugins, UNIX commands, Gist files, GitHub Releases, local plugins and so on. Unlike antigen, zplug requires no ZSH plugin file (`*.plugin.zsh`). It's such a fantabulous piece of software. * Can manage everything ** Zsh plugins/UNIX commands on https://github.com[GitHub], https://gitlab.com[Gitlab], and https://bitbucket.org[Bitbucket] ** Gist file (https://gist.github.com[gist.github.com]) ** Third-party sources e.g., https://github.com/robbyrussell/oh-my-zsh[oh-my-zsh] and https://github.com/sorin-ionescu/prezto[prezto] plugins/themes ** Binary artifacts on https://help.github.com/articles/about-releases[GitHub Releases] ** Local plugins ** etc. (you can add your own sources!) * Super-fast parallel installation/update * Support for lazy-loading * Branch/tag/commit support * Post-update, post-load hooks * Dependencies between packages * Unlike https://github.com/zsh-users/antigen[antigen], no ZSH plugin file (*.plugin.zsh) required * Interactive interface (https://github.com/junegunn/fzf[fzf], https://github.com/peco/peco[peco], https://github.com/zsh-users/zaw[zaw], and so on) * Cache mechanism for reducing the startup time OPTIONS ------- *--help*:: Print the synopsis and a list of all available commands. *--version*:: Print zplug's version. *--log*:: Show the error log. COMMANDS -------- *check* [--verbose] ['package']:: Check whether there is at least one item that's not installed. If 'package' (username/reponame) is given, check if 'package' is installed. If the `--verbose` option is given, print extra debugging information. *clean* [--force] [--select] ['package']:: Remove unused packages that are in `$ZPLUG_HOME/repos` after showing a yes/no prompt. If 'package' is given, uninstall that particular 'package'. If `--force` option is given, suppress the prompt and uninstall 'package'. If the `--select` option is given, by using the filter specified in `$ZPLUG_FILTER`, interactively select the 'package' you want to uninstall. *clear*:: Remove the cache file. *install* ['package']:: Install 'package'. *list* [--verbose] [--select] ['package']:: List installed packages. `--select` do the same as what's described above. *load* [--verbose]:: Load packages. All packages registered with 'as:plugin' are sourced into the current zsh process, and its parent directory is added to `$fpath`. In addition, all packages with 'as:command' are linked to `$ZPLUG_HOME/bin` and the bin directory is added to `$PATH`. `--verbose` does the same as what's described above. *info* :: Show the information such as source URL and tag values of the 'package'. *status* [--select]:: Fetch the newest version of the installed packages by zplug. `--select` does the same as what's described above. *update* [--select] [--force] ['package']:: Update 'package'. If no package is given, updates all registered packages. `--select` does the same as what's described above. TAGS ---- Values 'truthy' and 'falsy' mean any of "true, yes, on, 1" and "false, no, off, 0", respectively. .zplug list of available tags [width="80%",cols="4,10,6,4",options="header"] |========================================================= |Tag |Description |Value (default) |Example |*as* | Whether to register the package as commands or as plugins | `plugin`,`command`,`theme` (`plugin`) | `as:command` |*use* | Specify the pattern of the files to source (for `plugin`) or the relative path from the package root of the file to add to `$PATH` (for `command`) / Useful, for example, with `from:gh-r` you can specify `use:"*darwin*{amd,386}*"` and so on. If you want to use extended glob, see later section for setting the zstyle. | *glob* (`use:"*.zsh"`) | `use:bin`,`use:"*.sh"`, `use:"*darwin*"` |*from* | Specify the service from which you install | `github`, `gitlab`,`bitbucket`,`gh-r`,`gist`, `oh-my-zsh`,`prezto`,`local` (`github`) | `from:gh-r` |*at* | Branch, tag, or commit to use | *revision* (`master`) | `at:v1.5.6` |*rename-to* | Specify the filename you want to rename to (only valid with `as:command`) | *filename* (-) | `rename-to:fzf` |*dir* | Installation directory which is managed by zplug | **READ ONLY** | `dir:/path/to/user/repo` |*if* | The conditions under which to install and/or use the package | *commands* (-) | `if:"[ -d ~/.zsh ]"` |*hook-build* | Commands to run after installation/update | *commands* (-) | `hook-build:"make install"` |*hook-load* | Commands to run after loading | *commands* (-) | `hook-load:"echo 'Boo!'"` |*frozen* | Do not update unless explicitly specified | truthy,falsy (no) | `frozen:true` |*on* | Dependencies | *package* (-) | `on:user/repo` |*lazy* | Lazy-load | *truthy,falsy* (no) | `lazy:true` |*depth* | The number of commits to include in the cloned repository. 0 means the whole history. | Any non-negative integer | `depth:10` | |*defer* | Defers the loading of a package. If the value is 2 or above, zplug will source the plugin after `compinit` (see also https://github.com/zplug/zplug/issues/26[#26]) | 0..3 (0) | `defer:2` |*ignore* | Similar to `use`, but specify exception pattern of files that you don't want to load (see also https://github.com/zplug/zplug/issues/56[#56]) | *glob* (-) | `ignore:"some_*.zsh"` | |========================================================= You can register packages for zplug from the command line. If you use zplug on the command line, you can take advantage of the command line completions. When using this method, zplug writes out the package settings to `$ZPLUG_LOADFILE`. If you launch a new zsh process, `zplug load` command will automatically use this file. Note that you can also use `$ZPLUG_LOADFILE` to isolate your zplug package listing from your `.zshrc`. Environment Variables --------------------- Various zplug commands use the following environment variables: 'ZPLUG_HOME':: Defaults to `~/.zplug`. zplug will store/load plugins in this directory. The directory structure is below. ------------ $ZPLUG_HOME |-- bin | `-- some_command -> ../repos/username_A/reponame1/some_command `-- repos |-- username_A | |-- reponame1 | | |-- README.md | | `-- some_command | `-- reponame2 | |-- README.md | `-- some_plugin.zsh `-- username_B `-- reponame1 ------------ If you specify 'as:command' when registering the package, zplug will recognize the plugin as a command and create a symbolic link of the same name (if you want to rename it, use `rename-to`) in `$ZPLUG_HOME/bin`. Because zplug adds `$ZPLUG_HOME/bin` to the `$PATH`, you can run that command from anywhere just like any other commands. 'ZPLUG_THREADS':: The maximum number of threads zplug should use when installing/updating. The default value is 16. 'ZPLUG_PROTOCOL':: Defaults to HTTPS. Valid options for `$ZPLUG_PROTOCOL` are `HTTPS` or `SSH`. Unless you have a specific reason, you should use the HTTPS protocol. For more information, see also https://help.github.com/articles/which-remote-url-should-i-use/[Which remote URL should I use? - GitHub Help] 'ZPLUG_FILTER':: Defaults to `fzf-tmux:fzf:peco:percol:zaw`. When `--select` option is specified in a subcommand, starting from the first element of the colon-separated list, whatever filter found will be used by zplug as the interactive filter. The `ZPLUG_FILTER` also accepts arguments (e.g. `fzf-tmux -d "10%":/path/to/peco:my peco`). 'ZPLUG_LOADFILE':: Defaults to `$ZPLUG_HOME/packages.zsh`. This file is used to add packages from zplug on the command-line. This is a useful feature when you want to isolate your zplug configurations from your `.zshrc`. Note that you don't need to add packages from the command line to use this feature: you can manually edit this file, and it'll work just fine! 'ZPLUG_USE_CACHE':: Defaults to `true`. If this variable is true, zplug uses a cache file to speed up the loading process. The cache file is located at `$ZPLUG_CACHE_DIR` (`$ZPLUG_HOME/.cache` by default). If you want to clear the cache, please run `zplug clear` or do the following: ------------ $ ZPLUG_USE_CACHE=false zplug load ------------ 'ZPLUG_CACHE_DIR':: Defaults to `$ZPLUG_HOME/.cache`. Specifies where to save the cache. For example, you can set this to `$HOME/.cache/zplug` to follow XDG Base Directory Specification 'ZPLUG_REPOS':: Defaults to `$ZPLUG_HOME/repos`. You can change where the repositories are cloned in case you want to manage them separately. 'ZPLUG_SUDO_PASSWORD':: Defaults to `''`. You can set sudo password for zplug's `hook-build` tag. However, this variable shoud not be managed in dotfiles and so on. ------------ # your .zshrc source ~/.zshrc_secret zplug "some/command", hook-build:"make && sudo make install" ------------ Using zstyle ------------ You can use zstyle to change the default values for each tag. The format is: `zstyle ":zplug:tag" tag_name new_default_value`. For example, if you have a lot of commands and not so many plugins, (i.e. if you find yourself specifying `as:command` often), you can do: `zstyle ":zplug:tag" as command`. You can also specify what options to enable in sub shells. Sub shells are used when expanding glob expressions. If you want to use the 'extended_glob' for example, you can do: `zstyle ":zplug:config:setopt" only_subshell extended_glob`. If you set `:zplug:config:setopt same_curshell` to a truthy value (i.e. `true`, `1`, `yes`), zplug will enable the options enabled at the point of sourcing zplug (i.e. at the point of `source $ZPLUG_HOME/init.zsh`). External commands ----------------- zplug, like 'git(1)', supports external commands. These are executable scripts that reside somewhere in the PATH, named zplug-cmdname, which can be invoked with `zplug cmdname`. This allows you to create your own commands without modifying zplug's internals. Instructions for creating your own commands can be found in the docs: https://github.com/zplug/zplug/blob/master/doc/zplug/External-Commands.md Check out the sample `zplug-env` external command for an example. Configuration ------------- Add a zplug section to your .zshrc (or `$ZPLUG_LOADFILE`): . Register packages with the zplug command (`zplug "username/reponame"`) . `zplug load` to source the plugins and add its commands to your `$PATH` ------------ source ~/.zplug/zplug # Make sure you use double quotes zplug "zsh-users/zsh-history-substring-search" # Can manage a plugin as a command # And accept glob patterns (e.g., brace, wildcard, ...) zplug "Jxck/dotfiles", as:command, use:"bin/{histuniq,color}" # Can manage everything e.g., other person's zshrc zplug "tcnksm/docker-alias", use:zshrc # Prohibit updates to a plugin by using the "frozen:" tag zplug "k4rthik/git-cal", as:command, frozen:1 # Grab binaries from GitHub Releases # and rename using the "rename-to:" tag zplug "junegunn/fzf-bin", \ as:command, \ from:gh-r, \ rename-to:fzf, \ use:"*darwin*amd64*" # Support oh-my-zsh plugins and the like zplug "plugins/git", from:oh-my-zsh, if:"(( $+commands[git] ))" zplug "themes/duellj", from:oh-my-zsh, as:theme zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]" # Also supports prezto plugins zplug "modules/osx", from:prezto, if:"[[ $OSTYPE == *darwin* ]]" zplug "modules/prompt", from:prezto # Set zstyle before zplug load zstyle ':prezto:module:prompt' theme 'sorin' # Run a command after a plugin is installed/updated zplug "tj/n", hook-build:"make install" # Support checking out a specific branch/tag/commit of a plugin zplug "b4b4r07/enhancd", at:v1 zplug "mollifier/anyframe", commit:4c23cb60 # Install if "if:" tag returns true zplug "hchbaw/opp.zsh", if:"(( ${ZSH_VERSION%%.*} < 5 ))" # Can manage gist file just like other plugins zplug "b4b4r07/79ee61f7c140c63d2786", \ as:command, \ from:gist, \ use:get_last_pane_path.sh # Support bitbucket zplug "b4b4r07/hello_bitbucket", \ as:command, \ from:bitbucket, \ hook-build:"chmod 755 *.sh", \ use:"*.sh" # Support Gitlab zplug "willemmali-sh/chegit", \ as:command, \ from:gitlab # Group dependencies, emoji-cli depends on jq in this example zplug "stedolan/jq", \ as:command, \ from:gh-r \ rename-to:jq, \ on:"b4b4r07/emoji-cli" # Defers the loading of a package # e.g., zsh-syntax-highlighting must be loaded # after executing compinit command and sourcing other plugins zplug "zsh-users/zsh-syntax-highlighting", defer:3 # Can manage local plugins zplug "~/.zsh", from:local # Load theme file zplug 'dracula/zsh', as:theme # Install plugins if there are plugins that have not been installed if ! zplug check --verbose; then printf "Install? [y/N]: " if read -q; then echo; zplug install fi fi # Then, source plugins and add commands to $PATH zplug load --verbose ------------ Finally, use `zplug install` to install your plugins and reload `.zshrc`. Further Documentation --------------------- See the references in https://github.com/zplug/zplug/wiki[official wiki page] to get started using zplug. The wiki may perhaps be overwhelming for first-time users. Authors ------- zplug was originally written by Masaki Ishiyama (a.k.a @b4b4r07). Many people have contributed to it. Copying ------- Copyright \(C) 2015-2016 Masaki Ishiyama MIT License Reporting Bugs -------------- Report bugs to the https://github.com/zplug/zplug/issues[zplug issues] // vim:ft=asciidoc zplug-2.4.2/doc/zplug/000077500000000000000000000000001322121161600145615ustar00rootroot00000000000000zplug-2.4.2/doc/zplug/Code-of-Conduct.md000066400000000000000000000000001322121161600177420ustar00rootroot00000000000000zplug-2.4.2/init.zsh000066400000000000000000000013221322121161600143420ustar00rootroot00000000000000#!/usr/bin/env zsh # A hash array for zplug typeset -gx -A zplugs zplugs=() # A variable as a starting point of zplug typeset -gx ZPLUG_ROOT="${${(%):-%N}:A:h}" # Load basic functions such as an __zplug::base function source "$ZPLUG_ROOT/base/init.zsh" # Load autoloader source "$ZPLUG_ROOT/autoload/init.zsh" __zplug::base "base/*" __zplug::base "core/*" __zplug::base "io/*" __zplug::base "log/*" __zplug::base "job/*" __zplug::base "sources/*" __zplug::base "utils/*" if ! __zplug::core::core::prepare; then __zplug::io::print::f \ --die \ --zplug \ --error \ "The loading of zplug was discontinued.\n" return 1 fi # Load the external file of zplug __zplug::io::file::load zplug-2.4.2/misc/000077500000000000000000000000001322121161600136065ustar00rootroot00000000000000zplug-2.4.2/misc/completions/000077500000000000000000000000001322121161600161425ustar00rootroot00000000000000zplug-2.4.2/misc/completions/_zplug000066400000000000000000000136351322121161600173750ustar00rootroot00000000000000#compdef zplug local curcontext="$curcontext" state local p desc local -i ret=1 local -a -U zplug_cmds local -a _zplug_boolean_true _zplug_boolean_false local -a cmds tags cmds=( "${(k)_zplug_commands[@]}" ) tags=( "${(k)_zplug_tags[@]}" ) _zplug_boolean_true=("true" "yes" "on" 1) _zplug_boolean_false=("false" "no" "off" 0) # Completions of zplug commands for p in "${(k)_zplug_commands[@]}" do zplug_cmds+=("$p:$_zplug_commands[$p]") done # Completions for user-defined commands for p in ${^path}/zplug-*(N-.) do desc= desc="$(grep -E "^# Desc(ription)?: ?" "$p")" regexp-replace desc "^.*[Dd]esc(ription)?: ?" "" desc="[User-defined] ${desc:-"No description."}" zplug_cmds+=("${p:t:gs:zplug-:}:$desc") done # Completions for user-defined functions for p in ${(M)${(k)functions[@]}:#zplug-*} do f=( ${^fpath[@]}/$p(N) ) desc= if [[ -f $f[1] ]]; then desc="$(grep -E "^# Desc(ription)?: ?" "$f[1]")" regexp-replace desc "^.*[Dd]esc(ription)?: ?" "" fi desc="[User-defined] ${desc:-"No description."}" zplug_cmds+=("${p:gs:zplug-:}:$desc") done _arguments \ "(-)--help[$_zplug_options[help]]: :->comp" \ "(-)--version[$_zplug_options[version]]: :" \ "(-)--log=[$_zplug_options[log]]: :->log" \ "(-)--rollback=[$_zplug_options[rollback]]: :->rollback" \ "(-)--self-manage[$_zplug_options[self-manage]]: :" \ "*:: :->comp" && return 0 if (( CURRENT == 1 )); then _describe -t commands "zplug subcommand" zplug_cmds return 0 fi case "$words[1]" in check) _arguments \ '(--verbose)--verbose[show non-installed items in output]' \ '*:: :( "${(uk)zplugs[@]:gs:@::}" )' ret=0 ;; install) _arguments \ '(--verbose)--verbose[show non-installed items in output]' \ '(--select)--select[select items with interactive filters]' \ '*:: :compadd -X "%F{green}Accept%f %Busername/reponame%b arguments"' ret=0 ;; load) _arguments \ '(--verbose)--verbose[display loading files]' ret=0 ;; status|update) _arguments \ '(--select)--select[select items with interactive filters]' \ '*:: :( "${(uk)zplugs[@]:gs:@::}" )' ret=0 ;; list) _arguments \ '(--loaded --installed)--loaded[list loaded packages]' \ '(--loaded --installed)--installed[list installed packages]' \ '(--select)--select[list packages and select them]' ret=0 ;; clean) _arguments \ '(--force --select)--force[force the removing activity]' \ '(--select --force)--select[select items with interactive filters]' \ '*:: :( "${(uk)zplugs[@]:gs:@::}" )' ret=0 ;; clear) _arguments \ '(--force)--force[force the removing activity]' ret=0 ;; info) _arguments \ '*:: :( "${(uk)zplugs[@]:gs:@::}" )' ret=0 ;; */*) if ! [[ $BUFFER =~ ", $" || $BUFFER =~ ":$" ]]; then return 0 fi _values -S : -s , "zplug tags" \ "as[$_zplug_tags[as]]:as:(plugin command theme)" \ "use[$_zplug_tags[use]]:use:->use" \ "from[$_zplug_tags[from]]:from:(gh-r gist oh-my-zsh github gitlab bitbucket local)" \ "at[$_zplug_tags[at]]:at:" \ "rename-to[$_zplug_tags[rename-to]]:rename-to:" \ "dir[$_zplug_tags[dir]]:dir:->dir" \ "if[$_zplug_tags[if]]:if:" \ "hook-build[$_zplug_tags[hook-build]]:hook-build:" \ "hook-load[$_zplug_tags[hook-load]]:hook-load:" \ "frozen[$_zplug_tags[frozen]]:frozen:->boolean" \ "on[$_zplug_tags[on]]:on:->on" \ "defer[$_zplug_tags[defer]]:defer:->defer" \ "ignore[$_zplug_tags[ignore]]:ignore:" \ "lazy[$_zplug_tags[lazy]]:lazy:->boolean" \ "depth[$_zplug_tags[depth]]:depth:({0..10})" && ret=0 case $state in on|dir) compadd -X "%F{green}READ ONLY%f %Bno arguments%b" ;; use) compadd -J 'command/plugin' -X "%F{yellow}Completing%f %BExample patterns%b" \ '*.zsh' \ '*.sh' \ 'zsh/*.zsh' \ '*.plugin.zsh' \ 'init.zsh' compadd -J 'gh-r' -X "%F{yellow}Completing%f %BGitHub Releases (example)%b" \ 'amd64' \ 'darwin*amd64' \ 'linux*amd64' \ '386' \ 'darwin*386' \ 'linux*386' \ 'darwin' \ 'linux' ;; defer) compadd -V 'default' -X "%F{yellow}Completing%f %Bpriority (default)%b" 0 compadd -V 'defer' -X "%F{yellow}Completing%f %Bpriority%b" -- 1 compadd -V 'after_compinit' -X "%F{yellow}Completing%f %Bpriority (after compinit)%b" 2 3 ;; boolean) compadd -J 'boolean/true' -X "%F{yellow}Completing%f %Btrue word%b" $_zplug_boolean_true compadd -J 'boolean/false' -X "%F{yellow}Completing%f %Bfalse word%b" $_zplug_boolean_false ;; esac return ret ;; esac case $state in "comp") _describe -t help_cmds "commands" cmds _describe -t help_tags "tags" tags ;; "log") local _log_args _log_args=( 'less' 'more' 'edit' 'clear' 'count' 'latest' ) if (( $+commands[jq] )); then _log_args+=("jq") fi _describe -t 'log' 'log' _log_args && ret=0 ;; "rollback") local _rollback_args _rollback_args=( 'build' ) _describe -t 'rollback' 'rollback' _rollback_args && ret=0 ;; esac return ret zplug-2.4.2/misc/contrib/000077500000000000000000000000001322121161600152465ustar00rootroot00000000000000zplug-2.4.2/misc/contrib/cache.awk000066400000000000000000000023041322121161600170140ustar00rootroot00000000000000BEGIN { TAGS_SEP = ", "; } { arr[NR] = reconstruct($0); } END { for (i in arr) print arr[i]; } function reconstruct(line, tags) { gsub(/, +/, TAGS_SEP, line) split(line, tags, TAGS_SEP); quick_sort(tags, 1, length(tags)); return join(tags, 1, length(tags), TAGS_SEP); } function quick_sort(array, left, right, i, j, tmp, pivot) { if (left < right) { i = left; j = right; pivot = array[int((left + right) / 2)]; while (i <= j) { while (array[i] < pivot) { i++; } while (array[j] > pivot) { j--; } if (i <= j) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; i++; j--; } } quick_sort(array, left, j); quick_sort(array, i, right); } } function join(array, start, end, sep, result, i) { if (sep == "") { sep = " "; } else if (sep == SUBSEP) { sep = ""; } result = array[start]; for (i = start + 1; i <= end; i++) { result = result sep array[i]; } return result; } zplug-2.4.2/misc/contrib/fuzzy.awk000066400000000000000000000023511322121161600171420ustar00rootroot00000000000000{ # calculates the degree of similarity if ( (1 - leven_dist($NF, search_string) / (length($NF) + length(search_string))) * 100 >= 70 ) { # When the degree of similarity of search_string is greater than or equal to 70%, # to display the candidate path print $0 } } # leven_dist returns the Levenshtein distance two text string function leven_dist(a, b) { lena = length(a); lenb = length(b); if (lena == 0) { return lenb; } if (lenb == 0) { return lena; } for (row = 1; row <= lena; row++) { m[row,0] = row } for (col = 1; col <= lenb; col++) { m[0,col] = col } for (row = 1; row <= lena; row++) { ai = substr(a, row, 1) for (col = 1; col <= lenb; col++) { bi = substr(b, col, 1) if (ai == bi) { cost = 0 } else { cost = 1 } m[row,col] = min(m[row-1,col]+1, m[row,col-1]+1, m[row-1,col-1]+cost) } } return m[lena,lenb] } # min returns the smaller of x, y or z function min(a, b, c) { result = a if (b < result) { result = b } if (c < result) { result = c } return result } zplug-2.4.2/misc/contrib/getopts.awk000066400000000000000000000025321322121161600174410ustar00rootroot00000000000000function out(k,v) { print(k "" (v == "" ? "" : " "v)) } function pop() { return len <= 0 ? "_" : opt[len--] } { if (done) { out("_" , $0) next } if (match($0, "^-[A-Za-z]+")) { $0 = "- " substr($0, 2, RLENGTH - 1) " " substr($0, RLENGTH + 1) } else if (match($0, "^--[A-Za-z0-9_-]+")) { $0 = "-- " substr($0, 3, RLENGTH - 2) " " substr($0, RLENGTH + 2) } if ($1 == "--" && $2 == "") { done = 1 } else if ($2 == "" || $1 !~ /^-|^--/ ) { out(pop(), $0) } else { while (len) { out(pop()) } if ($3 != "") { if (match($0, $2)) { $3 = substr($0, RSTART + RLENGTH + 1) } } if ($1 == "--") { if ($3 == "") { opt[++len] = $2 } else { out($2, $3) } } if ($1 == "-") { if ($2 == "") { print($1) next } else { n = split($2, keys, "") } if ($3 == "") { opt[++len] = keys[n] } else { out(keys[n], $3) } for (i = 1; i < n; i++) { out(keys[i]) } } } } END { while (len) { out(pop()) } } zplug-2.4.2/misc/contrib/packaging.awk000066400000000000000000000002631322121161600176770ustar00rootroot00000000000000#!/usr/bin/env awk BEGIN { FS = "/"; } { if ($2 == pkg) list[i++] = $0; } END { if (length(list) == 1) print list[0]; else print pkg; } zplug-2.4.2/misc/contrib/parser.awk000066400000000000000000000024501322121161600172470ustar00rootroot00000000000000BEGIN { KEY_SEP = ":"; TAGS_SEP = ", "; } { arr[NR] = $0; } END { if (get_tag(arr, package) != 0) exit 1; } function get_name(arr, tag, n, tags, i, name) { n = split(tag, tags, "#"); for (i in tags) { if (tags[i] ~ /\//) { name = tags[i]; break; } } return name; } function get_tag(line, tag, name, i, j, n, tags, line_tags, ret, key_and_value, key, value) { name = get_name(line, tag); if (name == "") { return 1; } n = split(tag, tags, "#"); for (i in line) { if (line[i] ~ "name" KEY_SEP name TAGS_SEP) { m = split(line[i], line_tags, TAGS_SEP); for (j in line_tags) { split(line_tags[j], key_and_value, KEY_SEP); key = key_and_value[1]; value = key_and_value[2]; if (n == 1) { ret[key] = value; } if (in_array(key, tags) == 0) { ret[key] = value; } } } } if (length(ret) == 0) return 1; for (key in ret) print key KEY_SEP ret[key]; } function in_array(e, arr, i) { for (i in arr) { if (arr[i] == e) return 0; } return 1; } zplug-2.4.2/misc/contrib/read_cache.awk000066400000000000000000000001671322121161600200140ustar00rootroot00000000000000BEGIN { flag = 0; } { if ($0 == "return 0") { flag = 1; next; } } flag { print $0; } zplug-2.4.2/misc/dev/000077500000000000000000000000001322121161600143645ustar00rootroot00000000000000zplug-2.4.2/misc/dev/make_tests.zsh000066400000000000000000000016721322121161600172570ustar00rootroot00000000000000#!/usr/bin/env zsh local arg="$1" fp ans for fp in "${arg:-$ZPLUG_ROOT}/base"/*/*.zsh do local parent="${fp:h:t}" local child="${fp:t:r}" local test_file="${arg:-$ZPLUG_ROOT}/test/base/$parent/$child.t" # Check if already exists if [[ -f $test_file ]]; then echo -en "$test_file: is already exists. Overwrite? y/N: " read -q ans && echo if [[ ! ${(L)ans} =~ ^y(es)?$ ]]; then continue fi fi # Update rm -f "$test_file" cat "$fp" \ | grep "^__zplug::$parent::$child" \ | awk ' { gsub(/\(\)/, "") gsub(/ {/, "") print "T_SUB \"" $0 "\" ((" print " # skip" print "))" } ' >> "$test_file" done for fp in "${arg:-$ZPLUG_ROOT}"/autoload/{commands,options,tags}/__*__ do local dir="${fp:h}" local file="${fp:t}" local name="${file:gs:_:}" touch "${arg:-$ZPLUG_ROOT}/test/$dir/$name.t" done zplug-2.4.2/misc/dev/pre-push000066400000000000000000000001711322121161600160510ustar00rootroot00000000000000#!/bin/bash if git diff --exit-code --check master..origin/master; then # the same exit 0 fi make test exit $? zplug-2.4.2/misc/dev/release.zsh000066400000000000000000000051411322121161600165330ustar00rootroot00000000000000#!/bin/zsh set -e printf "Now zplug version is $_ZPLUG_VERSION\n" printf "Please let me know new version: " read next_version printf "OK? $next_version: [y/n] " read ok case "$ok" in "Y"|"y"|"YES"|"yes"|"OK"|"ok") # ok ;; *) echo "canceled" >&2 exit 1 ;; esac dir="$(git rev-parse --show-toplevel)" source "$dir/base/base/base.zsh" if ! __zplug::base::base::valid_semver "$_ZPLUG_VERSION" "$next_version"; then printf "$next_version: invalid semver\n" exit 1 fi branch="$(git rev-parse --abbrev-ref HEAD)" if [[ ! $branch =~ $next_version ]]; then echo "You are on $branch, but next version is $next_version" >&2 exit 1 fi if [[ -z $GITHUB_TOKEN ]]; then printf "GITHUB_TOKEN is missing\n" >&2 exit 1 fi if [[ -n "$(git status -s)" ]]; then git status -s printf "your $branch branch is not clean\n" >&2 exit 1 fi files=( "$dir/base/core/core.zsh" "$dir/README.md" "$dir/doc/guide/ja/README.md" ) # overwrite echo "$next_version" >| "$dir/doc/VERSION" # overwrite for file in "$files[@]" do cat "$file" | (rm "$file"; sed "s/$_ZPLUG_VERSION/$next_version/" > "$file") done # show diff git diff printf "Can I continue to process? [y/n] " read ok case "$ok" in "Y"|"y"|"YES"|"yes"|"OK"|"ok") # ok ;; *) echo "canceled" >&2 exit 1 ;; esac # git ops set -x git add -p git commit -m "New version $next_version" git push -u origin $branch git checkout master git merge --no-ff $branch git push -u origin master # maybe not necessary thanks to curl post proc # git tag -a $next_version -m $next_version # git push origin $next_version set +x body="Release of version '$next_version'" printf "Do you enter releases message? [y/n] " read ok case "$ok" in "Y"|"y"|"YES"|"yes"|"OK"|"ok") while true do echo "Please let me know release message (kill to type ^D)" ok= message="$(cat)" printf "--- OK? --- [y/n] " read ok case "$ok" in [Yy]*) break ;; [Nn]*) continue ;; * ) echo "Please answer yes or no.";; esac done ;; *) # do nothing ;; esac curl --data \ '{ \ "tag_name": "'$next_version'", \ "target_commitish": "master", \ "name": "'$next_version'", \ "body": "'$body'", \ "draft": false, \ "prerelease": false \ }' "https://api.github.com/repos/zplug/zplug/releases?access_token=$GITHUB_TOKEN" printf "Completed.\n" zplug-2.4.2/misc/zshrc000066400000000000000000000113321322121161600146620ustar00rootroot00000000000000#!/usr/bin/env zsh # vim: ft=zplug # Prepare tests=() export ZPLUG_HOME="/tmp/zplug-$RANDOM" export ZPLUG_REPOS="$ZPLUG_HOME/repos" mkdir -p "$ZPLUG_HOME" "$ZPLUG_REPOS" # Prepare source "$ZPLUG_ROOT/init.zsh" zplugs=() zplug clear # as { # plugin zplug "tcnksm/docker-alias", \ use:zshrc # command zplug "Jxck/dotfiles", \ as:command, \ use:"bin/{histuniq,color}" # theme zplug "S1cK94/minimal", \ as:theme tests+=( '(( $+aliases[dl] ))' '[[ -x $ZPLUG_HOME/bin/histuniq ]]' '[[ -x $ZPLUG_HOME/bin/color ]]' '[[ -n $RPROMPT ]]' ) } # at { # branch zplug "b4b4r07/enhancd", \ at:v1, \ use:"*.sh" # commit zplug "mollifier/anyframe", \ at:4c23cb60 tests+=( '(( $+functions[enhancd_cd] ))' '(( $+functions[anyframe-init] ))' ) } # from { # github zplug "zsh-users/zsh-history-substring-search", \ from:github, \ as:plugin zplug "mrowa44/emojify", \ from:github, \ as:command # bitbucket zplug "b4b4r07/hello_bitbucket", \ from:bitbucket, \ as:command, \ hook-build:"chmod 755 *.sh", \ use:"*.sh" # oh-my-zsh zplug "plugins/emoji", from:oh-my-zsh zplug "plugins/git", from:oh-my-zsh zplug "plugins/cp", from:oh-my-zsh # prezto zplug "modules/git", from:prezto zplug "modules/directory", from:prezto # gh-r zplug "junegunn/fzf-bin", \ as:command, \ from:gh-r, \ rename-to:f # gist zplug "b4b4r07/79ee61f7c140c63d2786", \ from:gist, \ as:command, \ use:get_last_pane_path.sh # local ## skip tests+=( '(( $+functions[_zsh_highlight_bind_widgets] ))' '[[ -x $ZPLUG_HOME/bin/emojify ]]' '[[ -x $ZPLUG_HOME/bin/hello.sh ]]' '(( $+aliases[gba] ))' '(( $+functions[cpv] ))' '(( $+functions[random_emoji] ))' '(( $+aliases[gbS] ))' # "prezto" modules/git '(( $+functions[git-dir] ))' # "prezto" modules/git '[[ -o autocd ]]' # "prezto" modules/directory '[[ -x $ZPLUG_HOME/bin/f ]]' '[[ ! -x $ZPLUG_HOME/bin/peco ]]' # for b4b4r07/zsh-gomi (on tag) '[[ -x $ZPLUG_HOME/bin/get_last_pane_path.sh ]]' ) } # depth { zplug "willghatch/zsh-cdr", \ depth:1 } # dir { : 'SKIP' 'TODO' } # frozen { : 'SKIP' } # hook-build { # Duplicates zplug "b4b4r07/hello_bitbucket", \ from:bitbucket, \ as:command, \ hook-build:"chmod 755 *.sh", \ use:"*.sh" tests+=( '[[ -x $ZPLUG_HOME/bin/hello.sh ]]' ) } # hook-load { : } # if { # zplug "tj/n", \ # as:command, \ # use:"bin/n", \ # if:'(( $+commands[node] ))' # tests+=( # '[[ -x $ZPLUG_HOME/bin/n ]]' # ) } # ignore { zplug "zsh-users/zaw", \ ignore:"zaw-launcher.zsh" # SKIP # tests+=( # '(( ! $+functions[zle-line-init] ))' # ) } # lazy { zplug "mollifier/zload", \ lazy:true, \ use:"zload" tests+=( '(( $+functions[zload] ))' ) } # defer { zplug "zsh-users/zsh-syntax-highlighting", \ defer:2 tests+=( '(( $+functions[_zsh_highlight] ))' ) } # on { zplug "b4b4r07/zsh-gomi", \ as:command, \ use:"bin/gomi", \ on:"peco/peco" # It should not be installed without peco/peco tests+=( '[[ ! -x $ZPLUG_HOME/bin/gomi ]]' ) } # rename-to { zplug "stedolan/jq", \ from:gh-r, \ as:command, \ rename-to:jq tests+=( '[[ -x $ZPLUG_HOME/bin/jq ]]' ) } # use { zplug "b4b4r07/http_code", \ as:command, \ use:"bin/http_code" zplug "monochromegane/the_platinum_searcher", \ as:command, \ from:gh-r, \ rename-to:pt, \ use:"*${(L)$(uname -s)}*amd64*" zplug 'junegunn/fzf', \ as:command, \ use:'bin/{fzf,fzf-tmux}' tests+=( '[[ -x $ZPLUG_HOME/bin/http_code ]]' '[[ -x $ZPLUG_HOME/bin/pt ]]' '[[ ! -x $ZPLUG_HOME/bin/fzf ]]' '[[ -x $ZPLUG_HOME/bin/fzf-tmux ]]' ) } zplug install || ret=1 zplug load --verbose || ret=1 # on (test case) # SKIP # this need to be tested after installation #{ # local -i line=0 # local -A tags # # tags[dir]="$( # __zplug::core::core::run_interfaces \ # 'dir' \ # 'willghatch/zsh-cdr' # )" # line="$( # git \ # --git-dir="$tags[dir]/.git" \ # --work-tree="$tags[dir]" \ # rev-list --count HEAD # )" # # tests+=( # "[[ $line -eq 1 ]]" # ) #} ret=0 for test in "$tests[@]" do eval "$test" if (( $status != 0 )); then printf "$fg[red]FAIL: $test$reset_color\n" >&2 ret=1 fi done exit $ret zplug-2.4.2/test/000077500000000000000000000000001322121161600136325ustar00rootroot00000000000000zplug-2.4.2/test/all.t000066400000000000000000000001051322121161600145630ustar00rootroot00000000000000T_SUB "all" (( source "$ZPLUG_ROOT/misc/zshrc" t_is $status 0 )) zplug-2.4.2/test/base/000077500000000000000000000000001322121161600145445ustar00rootroot00000000000000zplug-2.4.2/test/base/base/000077500000000000000000000000001322121161600154565ustar00rootroot00000000000000zplug-2.4.2/test/base/base/base.t000066400000000000000000000010401322121161600165500ustar00rootroot00000000000000T_SUB "__zplug::base::base::is_cli" (( # skip )) T_SUB "__zplug::base::base::zpluged" (( # skip )) T_SUB "__zplug::base::base::version_requirement" (( # skip )) T_SUB "__zplug::base::base::git_version" (( # skip )) T_SUB "__zplug::base::base::zsh_version" (( # skip )) T_SUB "__zplug::base::base::osx_version" (( # skip )) T_SUB "__zplug::base::base::get_os" (( # skip )) T_SUB "__zplug::base::base::is_osx" (( # skip )) T_SUB "__zplug::base::base::is_linux" (( # skip )) T_SUB "__zplug::base::base::packaging" (( # skip )) zplug-2.4.2/test/base/base/test.t000066400000000000000000000001541322121161600166220ustar00rootroot00000000000000T_SUB "__zplug::base::test::log_new" (( # skip )) T_SUB "__zplug::base::test::log_captcha" (( # skip )) zplug-2.4.2/test/base/core/000077500000000000000000000000001322121161600154745ustar00rootroot00000000000000zplug-2.4.2/test/base/core/add.t000066400000000000000000000001551322121161600164120ustar00rootroot00000000000000T_SUB "__zplug::core::add::to_zplugs" (( # skip )) T_SUB "__zplug::core::add::proc_at-sign" (( # skip )) zplug-2.4.2/test/base/core/arguments.t000066400000000000000000000002521322121161600176650ustar00rootroot00000000000000T_SUB "__zplug::core::arguments::exec" (( # skip )) T_SUB "__zplug::core::arguments::auto_correct" (( # skip )) T_SUB "__zplug::core::arguments::none" (( # skip )) zplug-2.4.2/test/base/core/commands.t000066400000000000000000000001611322121161600174600ustar00rootroot00000000000000T_SUB "__zplug::core::commands::get" (( # skip )) T_SUB "__zplug::core::commands::user_defined" (( # skip )) zplug-2.4.2/test/base/core/core.t000066400000000000000000000003371322121161600166140ustar00rootroot00000000000000T_SUB "__zplug::core::core::get_interfaces" (( # skip )) T_SUB "__zplug::core::core::run_interfaces" (( # skip )) T_SUB "__zplug::core::core::prepare" (( # skip )) T_SUB "__zplug::core::core::variable" (( # skip )) zplug-2.4.2/test/base/core/options.t000066400000000000000000000004101322121161600173470ustar00rootroot00000000000000T_SUB "__zplug::core::options::get" (( # skip )) T_SUB "__zplug::core::options::parse" (( # skip )) T_SUB "__zplug::core::options::short" (( # skip )) T_SUB "__zplug::core::options::long" (( # skip )) T_SUB "__zplug::core::options::unknown" (( # skip )) zplug-2.4.2/test/base/core/self.t000066400000000000000000000003061322121161600166110ustar00rootroot00000000000000T_SUB "__zplug::core::self::init" (( # skip )) T_SUB "__zplug::core::self::update" (( # skip )) T_SUB "__zplug::core::self::load" (( # skip )) T_SUB "__zplug::core::self::info" (( # skip )) zplug-2.4.2/test/base/core/sources.t000066400000000000000000000004451322121161600173470ustar00rootroot00000000000000T_SUB "__zplug::core::sources::is_exists" (( # skip )) T_SUB "__zplug::core::sources::is_handler_defined" (( # skip )) T_SUB "__zplug::core::sources::use_handler" (( # skip )) T_SUB "__zplug::core::sources::call" (( # skip )) T_SUB "__zplug::core::sources::use_default" (( # skip )) zplug-2.4.2/test/base/core/tags.t000066400000000000000000000001421322121161600166140ustar00rootroot00000000000000T_SUB "__zplug::core::tags::get" (( # skip )) T_SUB "__zplug::core::tags::parse" (( # skip )) zplug-2.4.2/test/base/io/000077500000000000000000000000001322121161600151535ustar00rootroot00000000000000zplug-2.4.2/test/base/io/file.t000066400000000000000000000002231322121161600162540ustar00rootroot00000000000000T_SUB "__zplug::io::file::load" (( # skip )) T_SUB "__zplug::io::file::generate" (( # skip )) T_SUB "__zplug::io::file::append" (( # skip )) zplug-2.4.2/test/base/io/print.t000066400000000000000000000002131322121161600164700ustar00rootroot00000000000000T_SUB "__zplug::io::print::put" (( # skip )) T_SUB "__zplug::io::print::die" (( # skip )) T_SUB "__zplug::io::print::f" (( # skip )) zplug-2.4.2/test/base/job/000077500000000000000000000000001322121161600153165ustar00rootroot00000000000000zplug-2.4.2/test/base/job/hook.t000066400000000000000000000002241322121161600164410ustar00rootroot00000000000000T_SUB "__zplug::job::hook::service" (( # skip )) T_SUB "__zplug::job::hook::build" (( # skip )) T_SUB "__zplug::job::hook::load" (( # skip )) zplug-2.4.2/test/base/job/queue.t000066400000000000000000000004001322121161600166210ustar00rootroot00000000000000T_SUB "__zplug::job::queue::enqueue" (( # skip )) T_SUB "__zplug::job::queue::dequeue" (( # skip )) T_SUB "__zplug::job::queue::clear" (( # skip )) T_SUB "__zplug::job::queue::wait" (( # skip )) T_SUB "__zplug::job::queue::wait_all" (( # skip )) zplug-2.4.2/test/base/sources/000077500000000000000000000000001322121161600162275ustar00rootroot00000000000000zplug-2.4.2/test/base/sources/bitbucket.t000066400000000000000000000005561322121161600203760ustar00rootroot00000000000000T_SUB "__zplug::sources::bitbucket::check" (( # skip )) T_SUB "__zplug::sources::bitbucket::install" (( # skip )) T_SUB "__zplug::sources::bitbucket::update" (( # skip )) T_SUB "__zplug::sources::bitbucket::get_url" (( # skip )) T_SUB "__zplug::sources::bitbucket::load_plugin" (( # skip )) T_SUB "__zplug::sources::bitbucket::load_command" (( # skip )) zplug-2.4.2/test/base/sources/gh-r.t000066400000000000000000000003361322121161600172530ustar00rootroot00000000000000T_SUB "__zplug::sources::gh-r::check" (( # skip )) T_SUB "__zplug::sources::gh-r::install" (( # skip )) T_SUB "__zplug::sources::gh-r::update" (( # skip )) T_SUB "__zplug::sources::gh-r::load_command" (( # skip )) zplug-2.4.2/test/base/sources/gist.t000066400000000000000000000005201322121161600173570ustar00rootroot00000000000000T_SUB "__zplug::sources::gist::check" (( # skip )) T_SUB "__zplug::sources::gist::install" (( # skip )) T_SUB "__zplug::sources::gist::update" (( # skip )) T_SUB "__zplug::sources::gist::get_url" (( # skip )) T_SUB "__zplug::sources::gist::load_plugin" (( # skip )) T_SUB "__zplug::sources::gist::load_command" (( # skip )) zplug-2.4.2/test/base/sources/github.t000066400000000000000000000005341322121161600177000ustar00rootroot00000000000000T_SUB "__zplug::sources::github::check" (( # skip )) T_SUB "__zplug::sources::github::install" (( # skip )) T_SUB "__zplug::sources::github::update" (( # skip )) T_SUB "__zplug::sources::github::get_url" (( # skip )) T_SUB "__zplug::sources::github::load_plugin" (( # skip )) T_SUB "__zplug::sources::github::load_command" (( # skip )) zplug-2.4.2/test/base/sources/local.t000066400000000000000000000002571322121161600175120ustar00rootroot00000000000000T_SUB "__zplug::sources::local::check" (( # skip )) T_SUB "__zplug::sources::local::load_plugin" (( # skip )) T_SUB "__zplug::sources::local::load_command" (( # skip )) zplug-2.4.2/test/base/sources/oh-my-zsh.t000066400000000000000000000004551322121161600202530ustar00rootroot00000000000000T_SUB "__zplug::sources::oh-my-zsh::check" (( # skip )) T_SUB "__zplug::sources::oh-my-zsh::install" (( # skip )) T_SUB "__zplug::sources::oh-my-zsh::update" (( # skip )) T_SUB "__zplug::sources::oh-my-zsh::get_url" (( # skip )) T_SUB "__zplug::sources::oh-my-zsh::load_plugin" (( # skip )) zplug-2.4.2/test/base/utils/000077500000000000000000000000001322121161600157045ustar00rootroot00000000000000zplug-2.4.2/test/base/utils/awk.t000066400000000000000000000001471322121161600166550ustar00rootroot00000000000000T_SUB "__zplug::utils::awk::path" (( # skip )) T_SUB "__zplug::utils::awk::available" (( # skip )) zplug-2.4.2/test/base/utils/git.t000066400000000000000000000007631322121161600166620ustar00rootroot00000000000000T_SUB "__zplug::utils::git::clone" (( # skip )) T_SUB "__zplug::utils::git::checkout" (( # skip )) T_SUB "__zplug::utils::git::merge" (( # skip )) T_SUB "__zplug::utils::git::status" (( # skip )) T_SUB "__zplug::utils::git::get_head_branch_name" (( # skip )) T_SUB "__zplug::utils::git::get_remote_name" (( # skip )) T_SUB "__zplug::utils::git::get_remote_state" (( # skip )) T_SUB "__zplug::utils::git::get_state" (( # skip )) T_SUB "__zplug::utils::git::remote_url" (( # skip )) zplug-2.4.2/test/base/utils/omz.t000066400000000000000000000000641322121161600166760ustar00rootroot00000000000000T_SUB "__zplug::utils::omz::depends" (( # skip )) zplug-2.4.2/test/base/utils/releases.t000066400000000000000000000005231322121161600176740ustar00rootroot00000000000000T_SUB "__zplug::utils::releases::get_latest" (( # skip )) T_SUB "__zplug::utils::releases::get_state" (( # skip )) T_SUB "__zplug::utils::releases::is_64" (( # skip )) T_SUB "__zplug::utils::releases::get_url" (( # skip )) T_SUB "__zplug::utils::releases::get" (( # skip )) T_SUB "__zplug::utils::releases::index" (( # skip )) zplug-2.4.2/test/base/utils/shell.t000066400000000000000000000006771322121161600172120ustar00rootroot00000000000000T_SUB "__zplug::utils::shell::remove_deadlinks" (( # skip )) T_SUB "__zplug::utils::shell::search_commands" (( # skip )) T_SUB "__zplug::utils::shell::glob2regexp" (( # skip )) T_SUB "__zplug::utils::shell::sudo" (( # skip )) T_SUB "__zplug::utils::shell::unansi" (( # skip )) T_SUB "__zplug::utils::shell::cd" (( # skip )) T_SUB "__zplug::utils::shell::getopts" (( # skip )) T_SUB "__zplug::utils::shell::pipestatus" (( # skip )) zplug-2.4.2/test/base/utils/yaml.t000066400000000000000000000001531322121161600170320ustar00rootroot00000000000000T_SUB "__zplug::utils::yaml::tokenizer" (( # skip )) T_SUB "__zplug::utils::yaml::parser" (( # skip ))