Skip to content

Instantly share code, notes, and snippets.

@pesterhazy
Last active April 25, 2025 08:09
Show Gist options
  • Save pesterhazy/be940a7868afb74a986d5b156855a145 to your computer and use it in GitHub Desktop.
Save pesterhazy/be940a7868afb74a986d5b156855a145 to your computer and use it in GitHub Desktop.
Setting up macOS

This guide helps me set up my macOS laptop in a fairly simple manner. I'll need to go back to this guide roughly every 2–3 years. Maybe it'll help you, too!

Smart Caps Lock

Use Karabiner Elements

Map Caps Lock to Ctrl (when long-pressed) or Escape (when tapped). See this guide

Put backtick/tilde character to the left of 1 key

Use Karabiner Elements

adding the following entry in Simple Modification – For all devices – non_us_backslash -> grave_accent_and_titlde.

On a German keyboard, this changes caret key to produce the backtick/tilde characters, which is very frequently needed for coding and hard to reach when it's to the left to the Y/Z key.

Faster key repeat

Gotta go faster than the defaults

defaults write -g InitialKeyRepeat -int 13
defaults write -g KeyRepeat -int 1 

You need to log out and log in again to make these settings take effect. source

Software

Necessary

Optional

  • cleanshot X - screenshots that you can draw on. I didn't know I needed this! Best feature: you can OCR strings on your screen ("Capture Text")

Homebrew

The package manager for macOS that's not great but kinda works

Create the initial version of the Brewfile:

brew bundle dump

Re-install from scratch

brew bundle --force --cleanup

Emacs

This distribution works best for me

iTerm2

zsh

git

Put this in your ~/.gitconfig:

[push]
        default = current
        autoSetupRemote = true

[alias]
        st = status -sb
        co = checkout
        c = commit -v
        
        a = add -p
        i = !git add -N . && git add -p

        wip = commit -mWIP
        pp = "!git fetch && git merge --no-edit && git push"
        trash = "!f() { branch=$(git symbolic-ref --short HEAD); git reset --hard \"origin/$branch\" ;} ;f"
        sync = fetch origin main:main
        leaderboard = shortlog -s -n --no-merges
        branches = for-each-ref --sort=committerdate refs/heads/ --format="%(authordate:short)%09%1B[0;33m%(refname:short)%1B[m%09"
        touched = diff --relative --name-only main...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment