DLS Review: Why is Komodo Edit the best free PHP editor on the market today
I have strong feelings about text editors for programmers. I'm not talking about Vim or Emacs here; I'm talking about stuff for mere mortals -- PSPad, jEdit, Notepad++. Those are all editors I have used extensively over the years, and each time I become convinced that "this is it -- this is the last text editor I will ever need," only to then find out it wasn't quite as great as I thought.
With jEdit, it was the lack of support and horrible forum system; with PSPad, the closed source and disorderly add-on system; Notepad++ was a long time ago, and I honestly can't remember what its main issue was. However, it's also true that my requirements change over time; for example, these days I code far more PHP than I used to.
When my current wave of PHP coding began, I spent some time evaluating different editors and IDEs. After running through the text editors I already knew, I started looking at IDEs. I checked Aptana; it actually seemed cool, but they ditched their own PHP extensions for Eclipse's PDT, which is really underdeveloped. I looked into Eclipse itself, too, and was horrified by its clunkiness.
I remember checking some other options, until I finally came across Komodo Edit. After spending a fair bit of time evaluating it, using ActiveState's forum system, installing add-ons and tweaking it, I can honestly say I feel it's the best free PHP editor available today. To see why (with lots of screenshots), continue reading after the fold.
First, a little bit about the editor itself: It's open source, and it's an ActiveState product. It has an "older brother" in the form of the commercial Komodo IDE, so it's actively developed. ActiveState runs a very active forum system, and it has a large community of users. Also (one of the best features, IMHO), it's Mozilla-based; it runs using the same framework as Firefox, and the next release (Komodo IDE/Edit v6) will be based on the same codebase as Firefox 3.5. That means it's cross-platform without being Java (yay!), and that it has features such as the familiar about:config and a full-fledged add-on system.
A little bit about configuration: There are numerous config preferences. In fact, a bit too many; a "quick search" feature would have been very helpful. Still, the upside is that you can tweak just about anything you like. Below you can see the Key Bindings configuration dialog; this one does have quick search, letting you find the command you need very quickly. Multiple keystroke bindings are supported, so you can use things like Ctrl+K, V (meaning, hit Ctrl+K, then hit V). As you can see, key bindings are saved as "schemes," and there's a full-fledged Vi mode (which I haven't tested, because I don't know the first thing about Vi/Vim).
Another point worth noting is that configuration can be migrated very easily. Again, this is due to the product being Mozilla-based; configuration is file-based, and saved within the user's own folder. So backing up is easy, and migrating settings to another computer is just a matter of copying files over.
Still, the macro capabilities are quite impressive, especially if you hand-code the macros. Here's what the dialog looks like:
Macros can be invoked from the toolbox, using key bindings, and also by events such as file-open or file-close. A macro can even abort a file close process.
One super-cool feature is Zen Coding, which I have just covered in some detail. This is implemented as an add-on, and is a great example of how deeply add-ons can integrate into the system. Not only do you get menu entries, but complete key binding support as well, through Edit's built-in key binding configuration dialog (shown above).
And here we come to a really buggy area, one that I hope will be fixed in version 6. This is the "scheme" dialog, which lets you set syntax highlighting schemes or themes. Only it has a really annoying bug: You select a scheme, which sets a certain color for, say, comments. You then scroll up to another scheme, which has no preference for the comment color. At this point, Edit keeps the previous scheme's color setting for this element, even though you never applied it (you just scrolled through it), and it may clash horribly with the scheme you selected. This means you sometimes get stuff like black text on black background. You can never be completely sure that the scheme you applied really does look like it's supposed to look. This is the worst area of the application, without a doubt.
Okay, on to a nicer element: live preview! The live preview function goes for PHP files, too. You just point it at your local PHP installation and set some "URI mapping" options, and then you can instantly preview PHP files executing locally. The refresh is immediate, too. Edit the file, save it, and see the preview change. There's no manual refresh needed. I love that feature!
One of the main reasons I like this editor so much is that it has very nice auto-completion support. Here's a simple autocompletion tip for a paragraph tag in HTML; when you switch to PHP, the code tips become more informative and display function arguments, etc.
Another sweet feature that Edit offers is on the fly PHP syntax checking. Yes, you get a cool squiggly, just like in Visual Studio. The error you see below is because I didn't end the top line in a semicolon.
The editor component used is the powerful Scintilla (the same editor component that Notepad++ and SciTE use), so it natively supports code folding. You can select one of several styles for the fold marks; this one is called "Curvy Trees."
It also has FTP access! This is, again, implemented via add-on, and it blends nicely with the existing interface. It just adds another pane to the left-hand toolbox, which lets you browse local files as well as FTP folders. You can also set favorites and save passwords (although I don't).
This is what that said folder tree looks like. You can't really see because I zoomed in, but this is on the left side of the window. To the right is the edit component. By the way, when you open multiple files you get tabs - Mozilla-based, as we said.
When selecting Help > List Key Bindings, you get a nice HTML page in your default browser, showing you every key binding that's active for your current scheme. This page is very easy to print out, but you can also quickly look for a specific function using your browser's Find function.
Bottom line: Edit is a fantastic product. Even though some parts don't work well (most notably the macro recorder and the scheme engine), I feel it's a very useful tool for any PHP developer. In my opinion, it is indeed superior to any other free editor I've tried for this particular purpose.