Watts (chipotle) wrote,

Finger sprains and text editors

I think I sprained my finger last week, or bruised it in some seriously unpleasant way. I don’t remember what I smacked it into, but it was something like the edge of a table or countertop, hard enough to hurt for a while. I didn’t think about it much until the finger started hurting again when I moved it. I’ve immobilized it now in a little finger wrap and am hoping it won’t need real attention–although I’m overdue for a general doctor’s appointment anyway at this point. (By, oh, two years, at least.)

I’ve been playing around with a text editor called TextMate, a fairly new one in the Mac market which got lots of attention thanks to heavy promotion from Ruby on Rails zealots. I looked at this editor in its 1.0 release and hated it–it looked like a programmer with Great! New! Ways! of doing things who didn’t understand that Boring Old Ways of doing things were often derived from practical experience, not mere inertia. It didn’t have preferences; you could toggle some things if you could find them in menus. It couldn’t print. The text colors were tied to programming languages, so while you could set TextMate for black text on a white background, that only worked for plain text files–edit Ruby source and poof white text on black background you couldn’t change without editing an XML file. It supported folding, but badly.

But, TM’s developer has a saving grace–he listens to his users. He’ll stick to his guns on some things, but the upcoming 1.1 release fixes all the things that sent me screaming from it. (The users are still the most annoying things about it, as when you say that, yes, integrated SFTP support is really useful to you, they tell you why you’re wrong.) And, while both it and its longtime competitor BBEdit support boilerplate text entry (“snippets” in TM, “glossary entries” in BBEdit), TM has a UI for creating snippets and assigning them keystrokes or autocomplete keywords–type the keyword and hit Tab. So for building on a MUCK, I have a snippet named exits which looks this:

@succ ${1:dir}=You walk ${2:longdir} to ${3:place}.
@osucc ${1:dir}=walks ${2:longdir} to ${3:place}.
@odrop ${1:dir}=approaches from the $4.
@desc ${1:dir}=To the ${2:longdir}, you can see #{3:place}$0

After expansion, dir is highlighted. Type “n” and all the $1 placeholders change; hit Tab and the selection moves to longdir. Type “north,” all those change, hit Tab, and so on. So I get basic canned messages with very little work. And that’s something BBEdit’s glossary entries can’t do.

Of course, the downside for TextMate is that it’s another commercial application. One suspects that “snippets” could be written for Emacs, which is the editor I’m actually using to write this. I’m not a huge fan of either of the “big two” Unix editors (Emacs and Vim*), but they’re both free and powerful, even if neither of them actually knows how to handle soft wrapping correctly. That’s a different rant, though.

*I know there’s actualy a bunch of Vi relatives out there people use, but Vim seems to be both the most popular and the most powerful of them, so assume it’s standing in for nvi, vile, elvis, vigor, etc.

Tags: life, tech
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded