Friday, July 16, 2010

Take advantage of full-featured Komodo IDE to boost productivity

Komodo is a great IDE (Integrated Development Environment) for a number of programming languages. You can use the free Komodo Edit or the commercial Komodo IDE. Depending on your needs, Komodo Edit may be sufficient, but Komodo IDE does have some compelling feature enhancements, including Source Code Control (SCC) integration, the fantastic regular expression toolkit, debugging support, interactive shells, and much more.

Komodo IDE can definitely be a handful, however, because there are so many features available. There are, however, some things about Komodo that can really boost productivity beyond being a multi-language visual editor with call-tips and syntax highlighting.
Debugging

The first thing is the debugging support. Komodo supports debugging in a number of languages: JavaScript, Perl, PHP, Ruby, Python, and TCL. For some of these languages you may need to do some configuration in the preferences, like installing the Komodo JavaScript Debugger extension in Firefox, or setting locations of debug logs. As well, Komodo supports remote debugging for a number of languages as well, including Python and PHP.

To begin debugging a Python script, open it in Komodo. From the Debug menu, select the Go/Continue or Step In options to start a debugging session. A popup window will come up asking for script arguments, interpreter arguments, etc. Provide the arguments to the script and click the OK button. You can even select to debug in a separate console, which allows you to see more of what is going on than you would in Komodo’s window pane mode.
Figure A

Click to enlarge.
Keybindings

If you are a vi or vim user, you probably don’t like the idea of using a GUI text editor because you are so used to the vi keybindings. The same can be said if you are an Emacs user. Luckily, Komodo can accommodate you here as well. In the Preferences, head to the Editor section. Expand the triangle next to the Editor category and select the Key Bindings sub-category. Here you can choose which keybindings to use: Vi, Emacs, or the default. You can even create new schemes based on your favourite editor if you wanted to.
Add-ons

Because Komodo is based on Mozilla code, it supports community-supplied add-ons as well, similar to add-ons for Firefox. For instance, there are dd-ons like the HTML Toolkit, which provide a number of tools to edit HTML and XML documents, including HTML end tag auto-completion and helper commands for creating HTML entities. Or the MoreKomodo add-on that has some nice features like renaming or moving the current editor file and encoding or decoding HTML entities into a document, amongst others.

TODO Helper is an add-on to search for specific TODO markers in a file, and has customizable search criteria so it works with your style, without forcing you to work with its own. Finally, the Tweak UI add-on is great as it allows you to move elements of the UI around in a way that makes sense for you. Other add-ons exist to provide side-by-side diff output, the use of scp within Komodo to transfer files, and even play a Tetris clone.
Komodo Toolbox

And if that weren’t enough, there is the Komodo Toolbox, which allows you to define snippets of code or applications to run on your code. For instance, I created a Toolbox command entry to run PyLint on the current document.

By default, the Toolbox is not on the workspace, so select the View menubar option, highlight Tabs & Sidebars and click on the Toolbox menu item. On the right side of the screen a new pane will appear with some sample Toolbox items. Toolbox items can be applications to run, snippets of code, macros, templates. or even links. To add a new Toolbox item (we’ll create a command to run PyLint), select Toolbox from the menubar, highlight the Add option and then select “New Command”. The Add Command window will come up and here you can specify the command name (PyLint) and the command to execute, in this case:

cd %p; /usr/bin/pylint %F

You can even define a key binding, to make access to the command a hot-key affair.

Komodo IDE and its little brother Komodo Edit have a lot of tricks hiding up their respective sleeves. Finding them may take a bit of time, and tweaking your environment to something you are comfortable with and used to can take some effort, but the end result is really well worth it. If you are currently using Komodo, take advantage of the key bindings and Toolbox features, and take a look at the different add-ons available to see if there is anything that will boost your productivity.

No comments:

Post a Comment