Setting up a macbook for a windows developer

I recently got a macbook at work and I’m doing only web development these days so no Visual Studio. I had to do a bit of reading to get things set up and I don’t want to do it again so here is a post for me!

UPDATE 3/1/2022: I’ve since created scripts to do all of this and more. You can find those here: https://github.com/darraghoriordan/mac-setup-script

First thing is download iTerm from: https://www.iterm2.com/

Open a new iTerm and run the following to install Homebrew (this is like chocolatey)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

next install oh my zsh

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

Follow this great tutorial on setting up powershopp fonts and zsh: https://github.com/thacherT1D/fishToZsh

Setup git with homebrew

brew update && brew upgrade

brew install git

brew link --force git

Install beyond compare from https://www.scootersoftware.com/ Open beyond compare and go to File >> Installl command line tools Confirm that “bcompare” can be launched from Terminal.

Run the fllowing lines to set up some git diff and merge magic and to add an alias to for code review (change develop here to whatever you use as your master branch)

Then in an iterm window enter:

git config --global alias.code-review = "!git difftool --dir-diff origin/develop...$1"
git config --global diff.tool bc3
git config --global difftool.bc3.trustExitCode true
git config --global merge.tool bc3
git config --global mergetool.bc3.trustExitCode true

Run a code review on some branch with differences and open the rules by clicking the rules button in the merge window o beyond compare. In here set beyond compare to follow symlinks! This will make all the paths line up like they should.

To launch a 3-way merge using Beyond Compare, use the command “git mergetool file.ext”. To launch a diff using Beyond Compare, use the command “git difftool —dir-diff”.

If you’re on a mac and you’re using Rider from jetbrains but the rest of your team is using visual studio you can have repository specifc ignores by editing the .git/info/exclude file. The following will hide the idea folder.

.idea

Set iterm to use your project directory as the start up location in the preferences for iterm

If you use jira I highly recommend the zsh plugin “jira”. To have this remember your jira instance add the following to ~/.zshrc

export JIRA_URL=https://jira.myorganisation.com
export JIRA_NAME=doriordan
export JIRA_PREFIX=REC-
export JIRA_RAPID_BOARD=true

then you can use

jira            # performs the default action
jira new        # opens a new issue
jira dashboard  # opens your JIRA dashboard
jira reported [username]  # queries for issues reported by a user
jira assigned [username]  # queries for issues assigned to a user
jira branch     # opens an existing issue matching the current branch name
jira ABC-123    # opens an existing issue
jira ABC-123 m  # opens an existing issue for adding a comment

Sweet, all done. This could be a great scripting project :D

Next install the following apps https://www.cockos.com/licecap/ - Licecap for gif recording https://www.spectacleapp.com/ - window management for osx https://www.alfredapp.com/ - an enhanced spotlight/helper

You can use https://www.rubicode.com/Software/RCDefaultApp/ to change the default applications on the mac. For example the mail client can be changed from Mail without having to setup an email account in Mail.

Photo by Fabian Grohs on Unsplash

Darragh ORiordan

Hi! I'm Darragh ORiordan.

I live and work in Sydney, Australia building and supporting happy teams that create high quality software for the web.

I also make tools for busy developers! Do you have a new M1 Mac to setup? Have you ever spent a week getting your dev environment just right?

My Universal DevShell tooling will save you 30+ hours of configuring your Windows or Mac dev environment with all the best, modern shell and dev tools.

Get DevShell here: ✨ https://devshell.darraghoriordan.com


Read more articles like this one...

List of article summaries

#developer-experience

Start tracking DORA metrics for your team in just 15 minutes with Apache Dev Lake

DORA (DevOps Research and Assessment) metrics are an excellent way for engineering organisations to measure and improve their performance.

Up until now, monitoring the DORA metrics across Github, Jira, Azure Devops etc required custom tooling or a tedious manual process.

With Apache Dev Lake you can get beautiful reporting for DORA metrics on your local machine in as little as 15 minutes (honestly!).

From Google Sheets to Grafana
From Google Sheets to Grafana

#developer-experience

How to use SSH with Git and ssh-agent on Windows

I needed to run git natively in windows (no wsl) for a recent project. I use ssh certificates with passphrases to authenticate with my git provider.

Ssh requires the certificate passphrase every time you use a connection. It’s annoying typing this passphrase in to terminal when using a git command.

#developer-experience

How to fix custom type definitions not being type checked

If you have a custom types file (e.g. myTypes.d.ts) but you get no errors from the type checker and compiler in typescript even though you know there are issues in the file you might have skipLibCheck turned on.

#developer-experience

Consistent modern shell tooling on MacOS and Windows WSL for developers

I regularly code on both MacOS and Windows machines and I was always annoyed how different the default experiences are on each. I need to use the same tools and the same experience on both.

Windows “WSL” (Windows Subsystem for Linux) is a great tool for this you can use on Windows 10 and newer. The latest version lets you run a full Ubuntu instance that integrates seamlessly with the underlying windows instance.

By using WSL2 you can have a (mostly) identical developer experience jumping between MacOS and Windows.

Better tooling for Developers

Many of the terminal tools that come with unix environments are functionally similar to how they were 20 years ago. But other developer tooling has advanced quite a bit since then.

You can replace tools like ls or cat with modern equivalents that support full colour, unicode icons, git state and more. Terminal prompts can be made git aware and use colour to indicate state so you don’t have to query git so often.

Keeping developer experience consistent across machines

Keeping any shell changes you make on one machine up to date on all the machines you code on is a nightmare without the right tooling.

This article also explains all the tools I use and how I keep the same terminal setup consistent on MacOS and Windows!

Let’s go!

Comments