Mar 25 2009

Add a Source Code Beautifier to UltraEdit

Category: Generalsite admin @ 10:12 pm

Another great feature of UltraEdit is the ability to configure tools, programs, or commands that can be run from the menu or toolbar.

So here is how to configure the open source tool AStyle (Artistic Style) so that C/C++ or Java code looks like this:

Astyle_before

.. will be “beautified” in just about any format style, like this:

Astyle_after

Download AStyle and save it where you want it. There is no install to run.

In UltraEdit, go into Advanced > Tool Configuration from the menu.

Configure the command to run the AStyle program passing it the style option(s) you want. Run AStyle.exe -h from a command prompt to see all the options.

In this example, we are using the following Command Line

“C:\Program Files\AStyleWin\AStyle.exe” –style=allman –quiet “%f”

 

Astyle_config1

 Astyle_config2

Astyle_config3

Save your configuration (Apply and/or OK) and you will have AStyle available as a menu item for you to use.

Astyle_menu

When you select this tool from the menu (or use the short cut keys) AStyle will run against the current open file. To see the results of the beautification, make sure to choose Yes to reload when prompted.

Astyle_reload

References

Tags:

Leave a Reply

You must be logged in to post a comment. Login now.