Home-baked SVN support for Komodo Edit

with 13 comments

Komodo Edit (version 5.0.3 5.1.4 at the time of this writing) is my tool of choice for code editing. It is built on top of Mozilla and Scintilla with some Python glue, which gives it great flexibility (Firefox like extensions, custom lexer files etc.)

I am using Komodo Edit for web development, mainly PHP/HTML/Javascript on Ubuntu Intrepid 64bit, and I must say that I’m extremely satisfied with my setup. It is extremely fast and clutter free.

ActiveState has done a lot of work in making this great tool. They also have a commercial product that extends the editor with some pretty neat pieces of functionality (Komodo IDE). I also tried the IDE, but for my specific needs I’m sattisfied with the free version. I’m considering buying a licence for the IDE in the future.

There are a couple of notable differences between the two “dragons”, most important are the ability to handle version control systems and debuggers from within the IDE, but not from within the free edition.

Of course, there are other alternatives like Aptana, which is also a great tool (I’ve been using it for a while), but I don’t like having JRE installed if possible (less dependencies is better). I also like to be a little different, and give other products a fair chance to be used. It’s a matter of personal taste I guess. Other IDE’s offer integrated database editing tools. I use MySQL as the db layer on most of my projects, but I don’t actually need that into my code editor. I use MySQL Administrator, Query Browser and Workbench, and I’m pretty satisfied by those tools. It also allows me to concetrate on the specific part of the application (database design, database debug, code editing) without having all that functionality loaded into my editor all the time.

Now, returning to Komodo Edit, one thing that is not easy to do, is to work with a versioned local copy of a project. You have to keep a terminal window opened all the time, and fire some, let’s say,  svn commitsvn add or svn update every time you modify something.

Subversion is widely used as a version control system, and it is available for all kinds of unix/linux flavours, mac, windows etc. We’re going to get rid of the terminal window and customize Komodo to do simple operations like commit or update.

How are going to do that? Well, one of the greatest things that Komodo offers is the possibility to add your own pieces of functionality into it, by using macros, snippets, commands, menus, toolbars etc. We’re going to create a toolbar and a couple of buttons that trigger some subversion commands. We already have subversion installed (we were using it from the command line, remember ?), so there are no other prerequisites required for our task. The advantage is that we rely solely on the official subversion binaries available to our system, which takes the weight of keeping it updated off our backs, as opposed to let’s say when we have our own subversion library and need to keep it updated.

This guide is for Linux only. It should also work in unix/mac os x. It does not work in windows, because windows lacks some system tools like awk or grep.

First, we make the right panel visible, and rightclick on the Samples (5.0.3 5.0.3)) folder, add -> New Custom Toolbar. We name it “my svn tools” and click ok.

Then we rightclick on the newly created toolbar and add -> Custom command, then fill the fields like this:

SVN update

SVN update

You’ll notice that I also changed the command’s icon (I used the arrow_up icon from the FamFamFam Silk icon set which are offered for free under a CreativeCommons license). You can do that by clicking “Change icon”. You’ll notice the %d in the “Start in” advanced option. That means that the command will be run in the active project’s folder path. Pay much attention to this specific detail when you have more than one project opened.

Now let’s add a new command for svn commit:

SVM commit properties

SVM commit properties

You will notice that this time we have something different in the Command field:

svn ci -m “%(ask:Commit message:)”

When you commit something, usually you have to write a commit message that describes the nature of the modifications you’ve made to the code (for example a fix for a specific trac ticket); that’s what the -m “message” does. For this, we are using the %(ask:dialog_title:default_value) construct that tells komodo to popup an input dialog  with the title replaced with the  dialog_title parameter, and the default value replaced with the default_value parameter. The default value is optional. In our case, when we fire that specific command, it will look something like this:


After using this a couple of times, you will notice that the field remembers older values that you entered, pretty much like a browser remembers what you tiped in a specific form input.

Now let’s add the svn cleanup command:

SVN cleanup

SVN cleanup

That was simple. I used the paitbrush icon.

What we need next is a command that adds newly created files into the versioning system.

I’ve used a code snippet from here. It looks like this:
for i in `svn st | grep ? | awk -F " " '{print $2}'`; do svn add $i; done

SVN add

SVN add

I used the add icon from the FamFamFam icon set.

So far so good. It’s time to test our work. Go to the View menu -> Toolbars and check “my svn tools”. Your Komodo’s toolbar should look like this:



You will notice that our four commands appeared on the Komodo’s toolbar.

If you did everything right, you should be able to use those commands on any project that is versioned through subversion.

Very important: remember, in order for those commands to work properly, you must set the project you intend to use the tools as Active Project.

This is no a complete solution by far. I intend to dive more deeply into Komodo and it’s extensibility features, and hopefully implement a more complete solution that has let’s say all the important subversion commands.

Here is the exported toolbar package. Download and import it into your Komodo, play with it, modify it, make it look the way you like.

Happy coding !


Here is how to do svn checkout:

SVN checkout

SVN checkout

The command uses the nice little program called Zenity (which makes dialogs). The command used for checkout is:

svn co %(ask:Repository URL:) `echo | zenity --file-selection --directory --title="Checkout SVN"` --username="%(ask:SVN username:anonymous)" --password="%(askpass:SVN password)" | zenity --progress --pulsate --title="SVN Checkout" --text="Please wait for the checkout to complete" --auto-kill --auto-close

You can download the kpz file from here, and import it into your Komodo. Enjoy !


Written by Doru Moisa

February 12, 2009 at 11:05 pm

Posted in Development

Tagged with , , , ,

13 Responses

Subscribe to comments with RSS.

  1. Congrats for the blog…hope I’ll see many interesting articles in the future…And yes…Unix is best


    February 15, 2009 at 1:03 pm

  2. This is no a complete solution by far. I intend to dive more deeply into Komodo and it’s extensibility features, and hopefully implement a more complete solution that has let’s say all the important subversion commands.

    منتديات لحظة

    March 2, 2009 at 1:28 am

  3. @منتديات لحظة

    I completely agree with you. My solution is just a quick workaround. The right way to do this would be with a Komodo extension. But that means you have to do some low level coding and you must have a pretty good understanding of the guts of mozilla and komodo, which sadly I don’t have enaogh time to do. Please keep me posted on any progress, maybe I can help.

    Doru Moisa

    March 17, 2009 at 2:12 pm

  4. Has anyone come up with anything for checking out? Not sure there is enough controls in Komodo to make that worthwhile.

    Paul Sayre

    March 30, 2009 at 11:31 pm

  5. i am using komodo edit since 2008, for svn feature i use nautilussvn it very similar to tortoise in ms windows explorer. very helpful 🙂


    April 30, 2009 at 4:27 am

  6. @Paul Sayre

    Just updated this post with the checkout procedure, enjoy 😉

    Doru Moisa

    June 16, 2009 at 1:09 pm

  7. […] Home-baked SVN support for Komodo Edit « Hardcoded a few seconds ago from Choqok […]

  8. Thanks for this tutorial, very useful!


    February 22, 2010 at 7:25 am

  9. Starting with your work, i’m trying to remove dependancy on zenity and other bash tools, using xul for dialogs.

    It’s a work in progress…


    February 25, 2010 at 11:44 am

  10. So, my setup is Windows 7 64-bit, Komodo Edit, TortoiseSNV (for shell integration) and SlikSVN 64-bit for the command line. 4 out of 5 of your commands seem to work great, expected since it’s straight svn command line stuff… but the New Files one doesn’t since window’s doesn’t really support that sort of thing from the command line. Any ideas?


    December 7, 2010 at 7:29 pm

  11. Thanks!

    This work fine in Komodo Edit 6.1.1, but the .kpz link not work properly. I downloaded from another link.

    San Luis

    San Luis

    March 19, 2011 at 8:12 pm

  12. 😮 404 .. please check the dl-uri !


    September 23, 2012 at 9:52 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: