Last updated on May 13, 2021
Show Hidden Folders in Finder
MacOS Sierra introduced a quick keyboard shortcut to show/hide hidden (dot) files.
When in finder just type:
CMD + SHIFT + .
Enable Full Word Backspace in Terminal
I use the
Option + delete keyboard combo to delete full words all throughout MacOS. By default Terminal doesn’t honor the full word backspace. Enabling it is really simple:
- Go to
Terminal > Preferences > Profiles > Keyboard
- Check “Use option key as meta key”
Sudo with Touch ID
Typing your sudo password is a lot of work! Utilize the touchID Pluggable Authentication Module (PAM) to run those commands quickly!
cd /etc/pam.d sudo chmod +w sudo sudo vim sudo
Add a new first entry to include the PAM module
pam_tid.so (like so):
# sudo: auth account password session auth sufficient pam_tid.so auth sufficient pam_smartcard.so auth required pam_opendirectory.so account required pam_permit.so password required pam_deny.so session required pam_permit.so
If you’re using iTerm, you’ll need to disable this option in:
Preferences => Advanced => Allow sessions to survive logging out and back in
Restart your terminal and run a
*Actually* Disable App Relaunch On Restart
Apps relaunching on a reboot drives me crazy. I don’t want this “feature” ever, not on a crash, not when rebooting from a script, and definitely not when I reboot myself. I found this tip on Stackoverflow that restricts the permission on the file used to restore.
- Mark file as owned by root (or else MacOS will just regenerate the file)
sudo chown root ~/Library/Preferences/ByHost/com.apple.loginwindow*
- Steal all permissions
sudo chmod 000 ~/Library/Preferences/ByHost/com.apple.loginwindow*
To restore, just
rm that file so macOS can regenerate it.
Disable Bluetooth auto-connect
I have Sony WH-1000XM3 wireless headphones that I love, EXCEPT for the fact that they can only pair with one device. The headphones often auto-connect to my Macbook, even if it’s closed and sleeping. If i’m trying to pair the headphone to my phone, this can get very annoying as the only way to unpair is to login to my Macbook and disconnect from there.
I disable Bluetooth auto-connecting across the board with this terminal command:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist DontPageAudioDevices 1
Drag a window by clicking anywhere
I wanted the linux alt-drag functionality, and luckily in MacOS similar functionality is hidden behind a flag. I found this tip here.
defaults write -g NSWindowShouldDragOnGesture -bool true
After rebooting, hold down ctrl+cmd and click a window to drag. This pairs nicely with a window manager like Magnet.
If you want a little more functionality there is a GitHub Projectby dmarcotte called called easy-move-resize.
Vim Extension: Press and hold movement keys (H,J,K,L)
If you use the Vim extension in VSCode, you’ll notice that when a movement key is held down it will only trigger once instead of holding like you’d expect.
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
Execute this in your terminal and restart VSCode to fix it.
First Hour Installs
Below is a list of the software (off the top of my head) that I immediately install on a fresh Mac.
- pcregrep (grep across lines)
- Proxyman - alternative: MITMProxy
- Proxifier (or something like it)
- Burp Suite Community
- VS Code
- Little Snitch
- Hex Fiend
- Discovery: DNS-SD Browser
- Texpad (LaTeX)
I back up my dotfiles and configuration settings. Notably some vim, vscode keybindings, and git settings. These are easy to restore with a symlink.