此文件由
scripts/gen-readme.sh自动生成。
先把本地插件配置到 ~/.config/sheldon/plugins.toml:
# fpath 必须排在 mise 前面:mise 的 hook-env 会跑 compinit,
# 那时不在 fpath 里的补全不会被注册
[plugins.scripts-fpath]
local = "~/path/to/scripts"
use = ["fpath.zsh"]
[plugins.mise]
inline = 'eval "$(mise activate zsh)"'
# 函数和 alias 排在 mise 后面,alias 里的 `type <tool>` 才看得到 mise 装的工具
[plugins.scripts]
local = "~/path/to/scripts"
use = ["main.zsh"]没装 mise 的话只配 [plugins.scripts] 即可,main.zsh 会自己 source fpath.zsh。
fpath.zsh 还会把 Homebrew 的 share/zsh/site-functions 加进 fpath:brew shellenv
不带参数时并不输出 fpath,不加的话 brew 装的 cargo/rg/fd/bat/gh/mise
等补全全是空的。
然后在 ~/.zshrc 中启用 sheldon:
eval "$(sheldon source)"- 目标环境是
macOS + zsh + Homebrew。 - 代理相关函数会在定义了
HTTP_PROXY_ADDR时读取该值。
- btme:
btm -e --process_memory_as_value --process_command
- ..:
cd .. - ...:
cd ../.. - ....:
cd ../../.. - lt:
ls -lhF --time-style long-iso -s time - ll:
ls -lhF --time-style long-iso - lg:
ls -lbGahF --time-style long-iso - lx:
ls -lbhHigUmuSa@ --time-style=long-iso --git --color-scale - lsa:
ls -a - cp:
nocorrect cp -i - man:
nocorrect man - mkdir:
nocorrect mkdir - mv:
nocorrect mv -i - sudo:
nocorrect sudo - su:
nocorrect su - grep:
grep --color
- i:
cd $HOME/w/i - p:
cd $HOME/w/p
- dps:
docker ps -a --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}' - dip:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' - dstart:
docker start - dstop:
docker stop
- fdd:
fd -Ht d - fdf:
fd -Ht f
- gaa:
git add . - gc:
git commit -m - gca:
git commit -am - gcam:
git commit --amend --no-edit - gp:
git push - gpl:
git pull - gcl:
git clone - gcl1:
git clone --depth 1 - gl:
git log --oneline --graph --decorate - gll:
git log --graph --cherry --pretty=format:"%h <%an> %ar %s" - gsl:
git shortlog - gtl:
git tag -l - gtd:
git tag -d - gba:
git branch -a - gbc:
git branch --show-current - gbd:
git branch --delete - gbrn:
git branch -m - gs:
git switch - gwls:
git worktree list - gwd:
git worktree remove - gwa:
git worktree add - gst:
git status -s - gcat:
git cat-file - gcf:
git config -l - gcln:
git clean -xdf - gdf:
git difftool - gho:
git hash-object - gundo:
git reset --soft HEAD^
- hf5:
hyperfine -r5 -w5
- j:
just - jc:
just --choose
- showfiles:
defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder - hidefiles:
defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder - spotlightoff:
sudo mdutil -a -i off - spotlighton:
sudo mdutil -a -i on
- public_ip:
dig +short myip.opendns.com @resolver1.opendns.com - local_ip:
ipconfig getifaddr en0 - ips:
ifconfig -a | grep -oE 'inet6? (addr:)?\s?((([0-9]+.){3}[0-9]+)|[a-fA-F0-9:]+)' | awk '{sub(/inet6? (addr:)? ?/, \"\"); print}' - status_code:
curl -LI -m 10 -o /dev/null -s -w '%{http_code}'
- nio:
ni --prefer-offline - nid:
ni -D - nido:
ni -D --prefer-offline - nidw:
ni -wD - niw:
ni -w - d:
nr dev - s:
nr start - b:
nr build - c:
nr clean - l:
nr lint - t:
nr test
- pid:
pgrep -lf
- delta
- entire
- pnpm
- clean_aria2
- clean_downloads
- clean_ds_store
- clean_maven
- clean_open_with
- clean_zcompdump
- zsh_load_time
- error
- info
- judge
- step
- step_end
- warn
- gi
- grename
- cht
- dir
- dua
- dud
- proxy
- reset_brew_mirror
- reset_cargo_mirror
- reset_npm_mirror
- reset_rustup_mirror
- set_brew_mirror
- set_cargo_mirror
- set_cargo_proxy
- set_cli_proxy
- set_git_proxy
- set_npm_mirror
- set_npm_proxy
- set_rustup_mirror
- unproxy
- unset_cargo_proxy
- unset_cli_proxy
- unset_git_proxy
- unset_npm_proxy
- o
- port
- ram
- upgrade_sheldon_plugin