This site provides the following access keys:

Brandan Lennox's

TextMate-style Commenting in BBEdit

Update on : As of BBEdit 10.1.1, this has been fixed.

Since July, I’ve been moving from my beloved-but-abandoned TextMate to BBEdit. It’s good. I like BBEdit. I like the feel, I like knowing that bugs will be fixed and new OS X APIs will be implemented…

But I miss the way TextMate comments out the current line when there’s no selection. Seems trivial, but I use it all the time. Kerri wrote a script to do this, but it wouldn’t block comment a selection, so I needed to remember two separate keystrokes: one when there was a selection and one when there wasn’t.

Instead, I changed the original script to act as a Menu Script and attached it to the “Text > Un/Comment Selection” menu item. If there’s a selection, it passes control back to BBEdit. If there’s not, it works its magic.1

The menu script is on Gist. Save that file as ~/Library/Application Support/BBEdit/Menu Scripts/Text•Un/Comment Selection2, and you’re off to the races.

Update on : Looks like Allan really is still working on TextMate 2. I’m excited to see what he’s done, but I doubt I’ll go back. Who’s to say it won’t be another five years until the next major update?

Footnotes

  1. It’s not exactly the same. TextMate places the comment delimiter in front of the first non-whitespace character on the line. This script places it at the beginning of the line.
  2. Finder will allow you to save a file with a slash in the name. Thanks to Patrick at Bare Bones for helping me figure that out.