Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse's Java editor do soft line wrapping?

I like to use Eclipse's Java editor feature that allows the me to split the editor window into several panes so I can look at multiple files at once (See below). When I do this, the editors usually can't display the longest lines, and I have to use the horizontal scroll bar.

Multi-pane Editor Example

I don't want to reformat the source itself because the window widths change depending upon what I'm looking at. So what I'm looking for is a soft line wrap, like many editors support (See below). Can I do this in Eclipse?

Good Editor Example

like image 807
Jeff Axelrod Avatar asked Jan 10 '12 16:01

Jeff Axelrod


People also ask

How do you wrap lines in eclipse?

There is a "Toggle Word Wrap" command hidden in the "Window > Editor" menu (default shortcut is Alt+Shift+Y). Or you can use the Quick Access bar: Ctrl+3, and type wrap.

How do you break a long line in eclipse?

:) Also in Window->Preferences->General->Editors->Text there is an option "show print margin". If you turn it on you'll always see vertical gray line that shows you when to break to a new line. You have to set the max line width to a very large number, like 1000.

How do I change line width in eclipse?

In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the primary option for line width (Maximum line width:).


1 Answers

Nope. Not that is hasn't been asked for.

There's a plugin but I've never used it.

like image 78
Dave Newton Avatar answered Oct 21 '22 22:10

Dave Newton