Formatting the file on save


I thought that’s the simplest thing to do. I have some Fortran source I want to format with a command-line tool fprettify.

Tried using save-autorun, but this unnecessarily creates a panel, which has to be closed manually.
Tried writing my own formatter plugin (sic!), with this as a starting point:, but it’s impossible due to a closed unfixed bug:

Is there any way I can format my code on save?


The short answer is yes. The long answer starts with a question: do you mind if the solution formats all Fortran code, or do you want it to only target specific files or projects?


I need to be able to disable this for specific projects. In particular, different projects may need different formatter configuration.