Wednesday, July 17, 2013

Eclipse: increase Java line width wrapping

Java standard line width wrapping is set for 80 which is archaic and unusable with today's screen sizes. Here are instructions how to change it.

1) Go to Eclipse -> Preferences..., search for "Formatter" -> Edit...
2) rename the Active Profile name to something meaningful to you (e.g. company name).
3) open "Line Wrapping" tab
4) Change "maximum line width: from 80 to something like 140 or 160 (for 15 inch macBookPro)
5) Apply, OK
6) format your code (shift+command+F)
7) Export Formatter for other team members.