Is it possible for me to use Eclipse to mass-reformat a bunch of C++ files (on the order of a few thousands), without actually having to open every single one in the IDE?
Update:
A couple people have now posted solutions for the Java IDE, but this does not seem to work for the C++ IDE because there is no "Source" submenu in Project Explorer. :(
To format your whole script: Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.
You can use Ctrl + A to select the entire file, then use this shortcut to quickly fix all the indentation. You can also change how Eclipse handles indentation by going to Window > Preferences, then in the left panel, navigate to Java > Code Style > Formatter > Edit... > Indentation.
This feature will be arriving in the next version of CDT (due in June 2011), CDT 8 in Eclipse 3.7. You can try it now using a milestone build of the platform + cdt: http://eclipse.org/downloads/packages/release/indigo/m6
The bug where this feature was added is here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=245747
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With