Quick, reproducible setup to get a modern Zsh environment on macOS with Oh My Zsh, Homebrew, Antidote, and Autojump.
1) Install Oh My Zsh
1
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
Oh my Zsh
2) Install Homebrew
1
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
Homebrew
3) Install Antidote (plugin manager) and Autojump
1
| brew install antidote autojump
|
4) Define plugins to load
Create ~/.zsh_plugins.txt with one plugin per line, for example:
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
| # ===== CORE FUNCTIONALITY ===== # Git integration ohmyzsh/ohmyzsh path:plugins/git
# Python development ohmyzsh/ohmyzsh path:plugins/virtualenv ohmyzsh/ohmyzsh path:plugins/pip ohmyzsh/ohmyzsh path:plugins/python
# Node.js development ohmyzsh/ohmyzsh path:plugins/node ohmyzsh/ohmyzsh path:plugins/npm
# Linux / Homebrew integration ohmyzsh/ohmyzsh path:plugins/brew
# Utilities ohmyzsh/ohmyzsh path:plugins/extract ohmyzsh/ohmyzsh path:plugins/web-search ohmyzsh/ohmyzsh path:plugins/colorize ohmyzsh/ohmyzsh path:plugins/autojump
# ===== THIRD-PARTY PLUGINS ===== zsh-users/zsh-completions zsh-users/zsh-autosuggestions
# Syntax highlighting (must be last) zsh-users/zsh-syntax-highlighting
|
5) Wire Antidote into ~/.zshrc
Add this snippet near the top of your .zshrc so Antidote builds and loads the bundle (Homebrew path assumed):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
source $ZSH/oh-my-zsh.sh
if command -v brew >/dev/null 2>&1; then ANTIDOTE_PATH="$(brew --prefix antidote)/share/antidote/antidote.zsh"
if [[ -f "$ANTIDOTE_PATH" ]]; then source "$ANTIDOTE_PATH"
if [[ ! -f "$HOME/.zsh_plugins.zsh" ]]; then antidote bundle < "$HOME/.zsh_plugins.txt" > "$HOME/.zsh_plugins.zsh" fi
source "$HOME/.zsh_plugins.zsh" fi fi
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
6) Set an Oh My Zsh theme
In ~/.zshrc, set something you like, e.g.:
7) Apply and verify
1 2 3
| source ~/.zshrc zsh --version autojump --help
|
Open a new terminal tab to ensure the theme and plugins load correctly. If you change ~/.zsh_plugins.txt, rebuild the bundle with:
1 2
| antidote bundle < ~/.zsh_plugins.txt > ~/.zsh_plugins.zsh source ~/.zsh_plugins.zsh
|
如需转载或引用, 请标注出处。