index

How I configure and use my Mac.

Latest update: September 3, 2023

Contents

  1. Installing software
  2. Terminal
  3. Keyboard
  4. Mouse
  5. Audio
  6. Window management
  7. Launching apps
  8. Dock
  9. Various shortcuts
  10. Node

Installing software

Use the App Store

It's trustworthy and updates automatically, so I prefer to use the Apple App Store when possible.

Install Brew

Most things aren't on the App Store, though. Brew is a third-party package manager that lets you install almost everything else. Install it by following the instructions at brew.sh.

Here are some common commands:

brew search PATTERN
brew info PACKAGE
brew install [--cask] PACKAGE
brew upgrade [--greedy]

Terminal

Install iTerm2

iTerm2 has some nice features that the Apple Terminal lacks, like fancy tmux handling.

brew install --cask iterm2

Set unlimited scrollback

iTerm 2 > Settings > Profiles > Default > Terminal > Unlimited Scrollback

Make the Option key act like Alt on Linux

iTerm 2 > Settings > Profiles > Default > Keys > Left Option Key: Esc+

Keyboard

Bind Caps Lock to Escape

Sometimes I use vim, and escape is too far away, plus I never want Caps Lock.

System Preferences > Keyboard > Keyboard Shorcuts... > Modifier Keys


Caps Lock (⇪) key ⎋ Escape

Remap special keys

My Keychron K8 keyboard has toggle that switches between Windows and Mac mode, which controls what the 2 keys to the left of the spacebar do. I like to keep it on Windows mode so that it works normally on Windows and Linux by default, and then swap those keys in the macOS settings so that I never have to flip that switch.

You don't want to do this unless you have a similar weird keyboard situation.

System Preferences > Keyboard > Keyboard Shorcuts... > Modifier Keys


Option (⌥) key ⌘ Command
Command (⌘) key ⌥ Option

Make F1, F2, etc. keys work normally

macOS interprets the F keys on my Keychron K8 as brightness, volume, etc. keys instead of normal F keys.

System Preferences > Keyboard > Keyboard Shortcuts... > Function Keys > Use F1, F2, etc. keys as standard function keys

Repeat when holding a key instead of opening accent menu

When holding down a key, macOS sometimes opens an accent selection menu instead of repeating that key. To disable it, run this command and log back in.

defaults write -g ApplePressAndHoldEnabled false

Faster repeat and delay

System Preferences > Keyboard > Key repeat rate > Fast


System Preferences > Keyboard > Delay until repeat > Short

Mouse

Install LinearMouse

LinearMouse is a utility that gives you more advanced control over your cursor.

brew install --cask linearmouse

Disable mouse acceleration

I'm really used to Linux and Windows cursor behavior, which doesn't usually have acceleration, so I disable it.

LinearMouse > Pointer > Acceleration > 0

Note you can instead check "Disable pointer acceleration", but then you can't also control the cursor speed.

Tweak cursor speed

I like it a certain speed that I'm used to.

LinearMouse > Pointer > Speed > 0.3

Reverse scroll wheel direction for the mouse but not the trackpad

So-called "Natural" scrolling feels fine on the trackpad, but it feels weird when scrolling the mouse wheel down scrolls up. LinearMouse lets you control the mouse and trackpad's scrolling direction independently.

LinearMouse > Scrolling > Reverse Scrolling

Audio

Switch input devices more easily

The built-in audio menu bar icon lets you quickly switch output sources, but not input sources.

Install Signal Shifter through the App Store to get a menu bar icon that lets you switch both.

Launch it on boot:

Signal Shifter > Open at Login

Play beeps and boops through the current audio device

By default system beeps and boops always play through the built-in laptop speakers.

System Settings > Sound > Play sound effects through: Selected Sound Output Device

Use a classic Mac alert sound

I like this one. It's nostalgic.

System Settings > Sound > Alert sound > Sonumi

Window management

Built-in shortcuts

These are the built-in window-related shortcuts I find useful. I learned most of them from Apple's Mac keyboard shortcuts page.

Cycle through apps Command-Tab
Cycle through windows of front app Command-`
Hide front app Command-H
Show only front app Option-Command-H
Show only a particular app Option-Command and click on a Dock icon
Hide all apps Option-Command and click on the Desktop

Install Moom

For advanced window management you need a third party app. There are many options. Moom is a good one. It costs $10. You can install Moom from the App Store. A free alternative is Rectangle, but it doesn't support layouts.

Launch it on boot:

Moom > Preferences > General > Launch automatically on login

Move windows with the keyboard

Moom lets you configure keyboard shortcuts for different "Move and Zoom" commands.

Moom > Custom

These are some bindings I use:

Move to left half of screen Command-Option-Control-Left Arrow
Move to right half of screen Command-Option-Control-Right Arrow
Maximize to entire screen Command-Option-Control-F
Move to left monitor Command-Option-Control-,
Move to right monitor Command-Option-Control-.
Revert to previous position Command-Option-Control-Enter

Saved layouts

Moom lets you arrange some windows, save it as a layout, and then recall the layout with a keyboard shortcut.

Moom menu icon > Save Window Layout Snapshot...

These are some layouts I use:

Coding (IDE, terminal, browser) Command-Option-Control-C
Browsing (2 side-by-side browser windows) Command-Option-Control-B
Discord (Discord, browser) Command-Option-Control-D

Note that recalling a Moom layout doesn't open an app if it's not already running, unfortunately.

Launching apps

Spotlight (Command-Space) is a quick way to launch apps and do math using the keyboard, but I prefer it doesn't also show my files and other things, because that's not useful for my usual workflow and makes the results distracting. So, I restrict its results like this:

System Settings > Siri & Spotlight > Spotlight > Search results

Dock

Auto-hide the dock

I try to use the keyboard instead of the dock whenever possible, and prefer to keep more screen real-estate free.

System Settings > Desktop & Dock > Automatically hide and show the Dock

Remove apps you don't use

By default the dock is full of apps I don't use, like Photos, Messages, and Contacts. Drag them out of the dock and wait a second until it says "Remove" to remove them.

Various shortcuts

Various other keyboard shortcuts I use. See also Window management above, and Apple's Mac keyboard shortcuts for a more complete list.

Lock Screen Command-Control-Q
Show/hide the Dock Command-Option-D
Move file to Trash (Finder) Command-Backspace
Empty Trash (Finder) Command-Shift-Backspace
Open preferences for most apps Command-,

Node

nvm (Node Version Manager)

nvm (Node Version Manager) is a nice way to install, update, and switch between different versions of Node.

However, nvm will make spawning new shells significantly slower by default, because it does some expensive checking to automatically determine the right version of Node to use. I like to use a trick to defer this logic until a Node-related command is actually called for the first time in a shell session. Credit to Ioannis Poulakas for this idea.

~/.zprofile
# Defer slow nvm startup until the first time running a node-related command
lazy_load_nvm() {
  unalias node npm nvm
  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
}
alias node="lazy_load_nvm && node"
alias npm="lazy_load_nvm && npm"
alias nvm="lazy_load_nvm && nvm"