【Mac Pro】如何从零开始配置Mac Pro

173 阅读1分钟

App 在 formulae.brew.sh/cask/ 里面找

Cli 在 formulae.brew.sh 里面找

使用 HomeBrew 安装 App 和 Cli 工具

# 配置代理

export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890

# 查看配置代理
# http://127.0.0.1:7890 是一个常见的本地代理地址,通常由代理工具(如 Clash、Shadowsocks、Charles 等)提供
echo $https_proxy

# 安装 HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# 用HomeBrew 安装 App
# brew install --cask 是安装 GUI 应用程序
# 不加 --cask 是安装 cli
brew install --cask \
 1password \
 alfred \
 anki \
 iterm2 \
 microsoft-edge \
 obsidian \
 sourcetree \
 telegram \
 figma
  ...
  
# 安装 cli 工具
brew install \
  autojump \
  node \
  deno \
  gh \
  git \
  nvm \
  pnpm \
  wget
  ...

配置 zsh 和 iTerm2

安装 zsh 和 starship,starship 是 rust 写的 prompt 工具

# 安装ohmyzsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 更新 omz
omz update

# 使配置文件生效
source ~/.zshrc
# starship 是 rust 写的 prompt 工具,极快

# 安装 starship
brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc

安装 zsh 的插件,用到了 zsh-autosuggestions、zsh-completions 和 fast-syntax-highlighting

# 从 github clone 插件到 ohmyzsh 的 plugin 目录中
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions

git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
  • 使用 zsh-completions, 如 git、Docker、kubectl 等 补全

输入

git <Tab>

输出

 add        bisect     checkout   commit     diff       fetch      grep       log        merge      push       rebase     reset      show       stash      tag
am         blame      clean      config     difftool   filter-branch gui       ls-files   mv         range-diff reflog     restore    shortlog   status     whatchanged
...