Setting up a MacBook from scratch for the first time in 8 years

—

by

in ,

Oh boy, did I not think about a lot of stuf…

For the past 8 or so years I’ve always used my work MacBook for all things dev, including private development. I’ve spent a lot of time setting up and changing my zsh, and later fish, configs, configuring iTerm, trying out different themes, … you know the drill.

When I decommissioned my old Mac and got my new shiny Mac from AOE, I realised I didn’t have any backups for all my app configs (iTerm, VSCode, …), so I had to start from zero. 😬

iTerm 2

Since forever iTerm 2 has been my go-to Terminal on MacOS. I’ve never found any terminal emulator that’s as reliable, fast, and custimizable as iTerm 2, plus there’s tons of community resources online.

The last time I had a fresh, clean iTerm installation was a long time ago, so I was quite shocked by the defaults. I’ve really gotten used to all my fancy customizations and adjustments.

Naural Text Editing

I didn’t even know that this wasn’t the standard for iTerm, but after a short search I found https://apple.stackexchange.com/a/293988 this stackexchange answer which is exactly what I wanted.

  1. Go to Preferences… > Profiles > Keys (not Preferences… > Keys)
  2. On current versions (3.14+) you then switch to the Key Mappings tab
  3. Press Presets… dropdown button.
  4. Select Natural Text Editing

Natural Text Editing sets some sensible defaults, like navigating by-word using Option + Left Arrow, or moving to the start of a line by pressing Cmd + Left Arrow, end of line with Cmd + Right Arrow, and so on – navigating the command line (like, the actual line) feels natural now.

Oh-My-Zsh

Years ago I was a oh-my-zsh user but then I switched to fish shell. With the new Mac and zsh being the default shell anyway I decided to try zsh again. At the end of the day it doesn’t matter that much, and zsh (and bash as well) have a lot of great tools and scripts to enhance them.

Anyway, I basically just installed oh-my-zsh and disabled all plugins for the prompt as I’m using starship for my prompt (see below).

I’ve also used zplug for zsh plugin management so oh-my-zsh is only used for all its default settings at the moment.

Starship pompt

starship is a super fast and awesome prompt written in rust. It’s cross-shell and cross-platform and comes with batteries included – meaning it has a lot of integrations with popular tools and frameworks.

I’ve been using starship for some time with bash and fish shell, so it was a natural choice. I disabled all plugins in oh-my-zsh, as the prompt is now handled by starship instead.

Here’s my current starship.toml config file.

format="""
$username\
$hostname\
$localip\
$kubernetes\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_metrics\
$git_status\
$docker_context\
$package\
$golang\
$helm\
$nodejs\
$python\
$rust\
$terraform\
$aws\
$env_var\
$custom\
$sudo\
$cmd_duration\
$line_break\
$jobs\
$time\
$status\
$shell\
$character
"""

# Replace the '❯' symbol in the prompt with '➜'
[character]
success_symbol = '[➜](bold 219)' 
error_symbol = '[✕](bold 45)'

219 and 45 are color codes taken from this graphic (via https://i.stack.imgur.com/KTSQa.png).

And below you can see what the prompt looks like. I think it’s cute, and a nice start. ✨

Screenshot of iTerm2 showing the prompt and colors for errors and success. With success an arrow in pink is shown as prompt symbol, with failure a blue X is displayed.

Keyboard setup

I like to use the English keyboard layout since I write English most of the time and all keys for programming are better reachable on the English keyboard.

Screenshot showing the English keyboard layout
The US International PC keyboard layout

All the nice keys one needs for programming are on the right side of the keyboard, which is a lot easier to reach than having all of these keys in the top row, as it is the standard on the German keyboard layout.

The only problem was that by default Umlauts (ä, ö, ü) are hard to type. The default was to type Option + u followed by the base-letter a, o, or u.

A more convenient way in my opinion is to type a quote " and then the letter to create the Umlaut, which doesn’t interrupt my typing.

This only works when the keyboard is set to “US International - PC“.

  • Go to System Preferences
  • Select Keyboard
  • Scroll to Text Input
  • Click the + sign to add a new keyboard
  • Search for “US International – PC
  • Remove the Text Input (called ABC)

VSCode

For a long long time I’ve used VSCode as my day-to-day editor for all things. Ansible roles, Terraform modules, Rust and Go, HTML/CSS/JavaScript, Shell scripting, … it’s just a perfect fit for me. It has so many extensions that it can work with anything.

Other software

I’m sure I am still missing something, but it’ll be installed when it’s needed. For now I have a device I can work with comfortably.


Comments

Leave a Reply