Friday, May 18, 2012

Eclipse: Set maximum line length for auto formatting?


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?



Source: Tips4all

4 comments:

  1. In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the option for line width (Maximum line width:). you will need to make your own profile.

    ReplyDelete
  2. Comments have their own line length setting at the bottom of the setting page java->code style->formatter-> Edit... ->comments

    ReplyDelete
  3. Click Project->preferences. Type format into the search - you should see java->code style->formatter. Click that, then edit - finally, the line wrapping tab - its there :)

    ReplyDelete
  4. for XML line width, update preferences > XML > XML Files > Editor > Line width

    ReplyDelete