DEV Community

Cover image for My Mac Setup
Nick Taylor
Nick Taylor Subscriber

Posted on • Originally published at iamdeveloper.com on

My Mac Setup

Maybe I should start a series called “Not just a Gist”, as I’m slowly converting gists of mine to blog posts. The last one I converted was all about My Visual Studio Code Setup.

I participated in this week’s #devdiscuss about tooling, and I posted a few links to gists that are my setup on my Mac.

Tools you absolutely need on your Mac

  • The Homebrew duo. These are a must have to simplify installing most things on your Mac. As soon as these are installed, you may proceed.
    • Homebrew - run /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" from the command line to install it.
    • Homebrew Cask - run brew tap caskroom/cask from the command line to install it.
  • Spectacle, the best application I’ve found for managing windows on macOS. This is especially useful for anyone coming from Windows who are used to this out of the box functionality. Run brew cask install spectacle from the command line to install it.
  • Alfred (buy the Alfred Powerpack to get the full use of Alfred). Run brew cask install alfred from the command line to install it.

Alfred Setup

Alfred is so awesome, it deserves it’s own section in this post. It’s basically Spotlight on steroids and a bag of chips. It’s more than an application launcher. It allows you to create workflows for repetitive tasks you do everyday and there is also a huge array of existing workflows for it available. I even decided to make some of my own, nickytonline/alfred-workflows: Hopefully useful workflows for Alfred.

I never used Alfred until this past summer. Why did I not use it sooner?!

(╯°□°)╯︵ ┻━┻

The Syntax FM podcast has a great episode on tooling, including Alfred, Our favourite Productivity Hacks 🔥 — Syntax Podcast 011. You should check it out.

Along with workflows, you can also install themes. I like Wes Bos’ Cobalt 2 theme for other things and I guess since Wes is a huge fan of Alfred, he decided to make the theme for Alfred as well. Download the raw Cobalt 2 theme file from the github.com/wesbos/Cobalt2-Alfred-Theme repository. Once downloaded, open the file and it will ask you if you want to import the theme into Alfred.

Click the import button and Alfred has been Cobalted.

At the time of this writing, here’s all the workflows that I currently have installed:

If you use Alfred and have some workflows that are not listed here, please mention them in the comments. I’m always looking for new ones to improve my whole dev workflow.

You can also launch the terminal from Alfred, by typing > in the Alfred search bar followed by the command you wish to run. Since I use iTerm, I want that to open instead of the default Terminal app. Since Alfred 2.7.2, you can run a custom Applescript to launch another terminal application. Open the Alfred preferences window and click on the Features button in the top of the preferences window then click on the Terminal / Shell button at the bottom. In the Application drop down menu, select Custom and paste in this script from the Custom iTerm Applescripts for Alfred repository.

You're all good to go. To test it out launch Alfred and in the search bar type > ls and press ENTER. iTerm should open up with a listing of the current directory.

Tools for Web Development

  • VS Code, here’s my setup. Run brew cask install visual-studio-code from the command line to install it.
  • n, for installing different versions of node. I’m sure someone is going to suggest using nvm. The problem was though, when I switched from zsh (another great choice for a shell), I was unable to get nvm working with fish, so I just switched to n which works super well. Run brew install n from the command line to install it.
  • now.sh, great for hosting but also great for knocking out some POCs and deploying it. Run brew cask install now from the command line to install it.
  • Docker, containerize all the things! Run brew cask install docker from the command line to install it.
  • Fira Code font for my shell and my favourite editor. Run the following only once as it's used for installing any font, brew tap caskroom/fonts. Once that is installed, you can install Fira Code by running brew cask install font-fira-code.
  • I’ve discovered what the whole commotion is about npx, so I’ve also added that to my tool belt. Thanks Peter Kühne!

Shell/Terminal Setup

  • iTerm2, a better terminal than the out of the box macOS terminal app. Run brew cask install iterm2 from the command line to install it.
  • Fish shell, a better shell experience. Run brew cask install fish from the command line to install it.
  • Fisherman, for themes and other utilities for the fish shell. Run curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher from the command line to install it.
  • edc/bass (to support bash utilities) - Assumes Fisherman is installed. Run fisher edc/bass from the command line to install it.
  • I use the git CLI with git aliases. Here’s my list of git aliases.
  • fish shell aliases I use because I'm a lazy typer or just can't remember the real command. Feel free to run the script snippet below to add them to your 🐡 🐚 .**
alias cg="eval \"git clone git@github.com:$argv.git\"" # Clones a gist, just pass in the gist ID
funcsave cg

alias flushdns="sudo killall -HUP mDNSResponder" # Because I never remember this command
funcsave flushdns

alias g="git"
funcsave g

alias glog="git log --oneline --decorate --all --graph"
funcsave glog

# Check out a PR
alias copr="git fetch origin pull/$argv/head:pr$argv;"
funcsave copr

alias y="yarn"  # Some say I live dangerously aliasing this to 'y'. I say yolo.
funcsave y

alias nib="node --inspect-brk" # nib path-to-my-file/my-file.js
funcsave nib

# When you want to just hash out an idea for something web
# Automatic page reloading and assets. Requires npx so
# ensure your npm is upgraded to the latest and greatest.
alias hot="npx browser-sync start --server src/ --files \"src/*.html\" \"src/css/*.css\" \"src/js/*.js\""
funcsave hot
Enter fullscreen mode Exit fullscreen mode

Useful Utilities

  • The Unarchiver - run brew cask install the-unarchiver from the command line to install it.
  • Amphetamine, sometimes you just want your laptop to stay awake… 💊
  • VLC - run brew cask install vlc from the command line to install it.
  • f.lux, so you can be nice to your 👀 in the evening. Run brew cask install flux from the command line to install it.
  • Dropbox, I use it to sync my Alfred settings, fish, fisherman etc. via symlinks.Run brew cask install dropbox from the command line to install it.
  • dark-mode - run brew install dark-mode from the command line to install it.
  • vanilla for OS X menu bar. Hide the clutter. Run brew cask install vanilla from the command line to install it.
  • Slack
  • Trello, I’m using this less and less though since I discovered Bear. I’ve fallen more in a todo list mode with Bear.
  • Bear, this is definitely my favourite new app. It’s the first note taking app that I’m consistently using. I think it’s all due to markdown support and simplicity.
  • LiceCap, for animated GIF screen captures. I find this tool very easy to use and the animated screen captures are pretty decent. Run brew cask install licecap from the command line to install it.
  • Onyx. It's great for general maintenance of your computer. To install it run brew cask install onyx.

Tweaking macOS

  • Prevent Mission control from rearranging Spaces. This drives me nuts, so I remove the setting. I arrange my spaces because I want them to stay like that.
  • If you’re on a Mac with a Touchbar, map the function keys to always be used when in browsers, your editors or any other tools you use for dev.

That’s pretty much the round up of what I have on my machine at the moment. I should probably get around to writing a script that installs all this, but for the time being, other priorities.

I’m always looking for new tools to make me more efficient, so feel free to chime in in the comments below.

And here's the link to my mac setup script which I made a little while's after this blog post. It's not perfect, but it's helped me set up a few machines pretty easily.

Top comments (54)

Collapse
 
shane325 profile image
Shane Barry

Great list! Thanks for sharing.

Collapse
 
ajoslin103 profile image
allen joslin

Nice list!

I would add Sip which I use for colors and color management

As well as Stay which I use for window management, since I regularly switch between laptop, 4K and various multiple-monitor setups -- one hot key and my windows adapt to whichever setup I'm running at the moment.

Collapse
 
nickytonline profile image
Nick Taylor

Thanks Allan. I'll check them out!

Collapse
 
loilo profile image
Florian Reuschel

Thanks for the list! Added some really nice utility to my macOS tool belt. 👍

I'd like to give a shoutout to one vital app in my setup: BetterTouchTool (or short, BTT). It really is pure gold.
The app allows you to create custom (global or per-app) gestures for the trackpad or the magic mouse. (It supports changing other devices' behaviour as well, like adding system-wide keyboard shortcuts, but those two are the ones I most commonly use it for.)

Some examples from the gestures I defined for the trackpad on my MacBook Pro:

  • 3 finger swipe down: close the current window/tab (performs ⌘W)
  • 3 finger swipe left/right/up: Put current window to the left/right half of the screen resp. maximize it

The following are only enabled for my browsers:

  • 2 finger click: open link in a new tab (⌘ + Click)
  • 3 finger swipe up: restore the most recently closed tab (⌘⇧T)
  • 2 finger swipe from bottom edge: refresh the page (⌘R)

Those are only a few of the gestures I use. They really become muscle memory and you're whole workflow is screwed when BTT is not running for some reason. 🙃

Collapse
 
denrimus profile image
Den Drobiazko

some install snippets are missing brew on start - it is typed before code section as plain text. You might want to fix that (or not - in any case this is a great post, I've acquired some handy tools/setups from it)

Example: "brew cask install iterm2" (not the only one in whole text)

Collapse
 
nickytonline profile image
Nick Taylor

Thanks Den. I'll update it when I have a chance. Glad you liked the post. Cheers.

Collapse
 
nickytonline profile image
Nick Taylor

I also started a script to automate the install of my tooling. It's not finished, but feel free to take inspiration from it.

Nice. I automated mine a while back, but still need to tweak it a bit still, gist.github.com/nickytonline/729fc...

Collapse
 
oncode profile image
Manuel Sommerhalder

This blog post inspired me to do a fresh mac setup and try to automize everything that is possible throughout the setup process. Took quit some time but my future me will thank me :) github.com/oncode/mac-setup

Collapse
 
nickytonline profile image
Nick Taylor • Edited

Nice. I automated mine a while back, but still need to tweak it a bit still, gist.github.com/nickytonline/729fc...

Collapse
 
jameswilson profile image
James Wilson • Edited

Late to the party here, but have two small contributions to add:

  1. Your glog alias looks very similar to something I came up with that I named git tree and git tree --all that show a nicely styled git graph, tweaked and colorized for the most relevant info.

    => Screenshot of output from git tree

    I use this literally 10s of times a day as primary developer, and release manager on a wide array of projects for work.

    Also, I'd point out that instead of putting this in a shell-specific aliases file, I place these kinds of git-specific configurations inside ~/.gitconfig and then can easily scp the file to any server environment that has git installed.

    # in ~/.gitconfig
    [alias]
    
    # Change directory to repo root
    repo-root = "!cd $(git rev-parse --show-cdup)"
    
    # Display the commit history of current branch in a tree format, with color. 
    # Use git tree --all to see entire repo instead of current branch.
    tree  =  "!git log --graph --decorate --pretty=format:'%C(yellow)%h %Cred%ad %Cblue(%an)%C(cyan)%d%Creset %s' --date=format:'%F %k:%M:%S'  --abbrev-commit"
    
    # Show recent commits, similar to git tree, but with different contextual information
    recent = "!git log --color --format='format:%C(auto)%h %Cred%<(8,trunc)%aN  %Cblue%<(12)%ar %Creset%s'"
    
    # Show the merge history on the current branch.
    mh = "!git log --decorate=short --pretty=format:'%C(yellow) %h %C(blue) %s %C(reset)(%C(red)by %cN %C(green)on %cD%C(reset))' --merges"
    
    # Sometimes the only change in a file is from 0755 to 0644 or
    # vice versa; the following command resets all file permissions
    # changes to their original values.
    permission-reset = "!git diff -p | grep -E \"^(diff|old mode|new mode)\" | sed -e \"s/^old/NEW/;s/^new/old/;s/^NEW/new/\" | git apply"
    
  2. When I need something a bit more powerful than git tree to view the git graph interactively I use gitUp (free and open source). ProTip: this tool is also really useful as a replacement for git add/checkout -p to interactively stage or discard hunks across a large number of files with mouse-click-n-drag, then Enter key to stage or Delete key to discard.

    To open gitup for the current repository from the command line just type gitup from inside any folder in a repository, which launches via a symlink at /usr/local/bin/gitup that points to /Applications/GitUp.app/Contents/SharedSupport/gitup

Collapse
 
nickytonline profile image
Nick Taylor

Thanks for sharing those tips James. Gonna check gitup out.

Collapse
 
leob profile image
leob • Edited

Great write-up ... the Mac "tools" (or programs, really) that I love personally are:

  • uBar: adds a Linux/Windows like taskbar which for me takes away the annoyance of window/task management on OSX (only the Dock and Mission Control is too frustrating for me, drives me crazy ... don't start a discussion with a Mac purist on this!)

  • DaisyDisk: lets you find out what the heck is eating so much space on your harddrive and reclaim that space. Easy and very powerful tool.

  • Apptivate: handy tool to define keyboard shortcuts to launch applications

uBar is paid (I believe it costs $10 or something like that), but it's well worth it for me. DaisyDisk is 'semi free' (pay a small amount to get rid of a startup message which makes you wait a bit). Apptivate is free.

All these programs are simple and have a zero learning curve.

Apart from these the 'tool' I use the most is the bash shell (Terminal).

I haven numerous other 'utility' programs installed but I could just as well delete them, never using them.

Collapse
 
denrimus profile image
Den Drobiazko

There's a free alternative for DaisyDisk: Disk Inventory X

Collapse
 
leob profile image
leob

Does it work as well as DaisyDisk? I found DaisyDisk to work extremely well, and tbh I'm using it for free ...

Collapse
 
wstone profile image
Will Stone

Hi Nick. Great list. I’ve got a similar set-up but have also now found some new tools I wasn’t aware of, thanks! Seeing as we have a similar taste in apps, I thought you might like to take a look at an app I’ve been developing called Browserosaurus (shameless plug, I know, but seemed appropriate). It allows you to intercept clicked links and send them to the browser of your choice. I’m currently in the process of a bit of a rewrite that should be released soon, but v1.3 is still fairly solid. The code is open source on GH too, so feel free to have a poke around and send feedback/issues.

Collapse
 
nzraad profile image
Naseem Raad

As a substitute for Spectacles, it feels a bit outdated compared to VEEER! You should definitely check it out, very similar but it is newly built so that means the developer is constantly updating it!

Collapse
 
edwin_r_c profile image
Edwin Ramirez

I've tried VEEER today. Spectacle has more keyboard shortcuts for better controlling and resizing windows. And I can't find a way of moving windows between monitors with VEEER.

Collapse
 
nickytonline profile image
Nick Taylor

Thanks Naseem, I'll check it out.

Collapse
 
nickytonline profile image
Nick Taylor

For those interested, here's the link, veeer.io

Thread Thread
 
nickytonline profile image
Nick Taylor

@nzraad , I may be a veeer convert. Still trying it out, but very happy so far.

Collapse
 
nishi_id profile image
Nishimiya • Edited

Good explanation there;although i don't have Mac. Hahaha, any chance for Linux or windows setup?

Collapse
 
nickytonline profile image
Nick Taylor

Aside from Alfred, Spectacle, Amphetamine and iTerm2, most of those tools including My Visual Studio Code Setup are available for all OSes. You also might want to check out @brpaz 's post My Linux Development Environment of 2018.

Collapse
 
nishi_id profile image
Nishimiya

Thx,I'll go check it.