一份年幼无知的 zsh 配置¶
在笔者大一刚结束时, 自己捣鼓了很久的zsh配置, 直至大三转入fish"邪教".
- 使用设备: MacbookPro(M2)
- 电脑版本: Sequoia 14.0 (23A344)
- 配置目的: 我的mac默认终端是zsh, 但缺乏oh-my-zsh的加持, 它显得不够高端, 遂决定“升级”
直接从官网下载iTerm.app软件: https://iterm2.com/
Danger
本文初稿写于2023年, 是笔者“稚嫩时期”的配置, 因此不具备“潮流性”.
现在(2025.11)更推荐的是fish shell, 详见本站《fish shell 配置》这一节.
oh-my-zsh安装¶
| Bash | |
|---|---|
1 | |
当然, 你也可以使用 git clone 进行下载, 两者是一个意思, 此处略去
FiraCode字体安装¶
安装字体:
| Bash | |
|---|---|
1 2 | |
插件安装¶
pure prompt¶
| Bash | |
|---|---|
1 2 3 4 | |
fuzzy finder¶
| Bash | |
|---|---|
1 2 | |
高亮+自动补全+跳转¶
很显然:一路y就好
使用快捷键:ctrl+R
⚠️下面这三个先下载后配置, 然后刷新zsh!
下载:
(1) zsh-syntax-highlighting
| Bash | |
|---|---|
1 | |
(2) zsh-autosuggestions
| Bash | |
|---|---|
1 | |
(3) autojump
| Bash | |
|---|---|
1 | |
配置:
| Bash | |
|---|---|
1 | |
| Bash | |
|---|---|
1 2 3 4 5 6 | |
生效:
| Bash | |
|---|---|
1 | |
iTerm2 配置清单¶
- 上面介绍的插件
- 窗口默认显示长宽比:100:50
- 窗口显示透明度:80%
- 显示窗体(悬浮窗):cpu使用率 + 内存使用率 + 当前git地址 + 查找
快捷命令:
command + enter进入与返回全屏模式command + t新建标签command + w关闭标签command + 数字command + 左右方向键 切换标签command + enter切换全屏command + f查找command + d水平分屏command + shift + d垂直分屏command + option + 方向键ORcommand + [ 或 command + ]切换屏幕command + ;查看历史命令command + shift + h查看剪贴板历史ctrl + u清除当前行ctrl + l清屏ctrl + a到行首ctrl + e到行尾ctrl + f/b前进后退ctrl + p上一条命令ctrl + r搜索命令历史