iTerm2
iTerm 官网,需要翻墙
A. 配置主题
Solarized Dark theme — — Download Link / Github
- 下载完成后压缩文件,解压,然后打开 iTerm2
-
Command + ,
打开Preferences
Profile -> Colors -> Color Presets

- 点击
Color Presets
- 然后选择
Solarized Dark theme
B. 设置背景图片
-
Command + ,
打开Preferences
配置页面
Profile -> Window -> Background image
- 点击并选择本地图片

Features
A. 搜索补全
例如: 我们搜索字符 "m", 如下图所示

按 tab
向右补全

shift-tab
向左补全

B. Toolbelt
打开 Toolbelt 窗口,Toolbelt -> show Toolbelt
(快捷键 shift + command + B
)
Toolbelt 有几种可视化窗口
- Captured Output — — 编译结果
- Paste History — — 粘贴版历史,在搜索框中按 down 可查看
- Jobs
- Actions
- Command History
- Notes
- Profiles
- Recent Directories

配置 On My Zsh
A.安装
zsh 安装
brew install zsh
On My Zsh 一键安装
- via curl 安装方式:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- via wget 安装方式:
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
B.zshrc
- 更换主题插件,都是在 zshrc 找到对应的设置,然后进行修改
vi ~/.zshrc
- 编辑结束后保存,并令其立即生效
source ~/.zshrc
C. 更新 shell
Mac 终端默认使用的 shell 是 bash,推荐使用 zsh
-
查看安装的 shell — —
cat /etc/shells
-
当前使用的 shell — —
echo $SHELL
-
下载 zsh — —
brew install zsh
-
切换 shell — —
chsh -s /bin/zsh
重启之后即可启用新的 shell
D. 更换主题
- 官方主题列表 WiKi
- 编辑 .zshrc 找到 ZSH_THEME,
ZSH_THEME="agnoster"
,然后进行主题设置
vi ~/.zshrc
source ~/.zshrc
Q: 安装 agnoster 主题时,会发现有问号

- 出现该问题是字体的问题
安装字体
git clone https://github.com/powerline/fonts
./install.sh
- 安装成功之后就可以在
Preferences -> Profiles -> Text -> Font
中选择Meslo LG L DZ for Powerline
字体可以解决
E. 插件安装
cd ~/.oh-my-zsh/custom/plugins/
/* 克隆插件地址 */
git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc
在 zshrc 修改 plugins 参数,默认 plugins = (git)
, 修改为 plugins=(git zsh-autosuggestions)
(每个插件中间用空格隔开)
可选插件
-
命令补全 — — https://github.com/zsh-users/zsh-autosuggestions
按第一次 tab 开启补全提示,然后通过 tab 切换补全提示 - 高亮 — — https://github.com/zsh-users/zsh-syntax-highlighting.git
网友评论