macOS set up for coding and development (2023 edition)

Share this:

Here’s basically what I would do every time I have a set up a new macOS machine for coding. This setup is generic enough for most development and coding work. This post is now updated (Sept 2023) and refreshed for you new 2023 Macs! I’ve cleaned up all the old commands and validated it as I ran all of the installs below on my new M2 Mac Studio.

This list assumes your on macOS Big Sur or Monterey and Zsh should be the default macOS shell.

The primary MacOS set up for coding

1. Install Homebrew

I shouldn’t even need to tell you to install Homebrew šŸ˜„

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install iTerm 2

Yup. This is #2 on the list. iTerm 2 is really that much better than Terminal.app.

brew install --cask iterm2

3. Install QuickLook Plugins

There are some quicklook plugins that makes it really easy to preview files in Finder.

brew install --cask qlcolorcode qlstephen qlmarkdown quicklook-json qlprettypatch quicklook-csv qlimagesize webpquicklook quicklookase qlvideo

4. Install Wget

A reminder to also install wget.

brew install wget

5. Install Visual Studio Code

brew install --cask visual-studio-code

Brew will install appropriate version (Intel or Apple Silicon) for your Mac. If you’re interested, you can check out the cask code for visual-studio-code here. I personally prefer installing using brew vs downloading from visualstudio.com because the default installer is the universal binary and you will need to get to the alternative downloads page to get the architecture specific downloads.

Then configure Code for use in shell.

  1. Launch VS Code.
  2. Open the Command Palette (ā‡§āŒ˜P) and type ā€˜shell commandā€™ to find the
  3. Shell Command: Install ā€˜codeā€™ command in PATH command.

(Source: https://izziswift.com/run-open-vscode-from-mac-terminal/)

6. Only if you really need it, install Atom

I’m leaving this here for legacy sake. Atom is pretty much dead.

brew install --cask atom

7. Install Temurin (previously known as AdoptOpenJDK)

Note: This has been updated since AdoptOpenJDK is now deprecated in favour of Temurin.
Temurin is my current go-to JDK. You can also easily install it using Homebrew. I personally still use JDK 8 as its the one that works best with some of the Java applications I use.

brew tap homebrew/cask-versions
brew install --cask temurin8

By default, it would install the latest version 19.0.2,7.

brew install --cask temurin

To install the version 11 (LTS).

brew install --cask temurin11

8. Install Tree

You can visually view the directory in a tree structure. Useful to see what’s nested in a specific directory.

tree command displaying a directory
brew install tree

9. Install jq

Really useful to process all those json files, especially if you deal with a lot of REST APIs and JSON configuration files.

brew install jq

10. API testing tool: RapidAPI (Now free!) or Postman (Free)

I personally use Paw app for all my API prototyping and testing work. The app is now called RapidAPI since its acquisition. It’s really powerful, especially when you start to use the extensions and plugins. I have used it back when they were an independent provider. This is a $49.99 USD paid app. RapidAPI has since made the app free!

Paw app
brew install --cask rapidapi

The alternative of course is Postman which has a free tier.

brew install --cask postman

11. Install Brave Browser

I used to use Firefox Developer Edition for most of my work related web-browsing but have since moved on the Brave as the add-on ecosystem is just much better supported on the chromium.

brew install --cask brave-browser

Customise zSH with Powerlevel10K

I’ve played around with a few other zSH setup, but the one below is still my favourite to date.

I was inspired by this guide here but have reconfigured my set up significantly with Powerlevel10k. In the previous version of my writeup, I had used Powerlevel9k theme. But thanks to a reader (see comments below), I’ve come to know of Powerlevel10k. The performance is so much faster to the point that I think its really useful to update this article to reflect my latest configuration. So, read on to see how I get iTerm2 to look like the screenshot below.

1. Install the MesloLGS NF fonts

Download the MesloLGS NF fonts listed here. There are 4 font files in total.

Install all of them.

2. Customise iTerm2 with a profile preset

Download the profile I’m using here and import it into iTerm2. To import the profile preset, go to iTerm2 -> Preferences -> Profile -> Other Actions… -> Import JSON Profiles.

If you prefer to configure it manually, the following is what I had done.

In Colors -> Color Presets…:

  • Download the colour scheme for iTerm2 and import the colour scheme. You can also find others with a Google search for other colour schemes that you prefer.
  • Update: I’ve been tweaking around and have since updated to this colour scheme that I slightly tweaked from the Dracula theme.

In Text:

  • Change Font to MesloLGS NF
  • Set the font size to 13pt
  • Change cursor to Box
  • Enable Blinking cursor

In Keys:

  • Load the “Natural Text Editing” preset

Quit and restart iTerm2.

2. Install Oh my Zsh and Zsh plugins

Oh my Zsh is a configuration framework for Zsh.

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

Install the Auto suggestions plugin (for Oh My Zsh)

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Install the and zsh syntax highlighting plugin (for Oh My Zsh)

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

Then install zsh-completions.

brew install zsh-completions

Now it’s time to edit your .zshrc and load some Oh my Zsh plugins and finish the zsh-syntax-highlighting plugin.

vi ~/.zshrc

Look for the plugins section and edit as per below. You can find more and read what the plugins does here. dotenv is particularly useful as you can create .env file with your ENV variables that the plugin will automatically load when you’re inside your project root directory.

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
    macos
    sudo
    brew
    dotenv
)

You also need to add the following line to be at the end of the file.

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Optionally, if you want to colorise the tabs of iTerm2 with the same colour as the background, add the following line to be at the end of the file.

# Colorise the top Tabs of Iterm2 with the same color as background
# Just change the 18/26/33 wich are the rgb values
echo -e "\033]6;1;bg;red;brightness;18\a"
echo -e "\033]6;1;bg;green;brightness;26\a"
echo -e "\033]6;1;bg;blue;brightness;33\a"

3. Install and customise Powerlevel10k theme for ZSH

Powerlevel10k has a powerful configuration wizard if you prefer to set up the theme on your own. It took me a good couple of hours to get to my preferred look and feel. I would encourage you to check out the Powerlevel10k project page to see what you can do with it.

But if all you want to do is to get the same settings as mine above, feel free to copy my configurations and set it up as I had.

Download my p10k.zsh file here. Copy it to your home folder and rename it to .p10k.zsh. Or just use the following command to do that.

wget -O ~/.p10k.zsh https://gitlab.com/peaz/iterm2-customisation/-/raw/master/p10k.zsh\?inline\=false

Next install the Powerlevel10k theme.

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

The edit and change the theme in your ~/.zshrc file. There are a bunch of items that you will be adding here that may not make sense if you are not familiar with Powerlevel10k. But if you do exactly as I did, your set up should look like my screenshot above.

Add the following lines right at the top of the .zshrc file. This is to enable Powerlevel10k’s instant prompt feature.

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

Next, look for the ZSH_THEME configuration and edit it to use powerlevel10k.

ZSH_THEME="powerlevel10k/powerlevel10k"

If you install multiple versions of JDK as I did, you will also want to add the following function at the top of your ~/.zshrc to easily switch the different JDK versions should you choose to install all the different versions.

jdk() {
        version=$1
        export JAVA_HOME=$(/usr/libexec/java_home -v"$version");
        java -version
 }
Easily switch JDK on macOS

All the Powerlevel10K customisations are located in the .p10k.zsh file you downloaded from my git repository. Add the following line right at the end in your ~/.zshrc file to load it.

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Reload .zshrc and your zsh terminal should now look like my setup.

source ~/.zshrc

If you want to further customise the powerline10k theme, everything is in the ~/.p10k.zsh file. FYI, do note that I’ve removed a lot of the theme’s segment configurations from my file as I do not use them.

Other installs

1. The frameworks and language of your choice!

Of course, you will need to install your preferred language SDKs. For me that would be Python and Golang. For you, it would likely be something else, so I would leave this section as is. You should be able to find the best way to install the SDKs if you don’t already have a preferred method.

2. VLC

Because VLC? šŸ˜„ Not exactly coding related but you always need to view some videos no?

brew install --cask vlc

3. Wake On LAN Utility

I use the wakeonlan command to make my home server that goes to sleep when unused.

brew install wakeonlan

4. Alfred + Powerpack

I’ve written about Alfred a few times here already. Alfred is one of the few utility apps that I canā€™t live without now on my Mac. Essentially, itā€™s a search utility, working pretty much like Spotlight of macOS. But what’s really cool and relevant for a development and coding set up is the ability to create workflows.

uuidgen_alfred_workflow
Screenshot of the Alfred workflow for generating UUIDs

Find out more about what Alfred can do for you here. The basic version of Alfred is available free on the Mac App Store or from their website as well, which makes it a real no brainer to have it installed on your Mac.

5. Scroll Reverser utility

Scroll reverser is useful when you use a mouse. It allows you to change the scroll direction of the mouse separate from the trackpad.

brew install --cask scroll-reverser

6. Stats

Stats is a pretty good menubar utility you all the statistics you ever need to know of your Mac. Best of all, its free!

brew install stats

Let me know what’s missing!

Feel free to comment if there’s anything else you think I should really add to this list too! Always open to suggestions how I can improve this baseline set up.



If this post has been useful, support me by buying me a latte or two šŸ™‚
Buy Me A Coffee

Share this:

You may also like...

8 Responses

  1. Narender says:

    how can we include in macOS, do you have any pointer for me,.

  2. Ken Ng says:

    Can you help to clarify what you want to include? Your question is unclear to me unfortunately.

  3. bocan says:

    This is a great guide but Powerlevel9k isn’t maintained anymore. I’d recommend https://github.com/romkatv/powerlevel10k

  4. Ken Ng says:

    Wow. Iā€™ve not checked out 10k yet. Thanks for pointing it out. It looks awesome. Will update the article soon

  5. JK says:

    How about vscode integrated terminal setup after iterm2 powerlevel10?

  6. Ken Ng says:

    You just need to change the VS Code terminal fonts to match the same as iTerm and it would be good.

  7. EDH says:

    This was super helpful — I had a lot of this done but your pointers to other dev tools was great! Thanks!

  8. Ken Ng says:

    Glad it was helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.