电脑又让我给弄格式化了(第三次),特此记录一下配置过程!!!
2022年7月15日
先展示一下目前电脑的系统版本以及应用
- macosMonterey(版本 12.4)
- google浏览器(重要性母庸置疑)
- Xcode(下载完成后,打开软件勾选下协议,就可以关掉了)
- item2(赏心悦目的终端)
- HomeBrew
建议先安装iterm2和oh-my-zsh
安装nvm切换不同版本的node (zsh)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- 如果安装缓慢建议在hosts文件中添加
185.199.108.133 raw.githubusercontent.com
- command not found: nvm
办法不是唯一的,但都大同小异--> 解决办法
nvm install 16安装16版本的node
安装nrm切换node源
npm i -g nrmnrm test检测不同源的速度nrm use taobao(切换源此处以taobao源为例)
brew安装
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
- 该命令为国内安装源,国内用户推荐使用此命令。
- 安装成功 但还需要重启终端 或者 运行
source /Users/star/.zprofile否则可能无法使用 brew doctor检测brew是否有错误(若有warning按照提示进行操作)
安装yarn
brew install yarn
以上环境基本ok了下面根据自己心情安装
oh-my-zsh
sh -c "$(curl -fsSL https://gitee.com/pocmon/ohmyzsh/raw/master/tools/install.sh)"
- 如果先安装了nvm,这时候会command not found: nvm
- 主题建议使用 apple 很清爽
oh-my-zsh 高亮插件 zsh-syntax-highlighting 强烈推荐
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
oh-my-zsh 自动补全插件 zsh-autosuggestions 推荐
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
安装完成之后需要配置zsh的配置文件不然不起作用
- 打开.zshrc
- 在plugins中增加 zsh-autosuggestions zsh-syntax-highlighting
- zsh-syntax-highlighting放在最后一个