Getting into TextMate

I recently read Adam Knight’s tale of how he was periodically exposed to TextMate yet it took a lot of pressure before he really got into it.

This is certainly not unusual. While the user base is growing at speeds I would never have imagined (but then, I am not known for my optimism), TextMate, for some people, still comes of as too different, complex, bland, or whatnot.

Fortunately for me, there is a user community making up for current shortcomings in presentation. Brett Terpstra recently posted Digging in to TextMate which gives the new user a walkthrough of what is what. It also links to other resources such as the upcoming book about TextMate and Soryu’s tutorials.

Vladimir Cvetic posted a comparison between vim and TextMate which might be helpful for vim users willing to make the switch.

Finally, for users who want a quick feel for what all the rave is about, I highly recommend you watch some of the screencasts. If you do HTML, there is a screencast for HTML, for a general feel for how versatile the editor is, there is a Working With Numbers and Blogging From TextMate screencast.

For people working with Objective-C, be sure to watch these two. Though they do not show the excellent front end to xcodebuild, the recently added code completion, nor that the documentation lookup also works for selectors.

A screencast is also missing for Subversion support, but it is there! :)

29 Comments

  1. 15 Feb 2007 | # Fredrik wrote…

    Thanks for keeping the good work up Allan. The Soryu tutorial looks real interesting. I've been using TextMate for some months now and it just keeps growing and growing on me. If you ask me, the 39$ i spent on TM are by far some of my best spent money of software for a long time. Can't wait to see what 2.0 brings!

  2. 15 Feb 2007 | # dmw wrote…

    I want to love TextMate, but it's not quite exactly what I need. What TextMate seems to excel at is writing brand-new code. Snippets are great. Being able to tab through the various fields in the inserted code really brings the code to life.

    But not all of us have the luxury of being able to enter large amounts of new code. Maintenance is part of the job. What would really send TextMate over the top would be for it to somehow recognize a block of code as one matching a snippet, and reactivate the fields that existed when the snippet was originally expanded.

    In the best of all possible worlds, imagine being able to select a variable and hit some kind of tab-trigger that would then let you edit in place every instance of that variable–not just by name, but by context. Now that would be cool.

    I realize that this kind of interactivity with code is many orders of magnitude more difficult to achieve than what TextMate already does. The closest I've seen anyone come is the refactoring support in the latest versions of SlickEdit. And the fact that despite their many years of experience with editor/language integration they are still having problems putting together a flawless implementation is testament to the difficulty of the problem.

    But one can dream.

  3. 16 Feb 2007 | # Adam Salter wrote…

    (disclaimer I haven't actually tried this since I have no personal interest, just throwing this in for completeness…)

    I just read recently that there is a cocoa plugin (read input manager) that allows you to do text editing in cocoa apps using vi commands…

    For those pining for the vi command set, this might be just the thing to combine with Textmate for the ultimate sensitive new age text editor: http://www.corsofamily.net/jcorso/vi/

    attribution: http://www.43folders.com/2007/02/05/vi-input-manager/

  4. 17 Feb 2007 | # Jacob Rus wrote…

    For those pining for the vi command set, this might be just the thing to combine with Textmate for the ultimate sensitive new age text editor.

    No, you can't use the vi input manager with textmate. And frankly, you wouldn't really want to. They use two completely different mental models, with completely different sets of (conflicting) shortcuts, etc. "Those pining for the vi command set" should just use vi; or they should stop their "pining", and pick up TextMate and run with it. ;)

  5. 17 Feb 2007 | # Jacob Rus wrote…

    dmw wrote:

    But not all of us have the luxury of being able to enter large amounts of new code. Maintenance is part of the job. What would really send TextMate over the top would be for it to somehow recognize a block of code as one matching a snippet, and reactivate the fields that existed when the snippet was originally expanded.

    If you can write your own code that recognizes such a pattern, you can easily make a command that replaces a big block of such code with a (programmatically-generated) snippet. But I can't imagine how the editor itself is going to recognize every such pattern in every language; I can't even think of how you'd approach such a problem. If you have ideas of how such a super-intelligent editor would work though, please share with the class. :)

    In the best of all possible worlds, imagine being able to select a variable and hit some kind of tab-trigger that would then let you edit in place every instance of that variable–not just by name, but by context. Now that would be cool.

    From what I can gather, something like this should be possible in the next version of TextMate. Allan has stated that he wants to allow scopes to be used for regular expression replacements.

    But actually, now that I think of it, you should be able to handle something like this now. You can make a command which gets the text of the document, finds all the instances of the current word, and makes them into mirrored tab stops in a snippet. This is admittedly imperfect, and you could probably do better for a particular language (doing more complicated transformations as needed for that language's syntax), but it should be plenty useful nonetheless.

  6. 15 Aug 2007 | # tonyl wrote…

    vi supoprt would be fantastic for textmate. vi is still the fastest way to navigate and edit text files. claiming that the "mental models" are too different and the short cut sets are conflicting, is dare i say it, just lame. the mental models have nothing to do with it, and i'm sure the developers at textmate are smart enough to figure out a vi bundle that allows proper vi key bindings while providing access to all the short cuts in textmate. one obvious solution would be to reformat the textmate short cut bindings so they don't conflict – since textmate should support vi.

  7. 16 Oct 2007 | # robert wrote…

    I heartily agree with tonyl. vi keybindings work nicely in other editors/IDEs thanks to plugins, and there's no mental model shift necessary.

  8. 03 Dec 2007 | # justin b wrote…

    I heartily third the motion. I'm all over the map development-wise (.NET programmer professionally, but a mac user / unix geek at heart)… I've found viEmu for Visual Studio to be more than adequate. I'm a big fan of textmate on the mac, but I inevitably find myself using Vim rather Textmate, even on my (macbook pro) laptop. I'm just too addicted to Command Mode. If Textmate had this feature, it would be my defacto editor.

  9. 04 Feb 2008 | # Arnar Birgisson wrote…

    Let me fourth it :) TextMate rocks but vi keybindings are conveniently stored in the muscle-memory of many of us. I've used TextMate since I got my mac about a year ago since vim used to suck, but now that MacVim is giving us a good vim implementation I find myself moving away from TM more often :/

  10. 19 Apr 2008 | # Jim Tomlinson wrote…

    I fifth it, if that's possible. I've been really impressed with TextMate, but I just won't use or buy an editor/IDE that doesn't somehow support vi keybindings. (Now if I could just get vi bindings for M$ Word, I could go into management ;^)

  11. 20 Apr 2008 | # Lloyd Moore wrote…

    Textmate looks absolutely fantastic, a real time saver, but on my imac at work or macbook pro at home, it has to be macvim, for the extra productivity it offers over 'text snippets'

  12. 23 Jun 2008 | # Marcin wrote…

    Another vote for VI key bindings. I love what TextMate can do but just can't deal with the slow editing without VI key bindings.

  13. 08 Jul 2008 | # Lloyd wrote…

    I really think the philosophy of textmate hits the spot, but the addition of vim key bindings would make it a competition destroyer, no doubt.

  14. 07 Aug 2008 | # Kenny wrote…

    I vote for vi bindings as well please.

  15. 21 Oct 2008 | # Michael wrote…

    For what it's worth, I surfed to this site after typing '"TextMate", vi key bindings' in Google. I think TextMate has a lot of power but I'd love to get vi keybindings on top of it as well…

  16. 02 Nov 2008 | # Peter K. wrote…

    Yes please! I too arrived here by Googling "TextMate vi key bindings bundle" I frequently find myself wishing I could zoom around a file using the good ol' vi keystrokes permanently burned in my muscle memory…

    I love TM for all it's bundles and great integration with things like RoR but for general editing, I'm still much faster with macvim… I hope there's some progress on this front soon!

    Cheers, Peter

  17. 02 Dec 2008 | # Ben wrote…

    +1 for vi bindings…

  18. 18 Dec 2008 | # David Hasson wrote…

    Another vote for vi bindings. It's what prevents me from buying TextMate.

  19. 25 Dec 2008 | # andy wrote…

    Another vote for vi bindings. I would not hesitate to buy TextMate if it had vi keybindings.

  20. 16 Jan 2009 | # steve wrote…

    +1 more for vi keybindings

  21. 08 Feb 2009 | # zenshade wrote…

    Wow, wonderful to see the outcry for vi keybindings. For me, too, the number one criteria for any "new" editor is will it allow standard vi command mode movements. There's obviously a whole lot that TextMate does better than vim (else I wouldn't even be here) and for those things you don't need the vi way. Adapting to the TextMate way is a win. But being able to traverse a file without moving your fingers out of the home row is just an absolute no brainer.

  22. 08 Feb 2009 | # carise wrote…

    TextMate is definitely cool. However, (votes_for_vi_keybindings)++

    =)

  23. 17 Feb 2009 | # String wrote…

    ++VI

  24. 18 Feb 2009 | # obviously wrote…

    VI ! of course. Only reason I haven't switched all these years.

  25. 23 Feb 2009 | # Richard Careaga wrote…

    vi. why: sometimes I think I've used more text editors than I've had beers. (Well, kegs.) All it takes is 10 seconds with it and the next thing I've got a string of jjjjjjjj in my textmate file. It ain't mental, it's physical, what the psiguys call procedural memory. It would be a great comfort in mine age to have vi keybindings in textmate, as an option, of course. Think of it as RPN for text.

  26. 02 Jun 2009 | # asdfasdf wrote…

    Ummm..

    Vi keybindings?? Please.. I neeeeed them soooo bad!

  27. 19 Oct 2009 | # Puddles wrote…

    I'm picking up Mac OS development again after all these years in Windows and UNIX land, and you know what, as nice as TextMate is, I won't use it (which implies paying for it) unless it has vi keybinding. How hard can it be to handle basic vi commands like range, search / replace, etc? For the most part they should readily map to what TextMate already offers. It's not like we're asking for FULL vim compatibility (no, I don't want to play game of life inside TextMate, thank you).

  28. 11 Nov 2009 | # Michael wrote…

    Here is a limited vi keybindings for textmate: http://sourceforge.net/projects/tm-vi-plugin/

    Quite a bit of vi functionality is missing: For instance, undo is not supported. apple-Z is supported so it is a bit curious that the author did not bind u to apple-Z.

  29. 12 Jan 2010 | # Alexander Solla wrote…

    I also agree that some support for Vim keybindings would be a good thing.

    One very nice thing about Apple-style short cuts is that they rely on the thumb to use, over the pinky. This makes them useful and ergonomic. You just have to move your thumb over about a half inch, and you're pressing the key.

    Emacs' meta-style is not as comfortable to me. I have to stretch my pinky in awkward way, or else move my whole hand to the arrow keys (or worse, the mouse). Which is why I chose Vim over Emacs in the first place. As MacVim (the Cocoa port of GVim) shows, it is quite possible to maintain a mix of modal and Mac-style key bindings together. Indeed, since the Vim bindings don't typically use a meta key, there is no way for them to conflict. (I avoid using those meta key users

    I would also like to see some key bindings that move the cursor from the sidebar and back without taking my hands off the keyboard.

Comments closed, you can use the mailing list for discussion.