My favorite text editors for web development

I’ve been neck-deep in web development for the last eight months or so during which I’ve been hopping between three different text editors — Webstorm, Sublime Text 2, and BBEdit 10.5. I thought I’d post some thoughts on what the good and bad aspects of each are.

Webstorm

Webstorm ★★★★★ is the web-flavored version of Jetbrains highly-regarded IDE. Despite, I believe, being written in Java it feels light and while not native its UI is solid. It has lots of nice features including jshint/jslint integration (which could be better) and pretty intelligent auto-complete (which is no mean feat for Javascript projects).

  • Very capable. Cluttered.
  • Doesn’t feel quite as lightweight as Sublime or BBEdit, but it’s very nimble compared to (say) Eclipse.
  • File-browser + Tabs seems wasteful of screen real-estate. I’d rather waste space on tabs than file paths.
  • Ridiculously configurable, which is a mixed blessing.
  • Project-centric to an annoying degree (e.g. you can’t just create a scratch document you don’t plan to save anywhere).
  • jshint/jslint and refactoring suggestions integrated into the editor (UI is very fiddly, but the integration can be very helpful).

Sublime Text 2

Sublime Text 2 ★★★★★ (version 3 is in testing) is flavor of the month in text editor world. Since version 2 came to the Mac it seems to have taken over most of Textmate’s mindshare (and deservedly so, it’s a far better product in most respects than Textmate ever was).

I should note that while I’ve played around with Sublime Text a fair bit, and admire it, I don’t actually use it for anything serious and haven’t actually licensed it (in part it’s because I’m waiting to see if version 3 addresses my few complaints).

  • Side-by-side editors are awesome, and great use of widescreen display.
  • Great tab implementation.
  • Nice modeless search, including multi-file search.
  • Lots of cool features such as multi-select-editing that I don’t use.
  • Minimap is a cute but generally useless gimmick.
  • Go to Anything… is awesome.
  • Ctrl-M to jump to matching braces is awesome.

BBEdit 10.5

BBEdit 10.5 ★★★★★ is the crusty old man of Mac text editing, having started life in the 608×0 era and yet having managed to weather the storm of many rivals to make it to the current day. (I first got BBEdit as a free bundle with Dreamweaver 1.0 which, at the time, couldn’t actually edit text files worth a damn, and instead would “round-trip” HTML source to BBEdit).

  • Popup menus for open files and functions in the current file are incredibly useful, but clunky. I tabs and keyboard-driven alternatives would be better respectively (there is a keyboard alternative to the open file popup, but it doesn’t differentiate between opened and unopened files).
  • Modeless search is cute but lacks features of and integration with regular search (e.g. regexp support).
  • Aging UI. E.g. I don’t understand why the Search and Multi-File Search dialogs aren’t the same dialog.
  • Best Regexp implementation I’ve seen in any editor, including remembering previous searches, ability to save queries, and full documentation.
  • Best Multi-File Search implementation I’ve ever seen in any editor (but it’s driven by modal dialogs and search results windows)
  • Most of the time when I see someone using a cool feature in some other editor (e.g. Sublime’s “Go to Anything…” shortcut) I discover BBEdit also has Open File by Name (which isn’t quite as smart).
  • Double-click to select contents of matching braces is even awesomer.

In the end, despite some quirks of its aging interface, I find BBEdit to be my go-to editor, but I envy the elegance and utility of Sublime’s basic UI and modeless search and Webstorm’s auto-complete (I’d also miss Webstorm’s jshint integration, but we’ve actually built jshint integration into our project documentation and it works even better). As always, I hope the next versions of my favorite editors will address my complaints and add new enviable features.

Mac Text Editors

One of the most baffling gaps in Mac third-party software is programming-oriented text editors with autocomplete. Now, obviously there’s XCode, vim, and emacs (which, being free, are all something of a problem for would-be competitors), and a bunch of cross-platform tools like Eclipse and Komodo, but XCode is really oriented towards Cocoa development and is kind of like using Microsoft Word to edit a shopping list, while the others are all non-Mac-like (and kind of suck anyway).

The Mac heavyweight text-editing champs — BBEdit and TextMate — have many great features, but don’t do autocompletion very well or at all, respectively. (There’s some kind of third-party hack add on for TextMate, but you need to compile it yourself and few seem to be able to get it working.) A lot of Unity developers were using PCs or Virtual Windows boxes to run Visual Studio just because it has an autocompleting text editor that doesn’t suck — that’s how bad it was. (Now that Unity runs on Windows their lives have gotten much easier, which is a pretty sad statement.)

Before you scream at me about how, say, Subethaedit has some kind of autocomplete support, or mention Coda (which has OK autocomplete support) or Espresso (which may one day have halfway decent extensible autocomplete support but right now is a work-in-progress), go and try Visual Studio or, if you’re allergic to Windows how about Realbasic. Realbasic‘s built-in text editor has autocomplete that doesn’t suck, e.g. it recognizes context, knows about intrinsic language constructs as well as library functions and the stuff you’ve declared, and doesn’t incorrectly complete stuff you need to fix constantly or fail to offer “function” when I type in “fun” in a .js file.

I will say this: TextMate’s macro facility is truly awesome (you can type swi->TAB and get a switch statement template, and then tab through the bits you need to change, almost like a context-sensitive-in-place-dialog-box), if this were paired with a proper autocomplete system (like RealBasic’s) it would be the best I’ve seen and then some — maybe 2.0 will have this — but right now the situation on the Mac remains pretty dismal.