Autopairs and the “Midas Touch”

Byword and TextMate spoiled me to the way they handle paired punctuation such as “”, (), [] and the like.

In the first use case, the apps recognize when you type the opening punctuation and automatically place the respective closing mark with the cursor betwixt the two waiting for your text.

The second case is even better. Select some text you want wrapped in quotes or parentheses or whatever, then type the appropriate punctuation. In most other software, the opening punctuation mark would replace that text. Byword and TextMate buck that default behavior and wrap the text in the opening and closing punctuation.

Seriously, it’s like magic.

It got me thinking, “Wouldn’t it be swell if this worked in other apps.” Sending an email in Sparrow for instance, or writing in BBEdit. Especially in BBEdit! I didn’t have to dwell on it long before I found Autopairs.

Developer James W. Walker maintains several projects available on his website). Autopairs is a preference pane cleared for action on Mac OS 10.4 or later, specifically calling out Tiger, Leopard, and Snow Leopard. Apple’s latest Mac OS X Lion isn’t mentioned, but I’ve seen no problems save for one.

Midas Touch

King Midas is remembered in Greek mythology for his deal with the god Dionysus, who granted his request to turn anything he touched into gold. Midas was thrilled with his new gift, then found he couldn’t eat or drink because his dinner also turned to gold, and finally his daughter did as well. Midas’ blessing became his curse.

This is kind of how I feel about Autopairs. It works everywhere–everywhere–and has unveiled how often I forget to use these characters, then have to go back and add them.

The preference allows for application-specific settings, but assumes global usage. I’ve been too lazy to enter each of the applications where I don’t want it to work and would prefer the ability to add the apps where I do want the added power. This is more of a testament to my own problems with sloth than a failure on the part of Autopairs.

It can get incredibly tedious for me, like trying to search for specific text in Google. I lazily type my search terms and get 20 bazillion hits, then go back to tighten my search and get this…

""specific search terms here""

…then I begin tracking with the arrow keys or mouse to delete the vestigial marks, which means I end up using more keystrokes than I save.

For me, the true power of something like Autopairs would be the ability to wrap text rather than simply pasting the paired punctuation.

See also, auto repair: Enjoy this blast from the 1980s.