Mako Highlighter for Komodo Edit

I have been using Komodo Edit for my web development at work. I’m really beginning to like it. The JavaScript and HTML code completion and linter help me a lot, and the python support is very nice. Plus it has VI key bindings that actually work decently! I’ve also been playing around with Pylons and Mako more and more but, unfortunately, there is no Mako highlighter for Komodo.

So I sat down Sunday night and started hacking, and a few hours later I had a working Mako highlighter. At first it was a bit daunting, but a blog post by Eric Primislow, from Active State, made things a bit easier. If you are interested in making a code highlighter for Komodo, I highly recommend his post.

I figured that someone else might be able to use this, so I have posted the initial release here (v 0.1.1). All of the highlighting seems to work in my templates, and basic code folding works for most of the template items, except for the Python blocks.

There are still a few areas that could use some improvement. I hope to have better folding soon. I have figured out how to add HTML and CSS auto completion for the templates, but I haven’t figured out how to have it automatically installed yet. It would also be nice to add some templates and code snippets as well.

If you use it, please leave me a comment, and please let me know if you find any problems or have any suggestions.

5 Comments

  1. Christian Lean said,

    July 11, 2007 at 4:01 am

    Thank you for this, I have found it quite useful. I noticed that it doesn’t highlight strings properly though, when you have something like this:
    ${ “” }
    then the second ” doesn’t highlight correctly. It happens with all types of quotes.

  2. Chuck said,

    July 11, 2007 at 11:34 am

    Hi Christian,

    Thanks for the input. The way the highlighter is set up at the moment, it switches to Python highlighting, so it is going to highlight however you have string highlighting set up for the Python highlighting settings.

    Chuck

  3. Christian Lean said,

    July 15, 2007 at 6:51 pm

    If I have the following three things in the same template the problem only occurs in the third one. The problem seems to be with the ${ } and not with the , which has correct highlighting even in the same file with the same highlighting.

    ${ h.link_to(“Return to list”, h.url(action=”list”)) }

  4. Christian Lean said,

    July 15, 2007 at 6:54 pm

    Sorry, it butchered my post, it should have been:

    ${ h.link_to(“Return to list”, h.url(action=”list”)) }

  5. Christian Lean said,

    July 15, 2007 at 6:55 pm

    Lets try this:

    ${ h.link_to(“Return to list”, h.url(action=”list”)) }


Post a Comment