Files
easyzsh/README.md
T
Jeffrey caac9235f6 fix(shell): use single ~/.config/zsh/local.zsh for machine local
Replace the local/ directory of split env/login/interactive files with
one always-on local.zsh sourced from .zshenv. Deploy migrates old
fragments and never overwrites local.zsh.
2026-08-06 14:41:31 +08:00

78 lines
2.7 KiB
Markdown

# Easy Zsh Setup
One-command zsh environment: oh-my-zsh, powerlevel10k, and a curated plugin set
(autosuggestions, syntax-highlighting, completions, history-substring-search,
fzf-tab, k), plus eza, zoxide, fzf, and Nerd Fonts.
## Install
```bash
curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/install.sh | bash
```
Options: `--cp-hist` / `-c` imports bash history; `--non-interactive` / `-n`
skips the default-shell change. The installer backs up existing shell stubs
before replacing them.
From a git checkout (recommended for multi-machine sync):
```bash
./deploy.sh --migrate-zprofile
```
## Architecture
```text
every zsh login only interactive only
────────── ────────── ────────────────
~/.zshenv (stub) ~/.zprofile (stub) ~/.zshrc (stub)
→ config/zsh/env/* → config/zsh/login/* → config/zsh/interactive/*
→ config/zsh/local.zsh → ~/.config/zshrc/* (before omz)
```
PATH for user tools is built **once** in `~/.config/zsh/env/00-path.zsh`
(always-on), so non-interactive agent shells (`zsh -c`, Codex, Claude) resolve
`~/.local/bin` the same way interactive terminals do.
| Path | Role | Reinstall |
| --- | --- | --- |
| `~/.zshenv` `~/.zprofile` `~/.zshrc` | Thin stubs | Overwritten |
| `~/.config/zsh/env/` | Managed always-on env (PATH, Homebrew) | Overwritten |
| `~/.config/zsh/interactive/` | Managed interactive UX (omz, aliases) | Overwritten |
| `~/.config/zsh/login/` | Managed login hooks (usually empty) | Overwritten |
| `~/.config/zsh/local.zsh` | Machine-local overrides (every zsh) | **Never overwritten** |
| `~/.config/zshrc/*.zsh` | Personal/tool overlays (before omz) | Left alone |
| `~/.local/bin/` | User tools + intentional shims (e.g. `grok`) | Left alone |
Do **not** put `~/.grok/bin` on PATH wholesale (generic names like `agent` shadow
other tools). Link wanted entrypoints into `~/.local/bin` instead.
## Personal configuration
### Machine-local (agents see this)
```bash
# ~/.config/zsh/local.zsh
. "$HOME/.cargo/env"
source ~/.orbstack/shell/init.zsh 2>/dev/null || :
```
### Interactive overlays (before oh-my-zsh)
```bash
# ~/.config/zshrc/local.zsh
plugins+=(docker)
plugins=(${plugins:#zsh-autosuggestions})
```
Ready-made tool configs from this repo's `zshrc/` directory:
```bash
curl -fsSL https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s -- fnm pyenv
```
Current fragments: `fnm`, `nvm`, `pyenv`, `p10k`, `merlin_devbox`, `merlin_worker`.
Aliases that must beat oh-my-zsh belong after omz loads (see managed
`interactive/20-post-omz.zsh`).