My TextMate Bundles, Commands, Macros, etc...

by Thomas Aylott Sun, 05 Feb 2006 15:41:00 GMT

Ahhh TextMate, how I love thee.

This is just a quick post to share a couple of handy TextMate commands.

Balance Jr textmate thinggy

Balance Jr Textmate Macro

(?<=(<%@\s|<%#\s|<%=\s))[^%]*(?=\s%>)|(?<=<%\s)[^%]*(?=\s%>)|(?<=</)[^/>]*(?=>)|(?<=<)[^/>]*(?=/>)|(?<=<!--\s)[^->]*(?=\s-->)|\b\w+\b(?=\s*=)|\s\b\w+\b=\"[^\"]*\"|(?<=\\")[^\\"\n]*(?=\\")|(?<=')[^'\n]*(?=')|(?<=\[)[^\[\]]*(?=\])|(?<={)[^{}]*(?=})|(?<=<)[^<>\n]*(?=>)|(?<=[^/]>)[^><]*(?=</)|(?<!\d)\d+(?!=\d)|[@$!]\w+\b|(?<=/\*).*(?=\*/)|(?<=[\(,])[^\(\),]*(?=[\),])

You place your caret inside something and the macro will select everything in between enclosing characters. It’s kinda like the balance command, except it grabs everything INSIDE the characters, but not the characters themselves.

It works with:

[], {}, (), '', "", word="", <>, ><, $word, @word, /* word */, <% word %>, <%= word %>, <%# word %>, <%@ word %>, integers, comma separated values, and probably more, but I forget now.

If you want to select the paragraph text section of the following HTML, place your caret somewhere in the text and hit the macro. It’ll select everything between the > & < characters.


<p class="blah">
     paragraph text 
</p>

Here’s all the crazy stuff!

All these files are .tmbundle packages. I have them in my personal TextMate folder ~/Library/Application Support/TextMate/Bundles/. All my TextMate stuff is now being hosted in SVN at http://textmate.svn.subtlegradient.com/. Enjoy!

Back to a regular folder. Blaaarrgghhh!

These linked files are now ZIPs, yet again. But Safari will auto un-zip them for you to just double click on in your downloads panel.

That’s all. It’s been a pleasure, as always!

RSS feed for this post |Trackback from your site |Add your comment

  1. You can now grab all my TextMate stuff with SVN at http://textmate.svn.subtlegradient.com/

    It’s an open svn server for all your grabbing porpoises ;).

    Enjoy

    Thomas Aylott about 9 hours
  2. Thomas Aylott about 10 hours
  3. Apparently, people aren’t thrilled with having to use subversion to download this stuff.

    That’s fine, I suppose.

    I’ll put the zip back up.

    Thomas Aylott about 17 hours
  4. Thomas Aylott, on the TM mailing list:

    > I’m delighted / surprised anybody even wants the thing. And yet, still, I’m the only person to comment on my own blog, how sad is that? :’(

    Aaah. :(

    Commenting on your own blog, I’d never stoop so low myself <fx: looks down, shuffles feet/>.

    Balance Jr looks pretty nifty, I’m about to download it. Cheers.

    Jon Evans about 22 hours
  5. This is very handy, thanks for sharing! It maps nicely with a laptop keyboard, fn-left and fn-right move from section to section, which is awesome.

  6. Very cool. Um, how do you implement that? I’m a textmate newbie, and I looked around at the create command, or macro, and couldn’t quite figure out how to get it to work. Do I create a find macro somehow? Thanks for any help.

    bob 1 day
  7. P.S. It looks like you’re using Typo? How are you liking it if that’s what it is?

    bob 1 day
  8. I just downloaded your x51.tmbundle after your reply on TM mail list about the HTML selection within tag question you answered to, and looking through your bundle, I’m wondering if you wrote some sort of “documentation” for it or if I should just go through everything and figure out what it does (which is fine, but I thought I’d ask before I go that route ;)

    m d 2 days
  9. I’m afraid my Dreamhost SVN server has tanked.

    I’m not sure what the problem is or how to fix it, but you can’t see anything when you go to http://textmate.svn.subtlegradient.com/ anymore, and i keep getting svn: PROPFIND of '/trunk': 405 Method Not Allowed (http://textmate.svn.subtlegradient.com) whenever I try to do anything with the server.

    This is REALLY irritating!

  10. Great bundles! Thanks!

  11. New user here. This bundle is going to be great, thanks.

    But where is the “real” Balance/Balance Sr. ? I ‘ve been looking for it everywhere!

    James 32 days
  12. Hi, great bundle. Should I use the zip file on this page or use svn to download from your repository x51_in_progress.tmbundle ?

    Thanks

    Daniel 58 days
  13. What is that diagonal arrow character that is the default trigger for your bundles? Holding down left+up at the same time doesn’t trigger it. I’m rebinding it to something else, but I’m leaving this comment out of curiosity. Also, if this thing won’t email me when someone responds, don’t bother because I won’t ever see it. Thanks for the bundle, by the way!

    Alan 68 days
  14. wow, this is some really cool looking control. I feel like it is going to speed up the production html that I do at work 10 fold.

    thanks a ton

  15. It’s bound to home and end by default.

    Or FN right-arrow and FN left-arrow on a powerbook.

    I also have it bound to the left and right scroll on my mouse.

  16. This is the old page. There’s a new screencast and bundle and everything. http://subtlegradient.com/articles/2006/05/06/balance-jr-2-0-for-textmate-screencast

  17. Hi all! Good afternoon!Best site in world herbal love[/URL] http://www.penisherballove.com/dr/index.php penis herbal[/URL] http://www.penisherballove.com/dr/erect-penis-herbal.shtml penis normal[/URL] http://www.penisherballove.com/dr/erect-penis-normal.shtml enlargement pill[/URL] http://www.penisherballove.com/dr/penis-enlargement-pills.shtml enlargement pill penis[/URL] http://www.penisherballove.com/dr/penis-enlargement-pill-penis.shtml growth pills[/URL] http://www.penisherballove.com/dr/penis-growth-pills.shtml herbal love[/URL] http://www.penisherballove.com/dr/penis-herbal-love.shtml big[/URL] http://www.penisherballove.com/dr/penis-big.shtml shop penis[/URL] http://www.penisherballove.com/dr/herbal-shop-penis.shtml love shop[/URL] http://www.penisherballove.com/dr/herbal-love-shop.shtml penis enlargement pill[/URL] http://www.penisherballove.com/dr/herbal-penis-enlargement-pill.shtml penis pill[/URL] http://www.penisherballove.com/dr/enlargement-penis-pill.shtml enlargement pill store[/URL] http://www.penisherballove.com/dr/penis-enlargement-pill-store.shtml penis enlargement pill[/URL] http://www.penisherballove.com/dr/top-penis-enlargement-pill.shtml penis enlargement pill[/URL] http://www.penisherballove.com/dr/viagra-penis-enlargement-pill.shtml male penis pill[/URL] http://www.penisherballove.com/dr/enlargement-male-penis-pill.shtml