(escape key) – used for word completion. type part of a word and then press the escape key to see the different word options.

↓ (option-command-down arrow) – jump between related files ↓ (shift-option-command-down arrow) – jump between related files (model, controller, functional test, unit test and fixture) – if one of the files doesn’t exist, it can be used to generate one for you

Make a Selection

Add shift key to any of the above hotkeys.

→ and ← (shift-option right and left arrow) – highlights words

→ and ← shift-command right and left arrow – highlights to end of line or beginning of line

↑ and ↓ (shift-option up and down arrow) – highlight everything above or below cursor

Deleting

(option-delete) – delete single word to left of cursor

fn (function-option-delete) – delete single word to right of cursor

fn or k (function-command-delete OR control-k) – delete everything to right of cursor

k (shift-control-k) – delete entire line or selection

Opening Project from Command Line

mate dir1 dir2 – open dir1 and dir2 in textmate project

Shortcuts within Migrations

tcs – create a new column of type string
tci – create a new column of type integer
tct – create a new column of type text
tcb – create a new column of type boolean

Shortcuts within Models

Models DB Schema

Inside the model, place cursor on Model name and type: control-shift-command-s to open up a window which displays database schema associated with that model.

Models Associations

hm – has_many (then click tab again to tab through areas you want to customize)
ho – has_one (then click tab again to tab through areas you want to customize)
hmt – has_many :through (then click tab again to tab through areas you want to customize)
bt – belongs_to (then click tab again to tab through areas you want to customize)

Models Validations

t (control-command-t) Then type ‘validate’ to narrow down

Models After-Before Filters

t (control-command-t) Then type ‘after’ to narrow down t (control-command-t) Then type ‘before’ to narrow down

Models, Controllers, Helpers, Modules, Classes

def – creates a method stub

cla – creates a class stub

: – gives you available options for that particular section. For example, for creating a new route, open up routes file, type map-tab and at the end type :-tab to create key value pairs.

Tests

r (command-r) – run a test. (must be in the test rb file. test db must be created already)

Views

ft – creates a form_tag
ff – creates form_for
ffe – creates form_for with error messages at top of it

use the following with the form_for tags:
f. – provides a menu of different form fields (use this one within the form_for tag)
ffl – creates form label field
fftf – creates form text_field
ffta – creates form text_area
ffcb – creates form check_box
ffrb – creates form radio_box
ffpf – creates form password_field
ffhf – creates form hidden_field
ffff – creates form file_field
ffs – creates form submit field

div – creates a div tag

div – creates a div tag but assume you don’t want to set id, you can type option-escape at that point to see a list of other attributes you can use instead of id.

. (control-shift-. (period)) – gives you ,

create a partial by doing: select piece of view and do h (shift-control-h) to