你的 .zshrc 一直在等待的插件管理器
内联声明插件。锁定到精确的提交。并行安装。 除 Zsh 和 Git 外零依赖。
将此添加到你的 .zshrc
粘贴下面的代码片段。首次启动 shell 时,Zert 会自动克隆自身。
# 引导 zert — 运行一次,首次启动时自动克隆
export ZERT_PLUGINS_DIR="${ZERT_PLUGINS_DIR:-${ZERT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/zert}/plugins}"
[[ -f "$ZERT_PLUGINS_DIR/zert/zert.zsh" ]] || \
(curl -fsSL https://raw.githubusercontent.com/oxcl/zert/main/bootstrap.sh | zsh)
source "$ZERT_PLUGINS_DIR/zert/zert.zsh"
# 声明你的插件
zert zsh-users/zsh-autosuggestions
zert zsh-users/zsh-syntax-highlighting
zert zert # zert 管理自身
打开新终端,Zert 会处理其余一切 — 自动克隆、编译和加载你的插件。
你需要的一切。没有多余的。
没有 Python。没有 Ruby。没有 Node。只有 Zsh 做它最擅长的事。
声明式
直接在你的 .zshrc 中声明插件。无需单独的配置文件。没有 YAML、TOML 或 JSON — 只需 zert user/repo。
锁文件可重现性
每个插件都固定在 zert.lock 中的确切提交 SHA。将其提交到 dotfiles 以在任何地方获得完全相同的安装。
并行安装
使用 git treeless clones 同时克隆缺失的插件。安装是并行的,加载是顺序的 — 没有排序意外。
零依赖
纯 Zsh。没有 Python、Ruby、Node 或 Perl。唯一的外部二进制文件:git、curl 和标准 POSIX 工具。
自我管理
将 zert zert 添加到你的 .zshrc,Zert 会像跟踪其他插件一样跟踪和更新自身。甚至可以指定特定分支。
OMZ & Prezto 兼容
无需安装 Oh-My-Zsh 或 Prezto 框架即可加载它们的库和模块。使用 zert use ohmyzsh 和 zert use prezto。
四个步骤。就这么简单。
从零到完全管理的 shell 不到一分钟。
引导
将安装代码片段粘贴到你的 .zshrc 中。首次运行时,Zert 会自动克隆自身。
声明
在引导代码下方添加 zert user/repo 行。使用 --pin、--branch 或 --no-alias 等标志。
安装
打开新 shell。Zert 检测缺失的插件,并行克隆它们,编译并写入 zert.lock。
加载
插件按声明顺序依次加载。你的 shell 已准备就绪。提交 zert.lock 以实现可重现性。
简单语法。强大功能。
一切都在你的 .zshrc 中内联配置。
# 自我管理
zert zert # zert 管理自身
# Oh-My-Zsh / Prezto 兼容性
zert use ohmyzsh
zert ohmyzsh lib/clipboard
zert use prezto
zert prezto modules/utility
# GitHub 简写
zert zsh-users/zsh-autosuggestions
# 完整 URL
zert https://github.com/user/repo
# 跟踪分支
zert user/repo --branch dev
# 本地插件
zert /home/me/my-plugin
# 固定到特定提交
zert user/plugin --pin abc123def
# 跟踪分支而不是默认分支
zert user/plugin --branch dev
# 跳过别名加载
zert user/plugin --no-alias
# 跳过补全加载
zert user/plugin --no-completion
# 仅加载补全
zert user/plugin --only-completion
zert list # 显示已安装的插件
zert update # 更新所有插件
zert prune # 移除未使用的插件
# 自动生成的文件。请勿手动编辑。
# 将此文件提交到版本控制以实现可重现的安装。
version::1
zert::git::https://github.com/oxcl/zert::a1b2c3d::
zsh-autosuggestions::git::https://github.com/zsh-users/zsh-autosuggestions::f7g8h9i::
clipboard::ohmyzsh::https://github.com/ohmyzsh/ohmyzsh::l3m4n5o::
my-plugin::local::::r9s0t1u::
Support Zert
Zert is free and open source. If you find it useful, consider supporting development with a donation.
Scan to donate
bc1qhngkx9670q2vc4w494yfys3cpx2ykne90tanl7