Interesting Additions to TextMate 1360

The new cutting edge version of TextMate has a number of interesting additions for Objective-C, Ruby and CSS users. To get cutting edge updates, go into Preferences, Software Update, and choose "Watch For: Cutting Edge". Here's a quick look at the relevant changes.

The Objective-C bundle gains the ability to instantiate Cocoa objects very easily. Simply type "NS" and hit tab. This fills in a template which allows you to type virtually any NS-prefixed class name and call the class factory method.

You can combine this with Foundation class completion for some very quick editing. Type "NS", hit Tab, hit Escape to go the end of the symbol, and keep hitting Escape to cycle through the obvious options — NSString, NSArray, NSDictionary, and so on.

The Objective-C, Ruby and CSS bundles can activate method completion with Option-Escape. This is very similar to Xcode's code sense. In the case of CSS, it's property/selector completion, rather than methods. The C bundle now features the same sort of support for standard library functions, though it's activated with Control-M.

There's also this, which might be interesting to Flash developers:

ActionScript bundle: The "Build with MTASC" command allows TextMate to compile ActionScript out of the box.


On a related note, a recent post from Wincent Colaiuta alerted me to one of the most humble yet potentially invaluable techniques in TextMate: holding down Control and hitting the left and right arrow keys allows you to jump to the obvious places inside of a CamelCase symbol name. Add Shift to the mix and you get selections. Awesome.
Design Element
Interesting Additions to TextMate 1360
Posted Feb 14, 2007 — 16 comments below




 

Manton Reece — Feb 14, 07 3573

The control-arrow trick works in BBEdit and Xcode too. When I used to go back and forth between CodeWarrior and Xcode, I was always surprised that CodeWarrior didn't support it.

The biggest problem for me in using external editors for Objective-C is the disconnect when you have to start using the debugger. Otherwise I'd love to use BBEdit and TextMate more often for Cocoa projects.

Scott Stevenson — Feb 14, 07 3574 Scotty the Leopard

editors for Objective-C is the disconnect when you have to start using the debugger
True enough. I think of TextMate as my code writing machine, and Xcode more as my code analysis and adjustment tool. You can, of course, use Xcode for both, but TextMate is drastically more efficient for me when filling out the large chunks of an application.

Chris — Feb 14, 07 3575

holding down Control and hitting the left and right arrow keys allows you to jump to the obvious places inside of a CamelCase symbol name

Allan added this feature a couple of builds ago at my request. Ask and ye shall receive!

It's originally from CodeWarrior, and the Xcode team very recently implemented it as well. In TextMate, it also works for underscore_divided_names, which I think was already implemented but was bound to a different key combination.

Chris — Feb 14, 07 3576

Nothing against XCode, but Visual Studio puts XCode's implementation of code completion / Intellisense to shame.

This coming from a forced (literally) to use Microsoft platform and tools developer by day and beginning Mac developer at night.

I do not enjoy the bloat that is Visual Studio, but I admit there are some wonderful features that I wish XCode/Apple would add.

Chris — Feb 14, 07 3577

Sorry, click happy.

In regards to TextMate, I have been using the CTRL + Arrow for what seems like a long time now. And I thought I was learning to use TextMate strokes slow. I expected more from you Scott ;)

Scott Stevenson — Feb 14, 07 3578 Scotty the Leopard

Visual Studio, but I admit there are some wonderful features that I wish XCode/Apple would add
Do you have some examples? I believe you, I'm just curious.

Elliott Harris — Feb 15, 07 3579

I knew you were going to be excited about this as I was, and I was just waiting for this blog post to happen. I'd really like to see TextMate support setting breakpoints within XCode projects. I wonder if you can set them via AppleScript... hmm..

Joachim Mrtensson — Feb 15, 07 3580

The C bundle now features the same sort of support for standard library functions, though it's activated with Control-M.
it is actually on Option-Escape, but it used to be on Control-M back when the original commit message was written. If you look in the release notes you will see the following.
[CHANGED] Objective-C bundle: code completion for the C and Objective C Bundles now use alt-esc as key shortcut.
For those that check out from svn C++ completions for the STL algorithms was just added.

Chris — Feb 15, 07 3581

Do you have some examples? I believe you, I'm just curious.

I'm at work, but will write up a little something. To compare and show. Lets me think of specific examples during the day.

I'm not a MSFT devotee at all. I'm just forced to use their tools on a daily basis. I'm an open source/Mac developer at night. Which I preach all day to my managers.

Pete — Feb 15, 07 3582

Chris: You may also give Completion Dictionary and (more generally) Text Expander a try! ;-)

Scott Stevenson — Feb 15, 07 3583 Scotty the Leopard

@Pete: I actually posted something about Completion Dictionary before. It's very nice, but not a replacement for TextMate.

Erik — Feb 15, 07 3584

After years of hearing about how great Visual Studio is in various weblogs and forum posts, I finally had a chance to try it out when I was asked to work on a .NET project last year for the first time. I was actually excited to see what this legendary IDE offered over other IDEs.

Sadly, it was a complete letdown. Poor key-binding customizability, poor search functionality, passable debugging features, and bugs in the product made for a miserable experience. In fact, I think C# is kind of cool and I can't say I hate the .NET platform, but I'd never go back to another .NET project after that experience -- like Cocoa, .NET is one of those frameworks that is very tightly coupled to its tools, and in a framework like that, if the tools are constantly getting in your way, the whole experience sucks for the developer.

If you want to see an example of shining greatness in an IDE, see IntelliJ IDEA. Since it's Java-only, I don't expect most people here will bother (and even a one-week trial isn't enough to really learn all of the things that make it great), but it's the best editing environment I've ever used, for any language or framework. Intuitive, customizable, packed with features, but most importantly, it doesn't get in your way.

StuFF mc — Feb 16, 07 3589

I might comeback here now and then and post about VS, since I just started an ASP.NET project. But... and I discussed about that when I Interviewed Scott back in January :

Being a Windows developer who started in VB 4's IDE, with all the bells and whistles of intelisense (that would be auto-completion in Xcode), I was always frustrarted when I had to do things like PHP or else, "just because of the IDE". I would guess, kind of the same thing as us, Devs who are used to Garbage collector and run away screaming for momm when they see "alloc" ;)

That said, I just started (today) to use TextMate (funny enough a few hours before I read this post) and I find it pretty cool. What really stresses my mind is that it keep on coming back: Developing for the Mac is as hard as using Windows (and Vice Versa). What I mean is the learning curve to Cocoa, but also the fact that without TextExpander (which I simply can't live without anymore...), TextMate (or SubEthaEdit, also pretty cool...), Complete Dictionnary, ... it's just not enough with "only Xcode :(

Anyways... One thing still needs to be said here... Before I started Pomcast.com I was probably using 50/50 PC's and Macs (probably even more the PC), and now I actually have NO PC anymore at home :) Who needs it, I got Parallels, running in Coherence Mode and the only things I use for this ASP.NET project is VS.NET, the MS-SQL tool, and IE... The rest ? Browsing, emailing, finding files, ... Is all done within the "holly cat" :)

Boyan — Feb 17, 07 3590

Regarding MS Visual Studio and Xcode:

I am using both on daily basis . I work in games industry and projects I work on have milions of lines of code. For such big projects VS is unbeatable (you think Sony uses it for no reason?). Add "Visual Assist" plugin (even Allan mentioned it as inspiration for TextMate) and you have the best IDE ever (as far as C-like languages and projects go, I don't use .net, java, scripting languages etc). I use Mac at home, but I have to say - Xcode has a lot to learn from MS. From project-management features, to code completion.
It's true, the first Visual Studio .Net version was very buggy. VS 2003 and 2005 however are fantastic. I'd like to see Apple finaly putting their act together and at least copy the best features from VS if not implementing their own.

Henry K. — Feb 17, 07 3591

But you can integrate Subversion into Xcode!

Scott Stevenson — Feb 17, 07 3592 Scotty the Leopard

@Boyan: Xcode has a lot to learn from MS
Xcode 3 and Inteface Builder 3 have some pretty big changes. I'll be curious what the VS veterans have to say about them once Leopard goes final.




 

Comments Temporarily Disabled

I had to temporarily disable comments due to spam. I'll re-enable them soon.





Copyright © Scott Stevenson 2004-2015