this should be a simple one for some who using komodo edit for a while. I've a rails html.erb file in the editor and the indentation has gone a bit wild. Is there a function to automatically indent my code so it's easier to read?
|
feedback
|
|
I use this slightly edited version of the that code. Variations have been floating around the Komodo Forums for some time. I use this on Komodo Edit 6.1, works fairly well. I might come back and update this post, if/when I add new syntax support. I changed some of the tidy and csstidy options, added the XML support, and Changed undefined syntax alert message. You might want to check out rbeautify, i'm sure adding a new case statement wouldn't be too difficult. (I would integrate it for you, but i'm lost on Ruby) Format_Syntax.js
| ||||
|
feedback
|
|
Not directly. However, the "Run Commands" system (and possibly the use of macros) can be used to help run an external script that will massage the contents of the current buffer. So, if you have a script that can do good .html.erb formatting then you should be able to integrate that. Aside: Komodo IDE (the commercial relative of Komodo Edit) has a framework for integration code formatters into Komodo. It ships with an "HTML Tidy" formatter that might do an okay job of .html.erb formatting. | |||
|
feedback
|
|
I found this formatting script (macro) and adapted it for my personal use with the latest Komodo Edit (v6.1.0). It works well (assuming you've got HTML Tidy available on your system) and I included the JavaScript formatting code provided by a commentator but I think it may only work with Komodo IDE. It's unimportant for my purposes. Perhaps someone out there can find a universal improvement (using something like html tidy).
| |||
|
feedback
|