Objective-C and PHP Additions in TextMate 1368
The newest build of TextMate adds completion-related improvements for Objective-C and PHP. Here's a quick glance at what they are and how to use them.Objective-C Additions
The Objective-C bundle can now autocomplete all of the important class names inside messaging brackets.

A minor inconvenience is that there are two commands that do very similar things. Esc will autocomplete from a short list of the most popular classes — string, array, dictionary, and mutable versions of each. Hitting escape multiple times will run through these options very quickly. This is a good tool whenever you quickly need basic storage.
Autocompletion with Option-Esc consults a vast list of classes and presents the results in a popup list, but only works inside square brackets. This command will offer both NSArray and NSArrayController, for example, whereas the quick completion would offer only NSArray.
Also, you might remember that TextMate 1360 added easy object instantiation by typing "NS" and hitting tab, which creates a new instance for most of the obvious classes in the main frameworks. Not to mention build 1310 added method completion, which is activated by the same Option-Esc sequence as the class names.
An incredibly valuable addition here would be for the new class completion command to work in a broader scope, so that it could be combined with the "NS" tab trigger (hint, hint Joachim).
If all of this is too much to remember, just use Option-Esc when inside square brackets to autocomplete class or method names. Use Esc to complete symbols that you type (variable names and such).
PHP Additions
PHP has picked up the function popup lists as well, using the same magic Option-Esc sequence.

You can get much of the same functionality by just hitting Esc to run through various options. Unsurprisingly, this works much the same as the Objective-C bundle.
Particularly interesting in this build are the documentation-related additions to the PHP bundle. The first is Option-F1 to get a tooltip with a signature and short description of the current function.

The cursor must be outside of the parenthesis for this to work, by the way. Also, you can bring up the live documentation page for a function with Control-H:

As always, you need to activate Cutting Edge updates in Preferences → Software Update in order to get the newest builds.

Objective-C and PHP Additions in TextMate 1368
Posted Mar 4, 2007 — 12 comments below
Posted Mar 4, 2007 — 12 comments below
Joe Goh — Mar 04, 07 3673
Thanks for the heads-up Scott.
StuFF mc — Mar 05, 07 3674
Scott Stevenson — Mar 05, 07 3675
The Option-Esc sequence can be changed to whatever you want in the Bundle Editor. The completion command is in the Objective-C bundle and is called "Cocoa Context".
TextMate want le me "Save on the Server"
I'm not sure which FTP client you use, but I use Transmit's external editor support, which works just fine with TextMate. I also use the "DockSend File"command quite a bit, which is in TextMate's Transmit bundle. I guess there is interest in TextMate having built-in FTP/SFTP support, but I think this works pretty well.
Matt Mower — Mar 05, 07 3676
Joachim Mrtensson — Mar 05, 07 3677
Completing class names outside of brackets will soon be added, as well as some other completion goodies.
Henrik N — Mar 05, 07 3678
Kelan — Mar 05, 07 3679
David Wareing — Mar 05, 07 3680
- the symbols popup menu should be moved back up to the top of the window where it belongs. There are numerous things wrong with the placement, but the most grievous is the need to engage in precision clicking else the Dock will grab you. No response from developer on this one.
- there is nasty search-and-replace bug, at least using the (third party) Lua module, which the developer hasn't been able to reproduce yet. Also, its project-wide search results needs to be implemented in a split window view.
- the app needs to remember project state, for the drawer. It's great being able to open my entire project, but a bit tedious to have to go and then manually open up the file hierarchy.
Overall though, a great app, and recommended.
thegoldenaura — Mar 05, 07 3681
By the way, really nice TM Theme. I supose you have done it, because i can not find it in the included themes list.
Thanks
Joachim Mrtensson — Mar 05, 07 3682
Since no one has mentioned it (It was not mentioned in the release notes). I thought I tell you that in this release the insert matching bracket command has been completely reworked. It now consults a list of known Cocoa methods before inserting the opening bracket.
And finally a trick for people who have problems reading Objective-C syntax. Since October it has been possible to color the Objective-C method names: even multipart ones. Set the "support.function.any-method" scope to the color of your choice in Fonts & Colors in Preferences.
But the possibilities does not end there! (Uses best infomercial voice). If you want the method-names to show up in different color depending on how deeply nested they are create another item with the scope set to "meta.bracketed.objc meta.bracketed.objc support.function.any-method" (yes the meta part should go twice), pick another color and the Objective-C syntax has now become easier/harder to read :). If you want to allow coloring for even deeper nested methods create another item with three "meta.bracketed.objc" in the scope selector, repeat if you want to color even deeper nested methods.
David Wareing — Mar 05, 07 3683
Cheers.
Scott Stevenson — Mar 06, 07 3685
Yup, I just noticed that too. I'd bet it was added in this release since I use that feature quite a bit.
@thegoldenaura: By the way, really nice TM Theme. I supose you have done it, because i can not find it in the included themes list
The theme is Monokai.