- Install Homebrew
- Install mas-cli
- Setting up a Brewfile
- Making Our Terminal Awesome
Hi everyone and welcome to my site! This is my first blog post so please bear with me while I get the hang of things. If you’d like to learn a little bit more about me be sure to check out my about me page.
I recently purchased a new MacBook Air and I figured that I would document the steps I took to get everything up and running.
So without further ado, here are the steps I took to get it setup.
Homebrew is a package manager for MacOS and was one of things I was most excited to try out with my new Mac. We will be using this along with Cask (more on that below) to get all of our software installed.
To install Homebrew open up terminal and paste/type in the following.
Verify your install by typing in
brew -v to give you the version of Homebrew you installed. At the time of posting the latest version is
mas-cli stands for Mac App Store Command Line Interface and we are going to use it to automate the installation of software from the App Store. To install it type the following into your terminal.
Then you want to sign into the the App Store if you haven’t done so already during your inital setup.
After you sign in for the first time with mas-cli, or the regular app store you shouldn’t have to sign back in again.
Setting up a Brewfile
The beauty of HomeBrew isn’t just that you can install applications right from your favorite shell, but that you can automate those installations using what’s called a Brewfile.
To create one type the following into your terminal at your home directory.
The Brewfile lets us list all of the software we want and then install it in a bundle for the sake of convenience and automation.
Open up the Brewfile you just created with TextEdit, Nano, or any other text editor you have at your disposal for the moment (we will install of favorite momentarily) and paste in the below.
That looks like a lot to digest so lets go through line by line.
The first thing we are going to tell Homebrew to install is Cask which extends Homebrew and lets you install virtually any software you want for Mac.
Next up is Git which I use for version control across all of my projects, I would consider it industry standard at this point.
z is a nifty little script that makes navigating your file system a little faster.
Visual Studio Code is my text editor of choice, I was a sublime text user for years but VSCode is crazy fast and the integrated terminal is fantastic.
f.lux dims your screen at night to make it easier on your eyes.
Firefox second most popular browser at the moment, gotta cover your bases.
Gimp is an excellent alternative to photoshop.
Google Chrome not much to say here, the most popular browser available at the moment with an excellent suite of dev-tools.
MAMP sandboxed PHP dev environment, mainly for WordPress.
Spectacle resize your windows!
VLC a very solid media player that I’ve used for years.
mysqlworkbench connect and work with mysql DBs.
Numbers alternative to Excel, comes installed with MacOS
Pages alternative to Word, comes installed with MacOS
Slack used extensively by several times I’ve been a part of for chatting.
With all that out of the way, lets get all of these installed. Type the following into your terminal
Making Our Terminal Awesome
While BASH is a fantastic shell, lets take our terminal to the next level by getting zsh up and running using the oh-my-zsh framework.
Firstly, lets get a new terminal installed. The one I’m going to use is ITerm2. Navigate to that site, download ITerm2, and put the application into your Applications folder.
Disable Last Login Message
You may have noticed the, somewhat annoying,
Last Login: #:##:## message at the top of your terminal when you open it for the first time on a given day. In order to disable that all we need to do is open our terminal and type
touch ~/.hushlogin the presence of this file in our home directory will prevent this message from appearing.
We installed ZSH when we ran our Brew Bundle Install earlier now we need to set it as our default shell. This is easy enough to accomplish and we can do so by typing the following into our terminal.
As I mentioned earlier, my favorite thing about zsh is the amazing oh-my-zsh framework we can use alongside it. In order to install oh-my-zsh type the following into your terminal
After running that command you should have a
.zshrc file in your home directory. Open it up and you can change your theme. I personally like a solarized look and the agnoster theme lends itself to this nicely.
In order to get the theme completely setup you need to be using a font with ITerm2 that supports the characters it uses. I recommend Fira Code for this.
Finally to complete the look set the color scheme for ITerm2 to
Solarized Dark by going into
Preferences > Profiles > Colors > Color Presets.
Reload your terminal or type
source ~/.zshrc and you should be good to go, but there are still a couple more fun things we can do.
Okay so zsh syntax highlighting is really cool, once you have it setup it will tell you if a command is valid before you enter it. to install it type the following into your terminal
then add this line to your
restart your terminal or run
source ~/.zshrc and you’re good to go.
Earlier we installed z script, so now lets get it running. All you need to do is add this line to your
~/.zshrc file and hit save.
It’s really cool because it keeps track of the places you’ve cd’d into and stores them in a
~/.z file so that you can easily navigate to them in the future. For example, instead of doing
cd ~/someplace/someproject/source you can simply type
Typically you will use NPM on a per project basis, but I do use Gulp globally so let’s install that now
Ruby is required to run Jekyll, which I use to power this blog. So lets get that installed.
I’m using RVM to make sure I have the latest version of Ruby installed without messing with the builtin system Ruby. To install RVM type the following
Install the Latest Version of Ruby
In order to install the latest version of Ruby type the following into your terminal
You can see what versions of Ruby you have installed by typing
rvm list. We want to set our default version of Ruby to be the latest so do that by typing the following command
in my case the latest version is
2.4.1 but at the time of reading this it could be a later version so make sure you use that one instead. You can confirm you’re using the version you set by using the command
rvm -v it should print
2.4.1 in the console in my case, or whatever the version you entered in the prevous command is.
Gem is Ruby’s package manager and we are going to use that to install bundler, which is another package manager that is required to use Jekyll. In order to install it type the following command
Finally we can install Jekyll, the static site generator. In order to install it type the following command into your terminal
Once it’s installed confirm it’s working by entering the following commands
Create a test site
CD into it
Serve it up
Browse to http://localhost:4000 and you should see your test site up and running. You can hit
ctrl + c in your terminal to stop running the site and then remove the directory with
rm -rf test-site since it was only for testing.
Before getting started I found setting these preferences helpful.
- Keyboard > Text > Disable “Correct Spelling Automatically”
- Security and Privacy > FileVault > On (Encrypt your drive)
- Security and Privacy > Firewall > On (who doesn’t like a little extra security?)
- Security and Privacy > General > App Store and Identified Developers
- File Sharing > Off
- Users & Groups > Login Items > Spectacle, Flux (I like these on at startup)
Finally some commands to make your life easier
Show Library Directory
Show Hidden Files
Show Path Bar
Show Status Bar
There are still a lot of things to setup, mainly SSH and Virtual Machines. But for now this is all I need to be up and running. I plan on putting out more tutorial-esq posts like this in the future so if this helped you at all please let me know!