Since I wrote my original post on switching to Sublime Text 2 a lot has changed. The final version was released just a few weeks ago. I also got a new computer and had to reinstall it; what I had originally written is a bit out of date so here is an updated post.
Command line ToolTo be able to open a file or folder from the command line from anywhere create a symlink to the subl command line tool.
RVMEdit Sublime Text's ruby settings file:
It should look like this:
"cmd": ["ruby", "$file"],
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"],
Preferences FileSublime Text 2 stores all settings and preferences in editable files with key/value pairs. If you want to change any default settings edit the User Preferences settings file and place your changes there. This will prevent them from being overridden in an upgrade.
Edit the User Preferences file:
You can also edit this file from within Sublime Text. Click the menu item: Sublime Text 2 => Preferences => Settings – User. I changed mine to use spaces instead of tabs and adjust the indentation globally. I also turned off hot exit, word wrap, and a few other things. If you just look at the default settings file you can get an idea of what's available to change. Just copy the keys to your own user file and change the values. I recommend checking this file into git as well.
To open all packages to see what's in them:
Sublime Package ControlSublime 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.
The packages you have installed are listed in another settings file. Any changes you make to this file will be automatically picked up by the package manager. It is easy to just add or remove packages here as well.
Some useful ones I've installed are: CoffeeScript, Dogs Colour Scheme, Haml, RSpec, RubyTest, Sass, and SCSS. It's also a good idea to check this file into git.
Sublime Text 2 Ruby Tests Bundler IntegrationWhen you try running tests from within Sublime Text it will probably error out if you are using Bundler. To fix this you need to override the command to execute the tests. Open you User Preferences file again and add:
// RubyTest settings
"ruby_unit_exec": "bundle exec ruby",
"ruby_rspec_exec": "bundle exec rspec"
Sublime Text 2 Ruby Tests ANSI Color FixWhen running RSpec test from within Sublime Text 2 you'll notice that the output contains ANSI color codes.
To fix this you can edit this file:
//"color_scheme": "Packages/Theme - Default/Widgets.stTheme"
I hope this helps you out. If you have any suggestions or tips please post a comment!