TextMate + iGTD

New to TextMate?

TextMate is a great text editor, especially for developers working with HTML, Python or Ruby scripts. It contains many useful additions for lots of different programming languages. And some good news: iGTD integrates with TextMate flawlessly.


F-key trick for TextMate

You can use the F-key trick for TextMate which makes possible to put the currently edited file as a new task in iGTD. The task contains a link to the TextMate file including the caret position.


How to configure it?

Unfortunately, some extra steps are required to enable the F-key trick for TextMate. Let's go!

Important: iGTD >=1.4.5.3 is required!... Please upgrade from previous releases.

a) download the rubycocoa package (get the DMG file from here) and install it

b) open TextMate and switch to the Bundle Editor

Pasted Graphic

c) choose the desired bundle you're working with frequently - and add a new command:

Pasted Graphic 2

d) enter the name like 'Add to iGTD'

e) paste this content to the command field:

#!/usr/bin/env ruby

require "osx/cocoa"

dnc = OSX::NSDistributedNotificationCenter.defaultCenter()

dict = OSX::NSMutableDictionary.dictionary

filename = File.basename(ENV['TM_FILEPATH'])
dict.setObject_forKey(filename, "name")

dict.setObject_forKey(ENV['TM_SELECTED_TEXT'], "content")

link = "txmt://open/?url=file://"+ENV['TM_FILEPATH']+"&line="+ENV['TM_LINE_NUMBER']+"&column="+ENV['TM_LINE_INDEX']
dict.setObject_forKey(link, "url")

dnc.postNotificationName_object_userInfo_("iGTDNewTaskDistributedNotification", nil, dict)

e) set other settings to this state:

Pasted Graphic 3

That's all! Now you can also assign a key shortcut for this feature:

Pasted Graphic 4

and you're ready to go. Just use the new command and enjoy adding your TextMate files to iGTD.