安装homebrew
中科大homebrew镜像:https://mirrors.ustc.edu.cn/help/brew.git.html
# 使用以下命令快速安装homebrew
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
/bin/bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/HEAD/install.sh)"
# 替换为国内镜像
vim ~/.zshrc
# 添加以下代码
# brew
export PATH="/opt/homebrew/bin:$PATH"
export HOMEBREW_NO_ENV_HINTS=true
export HOMEBREW_NO_AUTO_UPDATE="true"
export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
# 按esc + :wq保存
source ~/.zshrc
安装git
brew install git
安装nvm
brew install nvm
mkdir ~/.nvm
vim ~/.zshrc
# 添加以下代码
# nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
# 按esc + :wq保存
source ~/.zshrc
安装VSCode及配置
VSCode官网:https://code.visualstudio.com/
常用插件
- GitLens
- ESLint
- Prettier
- Vue - Official
配置ESLint保存时自动修复并格式化
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}