everyday mac tools

The Mac settings developers change first on a new machine

· 7 min read

The Mac settings for developers that matter most fall into four groups: make Finder show what it hides (hidden files, extensions, full paths), make the keyboard behave (fast key repeat, no accent popup on held keys, real function keys), switch off the text substitutions that break code, and set up Terminal (the command line tools, Touch ID for sudo). Most live in System Settings. A few exist only as defaults write commands, and every one of them can be undone.

Finder: show what it hides

  • Hidden files. Press Shift-Command-period in any Finder window or Open dialog to toggle them. To make it the default, run defaults write com.apple.finder AppleShowAllFiles -bool true and then killall Finder. Show hidden files in Finder has the details and the reverse.
  • Every file extension. Finder, Settings, Advanced, Show all filename extensions. Without it, Finder hides the extension on most files, and two files that differ only in extension look identical. Show file extensions for every file covers the apps that override it.
  • Where you are. View, Show Path Bar puts the current folder’s full location at the bottom of every window. For the POSIX path in the title bar as well, run defaults write com.apple.finder _FXShowPosixPathInTitle -bool true and killall Finder.
  • The Library folder. Open your home folder, press Command-J, and tick Show Library Folder. You will be in ~/Library more often than the defaults assume.

Keyboard: repeat, accents and function keys

In System Settings, Keyboard, drag Key repeat rate to Fast and Delay until repeat to Short. If the fastest setting still feels slow for moving the cursor through code, the system accepts faster values than the sliders offer:

defaults write -g KeyRepeat -int 2
defaults write -g InitialKeyRepeat -int 15

Log out and back in. A faster key repeat rate explains the numbers.

Holding a letter key shows an accent menu instead of repeating the letter. That is helpful in prose and infuriating in a modal editor where holding a key is how you move. Turn it off with:

defaults write -g ApplePressAndHoldEnabled -bool false

Quit and reopen your apps afterwards. defaults delete -g ApplePressAndHoldEnabled restores it.

Three more in the same pane:

  • Function keys. Keyboard Shortcuts, Function Keys, Use F1, F2, etc. keys as standard function keys, if your debugger and editor bind them. Brightness and volume then need the Fn or Globe key.
  • Caps Lock. Keyboard Shortcuts, Modifier Keys lets you turn Caps Lock into Control or Escape, per keyboard.
  • Keyboard navigation. Switch it on and Tab moves focus between every button in a dialog, so you can answer “Don’t Save” without the mouse.

Text substitutions: off before they touch code

macOS replaces straight quotes with curly ones and corrects words it does not know. Paste a command from a note into Terminal and it fails, because a curly quote is not a quote to the shell.

Go to System Settings, Keyboard, then under Text Input click Edit next to your input sources. Turn off:

  • Correct spelling automatically
  • Capitalize words automatically
  • Add period with double-space
  • Use smart quotes and dashes

Individual apps can still switch these on for themselves, under Edit, Substitutions. Turn off autocorrect, smart quotes and substitutions covers the per-app cases.

Terminal and the command line

Install the command line tools. Run xcode-select --install and accept the prompt. You get the compilers, make and the usual version control tools without downloading all of Xcode. You need full Xcode only for building Apple platform apps or running the simulators.

Know your shell. New accounts use zsh, which reads ~/.zshrc, not .bash_profile. Move aliases and PATH changes there.

Use Touch ID for sudo. On macOS Sonoma and later, one file makes sudo accept your fingerprint, and it survives system updates:

sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
sudo nano /etc/pam.d/sudo_local

Remove the # at the start of the auth sufficient pam_tid.so line and save. It works in local Terminal windows. It does not apply over SSH, where there is no fingerprint sensor to ask, and may not work inside a terminal multiplexer.

Terminal itself. Terminal, Settings, Profiles, Keyboard has Use Option as Meta key, which many shell shortcuts assume. Open Terminal at a folder covers jumping in from Finder.

Keep builds and tools out of the way

  • Spotlight. Build output and dependency folders fill search results and keep the indexer busy. Add them to System Settings, Spotlight, Search Privacy (Siri & Spotlight, Spotlight Privacy on Ventura and Sonoma). Exclude a folder from a file search walks through it.
  • .DS_Store files on shared drives. defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true stops Finder writing them to network volumes; DSDontWriteUSBStores does the same for USB drives. Log out and back in. Stop .DS_Store files appearing covers what they are for.
  • Long jobs and sleep. caffeinate -i ./build.sh keeps the Mac from idle sleeping for exactly as long as the command runs, then lets it sleep normally.
  • Spaces. In System Settings, Desktop & Dock, turn off Automatically rearrange Spaces based on most recent use, or your carefully arranged editor and terminal desktops will reorder themselves.

Undoing any of it, and doing it twice

Every defaults write above is reversed by defaults delete with the same domain and key; the setting returns to the system default. What defaults write does and how to undo one safely explains how to read the current value first, which is worth doing before you change anything.

Keep the commands in a file with your dotfiles, so the next Mac takes minutes. If you would rather not maintain a script, Mainspring has most of the Finder and keyboard changes as one-click power-ups: show hidden files, full path in the Finder title, all file extensions, fast key repeat, autocorrect and smart quotes off, no .DS_Store on external drives and a custom screenshot folder. Its Developer Setup recipe applies a set of them together, and it snapshots every value before changing it, so the whole set reverts in one click. It changes settings only; it does not install tools. It is $29 once for up to three Macs, with a one-day free trial.

Questions

Do developers need full Xcode on a Mac? Only for building apps for Apple platforms or using the simulators. The command line tools cover compilers, make and version control for most other work, at a fraction of the size.

Will a macOS update reset these settings? Most survive. A few occasionally revert after a major update. Mac settings that revert after a macOS update lists the usual suspects.

Why does holding a key not repeat in some apps? That is the accent popup. Turning off ApplePressAndHoldEnabled makes held keys repeat everywhere; restart the app after changing it.