Finder

macos 在应用使用弹出式的文件选择器时选中被macos隐藏的目录,比如 /tmp/

在窗口中使用 cmd + shift + g 即可

brew

macos 上的包管理工具,类似linux的yum和apt

插件

  • 特殊命令高亮
1
2
3
4
5
6
7
brew install zsh-syntax-highlighting

cat >>~/.zshrc<<EOF
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
EOF

source ~/.zshrc

注:如果高亮不生效,在 ~/.zshrcplugins 配置追加 zsh-syntax-highlighting 即可

  • 自动建议填充
1
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

编辑 ~/.zshrc , 在 plugins 中追加zsh-autosuggestions

更换源地址

  • 中科大
1
2
3
4
5
6
7
cd $(brew --repo)
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git

cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
  • 清华
1
2
3
4
5
6
7
cd $(brew --repo)
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git

cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
  • 恢复缺省地址
    1
    2
    3
    4
    5
    cd $(brew --repo)
    git remote set-url origin https://github.com/Homebrew/brew.git

    cd $(brew --repo)/Library/Taps/homebrew/homebrew-core
    git remote set-url origin https://github.com/Homebrew/homebrew-core

显示缓存目录

1
brew --cache

为应用程序单独设置语言

1
defaults write com.apple.iWork.Pages AppleLanguages '("zh-Hans")'

Macos 实时显示按键

1
brew cask install keycastr

MacOS 10.15 文件已损坏

1
xattr -r -d com.apple.quarantine

SIP

查看SIP状态

1
csrutil status

关闭SIP

重启 Command + R 进入恢复模式

1
csrutil disable

开启 SIP

1
csrutil enable

解决 无法打开应用,应该移到废纸篓

1
sudo spctl --master-disable