ZPLUG(1)
π ZPLUG(1) β the ZPLUG Manual, section 1 π
okay bestie, sit down, hydrate, and let me tell you about zplug β¨ this is the manual page for it, section 1, and it's gonna be a whole journey. no cap.
πΈ NAME πΈ
zplug β a next-generation plugin manager for zsh π¦
β¨ SYNOPSIS β¨
zplug ["username/reponame"[, tag:"value"[,...]]]
[<command> [<options>] [<package>]]
so when we say package anywhere in this page, we mean a string shaped exactly like this: "username/reponame". that's the vibe. that's the format. periodt. π
π DESCRIPTION π
zplug is a super-fast next-generation plugin manager for zsh. she can manage everything, literally: zsh plugins, UNIX commands, Gist files, GitHub Releases, local plugins, and so on and so on. and unlike antigen, zplug requires no ZSH plugin file (*.plugin.zsh) β not one, not ever. it's such a fantabulous piece of software, i'm obsessed fr fr ππ
here's the whole flex list:
- Can manage everything π
- Zsh plugins/UNIX commands on GitHub, Gitlab and Bitbucket
- Gist file (
gist.github.com) - Third-party sources e.g.,
oh-my-zshandpreztoplugins/themes - Binary artifacts on GitHub Releases
- Local plugins
- etc. (you can add your own sources! yes queen, build your own π«Ά)
- Super-fast parallel installation/update π₯
- Support for lazy-loading π¦
- Branch/tag/commit support π
- Post-update, post-load hooks π
- Dependencies between packages π
- Unlike antigen, no ZSH plugin file (
*.plugin.zsh) required π - Interactive interface (
fzf,peco,zaw, and so on) β¨ - Cache mechanism for reducing the startup time β
π OPTIONS π
--helpβ prints the synopsis and a list of all the available commands. your lil cheat sheet bestie π--versionβ prints zplug's version. that's it, that's the whole job π--logβ shows the error log. when things go π, look here.
π COMMANDS π
check [--verbose] [package]β checks whether there's at least one item that's not installed. if you hand her a package (username/reponame), she checks if that package is installed. and if you pass the--verboseoption, she prints extra debugging information πclean [--force] [--select] [package]β removes unused packages that are sitting in$ZPLUG_HOME/repos, but only after showing you a yes/no prompt. if you give her a package, she uninstalls that particular package. if the--forceoption is given, she suppresses the prompt and just uninstalls β no takebacks. and if the--selectoption is given, she uses the filter you set in$ZPLUG_FILTERso you can interactively pick which package you wanna uninstall π§Ήclearβ removes the cache file. bye cache π«‘install [package]β installs package. go get it β¨list [--verbose] [--select] [package]β lists installed packages.--selectdoes the same as what's described above πload [--verbose]β loads packages. every package registered withas:plugingets sourced into the current zsh process, and its parent directory gets added to$fpath. on top of that, all packages withas:commandget linked into$ZPLUG_HOME/binand that bin directory gets added to$PATH. and--verbosedoes the same as what's described above πinfo <package>β shows the information like the source URL and the tag values of the package. the tea βstatus [--select]β fetches the newest version of the installed packages by zplug.--selectdoes the same as what's described above πupdate [--select] [--force] [package]β updates package. if no package is given, she updates all the registered packages.--selectdoes the same as what's described above π
π TAGS π
the values truthy and falsy mean any of "true, yes, on, 1" and "false, no, off, 0", respectively. iykyk π
π·οΈ Table 1. zplug list of available tags
okay bestie, this is the whole tag menu π every one of these is a lil knob you can twist inside your zplug call, and ngl they're all kind of iconic. going down the list one by one, no skipping, we do not skip. β¨
asβ tells zplug whether you're registering this package as commands or as plugins.- Value:
plugin,command,theme(default:plugin) - Example:
as:command
- Value:
useβ sets the pattern of the files to source (when it's a plugin), OR the relative path from the package root of the file you want added to$PATH(when it's a command). super useful, like, for example withfrom:gh-ryou can sayuse:"*darwin*{amd,386}*"and so on and so forth. and if you wanna use extended glob, bestie, there's a later section about setting thezstylefor that, iykyk. π¦- Value: glob (default:
use:"*.zsh") - Example:
use:bin,use:"*.sh",use:"*darwin*"
- Value: glob (default:
fromβ which service you're installing from. pick your fave. π- Value:
github,gitlab,bitbucket,gh-r,gist,oh-my-zsh,prezto,local(default:github) - Example:
from:gh-r
- Value:
atβ the branch, tag, or commit you want to use. pin it, queen. π- Value: revision (default:
master) - Example:
at:v1.5.6
- Value: revision (default:
rename-toβ lets you say what filename you want it renamed to (heads up: this one is only valid withas:command).- Value: filename (default:
-) - Example:
rename-to:fzf
- Value: filename (default:
dirβ the installation directory, and just so you know, this one is managed by zplug itself.- Value: READ ONLY
- Example:
dir:/path/to/user/repo
ifβ the conditions under which to install and/or use the package. conditional queen behavior. π- Value: commands (default:
-) - Example:
if:"[ -d ~/.zsh ]"
- Value: commands (default:
hook-buildβ commands to run after installation/update.- Value: commands (default:
-) - Example:
hook-build:"make install"
- Value: commands (default:
hook-loadβ commands to run after loading. surprise!! π- Value: commands (default:
-) - Example:
hook-load:"echo Β΄Boo!Β΄"
- Value: commands (default:
frozenβ do not update this one unless it's explicitly specified. it's giving "don't touch my baby". π«Ά- Value:
truthy,falsy(default:no) - Example:
frozen:true
- Value:
onβ dependencies. this package depends on that package, we love a support system. π- Value: package (default:
-) - Example:
on:user/repo
- Value: package (default:
lazyβ lazy-load it. main character energy, arrives exactly when needed. π- Value:
truthy,falsy(default:no) - Example:
lazy:true
- Value:
depthβ how many commits you wanna pull into the cloned repo, bestie.0means the whole history, no skips. Value type? Any non-negative integer, so likedepth:10if you're being picky. β¨deferβ delays the loading of a package, iykyk. If the value is2or above, zplug will source the plugin aftercompinit(see also #26). Range is0..3, defaulting to0. πignoreβ basicallyuse's sibling but for the opposite vibe: specify an exception pattern of files you do not want loaded (see also #56). Takes a glob, default-. π«
You can also register packages for zplug straight from the command line, no cap. If you use zplug on the command line you get to flex the command line completions. When you do it this way, zplug writes out the package settings to $ZPLUG_LOADFILE. Then if you launch a new zsh process, the zplug load command will automatically use that file. π«Ά And heads up β you can also use $ZPLUG_LOADFILE to keep your zplug package listing fully isolated from your .zshrc, which is lowkey iconic.
πΈ ENVIRONMENT VARIABLES πΈ
Various zplug commands use the following environment variables, bestie, so let's get into it:
ZPLUG_HOMEβ defaults to~/.zplug. This is where zplug stores and loads plugins from. The directory structure is giving:
$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 in $ZPLUG_HOME/bin (and yeah, if you wanna rename it, use rename-to). Because zplug adds $ZPLUG_HOME/bin to your $PATH, you can run that command from literally anywhere, just like any other command. π
ZPLUG_THREADSβ the maximum number of threads zplug should use when installing/updating. Default value is16. Go off. π₯ZPLUG_PROTOCOLβ defaults toHTTPS. Valid options for$ZPLUG_PROTOCOLareHTTPSorSSH. Unless you have a specific reason, you should use theHTTPSprotocol. For more information, see also Which remote URL should I use? - GitHub Help.ZPLUG_FILTERβ defaults tofzf-tmux:fzf:peco:percol:zaw. When the--selectoption 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. TheZPLUG_FILTERalso 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. It's a super useful feature when you wanna isolate your zplug configurations from your.zshrc. And note: 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 totrue. If this variable is true, zplug uses a cache file to speed up the loading process. The cache file lives at$ZPLUG_CACHE_DIR($ZPLUG_HOME/.cacheby default). If you wanna clear the cache, please runzplug clearor 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/zplugto follow the XDG Base Directory Specification. πZPLUG_REPOSβ defaults to$ZPLUG_HOME/repos. You can change where the repositories are cloned, in case you wanna manage them separately.ZPLUG_SUDO_PASSWORDβ defaults to´´. You can set the sudo password for zplug'shook-buildtag. 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 wanna 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 lets you 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
zplugcommand (zplug "username/reponame") zplug loadto 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 the 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 π
ok so if something's acting up and it's giving broken, bestie, don't just suffer in silence β report bugs to the zplug issues π«Ά
like, that's literally the move. the issues tracker is where the zplug girlies hang out and fix things, so slide in there and tell them what's wrong. no cap. β¨
and that's a wrap on the whole page, bestie π the ZPLUG Manual is dated 12/22/2016, and this whole serve lives under ZPLUG(1). go forth, plug in your zsh, and slay π πβ¨
π¦ where this page comes from
- debian bookworm: zplug 2.4.2-2 Β· MIT
- debian trixie: zplug 2.4.2-2 Β· MIT
- nixpkgs unstable: zplug 2.4.2
- ubuntu jammy: zplug 2.4.2-1 Β· MIT
- ubuntu noble: zplug 2.4.2-2 Β· MIT
- ubuntu resolute: zplug 2.4.2-3 Β· MIT
- ubuntu stonking: zplug 2.4.2-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms