mac配置


✅ 一、系统级基础配置

1. macOS 设置(建议手动设置)

  • 打开开发者模式(如终端执行命令无警告)

  • 快捷键、触控板、Dock、访达偏好设置优化

  • 安装 Xcode Command Line Tools:

    bash
    
    
    复制编辑
    xcode-select --install

2. 安装包管理器 Homebrew

bash


复制编辑
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew doctor

✅ 二、终端环境配置

1. 安装并配置终端工具

bash


复制编辑
brew install zsh zsh-completions
brew install starship

建议使用 iTerm2 替代默认终端,配合 Starship 提升体验:

bash


复制编辑
brew install --cask iterm2

2. Zsh 插件和主题

  • 使用 oh-my-zsh:

    bash
    
    
    复制编辑
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • 推荐插件:

    • zsh-autosuggestions
    • zsh-syntax-highlighting
    • z
  • 使用 Starship 美化终端提示符(.zshrc 添加)

    bash
    
    
    复制编辑
    eval "$(starship init zsh)"

✅ 三、开发通用工具安装

1. Git 与 SSH 配置

bash


复制编辑
brew install git
git config --global user.name "你的名字"
git config --global user.email "邮箱"
  • 生成 SSH key:

    bash
    
    
    复制编辑
    ssh-keygen -t ed25519 -C "your_email@example.com"
  • 添加到 GitHub / Gitee

    bash
    
    
    复制编辑
    pbcopy < ~/.ssh/id_ed25519.pub

2. Node.js 管理器(nvm 推荐)

bash


复制编辑
brew install nvm
mkdir ~/.nvm

~/.zshrc 添加:

export NVM_DIR="$HOME/.nvm"
source "$(brew --prefix nvm)/nvm.sh"

安装 LTS Node.js:

nvm install --lts
nvm use --lts

✅ 四、前端开发环境

1. 包管理器

npm install -g pnpm yarn

2. 常用 CLI 工具

npm install -g eslint prettier vite create-react-app @vue/cli typescript

3. 浏览器与扩展

  • Chrome / Edge(调试工具丰富)
  • 插件推荐:
    • Vue.js Devtools
    • React Developer Tools
    • Redux DevTools
    • JSON Viewer

✅ 五、IDE 与编辑器

推荐安装 VS Code:

brew install --cask visual-studio-code

推荐插件:

  • ESLint / Prettier / Vetur / VueDX / Volar
  • GitLens / Git Graph
  • Path Intellisense / Auto Import / IntelliCode
  • Bracket Pair Colorizer / TabNine(AI)
  • REST Client

✅ 六、其他推荐工具(视个人喜好)

1. 数据库/接口调试

brew install --cask postman
brew install --cask insomnia

2. API Mock / 服务代理

  • mockoon、apifox、proxyman、whistle 等

3. Docker

brew install --cask docker

✅ 七、前端项目模板或脚手架配置

可提前准备如下内容:

  • 公司或个人常用项目模板(React、Vue3 + Vite、Nuxt、Next.js)
  • ESLint + Prettier + husky + lint-staged 等规范统一方案
  • Tailwind / Naive UI / Element Plus / Ant Design 配置
  • 常用 hooks、组件封装库
  • vite.config.js / tsconfig.json 模板

✅ 八、效率与脚本工具

  • Alfred(效率神器)
  • Raycast(现代替代品)
  • Rectangle(窗口管理)
  • Typora / Obsidian(笔记)
  • Hammerspoon(脚本自动化)

文章作者: 高红翔
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 高红翔 !
  目录