Set Line Height in Komodo

Have I mentioned that I love Komodo IDE? Still, I occasionally come across an annoyance. One very annoying thing is that there is no way to change the line height in the editor other than changing the font size. I like to have a larger than average line height for better readability. I recently noticed that PhpStorm has a line height setting. I also love PhpStorm and think it has advantages over Komodo for certain tasks, but I still like Komodo better overall and use it more often. After some googling, I found this great tip on the ActiveState forums:

Add this Komodo JavaScript macro to the toolbox to increase the line height:

/**
* @type {Components.interfaces.ISciMoz}
*/
sm = komodo.editor
sm.styleSetSize(sm.STYLE_BRACEBAD, 16);

Change the 16 to any number you want (as long as it increases the line height – does not work for decreasing line height). I set mine to 21 because my font size is set to 14, and I like a line height of about 1.5em. Even though the setting is for the bracebad style only, it has the effect of changing the line height for everything else too.

How to add a macro:

  • Open the toolbox pane in Komodo
  • Right click and choose Add > Create new macro
  • In the Macro tab, name the macro, choose JavaScript as the language, and enter the code above into the main text area.
  • In the Triggers tab, check the box that says “Macro should trigger a Komodo event”.
  • Choose ‘After file open’ as the event and click ‘OK’.

These instructions are for the latest version of Komodo IDE (8.5.2 at this time) on mac. They may vary slightly in other situations.

To edit the macro, right click on it in the toolbox, and choose ‘Properties’.

1 thought on “Set Line Height in Komodo”

Leave a Comment