More Goodies for TextMate

After introducing the controller-to-view textmate shortcut yesterday, my coworker (Pete Lasko) and I got excited about the possibility of expanding this idea. So from some of our ideas I built the “syncPeople on Rails” bundle for TextMate, in honour of the company we both work for.

Features of v.0.5

  1. Open Controller / View — option-command-up
  2. Create Partial from Selection — option-command-p
  3. Intelligent Go To File — keypad ‘enter’ key

The Open Controller / View feature is the same as yesterday’s feature. It is superceded by the Intelligent Go To File command, however, and may soon be deprecated.

The Create Partial from Selection feature lets you select a section of text in your view, hit option-command-p and then name your new partial. In place of the selection you’ll get a “render :partial => [partial name]” and a new partial file to match.

The Intelligent Go To File feature is perhaps the coolest feature of the set. Hit the keypad ‘enter’ key and you’ll be taken to whatever makes the most sense. For example, if you’re on a line that reads “render :action => ‘list’” and you hit ‘enter’, you’ll be taken to that list action in the controller. If you’re inside a view file but not on any particular “render” line, you’ll be taken to the controller. It tries to use a best-match scenario, and for the most part, I think it does well enough. It still has some significant limitations, however, that I will be eliminating as I develop Rails apps with it.

Installation - 5x Easier!

Download the syncPeople on Rails Bundle and untar/unzip it in to the following folder:

~/Library/Application Support/TextMate/Bundles

Done!

Enjoy!