安装brew
执行gitee安装脚本
/bin/zsh -c "$(curl -fsSL https://gitee.com/huwei1024/HomebrewCN/raw/master/Homebrew.sh)"
问题处理记录:
-
no git
image.png
自己下载安装:https://sourceforge.net/projects/git-osx-installer/ -
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
image.png
上官网下载了Command Line Tools for Xcode 13
添加环境变量
vim ~/.zshrc
export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH
source ~/.zshrc
安装 iTem2
iTerms2 下载地址点击这里:https://iterm2.com/
iterm2的设置里选择
profiles
-->colors
中选择Solarized Dark
安装 Oh My Zsh
Oh My Zsh是一个开源的、社区驱动的框架,用于管理您的Zsh配置。
官网提供的安装方式:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
设置主题
打开~/.zshrc
文件后将 ZSH_THEME="robbyrussell"
修改为ZSH_THEME="agnoster"
命令提示和语法高亮插件安装
安装历史命令提示插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
安装语法高亮插件
git clone git://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
配置插件,修改 .zshrc
vim ~/.zshrc
# 在文件里找到plugins,修改为
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
处理文字有乱码情况
解决乱码,下载Powerline字体,安装后可以删除这个git项目
// clone 克隆
git clone https://github.com/powerline/fonts.git
// install 安装
cd fonts
./install.sh
安装完字体库之后,把iTerm 2的设置中的 Profile
中的 Text
选项卡中里的、 Font 和 Non-ASCII Font的字体都设置成 Powerline的字体,我这里设置的字体是 Meslo LG S DZ for Powerline