How to customize Eclipse's text editor code formatting

Eugeniu Torica picture Eugeniu Torica · Nov 24, 2009 · Viewed 35.6k times · Source

How can I set my Eclipse's code formatter to allow code rows longer than 80 characters. I know that very long lines is hard to read but in my opinion 80 characters per line is very small value for wide screen monitors.

Answer

BalusC picture BalusC · Nov 24, 2009

In Preferences, go to Java > Code Style > Formatter and edit/create the formatter and go to tab Line Wrapping. There in you can set the Maximum line width.

Further on you can in General > Editors > Text Editors also set the Print margin column which should shift up that margin (a 1px wide vertical line in the right side of your code) to the desired position. This however doesn't affect the formatter, only the human eye.