Configs2026年7月20日·1 分钟阅读

zplug — Next-Generation Zsh Plugin Manager

A fast, flexible Zsh plugin manager that supports parallel installation, conditional loading, and fine-grained control over how plugins are sourced.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
zplug Plugin Manager
先审查命令
npx -y tokrepo@latest install a8015aa9-8419-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

zplug is a Zsh plugin manager that gives users precise control over how plugins are fetched, loaded, and ordered. It supports GitHub repos, Oh My Zsh plugins, local files, Gist snippets, and binary releases, all managed through a declarative syntax with options for deferred loading, conditional activation, and parallel downloads.

What zplug Does

  • Installs Zsh plugins from GitHub, Bitbucket, local paths, Gist URLs, and Oh My Zsh
  • Downloads and manages pre-built binaries from GitHub Releases alongside plugins
  • Loads plugins in parallel during installation for faster setup
  • Supports deferred loading with defer:N to control source order
  • Provides conditional loading with if:"condition" tags for platform-specific plugins

Architecture Overview

zplug maintains a plugin registry in ~/.zplug/packages.zsh. Each zplug declaration records the source, loading options, and hooks for a plugin. On zplug install, it clones repositories in parallel using background jobs. On zplug load, it sources plugins in the declared order, respecting defer levels. A lock file ensures consistent state across sessions.

Self-Hosting & Configuration

  • Install via the official installer script or clone the repository to ~/.zplug
  • Source ~/.zplug/init.zsh at the top of your .zshrc
  • Declare plugins with zplug "owner/repo" and optional tags like as:, use:, defer:, if:
  • Run zplug install to fetch new plugins and zplug update to refresh them
  • Use zplug clean to remove plugins no longer declared in .zshrc

Key Features

  • Parallel plugin installation using background Zsh jobs
  • Tag-based configuration for fine-grained control (as:, use:, from:, defer:, if:, hook-build:)
  • Supports GitHub Releases for installing CLI binaries alongside plugins
  • Conditional loading based on OS, hostname, or arbitrary shell expressions
  • Compatible with Oh My Zsh and Prezto plugins

Comparison with Similar Tools

  • antigen — simpler syntax but lacks parallel install, defer levels, and binary management
  • zinit — faster with turbo mode and richer features but significantly more complex
  • Oh My Zsh — all-in-one framework; zplug manages individual plugins without framework overhead
  • sheldon — Rust-based and fast but lacks zplug's tag-based conditional loading
  • Antibody — Go-based static loader; faster startup but no runtime install or update commands

FAQ

Q: Does zplug support Oh My Zsh plugins? A: Yes. Use zplug "plugins/git", from:oh-my-zsh to load individual Oh My Zsh plugins.

Q: How do I install a CLI binary with zplug? A: Use as:command and from:gh-r to download a binary from GitHub Releases and add it to your PATH.

Q: Can I defer plugin loading for faster startup? A: Yes. The defer:N tag lets you control source order; higher numbers load later.

Q: Is zplug still maintained? A: The core is stable and widely used, though development activity has slowed. The plugin ecosystem remains active.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产