使用 Antidote 管理 Zsh 配置
之前介绍了使用 antigen 和 sheldon 管理 Zsh 配置,由于 antigen 已经停止维护了,后面就有了 antibody,但是这个也停止维护了,最终就有了继任者 antidote,这几个使用上都大同小异。
安装
1
2
3
4# macOS 使用
brew install antidote
# 其他平台
git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote在
$HOME
目录添加.zsh_plugins.txt
来定义需要使用的插件1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36# .zsh_plugins.txt
# comments are supported like this
https://github.com/peterhurford/up.zsh
rummik/zsh-tailf
mattmc3/zman
agkozak/zsh-z
# empty lines are skipped
# annotations are also allowed:
romkatv/zsh-bench kind:path
olets/zsh-abbr kind:defer
# frameworks like oh-my-zsh are supported
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/command-not-found
ohmyzsh/ohmyzsh path:plugins/common-aliases
ohmyzsh/ohmyzsh path:plugins/gem
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/npm
ohmyzsh/ohmyzsh path:plugins/tmux
ohmyzsh/ohmyzsh path:plugins/yarn
ohmyzsh/ohmyzsh path:plugins/fzf
# prompts:
# with prompt plugins, remember to add this to your .zshrc:
# `autoload -Uz promptinit && promptinit && prompt pure`
# sindresorhus/pure kind:fpath
# romkatv/powerlevel10k kind:fpath
# popular fish-like plugins
zsh-users/zsh-autosuggestions
zsh-users/zsh-completions path:src kind:fpath
zdharma-continuum/fast-syntax-highlighting kind:defer
# zsh-users/zsh-history-substring-search在
.zshrc
中添加下面的内容,以后修改.zsh_plugin.txt
中的内容后会自动更新1
2
3
4
5
6
7
8
9
10
11
12
13# .zshrc
# Lazy-load antidote and generate the static load file only when needed
zsh_plugins=${ZDOTDIR:-$HOME}/.zsh_plugins
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
(
source ${ZDOTDIR:-$HOME}/.antidote/antidote.zsh
antidote bundle <${zsh_plugins}.txt >${zsh_plugins}.zsh
)
fi
source ${zsh_plugins}.zsh
# starship
# eval "$(starship init zsh)"
---EOF---