"Don’t write a text editor; you’re reinventing fire." — Ben Straub
As I’ve mentioned here before, I’ve been a TextMate user for the last few years, albeit increasingly reluctantly. TM has always been a mix of sheer brilliance and stone cold stupid, and while the former outweighs the latter, when the latter pops up it really gets in your face. (Undo character by character, anyone?) We first started hearing about TextMate 2 in early 2006, and as people will always respond if you point out that it’s now 2011, the author never gave an ETA other than “after Leopard.” All well and good, but if your dad walks out one Thanksgiving saying he’ll be back “sometime after Christmas” and it’s now five years later, when your little sister tells you “he didn’t say how long after Christmas” she’s maybe not facing reality. If your dad pops up to make a blog post once a year saying he’s still working on it, he is just possibly not facing reality, either.
So. A lot of old TM users have been looking for the Editor That Will Be TextMate 2.0 By Default. This has in turn given rise to new editors all aiming for that ETWBTM2BD spot. I’ve been following a few of them sporadically. Sublime Text is coming to the Mac! It supports (some) TextMate bundle operations to make it easier to move over to it! And so does Kod, and even though it doesn’t actually do anything yet it’s open source! Let’s not forget Panic’s Coda and MacRabbit’s Espresso, which are both marketed as quasi-IDEs aimed specifically at web developers and—again—sport limited compatibility with bits and dribbles of TextMate’s bundles.
A few days ago, word started spreading around of yet another new editor, Vico! Like Sublime Text and TextMate, Vico is a shareware program developed by just one guy and sold for about $50. This one, though, is a native Cocoa editor that uses
vi keybindings, uses Nu instead of Vim’s scripting language, and is partially compatible with TextMate bundles.
Wait. Now we’re trying to make Vim pretty? Really?
I love you all, but it’s time to stage a text editor intervention. Put down the mouse, back away from that download link, and take a deep breath.
First off: if you are a Mac user and compatibility with TextMate is an absolute must-have, let me ask you two questions. Is TextMate 1.5 still working for you? Can you keep living with its limitations? If you answered both those questions “yes,” our work is done here. Go in peace.
Otherwise, I’m going to make a radical prescription. I like both Coda and Espresso, but right now I can’t recommend either one unless you’re mostly doing static HTML files. Your decision is between three editors: BBEdit, MacVim and Cocoa Emacs.
This assertion will piss off BBEdit fans, but BBEdit is the least powerful of those three. Its color schemes are minimal, its “codeless language modules” are underpowered, and it can’t do syntax-aware indenting. And it’s $99, whereas the other two are free. But it’s the only one of the three which is a true Mac program. In its basics, it behaves like every other Mac text window you’ve ever seen and just adds lots of great stuff onto that. MacVim and Cocoa Emacs make a few concessions to the Mac environment, but you gotta learn Vim or Emacs to use one or the other.
But all of these editors are very extensible. Either out of the box or with an afternoon of dorking around, you’ll have everything you miss from TextMate. They all have TextMate-style snippets. (Ironically, BBEdit had them years before anybody else; the extensions for Vim and Emacs are both consciously modeled on TextMate’s.) All of them have folding and multiple windows and pane splits. All of them have quick navigation between files in a project hierarchy. (All of them can use PeepOpen if you want.) If you’re the kind of nerd who knows what HTML Zen Coding is, all of them have add-ons for it. And, oh yeah: they all understand that tabs are a terrible way to manage multiple open files once you have more than four or five open at once, and all can handle files much bigger than TextMate can dream of.
Those of us who cling tenaciously to TextMate do so because of its amazing bundle system; you really have to spend time digging into it to understand how powerful it is. BBEdit, Vim and Emacs all require you to learn a weird scripting language; TextMate lets you write in any language you can script a Unix shell with, from bash to Ruby.¹ The flip side of that, though, is that TextMate’s bundles are—with few exceptions—limited to passing standard input and environment variables to a shell script and getting standard output back. With BBEdit and the Ugly Unix Twins, you can attach scripts nearly everywhere, with deep access to the underlying editing engines.
I keep trying to love BBEdit once more but at best it’s an affable fling. I still prefer TextMate for writing Markdown prose (like, say, this blog post); for code, I’m spending more time hanging out with MacVim these days. It’s not as pretty as Vico, but it retains Vim’s top-notch support for displaying multiple files at once. (None of the native Mac programs except Coda can display more than one file per tab or physical window.) And Vim’s modal editing really is faster once you get used to it for coding. Yes, it takes a damn long time to start making sense. But the first time you watch someone cut a
<div> block in an HTML document by putting the cursor somewhere in the open or close block tag and typing three characters—or typing one command for “delete every line after each line that contains this pattern”²—you have to at least concede there’s something to it.
Here’s my baseline test: can I tell the editor I want most code to be indented by 4 spaces but YAML by 2? In 2011, this should be dead simple—but it knocks all but our Fab Four right out.³
Okay, sure. You’re an editor junkie like me. I understand. I’m not saying you can’t keep watching the other programs. Play with ‘em in your spare time. One of them might end up being something that blows our collective doors off. It’s okay. We can all hope. (Maybe dad has just been out on a smoke break all this time, too.)
But in the meantime, you gotta get work done. Either pony up money for BBEdit, pony up time for MacVim (or Emacs), or stick with TextMate.
(A couple Thursday-at-5 updates: as Brian Ashe reminded me I should mention, BBEdit does have a free relative, TextWrangler, also. And, as the plethora of comments below suggests, editor choice gets pretty personal. Why do I recommend three stodgy old warhorses? Well, any editor that has a still-growing community after two decades is probably doing something right.)
- Yes, AppleScript is weird. Don’t even pretend.
g/pattern/+1drespectively. Yes, that last one did actually come up when I was editing an SQL dump file.
- In theory Sublime Text can do this but dear God, you thought Vim configuration was arcane? Welcome to the 500 Preference Files of Bartholomew Cubbins.