ZPM ( Zsh plugin manager ) is NOT a yet another plugin manager for zsh. zpm ( ZSH Plugin Manager ) is a plugin manager for ZSH who combines the imperative and declarative approach. At first run, zpm will do complex logic and generate cache, after that will be used cache only, so it makes this framework to be very fast.
- Fastest plugin manager (Really, after the first run, zpm will not be used at all)
- Support for async loading
- Dependencies between packages
- ZPM plugins are compatible with oh-my-zsh.
- ZPM runs on Linux, Android, FreeBSD and macOS.
Plugin manager | zpm, first run | zpm with cache | zplug | zplugin | zplugin, with light |
---|---|---|---|---|---|
Start time | 0.387 | 0.152 | 0.698 | 0.709 | 0.381 |
- zsh
- git
- xargs
- Termux for Android
Add the following text into .zshrc
if [[ ! -f ~/.zpm/zpm.zsh ]]; then
git clone --recursive https://github.com/zpm-zsh/zpm ~/.zpm
fi
source ~/.zpm/zpm.zsh
If you don't have .zshrc
copy example of .zshrc
from zpm
cp ~/.zpm/zshrc ~/.zshrc
Add your zpm commands to ~/.zshrc
after zpm initialization:
zpm load github-user/github-repo # Download and enable the plugin from GitHub
zpm if linux load github-user/github-repo # Load plugin only on Linux
zpm if-not linux load github-user/github-repo # Don't load the plugin on Linux
zpm load gitlab-user/gitlab-repo,type:gitlab # Download and enable plugin from GitLab
zpm load bitbucket-user/bitbucket-repo,type:bitbucket # Download and enable the plugin from Bitbucket
zpm load plugin-form-oh-my-zsh,type:omz # Load plugin form oh-my-zsh
zpm load github-user/github-repo,async # Async load
Notice: if you change
~/.zshrc
, you need to remove zpm cache:zpm clean
linux
- if current OS is Linuxbsd
- if current OS is *BSDmacos
- if current OS is macOStermux
- if current session run in Termuxssh
- if session run on remote hosttmux
- if session run in Tmux
The condition can be combined zpm if ssh if tmux if-not macos load repo/plugin
Zpm supports tags for plugins:
This tag has 3 possible arguments:
source
- for source this plugin, enabled by defaultpath
- add/bin
folder to your$PATH
, only if it exists, enabled by defaultfpath
- add plugin folder to your$fpath
, only if exist at least one_*
file, enabled by default
some/plugin,apply:source:path:fpath
If this tag is present, zsh plugin will be loaded async
Define own file woh will be load
zpm some/plugin,source:/other.file.zsh
Using these tags you can change the destination of folders which will be added to $PATH
or $fpath
zpm some/plugin,path:/executables
zpm another/plugin,fpath:/completions
This tag has the following parameters:
type:gitlab
- plugin will be downloaded from GitLabtype:bitbucket
- plugin will be downloaded from Bitbuckettype:omz
- zpm will use a plugin from oh-my-zsh, oh-my-zsh will be download if not installed
plugin-from/gitlab,type:gitlab
plugin-from/bitbucket,type:bitbucket
plugin-form-oh-my-zsh,type:omz
This tag param contain command who will be run in plugin directory
zpm plugin/name,hook:"make; make install"
Run zpm upgrade
for upgrading, or run zpm upgrade some-plugin another-plugin
if you want to upgrade only these plugins