Markus Löning

Software Engineering & Machine Learning

Setting up my new macOS laptop

Posted at Sep 27, 2024 13:49:57 — Last modified at Oct 7, 2024 00:07:11

I recently had to set up my new macOS laptop and wanted to take some notes so that I can do it more quickly the next time. This blog post was very useful.

Manual configuration

Some things I configure manually, even though they could be automated:

Install command-line tools

xcode-select --install

Install homebrew

Install homebrew:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Add brew command to path:

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/mloning/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Install system packages

brew install \
  neovim \
  tmux \
  alacritty \
  eza \
  stow \
  bat \
  fzf \
  fd \
  gh \
  gpg \
  node \
  htop \
  tree \
  ripgrep

Install oh-my-zsh with powerlevel10k

Install oh-my-zsh with plugins specified in .zshrc file:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM//plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins $ZSH_CUSTOM/plugins/autoupdate
omz reload

In addition, I install the powerlevel10k them:

Install my dotfiles

Next, I add my configuration files from my dotfiles repo:

mv ~/.zshrc ~/.zshrc.bak
mkdir ~/Dev/projects && cd ~/Dev/projects && git clone https://github.com/mloning/dotfiles.git && cd dotfiles && make create
omz reload

Install tmux plugins

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

To install the plugins, open a tmux session and press: tmux prefix + I.

Install Python

Install miniforge:

brew install miniforge
conda init "$(basename "${SHELL}")"
omz reload
conda info

Create GPG keys

Finally, if you want to sign your git commits using GPG keys, you have to generate new keys and add them to your GitHub account.