Balance Jr 2.0 for TextMate ScreenCast!

The following is not exactly a transcript of the audio from my new Balance Jr 2.0 command screencast.

Balance Junior the 2nd Screencast

Balance Junior the 2nd Screencast


Or as always, you can grab all my stuff from my subversion repository.

Hello internet people

Thomas Aylott (aka subtleGradient) here to show you the latest edition of my Balance Jr command.

I noticed that there were a number of problems with the original that have always bugged me.

For example:

THIS ONE!!!! Where it selects the contents of string as well as the text between strings. Bleah, horrible.

Also, Duane Johnson released his snazzy Jump commands.

Here, have a goosee and the new regex. Note the lovely use of comments to disambiguate.

Let me show you a few things you can do with it.

Ok, there’s some HTML.

Balance Jr Foreword grabs stuff in big chunks When the caret is outside a tag it’ll grab the entire next tag. When the caret is INside a tag, it’ll grab the entire next attribute value pair, or whatever biggest thing it can get ahold of

Balance Jr Backwards is much more fine tuned As you can see.

for example, You can place the caret inside an html attribute’s value string, hit Balance Jr back and it selects the contents of the string, Hit it again and it’ll select outward until it grabs the entire tag.

ok! While we’re here…

Here’s my “add an HTML attribute” command. And Here’s Duane’s “Jump Next” command in action.


There are two built-in commands in the latest editions of TextMate EDIT/ SELECT/ “current scope” and EDIT/ SELECT/ “enclosing brackets”

note that both of these grab the brackets at the ends. While Balance Jr only grabs the innards!

Welp, that about wraps it up. goodnight everybody!


HTML tags that don't contain text

The contents of various other forms of Embedded source

The contents of Embedded source

HTML Comments

HTML Attribute name

HTML Attribute name value pair

HTML Compatible "String Double"

'String Single'

[Square Brackets]

{Curly Brackets}

>Text Inside HTML Tag</

Hex Colors #AABBCC


@variables $variables !etc

/* Contents of Comment Blocks */

Comma Delimitated

CSS Attribute Values

Closed xHTML Tags

Placer for adding HTML Attribute Values
)(?<=\")(?=(>|/>| />))|(?#


"String Double"

Space and the end of the line

JS function names and variables

The End :)subtleGradient