Setting up a new MacBook for development
/ 4 min read
Table of Contents
XCode
- Start by installing
xcode-select
- Afterwards you can install XCode Command Line Tools with
xcode-select --install
Package Manager
- Install the Homebrew package manager:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Update
.zprofileto addbrewto yourPATH
eval "$(/opt/homebrew/bin/brew shellenv)"- Open a new terminal and verify with
brew --versionorwhich brew
Download Terminal Emulator
- Right now I’m enjoying ghostty
brew install ghosttyPassword Manager
- Install 1Password utility
brew install 1password- And install the browser extension too
Configure SSH Agent
- Start by adding a new SSH key on GitHub with the help of 1Password:
- Go to SSH keys settings page on GitHub
- Select New SSH Key
- Use 1Password prompt to generate an SSH key; it will automatically be saved into your 1Password vault
- Make sure 1Password SSH agent is enabled, under 1Password > Settings > Developer
- Finish configuration by updating
.ssh/configto use 1Password as anIdentityAgent
Host * IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"- Now, whenever an application attempts to read your private SSH keys, you will be prompted by the 1Password app to authorize the action
- Read more about the 1Password SSH agent
Configure Dev Environment
Dotfiles
- I’m using dotbot as a dotfiles manager
- It works by symlinking files from my
/dotfilesrepository to the locations required by my system
git clone git@github.com:Amar-Gill/dotfiles.git; cd dotfiles; ./installCommand Prompt
- I’m using p10k.zsh, a tried and true zsh theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"- Look into Starship as another good choice
curl -sS https://starship.rs/install.sh | shCommand Line Utilities
- The following can be installed with
brew
brew install fzf ripgrep fd tealdeer thefuckLanguages and Runtimes
- Install Node Version Manager (nvm) to manage NodeJS installations
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash- Install pnpm; A more performant alternative of
npmthat leverages a local cache for packages
- Golang programming language and toolchain
brew install go- Rust programming language and toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- pyenv; A Python version manager
brew install pyenv- rbenv; A Ruby version manager
brew install rbenvNeovim
- Install Neovim with
brew
brew install neovim- Thanks to the lazy.nvim plugin manager, my plugins will auto install when first starting up
- The mason-lspconfig.nvim plugin will auto install the language servers as well
- Treesitter syntaxes will auto-install thanks to the nvim-treesitter plugin
- Do a
:healthcheckto see if anything else is missing in your Neovim environment
Docker
- For working with Docker containers I like OrbStack over Docker Desktop
brew install orbstackKeyboard Remaps
Karabiner Elements
- Use Karabiner Elements to remap keys on the Apple Internal Keyboard of your MacBook
brew install karabiner-elements- I don’t make many modifications, only the following:
- remap
caps_locktoleft_control - remap
right_optiontoright_control
- remap
- Useful when editing with Neovim where the control key is often used
Vial
- Use Vial to program your external keyboard if it supports QMK firmware
brew install vialInstantly Show Dock
- Out of the box, the MacOS dock has a brief delay before it unhides itself when you move your mouse to the edge of the screen
- There is also an animation which takes up more time as well
- I like to make the dock reveal itself instantly, which can be done using the following commands in your terminal:
defaults write com.apple.dock autohide-delay -float 0;\defaults write com.apple.dock autohide-time-modifier -int 0;\killall Dock;- To restore the default settings run the following in a terminal:
defaults delete com.apple.Dock autohide-delay; killall DockWindow Manager
Note Taking
- Obsidian is my go to note taking app
- Some reasons why:
- Local first
- Markdown syntax
- Native vim bindings
brew install obsidian