Please see my updated post for current instructions on getting Sublime Text 2 up and running on your machine.

I recently switched over to Sublime Text 2 for my primary development editor. I was waiting to see what TextMate 2 would be like, needless to say I didn’t see much an improvement. Sublime Text 2 has got some nifty features like multiple columns, rows, or even grid views. After a few hours of having 2 files open side by side I was hooked. Below are the things I had to do to get it customized enough for me to use every day. As I continue to customize and setup Sublime Text 2 I’ll be updating this post.

Command line Tool

To be able to open a file or folder from the command line from anywhere create a symlink to the subl command line tool.

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl</div>

RVM

Edit Sublime Text’s ruby settings file:

$ subl ~/Library/Application \ Support/Sublime \ Text \ 2/Packages/Ruby/Ruby.sublime-build</div>

It should look like this:

{ "cmd" : [ "ruby" , "$file" ], "file_regex" : "^(...*?):([0-9]*):?([0-9]*)" , "selector" : "source.ruby" }

Change it to this (replacing nickd with your username) in order to use the rvm-auto-ruby binary:

{ "cmd" : [ "/Users/nickd/.rvm/bin/rvm-auto-ruby" , "$file" ], "file_regex" : "^(...*?):([0-9]*):?([0-9]*)" , "selector" : "source.ruby" }

Spacing and tabs

You can set Sublime Text 2 to use spaces instead of tabs and adjust the indentation, however it seems to only change it for the current file your on, to make it global edit the User Base File settings file. Update – As Kevin Yank & Dimitar Dimitrov point out in the comments, it is best to put any custom user settings in the User packages. This way updates won’t overwrite them.

$ subl ~/Library/Application \ Support/Sublime \ Text \ 2/Packages/User/Base \ File.sublime-settings

Add the following settings to the hash of options. You can take a peek at all the other package settings and put any customizations you want to retain here.

// The number of spaces a tab is considered equal to " tab_size " : 2 , // Set to true to insert spaces when tab is pressed " translate_tabs_to_spaces " : true ,

To open all packages to see what’s in them:

$ subl ~/Library/Application \ Support/Sublime \ Text \ 2/Packages/

RSpec & Test::Unit

I found this great plugin for running both RSpec and Test::Unit tests from within Sublime Text 2, https://github.com/maltize/sublime-text-2-ruby-tests. It allows you to run all the tests in an individual file and also supports focused tests, however focused tests don’t seem to work for me. To get this installed:

$ cd ~/Library/Application \ Support/Sublime \ Text \ 2/Packages/ $ git clone https://github.com/maltize/sublime-text-2-ruby-tests.git

Sublime Package Control

Update – I’d like to thank Dimitar Dimitrov & Pablo Barrios for pointing out Will Bond’s Package Control. Sublime Package Control is a great addition to Sublime’s ecosystem. There are ton of useful packages and themes that you can add just by selecting them. Just follow the simple installation instructions and you’ll be good to go. Press cmd + shift + p and type “Package Control” to find all the options for this add on. You can also get to it under the Preferences Menu.

CoffeeScript

Sublime Text 2 supports TextMate bundles, to get CoffeeScript syntax highlighting just install the bundle through the package control.

Haml & Sass

To get Haml & Sass support clone this repository and copy the Ruby Haml and SASS folders into the Packages folder.