Highlights from the List
In the interest of sharing I will try to do write-ups of the interesting stuff from the mailing list and probably also a few of the personal replies I give while providing support for TextMate.
I am starting with half a dozen letters from the last few weeks which probably fall more in the category of frequently asked questions. The upcoming write-ups will have a more “how-to” feel over them (I actually picked a dozen letters, but putting those “how-to” sections in this post made it rather long, so I will post those over the next few days).
TmCodeBrowser 1.05 (Universal Binary)
Gerd Knops announced version 1.05 of his TmCodeBrowser plug-in, which is now a universal binary.
Navigate Bundle Items Using Quicksilver
Jeroen van der Ham gives a tip on how to navigate TextMate’s menus using Quicksilver (be sure to read the follow-ups which have additional instructions/clarifications).
Coincidentally The Tao of Mac has a post named Making the Mouse Redundant where a screencast shows this Quicksilver plug-in used to navigate TextMate’s menus.
Sharing Bundles Between Computers
A common question is how to export bundles to another computer.
All bundles and theme customizations end up in ~/Library/Application Support/TextMate
, so it is simply a matter of copying over that folder.
TextMate ensures that even if you rename bundles, bundle items, or themes inside TextMate, the filename used on disk remains the same, so it is possible to add the folder to Subversion (or similar version control system) without having to manually tell the SCM about how files were renamed.
Ned Baldessin had a nice suggestion about an infrastructure (dare I say Web 2.0) for sharing of TextMate customizations. I try not to make too many comments about the distant future, but I definitely want to isolate the current bundle editor into a “service” which can be used by other commands, and would allow others to build such a sharing system.
Back-references Versus Captures
Trevor Harmon questioned the sanity of using $1…$n
for captured variables in regular expression replacements, which made me write this explanation of my preference of $1…$n
over \1…\n
.
ProFont and Ligatures
Quinn Comendant noted that tool tips showed ligatures (that is, fi
show as the combined glyph fi
) when TextMate was using ProFont, which messed up results intended to be printed with fixed width fonts (like a dump of the database scheme).
TextMate uses ATSUI for normal text rendering, where it disables all such typographic features, but is not responsible for text rendering in tool tips, where such typographic features are thus not disabled. ProFont is a little strange in that it has such features, but there is a ProFontISOLatin1 variant which do not have them. Using that font will not show the problem, but will OTOH lack a few glyphs that the regular ProFont has, and the apostrophe is nicer in the regular font.
Jacob Rus noticed that tool tips also show straight single and double quotes as curly quotes. I wasn’t even aware the text system could do that automatically.
Printing in TextMate
Yeah, printing sucks in TextMate. Jeremy Wilkins took it upon himself to write a simple command to print the current document using a2ps
(available e.g. via DarwinPorts).
I should add that latest version of TextMate allows commands to get the current document marked up as XML using the current language grammar (see release notes for details), and printing is possible from the HTML output of commands. So it is possible to do syntax highlighted printing based on the current language grammar and whatever pre/post-processing desired. I added a proof-of-concept command for this in the Experimental bundle quoted here:
perl -pe 's/<\/[^>]+>/<\/span>/g' \
| perl -pe 's/<([^\/.>]+)[^>]*>/<span class="$1">/g' \
| perl -pe 's/\n/<br>\n/g' \
| perl -pe 's/\t/ /g'
Basically these four regular expression substitutions transform the XML into HTML with <span class="…">
tags, newlines converted to <br>
, and tabs converted to 3 non-breaking spaces.
I left out the stylesheet which style the classes. For the records, these are: comment
, constant
, entity
, keyword
, storage
, string
, support
, and variable
.
Alternative Shift Left/Right Keys
Some (mostly european) keymaps make ⌘[and ⌘] hard or impossible to reach.
For those there is ⌥⇥ and ⌥⇧⇥.