iTerm2配置(rz/sz命令)

本文档详细介绍了如何在 MacOS 系统上配置终端,包括安装 iTerm2、HomeBrew、Zsh 和 Oh My Zsh 等工具,并添加语法高亮和自动补全等增强功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.安装iTerm2

iTerm2官网下载安装

2.安装HomeBrew

参考博客:https://brew.idayer.com/guide/start/

作者写的非常细,但我照着执行下来有2个注意事项

⚠️

1.别急忙执行安装命令,先得去镜像助手那里选择适合自己的源,特别是记得先查看自己的终端类型;

2.安装完成之后,执行下面语句提示没有对应路径,原因是cask没装

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.gi

只要执行博客里的下面几行命令就行了

cd "$(brew --repo)/Library/Taps/"
cd homebrew
git clone https://mirrors.ustc.edu.cn/homebrew-cask.git

3.安装zsh

# mac os
brew install zsh
# centos
yum -y install zsh git
# debain ubuntu
apt install -y zsh git

4.安装 Oh My Zsh

参考博客:https://blog.youkuaiyun.com/Jrieh/article/details/123959873

sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

5.添加插件

zsh-syntax-highlighting(语法高亮)

# mac os
brew install zsh-syntax-highlighting
echo 'source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'  >> ~/.zshrc
source ~/.zshrc
# linux
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
sed -i 's/^\(plugins=[^)]*\))$/\1 zsh-syntax-highlighting)/g' ~/.zshrc
source ~/.zshrc

zsh-autosuggestions(自动补全)

# mac os
brew install zsh-autosuggestions
echo 'source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
source ~/.zshrc
# linux
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -i 's/^\(plugins=[^)]*\))$/\1 zsh-autosuggestions)/g' ~/.zshrc
source ~/.zshrc

6.添加sz rz命令支持

参考博客:https://blog.youkuaiyun.com/Ezra521/article/details/107754004

上面都配置ok的话,可以直接从链接里的第3步开始,可以跳过第4步选择第5步中的方法2

7.外观美化

主题

在这里插入图片描述

背景图在这里插入图片描述

结果图在这里插入图片描述

参考博客:https://blog.youkuaiyun.com/u010905433/article/details/123410029

https://blog.youkuaiyun.com/Ezra521/article/details/107754004

https://blog.youkuaiyun.com/Jrieh/article/details/123959873

https://brew.idayer.com/guide/start/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值