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.csdn.net/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.csdn.net/Ezra521/article/details/107754004
上面都配置ok的话,可以直接从链接里的第3步开始,可以跳过第4步选择第5步中的方法2
7.外观美化
主题
背景图
结果图
参考博客:https://blog.csdn.net/u010905433/article/details/123410029
https://blog.csdn.net/Ezra521/article/details/107754004
https://blog.csdn.net/Jrieh/article/details/123959873
https://brew.idayer.com/guide/start/