I would like to change the way Eclipse formats XML files. For example, if I have in pom.xml file a section as follows:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency>
After ctrl+shift+f it will look like:
<dependency> <groupId> junit </groupId> <artifactId> junit </artifactId> <version> 3.8.1 </version> <scope> test </scope> </dependency>
I prefer the first version, so how to configure Eclipse to format XML files to look like that?
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.
Window -> Preferences, then XML -> XML Files -> Editor. There is a search box above the preferences tree, very useful when you want to find where something is configured.
Note that it may be some other editor is used, e.g. if you're editing a build.xml
file and have the Ant integration. In this specific case you'd set up the formatting at Window -> Preferences, Ant -> Editor -> Formatter. In similiar cases you need to search for the corresponding options for that editor yourself.
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