I am using Per Tidy plugin in Padre IDE. By default, Tidy wrap my long lines into multiple lines which I don't like. How can I tell Tidy never wrap my lines?
How to configure Perl Tidy not wrap the lines?
808 Views Asked by Jirong Hu At
2
There are 2 best solutions below
0
On
You can also change the default settings of perltidy. First find out where it is installed:
perl -MPerl::Tidy -e 'print $INC{"Perl/Tidy.pm"}'
Then edit the file where maximum-line-length is defined (or any other parameters you want). You might need sudo if perltidy is installed gobally. I usually use VS code to format my code and that in turn uses perltidy but I can't define paramters. So I found doing this particularly useful.
Testing via
perltidyon the command-line (referring to the man page), I found that I preferred to change the defaultperltidyoptions to always keep newlines (line breaks) by enabling "freeze newlines" (-fnl), and and disabling all whitespace modifications (-fws, freeze whitespace), via options:perltidy -fws -fhl -bFor your specific case, to ignore all line breaks, all you would needs is
perltidy -fnl -b(the-bcreates a backup file, and modifies in-place.)There's also a second reasonable option of just setting the line length much longer (for example to 120 chars) than the default of 80 using:
-l=120(or:--maximum-line-length=120or an even longer "really large number" is enabled by setting it to zero (0).Note: as an aside, I'm testing on
bluefishhtml editor, which uses either htmltidyorperltidy, depending. For some reason, I had to change the rc file directly and couldn't change the setting in the GUI.