views:

151

answers:

2

Hi, I'm trying to force IntelliJ to reformat the code the way Eclipse does it. When I set a line width to e.g. 120 chars I would like IDE to join line that were broken up to multiple lines (e.g. because the line width was set to 80 chars).

I want to go from here:

int a = 1
    + 2;

To here:

int a = 1 + 2

Is it possible in IntelliJ? I'm looking for the appropriate setting in the formatter but cannot find it. Could someone tell me where I can find it?

A: 

Perhaps try the Jalopy plugin?

Paul McKenzie
+1  A: 

This works for me in intellij 8 if i go to:

File -> Settings -> Code Style -> Wrapping -> Binary operations -> 'set to: 'Wrap if long' or 'Do not wrap'

Then CTRL-ALT-L to reformat the code

andy boot

related questions