跳转至

macOS#

本文记录笔者的 macOS 系统配置及常用软件

  1. 使用 TimeMachine 进行备份。加速小技巧:sudo sysctl debug.lowpri_throttle_enabled=0
  2. 重装系统,恢复到电脑自带版本,如: macOS Sierra (10.12),请谨慎选择,编者在初始化过程中发现很多软件已经不支持此版本,于是重新升级到了 macOS Big Sur(11.4)。

    在基于 Intel 的 Mac 上:如果您在启动过程中使用 Shift-Option-Command-R,您会获得 Mac 自带的 macOS 或最接近且仍在提供的版本。如果您在启动过程中使用 Option-Command-R,则在大多数情况下,您会获得与您的 Mac 兼容的最新版 macOS。否则,您会获得 Mac 自带的 macOS 或最接近且仍在提供的版本。

  3. 重命名主机名:~~System Preferences -> Sharing -> Computer Name: macbook~~ 使用 Migration Assistant 仅恢复 Time Machine 的网络配置即可

  4. 设置触发角:

    • System Preferences -> Mission Control -> Hot Corners -> Left Up Corner: Start Screen Saver
    • System Preferences -> Security & Privacy -> General -> Require password: immediately
  5. 设置屏幕保护:System Preferences -> Desktop & Screen Saver: Word of the Day | √ Show with clock

  6. 交换 Capital 和 Control 键:System Preferences -> Keyboard -> Modifier Keys -> Caps Lock Key: Control -> Control Key: Caps Lock

  7. 调整键盘响应速度: System Preferences -> Keyboard -> Key Repeat: Fast -> Delay Until Repeat: Short

  8. 设置轻点触控板: System Preferences -> Trackpad -> Tap to click √

  9. 取消 Spotlight: System Preferences -> Keyboard -> Shortcuts -> Spotlight -> Unselect Show Spotlight Search

  10. macOS 小技巧:Command + Shift + . 可以显示/隐藏 被隐藏的文件或者目录

  11. macOS 小技巧:Shift + Command + V 可以取消要粘贴的文本格式,仅保留纯文本

  12. macOS 小技巧:自带录屏工具 Command + Shift + 5, 在下方选择录屏,即可使用 QuickTime Player 进行屏幕录制。

  13. macOS 小技巧:自带截图工具 Command + Shift + 4, 可选择全屏、指定完整窗口或自定义区域。保存位置可选「Desktop/Documents」等路径,或者 Clipboard/Preview/Mail/Message 等,若想改变保存到自定义路径,可以先自行创建相应目录后,按 Command + Shift + 5,在 Options 选项中选择 Other Location...

  14. 输入法切换快捷键改为 Command + Space / Control + Command + SpaceSystem Preferences -> Keyboard -> Shortcuts -> Input Source

  15. 配置 sudo 免密码,使用 vim 编辑完成后执行 :x! 强制保存并退出:

    # sudo vim /etc/sudoers
    root ALL=(ALL) ALL
    %admin ALL=(ALL) NOPASSWD: ALL
    
  16. Homebrew

    export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/brew.git"
    export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew-core.git"
    export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles"
    
    /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"
    
    # 使用阿里云的 cask 源
    brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.aliyun.com/homebrew-cask.git
    brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.aliyun.com/homebrew-cask-versions.git
    
  17. 使用 brew bundle dump 生成已安装软件列表

    # cd ~/Backup/brew && brew bundle dump
    
  18. 使用 brew bundle 恢复软件安装

    # cd ~/Backup/brew && brew bundle [install]
    
  19. KeePassXC

    # 最好使用 brew bundle 恢复安装,如需手动安装,执行如下命令
    brew install --cask keepassxc
    # 备份的账号密码文件位于 ~/Backup/KeePassDB
    
  20. Alfred 5

    # 最好使用 brew bundle 恢复安装,如需手动安装,执行如下命令
    brew install --cask alfred
    

    密钥可查阅 KeePassXC

  21. iTerm2

    # 最好使用 brew bundle 恢复安装,如需手动安装,执行如下命令
    brew install --cask iterm2
    
  22. Zsh (系统自带) + Oh My Zsh + my.zsh-theme

  23. Vimrc

  24. 中文输入法 - 鼠须管:macOS Big Sur 自带了中文五笔输入法,但是不好用,不支持通过 Shift 键切换成英文、自定义组词等。下载安装完成后,需要退出、重新登录。我的 Rime 配置

    # 最好使用 brew bundle 恢复安装,如需手动安装,执行如下命令
    brew install --cask squirrel
    # 备份文件位于 ~/Backup/RimeSync
    
  25. Clear DNS Cache:

    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    
  26. macOS Security Settings