Perl IDE Padre: how to format the source code

832 Views Asked by At

How can I have something like in eclipse, highlight the lines, right click Source --> Format, and make the code line up nicely.

2

There are 2 best solutions below

1
On BEST ANSWER

Finally I figured out. First download the plugin gzip from here: search.cpan.org/~azawawi/Padre-Plugin-PerlTidy-0.22/lib/Padre/…, then install it from Tools --> Module Tools --> Install Local Distribution. Then from Tools --> Plugin Manager, enable the Perl Tidy. Finally I can see this menu: Tools/Perl Tidy/Tidy the Active Document, as mentioned here padre.perlide.org/features/perl-tidy.html.

3
On

There is a tool called Perl::Tidy which is highly configurable that does auto formatting of Perl code. Padre has a plugin to use it. You can find the documentation here.

Padre has a plugin called Padre::Plugin::PerlTidy that provides integration with the above module. It uses the default settings of perltidy or the settings of the current project to tidy the current file or the current selection in the editor.

It probably will use the .perltidyrc config file in your project directoy, though I am note sure about that.