Filipin.eu

Željko Filipin's blog.
Home Blog Tags Now License

View on GitHub
30 September 2022

Setting up a new macOS machine

by Željko Filipin

I’ve recently had to set up a new macOS machine. I don’t trust syncing, so I do it manually. I’ve heard that macOS syncing works great these days from a few people, but I still prefer to set up a new machine manually. It might be just bad experiences from the past.

I have two reasons for the manual setup. First, it forces me to keep notes on software I install and configurations I make to the operating system and applications. Secondly, over the years the machine will accumulate a lot of unused software and settings. I like to start fresh every year or two. My notes have the essentials. If I set up a new machine and notice that an application or setting is missing, I update the notes.

I’ve mentioned to a coworker that I have notes on macOS setup and she asked if I could make it public.

App Store

The first thing I install and the only app I download from the App Store is Divvy, a window manager. I know there are others, but I’ve been using this one for more than a decade and it works just fine.

Homebrew

The next thing I install is Homebrew, a package manager for macOS. I use it to install pretty much everything else.

Firefox

Then I install my favorite browser, Firefox.

brew install firefox

Next, a few Firefox addons:

Applications

Then I install other apps I use regularly.

brew install ack android-file-transfer deezer git-review google-chrome mr neovim node@14 p7zip ruby sync visual-studio-code vlc yousician zoom homebrew/cask/docker

Applications:

Terminal

I make a few minor tweaks to the Terminal.

TextEdit

I don’t use TextEdit much, but when I use it, I only need plain text editing.

macOS

I update macOS and check Finder preferences and System Preferences. I usually need to make a few tweaks.

Browsers

I prefer that browsers download to Desktop instead of Downloads folder, so I’ll make the change in Chrome, Firefox and Safari.

SSH

I mostly follow GitHub’s Generating a new SSH key and adding it to the ssh-agent page.

ssh-keygen -t ed25519 -C "computer-name"
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
ssh-add -l

I add Gerrit’s fingerprint to the known_hosts file.

ssh -oFingerPrintHash=md5 -p 29418 zfilipin@gerrit.wikimedia.org

Finally, I upload my public key to Gerrit and GitHub.

Dotfiles

I don’t have such a huge investment in my dotfiles repository as some people I know, but I still find that repository very valuable. It makes copying configuration from one machine to another trivial.

mkdir -p ~/Documents/github/zeljkofilipin/
git clone git@github.com:zeljkofilipin/dotfiles.git ~/Documents/github/zeljkofilipin/dotfiles

cp ~/Documents/github/zeljkofilipin/dotfiles/.ssh/config.macos ~/.ssh/config
cp ~/Documents/github/zeljkofilipin/dotfiles/.gitconfig ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.gitignore_global ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.mrconfig.macos ~/.mrconfig
cp ~/Documents/github/zeljkofilipin/dotfiles/.zprofile ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.zshrc ~

mr

I use mr to automatically update more than 90 repositories every day. On a clean machine, the tool will clone all repositories.

mr u

MediaWiki-Docker

I use MediaWiki-Docker for the local MediaWiki development environment.

Fresh

I use Fresh to run MediaWiki tests on my machine. When the tool is installed, download the container.

fresh-node -env -net

Visual Studio Code

Did I mention I don’t trust much in syncing? So, I Copy Visual Studio Code configuration file from dotfiles.

cp ~/Documents/github/zeljkofilipin/dotfiles/Library/Application\ Support/Code/User/settings.json ~/Library/Application\ Support/Code/User/settings.json

I really like a few extensions:

Neovim

I prefer editing text in Vim. These days I usually use Neovim in Visual Studio Code. To use Neovim in Visual Studio Code install the VSCode Neovim extension.

On macOS, h, j, k and l movement keys may not repeat in visual mode when held. This is the fix.

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

Reviewers

I would like to thank Kosta Harlan for reviewing the article and for advice on how to make it better.

tags: software