第一次可以使用下面的安装列表,后面可以使用TimeMachine
安装 ClashX / ShadowsocksX
你懂的~~
安装 App 和 Cli 工具
1、安装 HomeBrew 并用他安装 App 和 Cli 工具。App 可以在 homebrew-cask — Homebrew Formulae 里找有没有,Cli 工具可以在 homebrew-core — Homebrew Formulae 找有没有。
# 先开代理,不然会很慢(依赖第一步)
export https_proxy=http://127.0.0.1:1087 http_proxy=http://127.0.0.1:1087 all_proxy=socks5://127.0.0.1:1087
# 安装 HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 用 HomeBrew 安装 App,以下是我可以用 HomeBrew 安装的 App 列表(以字母排序,方便你查找)
brew install --cask \
115browser \
1password \
alfred \
battery-buddy \
coteditor \
docker \
eagle \
espanso \
figma \
google-chrome \
gas-mask \
handbrake \
iina \
iterm2 \
karabiner-elements \
keepingyouawake \
keycastr \
licecap \
microsoft-remote-desktop \
obs \
obsidian \
qq \
setapp \
shottr \
sogouinput \
sourcetree \
telegram \
thor \
usr-sse2-rdm \
videofusion \
visual-studio-code \
wechat \
zerotier-one
# 安装 Cli 工具,以下是我的(以字母排序,方便你查找)
brew install \
autojump \
bat \
cmatrix \
commitzen \
deno \
diff-so-fancy \
fd \
ffmpeg \
fzf \
gh \
git \
httpie \
hub \
hyperfine \
imagemagick \
lazygit \
mkcert \
nvm \
pnpm \
the_silver_searcher \
tig \
tldr \
tree \
ugit \
wget \
youtube-dl
2、用 SetApp 安装额外 App。
- Bartender
- CleanMyMac X
- CleanShot X
- DevUtils
- Downie
- Sip
- RapidAPI
- Paste
- Yoink
3、用 Mac App Store 安装额外 App。
- Bob
- Tot
- RunCat
- Infuse
4、通过其他渠道安装额外 App。
- Flomo x Pake
- Flux
- Reeder(国区没有)
- PDF Expert
- uPic
- ChatGPT x Tauri
准备本地目录
我在 ~/Documents 下建了两个目录(新电脑还没施工完成,这里还会补充更多目录),Code 和 SoftwareConfiguration。Code 用于存代码;SoftwareConfiguration 用于保存各种软件配置,我把 Alfred、Eagle 和 Espanso 的配置放在这里。
配置 App
按这个顺序会比较好。
Karabiner-Elements
参考 Karabiner-Element 配置 F19 键 - HackMD 。在 Karabiner-Elements complex_modifications rules 搜「Change capslock key」,import 后只保留一条和 F19 相关的,然后在命令行里编辑「~/.config/karabiner/karabiner.json」,把刚才那条规则的「capslock」换成「right_command」(两处)。这样你就把基本不会用到的「右⌘」废物利用变成了「F19」键,然后你的快捷键组合会多很多。
如果你仔细看配置,会发现「F19」是由四个键「⌘⇧⌃⌥」组成的,在一些 App 的快捷键配置里你会看到四个键,不要奇怪,这也是他。
Alfred
做几个配置。1)开启 Powerpack,2)修改快捷键为刚才配的「F19」,3)把老电脑的 Alfred 配置复制到 ~/Documents/SoftwareConfiguration/Alfred 下,然后在「Advanced」里修改配置目录指向他,你的 Workflow 就全回来了,4)「Features > Web Bookmarks」里记得把「Google Chrome Bookmarks」选上,这样就可以用 Alfred 模糊搜 Chrome 书签,用于快速打开网站。
iTerm2 和 zsh
先配置 iTerm2,这是效果图。1)Appearance 里,General 的 Theme 选「Minimal」,Pane 里不要「Show per-pane title bar with split panes」,Dimming 里选上第一和第三个,2)Profiles 里,Working Directory 里选「Reuse previous session's directory」。
安装 zsh 和 starship,starship 是 rust 写的 prompt 工具,极快。
SSH
mkdir ~/.ssh
# file name 用 github,passphrase 随意
ssh-keygen -t ed25519 -C "github"
# 编辑配置,内容如下
touch ~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/github
# 添加到系统 keychain
ssh-add --apple-use-keychain ~/.ssh/github
# 添加 public key 到 github
gh auth login
gh ssh-key add ~/.ssh/github.pub -t github
额外命令行工具:Bun
安装 Bun。我主要是用他的 run 命令,极快,上面也有别名 br
,比如执行比如 br dev
即 npm run dev
。
curl -fsSL https://bun.sh/install | bash
Espanso
我在 ~/Documents/SoftwareConfiguration/Espanso 下建了个 base.yml,内容如下(已删除个人敏感信息),并软链到 Espanso 原来的配置文件夹里。
matches:
# misc
- trigger: ";>>"
replace: ➡
- trigger: ";vv"
replace: ⬇
- trigger: ";^^"
replace: ⬆
- trigger: ";<<"
replace: ⬅
# life
- trigger: ";mobi"
replace: 我的手机号
- trigger: ";mail"
replace: 我的邮箱
- trigger: ";addr"
replace: 我的家庭住址
- trigger: ";officeAddr"
replace: 公司地址
# faq
- trigger: ";chongt"
replace: 冲突了,merge 下 master。
# code
- trigger: ";log"
replace: console.log($|$)
- trigger: ";delay"
replace: const delay = (ms) => new Promise((res) => setTimeout(res, ms));
# mac symbols
- trigger: ":cmd"
replace: "⌘"
- trigger: ":shift"
replace: "⇧"
- trigger: ":ctrl"
replace: "⌃"
- trigger: ":alt"
replace: "⌥"
- trigger: ":opt"
replace: "⌥"
- trigger: ":left"
replace: "←"
- trigger: ":right"
replace: "→"
- trigger: ":up"
replace: "↑"
- trigger: ":down"
replace: "↓"
- trigger: ":caps_lock"
replace: "⇪"
- trigger: ":esc"
replace: "⎋"
- trigger: ":eject"
replace: "⏏"
- trigger: ":return"
replace: "↵"
- trigger: ":enter"
replace: "⌅"
- trigger: ":tab"
replace: "⇥"
- trigger: ":backtab"
replace: "⇤"
- trigger: ":pgup"
replace: "⇞"
- trigger: ":pgdown"
replace: "⇟"
- trigger: ":home"
replace: "↖"
- trigger: ":end"
replace: "↘"
- trigger: ":space"
replace: "␣"
- trigger: ":del"
replace: "⌫"
- trigger: ":fdel"
replace: "⌦"
Thor
让你可以一键启动、显示或隐藏某个 App,对我来说是效率神器。但有时太快也不好,会让你无意间地快速切过去,比如钉钉、Reeder 和 Telegram 我后来就把他们去掉了。
我的配置见图,快捷键供参考。
安装字体
编程字体我用 Monolisa,之前还用过 Source Code Pro、Dank Mono 和 Operator Mono。此外我还安装了霞鹜文楷。
VSCode
辅助编辑器,施工中。
目前包含的插件如下。
dbaeumer.vscode-eslint
esbenp.prettier-vscode
GitHub.copilot
isudox.vscode-jetbrains-keybindings
kettanaito.nako
styled-components.vscode-styled-components
unifiedjs.vscode-mdx
usernamehw.errorlens
主题是 Nako - Visual Studio Marketplace。
Git
先配 name 和 email。
git config --global user.name "Your Name"
git config --global user.email "you@your-domain.com"
再执行这两条命令。
git config --global --add push.default current
git config --global --add push.autoSetupRemote true
你会收获两个好处。1)不需要「git push origin xxx」,只要「git push」,2)再也不会遇到「no upstream branch」的报错,也不需要「git push --set-upstream origin test && git push」。因为我们执行 git push 的大部分场景都是 push 到同名的 remote branch。来源是 Auto setup remote branch and never again see an error about the missing upstream | pawelgrzybek.com。
再修改 ~/.gitignore_global,加入和你 IDE 相关的 ignore 配置。我会把 .idea 加进去,这是和你相关的专有配置,如果给其他用 VSCode 的作者的项目提交时,都加上 .idea 的 .gitignore 配置,其实并不太礼貌。反之,VSCode 或其他编辑器工具的用户也要加上自己的。
*~
.DS_Store
.idea
NVM 和 Node
nvm install 18
node -v
Eagle
Eagle 的库我保存在 ~/Documents/SoftwareConfiguration/Eagle 下。
Bob
我的快捷键是「F19+A」划词翻译,「F19+S」截图翻译。插件装了 bob-plugin-deeplx 和 bobplugin-google-translate。文本翻译我加了 DeeplX、有道、阿里、金山词霸,文本识别我用腾讯 OCR。
Rectangle
删了所有快捷键,只保留两个。「F19+C」居中,「F19+M」放最大。
uPic
用了自定义图床,略。
Paste
我的快捷键是「⌘⌥C」。配置里选上「Always paste as Plain Text」,去掉「Enable sound effects」。
Reeder
两个改动。在 Shortcuts 配置里,把「Mark All as Read…」的快捷键改成「⇧A」,然后去掉「Ask before marking all as read」。
Google Chrome
登录 Google 账号后所有东西就都同步过来了,除了 Tampermonkey 的自定义脚本。但简单 Google 后也找到了办法,我参考 extracttampermonkeyscript.py · GitHub 把 /Users/%YOUR_USERNAME%/Library/Application\ Support/Google/Chrome/Default/Local\ Extension\ Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo
这个文件夹下的内容复制到新电脑后就能用了。
Telegram
登录时死活登不上,开了代理才行。
iA Writer
把所有 Markdown 文件改成用 iA Writer 打开,因为 iA Writer 又轻又好看。然后我在「系统设置 > Keyboard > Keyboard Shortcuts > App Shortcuts」中增加了一些针对 IA Writer 的快捷键配置。
- Show Preview「⌘P」
- Hide Preview「⌘P」
- Move Line Up「⌘⇧↑」
- Move Line Down「⌘⇧↓」
- Strikethrough「⌘⇧R」
Shottr
快捷键里把所有都删了,只保留两个。Area screenshot 用「F19 + 7」,Scrolling screenshot 用「F19 + 8」。
Sip
Show Picker 的快捷键是「F19 + 2」。
CleanShotX
Capture Area 的快捷键是「F19 + 6」。
系统设置
- General。1)Default Web Browser 用「Google Chrome」,2)Language & Region 里,把 First day of week 改成「Monday」,这样你的日历就会从周一开始了。
- Siri。直接禁掉。
- Trackpad。Scroll direction:Natural 去掉。
- Keyboard。1)Keyboard 里把 Key Repeat 调到「Fast」,把 Delay Util Repeat 调到「Short」,需要一点时间适应,适应后会感受到光标快速移动带来的效率提升,2)Text 里 use
"
for double quotes,use'
for single quotes,然后把其他都禁掉,不需要系统帮忙改,基本都是帮倒忙的,3)Shortcuts 里,Mission Control 用「⌥A」,Application windows 用「⌥S」,Show Desktop 用「⌥D」,Input Sources 的 Select Previous 用 「⌘Space」,Screenshots 里 Save picture of selected area as a file 用「F19 + 3」,Copy picture of selected area to the clipboard 用「F19 + 4」,4)输入法删除默认的拼音改用搜狗拼音,登录后可以在不同电脑之间同步词库,搜狗输入法的皮肤我用的Matrix 矩阵。 - Spotlight。只开 Applications、Bookmarks & History、Documents、Folders、System Preferences。
- Mission Control。把 Hot Corners 里的全部关掉,不需要,因为有 Thor 了,可以更快切除应用。
- Sharing。只留「AirPlay Receiver」即可,同时可以改下 computer name。
- Security & Privacy。把「Use Apple Watch to unlock」打开。
- Notification。不必要的全关掉,我只开了 Calendar、Find By、Reminders 和 Wallet。
- Touch ID and Password。开启用 Apple Watch 解锁。
- 执行
defaults write -g NSWindowShouldDragOnGesture -bool true
,然后就可以按住「⌘+⌃」然后鼠标点击任意地方拖动窗口了。来源 Moving a macOS window by clicking anywhere on it (like on Linux) · mmazzarolo.com,但是在 MacOS 13 下似乎失效了。