Titanium Mobile TextMate Bundle

human hand shaking robot hand isolated on white with clipping path, 3d illustration

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:

  1. EDIT: As per Jeff’s note below, make sure the Ruby JSON gem is installed: sudo gem install json
  2. cd /Users/[your username]/Library/Application\ Support/TextMate/Bundles
  3. git clone git://github.com/subtleGradient/JavaScript-Appcelerator-Titanium-Mobile.tmbundle.git
  4. 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!


  1. I followed all instructions and did “sudo gem install json” but when I type “Ti.” I get nothing…. Any other help would be great!

  2. 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 🙂

  3. I both reloaded bundles and restarted text mate.

    I selected Titanium Mobile as the type

    Typed: Ti.

    and I get nothing.

    Any other suggestions?

  4. If you get this errror:

    ERROR: could not find json locally or in a repository


    sudo gem update –system
    sudo gem install json


  5. 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!

  6. 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!

  7. 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

Comments are closed.