系统配置

包管理器

安装

安装Command Line Tools

  1. xcode-select --install

安装brew

  1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

换源

Brew源

  1. cd "$(brew --repo)"
  2. git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

软件源

  1. cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
  2. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
  3. cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
  4. git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

Bottles 源

  1. echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
  2. source ~/.zshrc

在brew update 报错,可以做如下检查,找到报错文件,进入该路径执行git相关操作

  1. brew update --verbose

image.png
执行以下命令

  1. git fetch --prune origin
  2. git pull --rebase origin master

image.png

shell

更换默认shell

  1. chsh -s /bin/zsh

安装oh-my-zsh

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

安装插件

  1. cd ~/.oh-my-zsh/custom/plugins/
  2. git clone https://github.com/zsh-users/zsh-autosuggestions
  3. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git