Mac 系统装机配置指北

前置条件

允许任何来源

1
sudo spctl --master-disable

下载梯子

终端配置

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

复制 .zshrc 文件

https://github.com/Layouwen/config-backup/blob/master/mac/.zshrc

用户名和一些文件路径需要替换一下

spaceship 主题需要执行下面的命令

1
2
3
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

安装 bun

1
curl -fsSL https://bun.sh/install | bash

下载 brew

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

如果需要使用清华国内源,先设置环境变量,在 brew update

设置按键时长

设置三脂拖拽

开启轻点触发

设置 F1-F12 为默认键

设置显示秒

无法按住持续连按

关闭 ApplePressAndHoldEnabled

1
2
3
4
5
6
7
8
9
10
11
12
defaults write com.jetbrains.WebStorm ApplePressAndHoldEnabled -bool false # webstorm
defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false # idea
defaults write com.runningwithcrayons.Alfred ApplePressAndHoldEnabled -bool false # Alfred

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false # For VS Codium
defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false # For VS Codium Exploration users

defaults write -g ApplePressAndHoldEnabled -bool false # 全局设置

defaults delete -g ApplePressAndHoldEnabled # If necessary, reset global default

brew相关

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
brew install \
cowsay \
zplug \
trash \
neofetch \
scc \
duf \
diff-so-fancy \
lolcat \
fzf \
figlet \
tmux \
ctop

# ripgrep \
# bat \
# tldr \
# thefuck \
# nvm \
  • scc 更好的统计代码量
  • duf 更好的 diff
  • diff-so-fancy diff 后的 grep 过滤管道
  • fzf 全局查看文件
  • figlet 输出字符英文画
  • lolcat 彩色输出管道
  • 10.15.x 支持不太友好
    • tldr 更好的查看 -h
    • bat 更好的 cat 替代
    • ripgrep 更好的 grep

注意事项

nvm 安装完后,需要创建 ~/.nvm 以及更新 ~/.zshrc 的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
brew install --cask \
iterm2 \
bob \
mqttx \
firefox \
postman \
nutstore \
soapui \
jetbrains-toolbox \
iina \
adrive \
baidunetdisk \
apifox \
wechatwebdevtools \
visual-studio-code \
ticktick \
snipaste \
wechat \
qq \
telegram \
sourcetree \
sunloginclient \
wechatwork \
feishu \
discord \
tencent-lemon \
neteasemusic \
picgo \
macdown \
1password \
drawio \
microsoft-edge \
mongodb-compass \
chatbox \
steam \
google-chrome \
notion \
notion-calendar \
tencent-meeting \
josm \
hbuilderx \
font-jetbrains-mono \
sublime-text \
thunder \
obsidian

# 新版
brew install --cask \
docker \
proxyman \
todesk \
dingtalk \
arc \
obs \

# spotify \
# background-music \
# warp \
# youdaonote \

特殊版本软件

[[软件推荐]]

配置 git

[[Git#git 基本配置]]

配置 vim

[[Vim配置文件]]

Nvm

[[Nvm]]

Npm

[[配置]]

npm global package

1
2
3
4
5
6
7
pnpm i -g git-open \
yarn \
serve \
http-server \
pnpm \
nrm \
ts-node

与 windows 同步 [[Windows系统装机配置指北#npm global package]]

配置 iterm2

分屏进入上一个目录

配置 Alfred

[[Alfred 5]]