Setting up a new MacBook Pro

R Markdown Source

I had to set up my new work computer today and rather than just slog away at it, I thought I would live tweet the process. Honestly, there’s still a lot of config left to do, but the tweet thread does a good job organizing the apps and software I use daily. My install notes are another good summary.

I used rtweet and tweetrmd to unroll the twitter thread.

Upgrade to Big Sur

11:05amI’ve got a new work laptop! I’m going to try to track my setup process and the software and tools I install in this thread

11:05amStep #1, wait…

11:08amOh wow, I really jumped the gun on this thread

11:17amin the mean time, I guess I’ll tidy the dock

11:27amHere’s something I do on every machine I use: turn Caps Lock into Escape. It’s only annoying when I write SQL but it saves so much finger and hand movement. Essential for vim mode.

11:42amLooking for other things I can tweak while I wait. Hot corners?

↗️ Mission Control
↘️ Desktop
↙️ Application Windows
↖️ Put Display to Sleep (and add require password immediately)

11:47amOkay, Big Sur Install Time has arrived. After these messages, we’ll be right back.

🍎 1 minute remaining…
🍎 About 17 minutes remaining…
🍎 About 26 minutes remaining…
🍎 About 9 minutes remaining…
🍎 (no time estimate)

12:04pmAfter a reboot, all is quiet. The screen is black. I move the mouse. A login screen! That was fast!

I login. I’ve entered a time loop. Tuesday starts again.

12:07pmI guess we’re downloading Big Sur again. I feel like I did this before…

12:42pmDownload complete … now this looks legit. Wish me luck!

Critical First Steps

02:33pmAnd we’re back! I am… not sure how I feel about the new look of Big Sur

02:41pmJust in case you or I get lost, I took some notes while I was waiting for Big Sur to install. Here’s my general install plan

02:42pmFirst things first I need a good terminal and iTerm2 is my favorite

02:47pmNow that I have iTerm2, I need Apple’s Command Line Tools. Open up iTerm2 and run

xcode-select --install

Hopefully this won’t take long…

02:48pmThat was pleasantly fast. Next up: homebrew.

Homebrew makes it easy to install software, even apps. I’m just going to copy the install code from and run it

02:56pmHomebrew’s ready, so let’s put it to use. I use @alfredapp to switch between apps, files, etc. so I’ll use brew to install it:

brew cask install Alfred

brew install <x> usually installs command line utility <x>. Apps with interfaces need “cask”.

02:57pmIf you use Alfred, @hadleywickham has an awesome tip to let Alfred find @rstudio .Rproj project files.

I've documented my workflow for opening @RStudio projects (using on @alfredapp) in this short video: #rstats

— Hadley Wickham (@hadleywickham) February 27, 2018

02:59pmAnd if you purchase Alfred’s powerpack features, @pjs_228 has a collection of helpful R workflows

Are you an @alfredapp and #rstats user?

I’ve created an alfred workflow for R which might be helpful.

Feedback welcome.

— Patrick Schratz (@pjs_228) November 19, 2020

03:06pmAfter jumping through a few permission hoops to give Alfred access to everything, we’re in business.

I remap Alt + Space to Spotlight (Mac’s quick finder) and make Alfred Cmd + space.

03:10pmNext up, my browser. I use and love Firefox on all devices and my daily driver is the Firefox Developer Edition

03:11pmI’ve been informed by homebrew that

brew cask install <app>

has been deprecated in favor of

brew install --cask <app>

03:13pmAfter a short digression, I got Firefox to install with brew

brew tap homebrew/cask-version

brew install --cask firefox-developer-edition

03:19pmMy favorite part of installing @firefox: login to Firefox Sync and all of my bookmarks, extensions, preferences, etc. all magically appear in my new browser

03:22pmAnother short digression, I use these extensions every day:

Install R and Friends

03:26pmOkay, with the critical bits done, it’s time to install #rstats!

I’m going to install both 3.6.3 and 4.0.3 (and maybe eventually devel). Yes, you have multiple versions of R on your machine at once (more on that in a second)

03:30pmYikes! Those are not the links I want. How many other people click the wrong links on the front page of ?

03:33pmIt takes a surprising number of clicks to get to where I can download the macOS R binaries. I mostly just click things but I’m sure this process is very confusing for many people. The page is loaded in an iframe, which makes deep-linking hard:

03:39pmI picked the signed 3.6.3 binary but I still had to go through macOS security steps. When it doesn’t open, open System Preferences > Security and Privacy > General and then, while second-guessing yourself, click “Open Anyway”

03:51pmWhich R installs faster? It’s a race (to see if I can remember my new password)

03:53pmNow that I have more than one version of R installed, Bob Rudis’ RSwitch utility is essential. Easily switch between versions of R from the menu bar!

03:54pmIt also makes it easy to grab the latest preview version of @rstudio which you can also find online

03:58pmMy little laptop is growing up so fast

04:07pmOkay, I need R packages now. To get them fast, I’ll install pak, which requires a little setup, and then I’ll kick off an install of tidyverse

install.packages("pak", repos = "")



16 seconds later 🎉

04:16pmWow pak is fast. These packages installed in literal seconds.

Mostly just basics I know I’ll want, other things to customize @rstudio

I ran this code for both R 3.6.3 and 4.0.3

04:17pmLike it’s actually kind of fun to watch pak install your packages.

Utility Mac Apps

04:19pmThat’s it for R, here come a bunch of utility apps for Macs. These all make life a little easier, more productive. Fitter, happier.

These all worked on Catalina so I guess I’ll find out soon if they work for Big Sur…

04:22pmFlycut is a clipboard manager that adds history to your clipboard. Copy several things from here, paste them there. Reuse old clips. I can’t even without this.

04:24pmKap records your screen, converts movies to gifs and has powered half of this thread so far.

brew install --cask kap

04:26pmRectangle is another absolutely essential mac app. Easily resize windows to fill parts of the screen with many keyboard shortcuts. Rectangle replaces Spectacle and adds snap zones.

brew install --cask rectangle

04:28pmAltTab adds window previews to the window switcher. Thanks @PeeltothePithy for the tip!

brew install --cask alt-tab

04:30pmKeyCastr show key presses on-screen, perfect for demonstrating cool RStudio keyboard shortcuts

brew install --cask keycastr

04:31pmPock puts the dock in the touchbar. I appreciate this whenever my laptop isn’t docked.

04:33pmAmphetamine keeps your laptop awake for a certain amount of time. Useful for long running #rstats scripts, turn on amphetamine, turn off the monitor, walk away knowing your script is still going.

04:34pmIf you’ve ever wanted to open certain links in *certain* browsers, Finicky can help.

brew install --cask finicky

04:35pmI’ve had enough of the default Big Sur desktop background. Luckily there’s Irvue – an hourly wallpaper refresh using pictures from @unsplash

04:37pmIf you use, work with, or collect colors, Culr looks awesome. I haven’t used it much but I have a feeling I’ll use it frequently.

04:39pmAnd now that I just installed a dozen menu-bar apps, I don’t want to have to look at them all the time.

Hello dozer, a little app that hides the clutter!

brew install --cask dozer

04:42pmThat’s it for menu bar apps, let’s move on to big apps!

04:44pmFirst up, essential work apps, slack and spotify.

Did you know you can install both with brew at the same time?

brew install --cask spotify slack

04:46pmI don’t always use editors that aren’t RStudio to edit code…

but when I do I use Visual Studio Code.

brew install --cask visual-studio-code

04:48pmThere are a lot of cool things going on with R and vscode. If you want a little intro to some good vscode extensions for web dev and more, I put together a list for #js4shiny

04:49pmI recently started using @NotionHQ for collecting all of my random thoughts, outline writing, keep track of links and more.

04:50pmIt pairs nicely with Agenda, which is an app for date-linked notes and perfect for meeting notes.

04:52pmAnother awesome app is Figma. Great for bits of design, testing app layouts, drawing diagrams and a whole lot more. The desktop app is slick.

04:53pmMy favorite app for working with big and complicated git repos is Fork. The visual history and diff features have saved me many times.

04:55pmI wasn’t sure where to put Docker in the lineup, but it’ll be a good segue into command line apps.

And I always have to click around a bunch to find the download:

04:57pmWhat’s cooler than docker? Rocker! 👩‍🎤

The rocker project provides a ton of r-based docker images, ranging from bare bones to ready for publication or geospatial analysis. Thank you @cboettig, @eddelbuettel and @noamross for your awesome work!

Command Line Utilities

05:02pmAnd now we’re moving into a new category: command line apps.

I know what you’re thinking, but these aren’t your mother’s command line apps. Command line apps have gotten really pleasant to use lately. They even have color! 🌈

05:04pmMy recent new favorite is @github’s command line tool. It makes it surprisingly easy to create issues, review PRs, and generally interact with my work on GitHub.

brew install gh

05:06pmSpeaking of git, bit is a fun CLI that smooths out some of git’s rougher edges.

brew install bit-git

05:10pmTwo more rhyming CLIs:

  • bat makes it easy to see inside files
  • nat makes it easy to see inside directories
brew install bat nat

05:12pmOops nat needs a little more to install:

brew tap willdoescode/homebrew-natls

brew install natls

05:14pmI love the idea of this one. Forget how tar works? tldr

brew install tldr

05:18pmI can’t believe how much of the stuff in this thread I’ve been able to install with brew. Did you know you can use it to install fonts?

brew tap homebrew/cask-fonts

Then install fonts with

brew install --cask font-incosolata

or find fonts

brew search font-

05:20pmbrew can even install node and then you can use npm to install even more things!

brew install node

05:21pmDo you ever write JavaScript and want it to look great without doing any extra work? StandardJS makes this happen.

npm install --global standard

05:24pmAnother fun node package and CLI that I like a lot is gitmoji

npm install --global gitmoji-cli

Semantic emoji for git commit messages! 🤪

Fish Shell

05:27pmIf you hung with me this far, I hope you don’t mind if I go extra geeky and talk about shells. Terminal shells. Like, a totally new command prompt, but one that helps finish your thoughts like fish

05:29pmYou can install fish from brew, and then it’s a good idea to install fisher, too. It’s a plugin manager for your shell.

brew install fish

fisher install instructions:

05:30pmThen you can install plugins, like this sweet prompt theme called tide

fish # to start the fish shell

fisher install IlanCosman/tide

05:32pmtide has a sweet configuration menu that it walks you through, but of course I forgot that to make cool prompts like this work you need to install a Nerd Font

05:38pmI’ll just pick one to make it work

brew install --cask font-hasklug-nerd-font

and then configure iTerm to use “Hasklug Nerd”…

Boom, fancy prompt with icons!

05:40pmOne more fish thing… there’s a utility called “z”

fisher install jethrokuan/z

z uses a list of frequent and recent directories to make it easy to move around your computer. After using it a bit you can type z doc and jump to ~/Documents

05:44pmFinal fish point. The docs are awesome and there are some great extensions out there.

05:46pmOkay, at this point, my machine should be ready to use! And if not, it’s time for dinner anyway.

Thanks for reading! Let me know if I missed your favorite app anywhere 😉

So long and thanks for all the fish!

05:56pmomg I still have so many things to log into and configure