Eclipse Auto Format Line Wrapping Width


When using CTRL + SHIFT + F in Eclipse by default it wraps your lines quite tightly. If you have a relatively large screen this is unnecessary and annoying. To change the width that Eclipse lets your code use before wrapping it to the next line, use the steps below:

  1. In Eclipse, click "Window" > "Preferences"
  2. On the left expand "Java" and click "Formatter"
  3. Either edit your existing profile or create a new one using the "Eclipse [built-in]" to initialize settings and click the "Edit" button
  4. Click on the "Line Wrapping" tab at the top
  5. Change the "Maximum Line Width" (the first option) to your desired width
  6. Click "Apply" and "OK"

My screen resolution is 1920 x 1080 and a width of 200 was perfect.

Facebook Twitter Google+ LinkedIn Buffer
Leave us a Comment

Connect With Us

Get our monthly newsletter with tech tips for business professionals