This weekend, esteemed community member Thomas Aylott (a.k.a subtleGradient) published his TextMate bundle for Titanium Mobile! This is a must have for any Mobile developer working on the Mac (and using TextMate of course). Installing his bundle is easy – you’ll probably want to install via git, so you can update the bundle via a simple git pull:
- EDIT: As per Jeff’s note below, make sure the Ruby JSON gem is installed:
sudo gem install json - cd /Users/[your username]/Library/Application\ Support/TextMate/Bundles
- git clone git://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-Mobile.tmbundle.git
- reload your bundles or restart TextMate
To see the magic happen, simply start typing in a Titanium namespace:

At any point while typing a Titanium function, hit option+escape to bring up the code completion window. Once you’ve selected your function, hit the tab key to switch to the next argument:

There are some other goodies packed in there as well – typing “inc” then tab will create a Ti.include statement, and d+tab will output a Ti.API.debug statement. I definitely encourage you to check out this awesome TM Bundle, follow new developments in the project, and to shower praise and adulation on it’s author. Thanks for an outstanding contribution!

You need to have ruby, gems and the json gem installed in order to use this.
Awesome! I would also recommend everyone to use JSLint. Here’s a textmate bundle http://github.com/johnmuhl/javascript-tools-tmbundle
Also… need to have git installed. ;)
http://code.google.com/p/git-osx-installer/downloads/list
Looks great – excellent addition.
@Volante: Thanks for the update about JSLint.
I followed all instructions and did “sudo gem install json” but when I type “Ti.” I get nothing…. Any other help would be great!
make sure you reload the bundles or restart textmate.
Coda code completion support would be great!
Not sure if it’s me, textmate or the bundle but it does not fire everytime you type the DOT, in fact it seems to have a mind of it’s own. The there a way to make it manually fire… like for eclipse CTRL and SPACE ? Also the properties information window disappears when you move the mouse… is there anyway to make it hang around longer :-)
I both reloaded bundles and restarted text mate.
I selected Titanium Mobile as the type
Typed: Ti.
and I get nothing.
Any other suggestions?
WOW! Got it working! COMPLETELY MISSED THE “option+escape” part!
Thanks
If you get this errror:
ERROR: could not find json locally or in a repository
type:
sudo gem update –system
sudo gem install json
Thanks!
Sorry the above should have two dashes on system.
sudo gem update –system
The ‘Ti.’ completion only comes up when you use the titanium mobile JavaScript language syntax. Select it from the popup thing in the status bar.
Option-escape works everywhere on anything that starts with ‘Ti.’ or ‘Titanium.’ e.g. ‘Ti.UI.create{OPT-ESC}’ will give you the completions popup for everything thatmatches that.
Also, this article never mentioned the contextual tooltip help thing. Itworks by itself too! Simply hit ‘option-F1′ when your caret is on anything beginning with ‘Ti.’ or Titanium. It even works inside the parens! Try it all over the place to get a feel for it.
This was only possible because of the excellent API.json file that the Titanium team published.
Give me an API.json file and I’ll give you codecompletion for anything!
Oh yeah… Be sure to check out my other bundles too. I have a JavaScript.tmBundle that includes autocomplete for browser specific API. It includes tooltips taken from quirksmode.org with permission from PPK!
Also, SelectStuff.tmBundle is an absolute essential!
Thanks Tony, the “option+escape” was exactly what I was looking for :-)
Anyone else getting a Ruby error?
/Applications/TextMat.app/Contents/SharedSupport/Support/lib/ui.rb:130:in `reopen’: can’t change access mode from “w” to “r” (ArgumentError)
Then it’s a stack trace