Files
System/MacBook/Mac安装终端工具.md
offends d12a206210
Some checks failed
continuous-integration/drone Build is failing
synchronization
2025-08-25 16:02:49 +08:00

137 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 本文作者:丁辉
>
# 部署 Oh My Zsh
> 本文介绍如何安装"Oh My Zsh" 终端和 "zsh-autosuggestions" 自动补全工具
[Github项目地址](https://github.com/ohmyzsh/ohmyzsh)
[Homebrew官网](https://brew.sh/)
1. 打开 Mac 终端输入下载命令(下列三种方式都可以,建议使用 curl 因为 mac 一般自带哈哈)
| Method | Command |
| :-------: | :----------------------------------------------------------: |
| **curl** | `sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
| **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
| **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
2. 启用插件
```bash
vi ~/.zshrc
```
3. 替换如下内容
> 原内容如下
>
> ```bash
> plugins=(git)
> ```
修改后
```bash
plugins=(
git
bundler
dotenv
macos
rake
rbenv
ruby
)
```
4. 重启终端查看效果
# 部署 zsh-autosuggestions
[Github项目地址](https://github.com/zsh-users/zsh-autosuggestions)
1. 克隆仓库
```bash
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
```
2. 修改配置文件
```bash
vim ~/.zshrc
```
3. 添加 `zsh-autosuggestions` 到 plugins=() 模块内
```bash
plugins=(
zsh-autosuggestions
)
```
4. 重启终端查看效果
# 更换主题
[主题展示](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes)
1. 编辑配置文件
```bash
~/.zshrc
```
2. 找到 `ZSH_THEME` 配置
```bash
ZSH_THEME="agnoster"
```
# 安装字体
[Github项目地址](https://github.com/powerline/fonts)
1. 克隆仓库
```bash
git clone https://github.com/powerline/fonts.git --depth=1
```
2. 安装
```bash
cd fonts
./install.sh
```
3. 清除安装包
```bash
cd ..
rm -rf fonts
```
**更换字体**
1. Vscode更换字体
打开vscode > Settings > 搜索font > 找到`Terminal Integrated: Font Family`
填写字体(格式如下)
可以用 "," 来分隔多个字体
```bash
Go Mono for Powerline,Hack
```
2. Mac 默认终端更换字体
点击左上角终端 > 偏好设置 > 描述文件 > 更改字体 > 点击搜索添加
3. Item2 终端更换字体
点击左上角iTerm2 > Preferences > Profiles > Text > 勾选 Use built-in Powerline glyphs