vim has a nice builtin paragraph-reformatting tool (with gqip), and so does emacs (alt+q iirc). but padre (the perl ide) lacks one...
so i decided to create a plugin that would bring this ability to padre. moreover, it was the opportunity to discover padre's plugin subsystem.
writing the plugin was incredibly easy. especially since i'm standing on the shoulders of giants: i'm reusing the formidable text::autoformat module. in fact, adding the standard build stuff & boilerplate was really what took most of my time... ok, that and fighting a bit with wx stc, which provides everything but the methods i wanted. :-)
all in all, padre::plugin::autoformat is now propagating on cpan. to use it:
- install it using your favorite method
- open padre
- activate the plugin (plugins / plugin manager / autoformat / enable). you only need to do this once, since padre will remember the enabled plugins.
- open a file
- type ctrl+shift+j to autoformat either current selection (or current paragraph if nothing is selected).
Isn't that what the PerlTidy plugin already does?
ReplyDeleteClaudio
@claudio: no, pp:perltidy works on perl files. pp:autoformat is meant to reformat text files. check text::autoformat for more information on what it can do to clean up texts.
ReplyDelete