Mar 27 2009

Add a Source Code Beautifier to UltraEdit – The Easy Way!

Category: Generalsite admin @ 6:51 pm

After installing the latest version of UltraEdit and configuring it, I discovered that the Artistic Style source code formatter is built in and easily added.

From the Advanced > Configuration menu option

Astyle_builtin_1

Choose Toolbars / Menus > Customization and then select the Customize Toolbar button.

Astyle_builtin_2

Scroll down on the left side until you find the Artistic Style toolbar item, then select it and click on left arrow to add it to the toolbar, and select OK.

Astyle_builtin_3

The end result is a built in toolbar button for AStyle.. 

Astyle_builtin_4

…which presents the formatting options dialog whenever you click on it.

Astyle_builtin_5

Much easier than my original post!

Tags: ,


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: