I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would like to increase the maximum line length. How can I do this?
To set the maximum line length in Eclipse, open Eclipse and in the menu bar, go to Window -> Preferences and in the pop-up window, go to Java -> Code Style -> Formatter. This will open up the Formatter options in the right window pane. Click on the Edit button to modify the current formatter profile.
(2/2) Go to:Window --> Preferences --> C/C++ [or whatever language you are using] --> Code Style --> Formatter --> click Edit --> under the Line Wrapping tab set the value you desire for Maximum line width .
1) How to change the line length for auto formatting of java code (while using Ctrl+Shift+F)? Go to tab Line wrapping. Default value for Maximum line length is 120. Set Maximum line width to some higher number as per your requirement, I have set it to 140.
In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:). In the Comments tab you have a separate option Maximum line width for comments:, which will also need to be changed to affect comment wrapping.
You will need to make your own profile to make these changes in if you using one of the [Built-in]
ones. Just click "New..." on the formatter preferences page.
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