Seeking Mac editor nirvana

I’ve written about Mac text editors before on the previous incarceration of Ray Gun Robot. My preferred editor, the one I use every day at work and home, is Smultron. It’s nice, for reasons I’ll get into, but I wouldn’t mind having a few features that more mature text editors have, such as syntax hinting (is it strpos($needle, $haystack) or strpos($haystack, $needle)?) and scriptability.

Inspired by a post entitled “Komodo vs Coda” (found via Planet Drupal) and subsequent comments, I recently spent some time looking over a selection of Mac text editors and IDEs, seeing what the alternatives were, as I periodically do. Unfortunately, what I found has convinced me to stick with Smultron still.

After a bit of consideration, I came up with four criteria that a text editor must have to be usable in my opinion. There are others, of course - syntax coloring, regular expression searching - but those features are common enough among all editors that dare call themselves such that I won’t bother mentioning them. Those criteria are:

  1. Smart indenting. If I start a function by typing something like function foo($bar) {, the editor should be smart enough to realize what I’m doing and indent the next line by a tab stop to help keep my code tidy. Furthermore, if I end a function by typing a single } on a line, it should unindent that and the next line. (It would be really awesome if the editor could do that with array( declarations too, but I’ve gotten used to indenting those manually, unfortunately.)

  2. Mac-like. It should support standard Mac keyboard commands; it should use standard Mac user interface widgets; it should support the standard OS X spell-checking dictionary; it should feel svelte and unbloated; etc. It should also work like a Mac app when it comes to keyboarding around the document: the Home/End key should take you to the top/bottom of the document, not the beginning/end of the line; the Page Up/Down keys should scroll the viewport without moving the cursor; etc. (See my post on Mac OO.o 3 for more rants about supposed Mac applications adopting Windows’ lousy (in my opinion) text editing interface.)

  3. Vertical window splitting. Window splitting allows you to have two (or more) documents open in a window. This is handy when you want to work on HTML in one file and CSS in another file at the same time; or to refer to a database schema in one file while writing code in another file; or to work on a template file while referring to a code file… this feature offers a huge boost in convenience and productivity. Some editors only allow you to split horizontally, but I much prefer vertical splitting, especially nowadays that most displays are much wider than they are tall. Also, simply opening up two windows and displaying them side-by-side is not an acceptable alternative; you end up with redundant user interface widgets, and you can’t quickly and easily resize or minimize the windows at the same time when you need to get them out of the way. These problems are gone with true window splitting.

  4. Reasonably priced. When I can go out and buy the latest 3D whizbang video game for $60 or less, ponying up over $100 for a text editor seems a little bit ridiculous. Granted, I may spend ten hours or less playing the video game, whereas the text editor will be used eight hours a day, five days a week, for the indeterminable future; still, I can’t imagine that the latter took all that many more man-hours to develop than the former. However, for the perfect text editor, I’ll pony up two days’ pay… it better be pretty waeome, though.

Okay. So here’s a snazzy chart showing how several OS X editors compare with regards to these features. Note that some of these might be a little off, as I haven’t actually used all of them; so on some of them I’m just guessing by the feature lists. Lemme know if I made any obvious mistakes. (The chart uses Japanese-style maru ◯ for “yes” and batsu × for “no” because I’m a nerd.)

Editor Smart indenting Real Mac app Vertical splitting Reasonably priced
BBEdit × × ×
Coda × ×
Eclipse × ×
jEdit ×
Komodo × ×
MacVim ×
NetBeans ×
Smultron
SubEthaEdit ×
TextMate × ×

This table is very basic, but it’s enough to see that some would-be-great editors have some glaring oversights which are stopping me from switching. TextMate has a lot of buzz and cred among Mac nerds, but the fact that it doesn’t support window splitting, vertically or otherwise, seems to me to be a staggeringly unacceptable omission to what is otherwise a slick and mature editor. Likewise with SubEthaEdit, which actually predates TextMate (if I recall correctly) and features support for the ability for two or more people to work on a file concurrently over a network - this strikes me as a rather esoteric feature, which makes the omission of a basic feature such as window splitting all the more annoying. (SubEthaEdit also has the lowest price among the non-free editors on the list.) Coda is possibly the youngest editor on the list, but one which has picked up a lot of steam with its support for IDE-like features like syntax hinting and revision control systems; but the fact that it’s the only editor on the list which can’t smart-indent for me makes it useless. jEdit lets you go absolutely crazy with window splitting, letting you split windows horizontally and vertically in the same window; too bad its non-Mac-native interface looks like butt. BBEdit has been around since at least the early ’90s, and was probably the first real serious industrial-strength editor on the Mac, but it doesn’t seem to have really changed much since then, and again, the lack of splitting is an annoying oversight. MacVim was an interesting inclusion on the list, being a version of the venerable vim command-line text editor with some Mac interfacey spit and polish on it. I can’t find myself calling it a true Mac editor, though.

So I’m sticking with good old Smultron for now. It’s served me well for a couple of years now, and looks like it’s going to continue to serve me well for a little while more, at least until other editors can come out with the features I’m expecting.

Comments

Thanks for this write up and for your very useful comments on my post! I ultimately ended up upgrading Komodo. Coda looked nice until the indenting bug bit me at which point it was deleted once again (and I remembered why it had been deleted before).

It’s interesting on the mac-like editing portion. I’m of a bit of a split mind here. While I firmly believe Home and End should go to the top and bottom of the document. I’ve also been annoyed by editors that don’t move the cursor. It could be handy for a glimpse of another part of the file, however inevitability it ends up causing me to type into some place that is not visible on the screen and which isn’t easily found.

Smultron has a feature, which it shares with BBedit, that I really like — the command line interface. However this alone hasn’t been a deal stopper for me. On the other hand there is an additional requirement on my list which is the ability to manage projects. With dozens of sites on my disk at any one time the ability to have a single project file that can be opened to open a directory hierarchy is key. It also needs to use this as a basis of the hinting and documentation so that if site 1 has a module with function x1 the editor can automatically pick this up without having to be retrained. This is especially important in the case of working with sites in different versions of Drupal, including sometimes side by side.

It could be handy for a glimpse of another part of the file, however inevitability it ends up causing me to type into some place that is not visible on the screen and which isn’t easily found.

Nah. Once you start typing, the cursor location will instantly scroll into view. If you don’t want to actually insert any characters, you can just press one of the arrow keys and it’ll pop the cursor back into view (after moving it).

As for file/project management, Smultron does support this stuff to a certain extent, but I don’t use it - I prefer to stick to the Finder for file management.

You’ve got BBEdit marked as one of the smart indenters, but I can’t figure out how the heck to get it to do smart indenting. Any tips?

I may have to take another look at Smultron. I tried it a long time ago and dismissed it because it had so few features (and such an ugly icon), but it looks like it’s come a long way since then.

Hmm. I don’t actually have BBEdit proper to test with, but on TextWrangler (formerly BBEdit Lite), it looks like it’ll only indent a line if the previous line is indented too - like Coda does. This is not what I would call smart indenting. I’ll update the table.

Smultron’s icon has changed a few times in its lifetime. Its current one, which looks like a strawberry viewed from the top down, is fairly inoffensive.

Smultron is nice. Even though it doesn’t have all the functions and abilities that a programmer could want, it’s reliable and stable and easy to learn, well compared to other editors anyway.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Text may be marked up using Markdown syntax with Markdown Extra extensions.
  • Text will be beautified using the SmartyPants Typographer extensions.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <sup> <img> <blockquote><table><tr><th><td><br><pre>

More information about formatting options

About RGR

Ray Gun Robot is the personal site of Garrett Albright, a fairly decent web developer living in northern California. Find out more about me or check out some projects I’ve worked on.