Getting a new Mac (for me invariably a MBP) is bittersweet. It’s nice to have something shiny and powerful, but setup can be tedious—especially if you don’t remember the steps.
Every time I go through the process I vow to capture the steps next time. But no more.
- Configure the Shell
- vim on the Command Line
- Install Homebrew
- Install Software
- Install RVM
- Install and Configure
First I change my shell to
zsh, for these reasons:
chsh -s $(which zsh)
Then I install Oh My Zsh:
[ NOTE: It’s generally a bad practice to pipe the internet into your shell. Know what you’re doing before executing this command. ]
curl -L http://install.ohmyz.sh | sh
Then I get my
zsh configs from GitHub.
git clone https://github.com/danielmiessler/dotfiles/
…which has my oh-my-zsh.sh file in it.
Right after the shell is in order I like to fix vim. The reason is simple: vim is used to edit most of the files in later steps, and I can’t stand using vim without my configs in place.
Really all I do here is install Pathogen and import my vimrc, but let me highlight a few key configuration changes:
That’ll get you started at least.
By default shells use emacs mode when editing the command line. I like vim, so I try to use its language everywhere I can.
Map escape to work the same way on the command line:
bindkey -M viins ‘jk’ vi-cmd-mode
Now you can move around in your history, edit commands, etc. all using vim language.
Homebrew is a package manager for OS X, and I think it’s the best one. You can install it like this:
[ NOTE: Remember what I said about running commands from the internet? ]
ruby -e "$(curl -fsSL \ https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run doctor to make sure you’re in good shape:
One thing I like to do is get OS X using GNU versions of common tools instead of the default BSD versions. We’ll do this using Homebrew. First we’ll run tap for dupes:
brew tap homebrew/dupes
Then install your software:
brew install findutils --default-names brew install gnu-sed --default-names brew install gnu-tar --default-names brew install gnu-which --default-names brew install gnutls --default-names brew install grep --default-names brew install coreutils brew install binutils brew install diffutils brew install gzip brew install watch brew install tmux brew install wget brew install nmap brew install gpg brew install htop
--default-names allows the tool to be installed with the same name that might already exist on the system, instead of a modified name that avoids conflict. ]
Managing Ruby versions can be seriously annoying, but it’s made less so with RVM.
First we pull the PGP key:
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
Then we install:
curl -sSL https://get.rvm.io | bash -s stable
Then install what you want to use:
rvm install 2.1.1
…and tell your system to use it:
rvm use 2.1.1
Now you’re using that version of Ruby system wide.
[ NOTE:: You can go back to the default by giving
rvm use system. ]
I follow this each time.
This gets me to a somewhat sane state where I at least don’t hate my new system. I hope this has been helpful.