fix(zshrc): safer trash rm wrapper; drop personal install fragment

Keep ~/.zshrc upgrade-friendly by not shipping author-specific
plugin samples as patch targets. Prefer the flag-tolerant trash
function over bare aliases so common rm -f usage still works.
This commit is contained in:
Jeffrey
2026-08-05 16:53:25 +08:00
parent 3fbf8b2350
commit f2695ca431
3 changed files with 61 additions and 29 deletions
+19 -9
View File
@@ -14,27 +14,37 @@ Options: `--cp-hist` / `-c` imports bash history; `--non-interactive` / `-n`
skips the default-shell change. The installer backs up an existing `~/.zshrc`
and `~/.zshenv` before replacing them.
## What gets installed where
| Path | Role |
| --- | --- |
| `~/.zshrc` | Canonical shell entry (from repo `.zshrc`). Stay close to upstream; reinstall overwrites it. |
| `~/.zshenv` | Early env for every zsh (Homebrew `shellenv` on macOS). |
| `~/.config/zshrc/*.zsh` | Your overlays, sourced by `~/.zshrc` **before** oh-my-zsh loads. |
Do not put personal tweaks into `~/.zshrc` if you want painless upgrades: put them under `~/.config/zshrc/` instead.
## Personal configuration
`~/.zshrc` is meant to stay close to this repo's canonical version. Put your own
tweaks in `~/.config/zshrc/` instead of editing `~/.zshrc` directly: every
`*.zsh` file there is sourced near the end of `~/.zshrc`, just before oh-my-zsh
loads, so it can add plugins and override defaults.
Every `*.zsh` file in `~/.config/zshrc/` is sourced near the end of `~/.zshrc`,
just before oh-my-zsh loads, so it can add plugins and override defaults.
```bash
# ~/.config/zshrc/my.zsh
plugins+=(zsh-nvm) # add plugins
plugins=(${plugins:#zsh-autosuggestions}) # or remove one
# ~/.config/zshrc/local.zsh
plugins+=(docker) # add plugins
plugins=(${plugins:#zsh-autosuggestions}) # or remove one
alias gs='git status'
```
Ready-made configs from this repo's `zshrc/` directory (`fnm`, `nvm`, `pyenv`,
`merlin_devbox`, `merlin_worker`, `personal`, `p10k`) can be pulled in by name:
Ready-made **tool** configs from this repo's `zshrc/` directory can be pulled in
by name (not personal samples):
```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`.
Because these files load before oh-my-zsh, plugin and theme changes take effect;
aliases that must beat oh-my-zsh's own should be defined after oh-my-zsh loads
(see the note in `~/.zshrc`).