Skip to main content

Editors: I Dig Komodo Edit

I think I'll switch to Komodo Edit for editing HTML, CSS, JavaScript, Python, Ruby, Perl, and PHP. I'll still use Vim for random text editing and for editing my outline files, and I'll still use Emacs for editing Erlang, Haskell, and Lisp, but I think Komodo Edit is better suited for Web programming.

This is going to be a fairly long review, so let me break it down into sections:
The Good Parts
One thing I really like about this editor is that it is more sophisticated than a default installation of Vim or Emacs, but less sophisticated than a full-blown IDE. I don't feel overwhelmed like I do with Eclipse. The download is only 37mb compared to 134mb for Aptana Studio, and you can really feel the difference. So far, it's been very easy to learn and use rather than feeling frighteningly complex.

Let's start with the basics. As you might expect, it does a beautiful job highlighting the various languages. It handles HTML that contains JavaScript and CSS quite easily. It doesn't have a smart indent mode like Emacs, but I've always disliked that feature anyway.

It supports Vi key bindings (more on that later). It knows how to reflow a paragraph, even if that paragraph has "#" at the beginning of each line. It can increase or decrease the indentation level. It has a column selection (aka rectangular selection) mode, which, by the way, is one of those things that separates great editors from mediocre editors. It has code folding, although that's never been all that important to me.

It can do autocomplete for symbols within the current file. Even better, it has code assist. If you type "import os; os.", it'll tell you what your options are. If you type "import os; os.path.join(", it'll tell you what the API for the method is. The code assist is very helpful when you're editing CSS. It'll give you a drop down for things like "background-color" as well as a drop down for the possible values. It can also jump to the definition of a function (more on that later).

It has the notion of a project, but it doesn't require you to set much stuff up. You just say, "This directory is a project." This lets you do project-wide searches, and it shows your files in a file explorer pane on the left. It does create a project file, which is of type .kpf, but that file contains only 7 lines of XML. It basically says to figure out everything on the fly. I don't feel like I have to convert to a new religion or convince all my coworkers to switch before I can start using it.

It recognizes syntax errors. If I improperly indent some Python, it complains. If I forget the ":" after a for loop, it complains. Forgetting the ":" is perhaps my single most common syntax error, so that's helpful. However, it doesn't have built-in support for PyChecker or PyLint like Pydev does (or so I've heard). Hence, it doesn't complain if I print a local variable before setting the local variable even though PyChecker could catch that.

It knows how to run external commands and do something useful with the output like Emacs does. I told it to run "make test", and I purposely made a test fail. I was able to click on a filename in the exception to go directly to the file. What's better, it has the concept of a toolbox where I can setup all sorts of little things like "make test" and click on them when I need them.

Using the Open/Find toolbar does indeed make it easy to do a project-wide grep. "Find in Current Project" is even easier since it understands the root of your project. It allows you to search using a string or a regex. The UI is pleasant. All the matches are shown in a pane so that you can click on them one at a time.

Some of the smaller niceties include the following. There's a line at the 80 column mark. (I can only get Vim to do that using an awful hack, and that drives me crazy.) It opens up the project and files I had open when I last used it. Macros work, even when you're using Vi commands. It's pleasant to look at (it could be prettier, but it ain't bad).
The Bad Parts
It tends to freeze the UI if you ask it to do something really hard like do a project-wide search in a directory containing 1.7g. That sort of stuff should run on a background thread so that the UI never freezes. What's worse, I had to force quit it when it froze while I was playing around with running external commands like "svn diff" (which did work at least once, by the way).

It doesn't provide good error messages when it doesn't like what you're doing. It tends to just ignore you instead. I found several cases of this.

"Go to Definition" only works for the current file. It doesn't know how to use something like ctags for the project as a whole. You can't even use it for the standard library. This is, perhaps, my single largest complaint. WingIDE is much better in this regard. The essential problem is that the "API catalogs" are pre-made. I found this comment on the issue:
We are going to document this CIX codeintel structure, and later, some tools to help build CIX API catalogs, we shall let everyone know when we have this ready.
In general, the code intelligence behaves a bit strange. It is easily confused. It also doesn't give me nearly as much information as WingIDE does.

It claims to support SCP, but I couldn't get it to work. Even when I used a server on a standard port and provided a username and password (even though I have an ssh key), it still wouldn't connect. Furthermore, instead of giving me a useful error message, it just timed out.

The Help / Help for Languages section is less than spectacular. When I clicked on the Python Reference, I got some ad page for Komodo. The other languages were better. They should probably have links for CSS, HTML, and JavaScript too a la W3Schools.

The Open/Find toolbar is useful, but I keep ending up in the wrong field when I hit tab for autocomplete. Furthermore, it doesn't add the trailing "/" when autocompleting directories like a shell would do. Last of all, when you run out of room in the widget, it doesn't scroll to the right; hence, you end up not being able to see what you're typing. This definitely isn't as nice as opening up a file with "C-x C-f" in Emacs. (By the way, Vim is even nicer in that it passes the path through the shell when using ":e". That means you can use environmental variables, etc. That means it even understands whacky zsh syntax.)

Project / Import from File System... doesn't show me a dialog. It just ignores me. I have no clue why or what it does.

When I tried to create a new project using an existing directory it kind of just ignored me. It turns out that it actually did create the project file. I would have expected it to automatically open the project, but it didn't. Nonetheless, I was able to open the project manually after I created it.

When you preview an HTML file, the CSS doesn't work. However, once I copied the file:// URL and gave it to Firefox, Firefox rendered the file properly. I'm not sure why.
Vi Key Bindings
Komodo Edit does support Vi and Emacs key bindings. Its support is useful, but, as you might expect, it's far from perfect. Perhaps I'm too accustomed to Vim.

"gg" does not go to the top of the file. You have to use ":0" instead.

You can't use "gq" to reflow the paragraph, but you can use "Shift-Apple-Q" instead.

If you use "shift-v" to highlight multiple lines and then ">" to indent them, the cursor must not be in the first column. Otherwise, the last line won't get indented.

"control-o" and "control-i" don't work. Hence, there's no easy way to jump to wherever you were recently.

Surprisingly, "*" and "#" do work for searching for the symbol under the cursor.

Rectangle select works, but doesn't do anything useful. According to the documentation:
With Vi emulation enabled, mouse selection and Vi visual blockwise selection ('Ctrl'+'V') will not trigger column editing. While in Input mode, use 'Alt'+'Shift' with the direction keys to make the column selection, and 'Esc' to exit column editing mode.
Using ">}" to indent the current paragraph doesn't work. "}" by itself does move the cursor. You can use "v}>" to achieve the same goal.

"cw tab tab tab" inserts three things into the undo list instead of just one. Of course, this is a pedantic complaint.

Using "%" to jump between "{" and "}" works, but it's off by one character.

"50i. esc" does not insert 50 periods.

":e" is worthless since it doesn't do autocomplete.
Why Not ...?
You might wonder why I like Komodo Edit over some of the alternatives.

Why not TextMate? Because it's commercial. I might tolerate closed source software in some situations, but I'd rather write my own editor than spend 8 hours a day using someone else's proprietary editor. Call me crazy.

Why not WingIDE? Because Komodo Edit is probably more useful for a wider range of languages.

Why not Komodo IDE? Because it's commercial. Sure, it has an integrated debugger, Python shell, and revision control functionality. However, those things add a lot of complexity. That would destroy the simplicity that I admire so much in Komodo Edit. Besides, I'm a shell junky anyway, and I can use the shell for those things.

Why not Vim? I like the code intelligence features of Komodo Edit. I can still make use of Vi key bindings.

Why not Emacs? Emacs ain't so hot when it comes to HTML with embedded JavaScript and CSS. nXhtml is very promising, but it isn't there yet. Komodo Edit can do more with less configuring and less learning.

Why not jEdit? I've just never felt very drawn to it.
Well, I like it. It's far from perfect, but I can definitely see how to be productive with it. If you'd like to see it in action, check out the Komodo IDE screencast, and just ignore all the things that aren't in Komodo Edit.


cowmix said…
Your review pretty much sums up my experiences with Komodo Edit.. However, I very surprised that you couldn't get ssh/scp to work.. I'm guessing you are using OSX is the client platform.. what what the OS of the remote side?
wyldwolf said…
Have you looked at the new Netbeans 6.5? I've used Komodo, and while it is nice so far I've stuck with basic text editors (switch between Notepad2 and Intype).
> I'm guessing you are using OSX is the client platform.. what what the OS of the remote side?

OS X to Linux. I'm surprised too since it's OpenSSH on both sides.
> Have you looked at the new Netbeans 6.5?

I've heard nice things about Netbeans. I haven't tried it out yet. I don't know anyone else using it, unfortunately.
Marcelo said…
Komodo has no Linux x86_64 version... :-(

Thanks for the evaluation. :-)
Just to be clear (since someone asked me the question), Komodo Edit *is* open source.
cowmix said…
> I'm surprised too since it's OpenSSH on both sides.

The SCP client is built into the client so it doesn't depend on what version of OpenSSH might be installed on your client.

I used to have issues with the remote mounting of filesystems via ssh.. I'll look into my notes on how I debugged the issues.. Once it works, life is great. :)
Another vim complaint:

If I use "v" to visually select something and then click "c" to change it to something else, it deletes the thing and dumps me back into command mode. It should delete the thing and leave me in insert mode to insert something else. This should count as one thing in the undo history, and you should be able to redo it with ".".
Hmm, Komodo just crashed again :(

I was editing a file. I closed the file. I moved the file using my shell. I hit apple-o to open a new file. It crashed. It gave me a dialog so that I could submit a bug.

Ben Bangert was telling me of an even worse crash when he was trying it out. He was using Firefox and Komodo at the same time. One of them crashed. Somehow it caused the other to crash. Neither could be restarted until he logged out and logged back in again.

Clearly, Komodo Edit and Firefox are both based on XUL. I'm not sure how this could have happened. Did a shared library somehow get corrupted or something like that?
Jeswin P said…

You can use the 32-bit versions on 64-bit Linux by installing 32-bit compatibility libs.

For ubuntu: sudo apt-get install binfmt-support ia32-libs