New Mac Setup

Published on

New laptop time! Another lap around the sun, and another chance to re-learn how to invert the default scroll direction on my Apple machine. This post is for future me, and possibly present you.

Mac UX changes

I tend to really like most design choices Apple makes. Except for the following, which I tend to slowly turn off as a stumble into them.

This is on Sonoma 14.4.1.

Reversing touchpad scroll direction

There's nothing natural about letting users get accustomed to something, and then naming the opposite thing "natural". Flipping this back to the way it started out.

  1. Open System Settings from the Apple menu
  2. Open Trackpad settings
  3. Tap the Scroll & Zoom tab
  4. Turn off Natural scrolling
keyboard preferences

Disabling "double space periods"

Macs have a default setting where if you type two spaces after a word, the first will be replaced with a period (...assuming you forgot to end a sentence?).

Let's turn this off.

  1. Open System Settings from the Apple menu
  2. Open Keyboard settings
  3. Under Text Input > Input Sources, select Edit
keyboard preferences
  1. Toggle off the Add period with double-space flag
keyboard inputs

Disabling hot corners

Macs also have a setting where you can conjure a special action by moving the mouse to a corner. This is unnecessary for me, since I'm happy opening Notes and other programs using Spotlight (⌘ + {SPACE}).

Let's turn off the default action of creating a note when mousing into the bottom right corner (the only one configured out of the box).

  1. Open System Settings from the Apple menu
  2. Open Desktop & Dock settings
  3. Scroll to the bottom and pick Hot Corners...
system settings
  1. Remove the configuration for the bottom right corner action
disabling hot corners

Disabling the emoji picker

I don't really need the emoji picker to be accessible from the tap of a single key, and based on my physical keyboard, it's quite possible to fat finger the 🌐 key and interrupt typing.

emoji keyboard

It's giving Sagitarius ☼, Libra ☽, Gemeni ↑

Let's free up that binding since I have no use for it - easy enough to add emoji directly in iMessage.

  1. Open System Settings from the Apple menu
  2. Open Keyboard settings
  3. In the row labeled Press 🌐 key to, hit the select control and choose Do Nothing
emoji keyboard settings

Disabling dock app suggestions

Lastly, let's turn off the "pin recent items to the dock" functionality that bloats the dock.

  1. Open System Settings from the Apple menu
  2. Open Desktop & Dock settings
  3. Turn off the toggle for Show recent applications in Dock
recent applications

iTerm2 customization

I'm not sure what most folks use these days, but I've been using iTerm2 and zshell for quite some time. Just have a couple navigation and "word" handling changes to make.

Setting up word deletion

This means I can hit the left option key and delete, and delete the previous "word" until we find "whitespace".

$ foo bar baz▐
<hits OPT + DEL>
$ foo bar▐

I'm sure there are fancy ways to alter what counts as whitespace, but I don't know them.

  1. Open Preferences for iTerm2 (shortcut is ⌘ + ,)
  2. Navigate to the Profiles tab
  3. Hit the Keys sub tab for the default profile
  4. Hit the Key Mappings sub sub tab
  5. Under Presets..., enable Natural Text Editing
enabling natural text editing

Careful! This will reset key mappings associated with this profile. If you run this after setting up other custom bindings, you may have to create them again.

Option keys shifting by word boundaries

I find it easier to jump around in a terminal while holding the option key and using the directional arrows (read: I never learned vim).

  1. Open Preferences for iTerm2 (shortcut is ⌘ + ,)
  2. Navigate to the Profiles tab
  3. Hit the Keys sub tab for the default profile
  4. Make sure that the option key you favor acts as escape (Esc+)
setting up keyboard
  1. Hit the Key Mappings sub sub tab

  2. Create a key mapping for βŒ₯ + ← to send the the escape sequence b

    send b

    Use the plus icon to create the two key mappings

    keyboard shortcut

    Tap on Click to Set and record your binding, then hit OK

  3. Create another that uses βŒ₯ + β†’ to send the escape sequence f

Try it out in a terminal to make sure you can bounce around to your liking.

Start new tabs in current directory

I prefer the current working directory to be preserved when I open new tabs in iTerm2.

  1. Open Preferences for iTerm2 (shortcut is ⌘ + ,)
  2. Navigate to the Profiles tab
  3. Select Reuse previous session's directory under Working Directory
    reuse current directory

Git config

Most aliases and setup I use for git are already covered in my post on Commit Hygiene, but there's one I missed.

Disabling the pager for git branch

I don't like having less configured to show me the couple branches I may have locally.

Run the following from a command line:

git config --global pager.branch false

I would read this as 'disable the pager when running git branch'

Brew and friends

Can't install anything on a Mac without brew - installation instructions here: https://brew.sh/.

Packages

I use ag for searching and tree for visually looking at file and folder layouts.

With brew installed, we can set add these with:

brew install ag
brew install tree

Here's a little demo of each:

➜  public git:(mac-setup) βœ— tree -L 2 | head
.
β”œβ”€β”€ feed.xml
β”œβ”€β”€ search.json
β”œβ”€β”€ static
β”‚Β Β  β”œβ”€β”€ favicons
β”‚Β Β  └── images
└── tags
    β”œβ”€β”€ asdf
    β”œβ”€β”€ bash
    β”œβ”€β”€ canada

List all folders / files in this directory, or nested one level - limit that output to ten lines.

➜  public git:(mac-setup) βœ— tree -L 2 | ag react
    β”œβ”€β”€ react

List all folders / files in this directory, or nested one level - then filter for lines containing 'react'.