主要记录下自己比较习惯的 Mac 系统重装后的最小化基础设置工作流
仅为自己习惯而已
重装流程
基础设置
任意来源
让软件安装更 宽泛 (当然也更危险)
sudo spctl --master-disable
设置
> 安全与隐私
> 通用
> 点按锁按钮以进行更改
允许从以下位置下载的App
改为任意来源
触控板
基础操作手感
设置
> 触控板
> 光标与点按
- 勾选
轻点来点按
设置
> 触控板
> 滚动与缩放
- 全部勾选
设置
> 触控板
> 更多手势
- 全部勾选
键盘
- 长按单键手感
设置
> 键盘
> 键盘
> 按键重复
- 调节到
快
(最大)
设置
> 键盘
> 键盘
>重复前延迟
- 调节到
短
(最大)
外接机械键盘
- 交换
ALT
和WIN
键映射, 匹配 MAC 习惯
设置
> 键盘
> 修饰键...
Option (⌥)键
改为⌘ Command
Command (⌘)键
改为⌥ Option
- 快速切换输入法
设置
> 键盘
> 快捷键
> 输入法
选择上一个输入法
改为禁用
选择 “输入法” 菜单中的下一个输入法
改为⌘ + 空格键
基础环境
魔法
导入 (或添加) vps 配置
WireGuard (美区 app store)
导入 (或添加) 配置
ZSH
安装
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
配置 (~/.zshrc
)
alias zshconfig="vim ~/.zshrc"
alias ohmyzsh="vim ~/.oh-my-zsh"
alias vscode="/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code"
# v2ray
alias proxy="export http_proxy=http://127.0.0.1 https_proxy=$http_proxy"
alias unproxy="unset http_proxy https_proxy"
# homebrew 加速
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles
# github
export GH_TOKEN=""
# android
export ANDROID_HOME=/Users/zfkun/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
# jdk
# ...
# rust
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
# go
export PATH="$PATH:/Users/zfkun/go/bin"
# flutter
# ...
# dotnet
# ...
# unreal
# ...
# unity
export PATH="$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin"
# godot
# ...
# home
export PATH="$PATH:/Users/zfkun/bin"
SSH
# 默认 (常用)
ssh-keygen -t rsa -P "" -C "zfkun@msn.com"
# Mac 版本 13 之后可能会碰到 `Permission denied (publickey)` 错误 (比如 `git clone`)
# 需用 ed25519 秘钥类型:
ssh-keygen -t ed25519 -P "" -C "zfkun@msn.com"
Homebrew
网络 (确保通常)
ping raw.githubusercontent.com
不通, 则需 Host 配置 (/etc/hosts
), 解决 DNS污染
问题
借助 ipaddress 查询结果:
185.199.108.133 raw.Githubusercontent.com
185.199.109.133 raw.Githubusercontent.com
185.199.110.133 raw.Githubusercontent.com
185.199.111.133 raw.Githubusercontent.com
安装
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
加速
添加到
~/.zshrc
或~/.bashrc
或~/.bash_profile
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles
Git
安装
brew install git git-flow
配置
git config --global user.name zfkun
git config --global user.email zfkun@msn.com
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.df diff
Alfred
安装
同步配置 Alfred/Alfred.alfredpreferences
iTerm
开发环境
Node
借助 nvm 管理
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install node
# `npm.taobao.org` `registry.npm.taobao.org` SSL证书 2024.1.22 过期, 需使用新域名
npm config set registry https://registry.npmmirror.com
Flutter
借助 fvm 管理
brew tap leoafarias/fvm
brew install fvm
fvm use stable
Golang
借助 gvm 管理
shell~~ ~~bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)~~ ~~
gvm 安装 1.20 以上版本, 需要先安装 低版本 用于自身编译, 过程太繁琐
brew install go
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
Rust
官方 rustup 管理
安装
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustc --version
cargo --version
rustup --version
加速
cat >> ~/.cargo/config << EOF
[source.crates-io]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
EOF
常用软件
Visual Studio Code
登录同步
1Password
TODO
Sketch
最高版本 96.3 (支持 Big Sur 11.7.10)
14年的老本, 也只能这样了
PhotoShop
无需多言