From Zero to Hero: Setting Up Your Mac for Development

ISHAAN KAMRA
4 min readDec 27, 2024

--

In my previous job I had to set up my mac two times and now again when I switched jobs I had to set up a new mac in the way that I like. All these times I found myself scrambling for the same links, scripts and tools and how to download / add them.

Basically I had to do the same setup again and I would curse myself for not writing this blog so that it would be easier.

So this time I am finally overcoming my laziness and writing this out as I am setting up my mac.

Although one thing I want to mention, this is very opinionated and that means that firstly it isn’t the best setup in the world you would find better ones, it’s just what works for me and secondly you can do without this as well, you don’t need this to work on mac it just makes it a bit easier, especially for me.

Also before starting one quick note —

Whenever you make a change in zshrc, to see that change in action you either need to open a new terminal tab or reload current tab using source ~/.zshrc command.

Starting with the setup now -

Adjustment of keyboard response speed

  • In the Apple menu  and `System preferences…’
  • Go to Keyboard
  • Set Key Repeat to fast and Delay until Repeat to short 🏃‍♀️

Adjustment of trackpad response speed

  • In the Apple menu  and `System preferences…’
  • Go to Trackad
  • Enable the Tap to click (Tap with one finger) option
  • Set Trackpad speed as below —
Trackpad speed setting

Install iterm2 and OhMyZsh

iterm2 is a terminal emulator for macOS, you can install it from it’s download page.

Install OhMyZsh using following command -

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Also at this point you might get the question that what is the difference between zsh / iterm2 / ohmyzsh. You can refer to this stackoverflow link to know more on that.

Go to to the Iterm2 menu item and click on `Install Shell Integration`. This enables a number of useful features

Go to View > Auto Command Completion to enable autocomplete. We will later setup zsh-autosuggestions plugin for this below.

In your zshrc file update ZSH_THEME=”amuse”. This is just a personal preference.

For this theme to work correctly you need powerline fonts. Install them using following github repo — https://github.com/powerline/fonts. You can find download instruction in readme file of that repo.

After that you need to set the font in iTerm as well —

  • Go to iTerm2 preferences -> Profiles
  • Go to Text tab
  • Set the new font (Meslo LG M for Powerline in this case) in the Font dropdown.

Also if you want to use the ⌥ + left / right short cuts to jump forwards and backwards between words you will need to set that up as well as follows —

Preferences -> Profiles -> Keys
Left Key change from "Normal" to "Esc+"
Right Key change from "Normal" to "Esc+"

Add Keyboard Shortcut
Keyboard Shortcut: ⌥←
Action: Send Escape Sequence
Esc+: b

Keyboard Shortcut: ⌥→
Action: Send Escape Sequence
Esc+: f

Useful shortcuts for iterm —

  • + T - New Tab
  • + D - Split Window Vertically
  • + D + Shift - Split Window Horizontally
  • + W - Close Tab or Window
  • + Enter - Full screen
  • ^ + R - Search commands

Install brew

Brew is the package manager for macOS, similar to apt-get on Linux.

To install that follow instruction from — https://brew.sh/

Install maccy

Maccy helps you maintain your clipboard history. You can install maccy using following command —

brew install --cask maccy

Then you can change the setting for keyboard shortcut to access maccy in preferences. I usually prefer the ⌥ + ⌘ + C

Install and setup VS Code

Download vs code from it’s site.

After downloading open vs code and do ⌘ + shift + P and search for —

Shell Command: Install 'code' command in PATH

This will automatically add code to your path env variable. Now you can easily open any file or directory from terminal using following command

code <FILE_OR_DIRECTORY_PATH>

Also vscode will most probably also use the same ohmyzsh settings and themes in its integrated terminal that you had applied, given that it is using zsh for its integrated terminal.

Setup zsh-autosuggestions plugin

Install this plugin using following command —

sudo git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Then add it in in the plugins list in zshrc

plugins=(
...
zsh-syntax-highlighting
)

Install htop

brew install htop

Install jq

jq is a very useful tool to work with json on terminal.

brew install jq

Install wget

wget is a handly utility for downloading files

brew install wget

Some cool zshrc scripts to make your life a little easier

Add whichever of the following scripts you like to your zshrc.

# Setup an alias to easily reload / reapply your 
# zshrc file in current terminal tab
alias reload="source ~/.zshrc"
# Go up n directories
up() {
local count=$1
if [ -z "$count" ]; then count=1; fi
for i in $(seq 1 $count); do
cd ..
done
}

# usage -
# up n -> to go up n directories
# up -> to go up one directory
# Function to directly mkdir and also cd in it in one command
mkcd() {
mkdir -p "$1" && cd "$1"
}

Install common apps

Install common apps / technologies —

  • Intellij Idea Community edition
  • Postman
  • Ngrok
  • Python / pyenv
  • node
  • nvm
  • java jdk
  • go
  • docker

That’s it for now, will add more in the future as and when I add / find more things to make my life easier. Really hope that next time when I have to do this setup it will be easier then.

--

--

ISHAAN KAMRA
ISHAAN KAMRA

Written by ISHAAN KAMRA

SDE-2 Uber | Ex - Sprinklr, Wells Fargo, Aumyaa | DTU'23

No responses yet