Setting up a Mac for Development

Recently I got a new Mac and setting up for development is always fun, so I decided share some of the setups I do on a new Mac.

Is a Mac a good machine for development?

I think so and also know folks that think Linux is better, some are more use to Windows. In the end I think is not the OS which makes a better development machine (although there's space for some debate here) but how you deal with it. Take a look on The Productive Programmer by Neal Ford for some other tips.

What to keep in mind

As you setup a machine for development some things you should keep in mind. First is you want to lower the keyboard to mouse time. Taking your hands off the keyboard to point to a link in a webpage and then going back is time consuming, a developer goes from the IDE to the browser lots of time during the day.

Make the computer do what you're thinking without much effort, few keystrokes should take or do what you want. Going through menus, mouse, chasing windows on the desktop are also time consuming, unproductive and (for me) annoying.

If you do twice, think about how to do with one keystroke. If you caught yourself repeating something, think in a way to automate it (if makes sense). Apple has AppleScript and Automator which you can use to make simple scripts for mundane things.

Keep your projects and files organized, this goes for every developer. Not knowing where the files are leads you to browsing around to find them, avoid that. I have a Projects directory and an alias gp that goes to this folder, plus gp project takes me direct to the project folder. If you have some suggestion please do so (use the comments), I'm keen to know how you make your environment more smart and fast.

Now, some of the things I do on my Mac for development.

Disabling the Dashboard

I tried to use, make some meaningful use of it but never achieved, it just sit there. In Lion it turned to be a little more annoying as it shows on Mission Control view. Disabling the Dashboard is pretty easy, go to the terminal and issue this command:

defaults write mcx-disabled -boolean YES

And restart the Dock:

killall Dock

Get iTerm 2

OS X has its Terminal application but iTerm 2 has some features that I really like, one is the Hotkey Window which you can trigger by a keyboard shortcut and it come and goes easily.

One tip for Lion users, if you use multi desktops set iTerm 2 to be available in All Desktops. You can achieve this by control + click on iTerm icon in the Dock and selecting Options - Assign To - All Desktops. This way when you invoke Hotkey Window it will not shift from desktop to desktop.

Get QuickSilver

QuickSilver is a very powerful application for action at distance. Some of you might know Alfred (check the app store), in Linux the Gnome Do and on Windows I recall Launchy.

On a Mac I prefer QuickSilver, mind that it is not just a Application launcher it can do a lot more than launch applications.

Get Dropbox

I use dropbox for a lot of file transferring and storage, specially when I change machines it helps to avoid the USB stick protocol.

Get Caffeine

A development machine that keeps dimming the monitor, going to screensaver and sleeping because you took more than five minutes to type doesn't help you. Caffeine when on don't let this happen, it's way more easy than changing Energy Saver configurations.

Get iStat Menus

This one is paid. I use to keep and eye on CPU, Memory, Hard drive access and Network usage. Also it can replace the battery level indicator and the date menu on the Mac. This is a habit that I've acquired working with Linux for long time and Bubblemon.

Get Xcode

Although I don't develop for Mac, Xcode is needed because it brings a lot of libraries for development that it's needed for a dev.

Get Home Brew

Or another package manager for Mac as MacPorts. You will need to install other packages into your Mac. Unless you're a fan of compiling everything you need something similar to apt-get to your Mac.

Get GleeBox

I can't image myself using a browser without GleeBox. It makes easier to find links, form items, issue bookmarkslets on a page and more. Is one more application to lower the keyboard to mouse time.

Turn on keyboard access to all controls

In the System Preferences go to Keyboard then keyboard shortcuts and turn All Controls. Now you can use tab to navigate through windows buttons and fields.

If you use Safari, turn "Tab" for links

It doesn't come with the "Tab" to links enabled by default, just to go to its preferences advanced and turn Press Tab to highlight each item on a webpage.

Get a real Text/Code editor

I use Vim and usually is the first thing that I install in any computer that I use. MacVim is the Vim for a Mac. Also I don't like the menu if you also don't like add to your ~/.gvimrc:

set guioptions=-T

Learn some common shortcuts of OS X

One of the good things about Apple software is it tries to be consistent over the keyboard shortcuts. The famous Command + , in almost every software that runs on a Mac takes you to the preferences of the app.

Another good one is Command + ? which takes you to the help menu, plus there's a search that can show you a entry on the menu. If the app doesn't not provide a shortcut for the action you're trying to make you can use this one to go there.

Published in Jan 09, 2012