I have a custom code formatter that I have set in my Java projects. All code changes get automatically formatted on save. My projects are saved via SVN on a server, so others can work on them as well.
The problem is that I want to have a single code formatter (mine) to be applied on all machines. The way it is now, I have to go to a new machine, check out the code (the formatter is in the repository as well), import the project to eclipse and manually change the eclipse settings to use that code formatter. Is there a way to do that on project level instead of IDE level? So I don't have to do this manually on every machine?
To format your whole script: Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.
All you need is to export settings from Eclipse (go to Eclipse's Preferences → Java → Code Style → Formatter and export the settings to an XML file via the Export All button.), and then open IntelliJ IDEA Settings → Code Style → Java, click Manage, and import that XML file by simply clicking Import.
Open the context menu of the project -> Properties -> Java Code Style -> Formatter. Check "Enable Project specific settings" and configure the profile.
All the important Java related settings are available on a per project base and you should never modify Java related settings through Window -> Preferences, if you share the project with others. Project properties are saved in your project (and therefore shared with all), preferences are stored far away and unrelated to your project.
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