Last Updated: June 26, 2019

Macro for Toggling Editor Comments

Macro Monday – a new macro to dig into every Monday!

The Macro

This is an on-demand Python macro (most useful with a keybinding) that will
allow you to toggle comments on/off over the selected editor lines (or the
current editor line when there is no selection).

I use the Ctrl+3 keybinding, overriding the default “Comment” command, as this
way I never have to use the Ctrl+2 “UnComment” command, I just have the one
keybinding to turn comments on or off.


Here’s the macro in action:


To install the macro simply hit the “View Resource” and “Install Instructions”
links below.

Once installed – open the Macro properties and set the keybinding to Ctrl+3 (or whatever custom keybinding you like).

View Resource

Install Instructions

Related Materials

  • Komodo Developer Extension – play around with JavaScript or Python code in the context of the Komodo window
  • Komodo Macro API – to programatically interact with the Komodo editor – available to both Python and JavaScript
  • Editor API – the Komodo editor provides a wrapper around the Scintilla API
Todd Whiteman

Todd Whiteman

Todd Whiteman is the Development Lead for Komodo IDE. He works adeptly with Mozilla, Python and JavaScript to ensure that Komodo IDE is the IDE of choice for development teams. Todd has been working on Komodo IDE for nearly 6 years, adding components such as the Vi Key Bindings, Distributed Source Code Control, 64-bit Linux builds as well as Remote SSH support into Komodo IDE.