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.
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.
The next thing I install is Homebrew, a package manager for macOS. I use it to install pretty much everything else.
Then I install my favorite browser, Firefox.
brew install firefox
Next, a few Firefox addons:
- DuckDuckGo Privacy Essentials
- Facebook Container
- LastPass Password Manager
- uBlock Origin
- Croatian and English dictionaries
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
- ack - grep-like source code search tool.
- Android File Transfer - Transfer files between Mac and Android.
- Deezer - Music streaming.
- git-review - Submit changes to Gerrit for review.
- Google Chrome - Browser.
- mr - Multiple Repository management tool.
- Neovim - Vim-based text editor.
- Node.js - Programming language.
- 7-Zip - File archiver.
- Ruby - Programming language.
- Sync - File storage in the cloud.
- Visual Studio Code - Text editor.
- VLC - Multimedia player.
- Yousician - Learn to play an instrument.
- Zoom - Video communications.
- Docker - Containers all the way down.
I make a few minor tweaks to the Terminal.
- General > On startup, open > New window with profile: Homebrew
- Profiles > Homebrew > Text > Font > Andale Mono 14
I don’t use TextEdit much, but when I use it, I only need plain text editing.
- New Document > Format > Plain text
- New Document > Font > Plain text font > Menlo Regular 14
I update macOS and check Finder preferences and System Preferences. I usually need to make a few tweaks.
I prefer that browsers download to Desktop instead of Downloads folder, so I’ll make the change in Chrome, Firefox and Safari.
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 email@example.com
Finally, I upload my public key to Gerrit and GitHub.
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 firstname.lastname@example.org: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 ~
I use mr to automatically update more than 90 repositories every day. On a clean machine, the tool will clone all repositories.
I use MediaWiki-Docker for the local MediaWiki development environment.
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:
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
I would like to thank Kosta Harlan for reviewing the article and for advice on how to make it better.tags: macos