As mentioned in the post by VonC on this same page. Eclipse now has this capability as of 06/2016 Neon.
Try this plugin Eclipse platform plugin
It looks like eclipse only has the ability to do it manually on its own and here are the commands. At that point you must reformat the highlighted text manually.
It's not terribly obvious how to control Eclipse line width and line wrapping in your Java source files. Here's how and where:
Comment width and line wrapping is set in
Preferences->Java->Code Style->Formatter, then click on the Edit button and select the Comments tab. I like Line Width for Comments to be 120.
Code line wrapping is set nearby, in
Preferences->Java->Code Style- >Formatter, then click on the Edit button and select the Line Wrapping tab. I like a line width of 120 and indent size of 4.
Indentation is set separately, in
Preferences->Java->Code Style- >Formatter, then click on the Edit button and select the Indentation tab. I like an indent size of 4, consistent with the Line Wrapping indent setting.
As if that's not enough, you can also set printer margins, tab size, etc, in
Preferences>General>Editors>Text Editors where I set the Displayed Tab Width to 4 and Print Margin Column to 120 or more.
You can also check the Show Print Margin box to get a faint vertical line at the printer margin column
Try AhtiK Eclipse WordWrap, it works for me: http://www.ahtik.com/eclipse-update/
Got this answer from this post: How can I get word wrap to work in Eclipse PDT for PHP files?
Word wrap comes out of the box with Juno now. Right Click on the editor and select the "Word Wrap" option from the dropdown.
In Eclipse v4.7 (Oxygen):
Window menu → Editor → Toggle Word Wrap (Shift+Alt+Y)
From Bug 35779 - Comment 187:
A workaround, that I use for the last years now, is to use the eclipse wiki markup editor for editing text files. This supports word wrap, and this is enough for me. Maybe this information could be of help to some of you.
In Version: 2019-12 (4.14.0) on MAC
Toggle Word Wrap
Ahti Kitsik's plugin is mentioned above, but there's a newer plugin by another author that works with newer versions of Eclipse (up to Juno, at least), and also fixed the line numbering issue in the older plugin.
Full installation instructions are at Eclipse version to download the word wrap plug-in
The Eclipse Word-Wrap plugin works for any type of file for me.
Eclipse Neon (4.6), release date June 2016, includes word wrap for text editors. It's disabled by default, and can be activated and deactivated using the key shortcut
Alt+Shift+Y (on Mac OS,
Cmd-Opt-Y). Some editors also supply a tool bar button for activating word wrap.
See the 4.6 M4 New and Noteworthy
Ctrl+Shift+F will format a file in Eclipse, breaking long lines into multiple lines and nicely word-wrapping comments. You can also highlight just a section of text and format that.
I realize this is not an automatic soft/hard word wrap like the other answers, but I don't think the question was asking for anything fancy.
By default, text editors are opened with word wrap disabled.
This can be changed with the Enable word wrap when opening an editor option on the
General > Editors > Text Editorspreference page.
Manually toggle word wrap by clicking in the editor window and pressing (Shift+Alt+Y).
On Mac OS X, press (Cmd-Opt-Y). [Updated May 2017]
There are however a few new bugs:
- 481873 "No line ruler number repaint on text editing with disabled "quick diff""
- 484142: "Word Wrap makes some actions very slow"
- 488162: "[word wrap] Hide WW preference to avoid unexpected performance impact"
As long as we are unable to provide acceptable editor performance for big files after toggling editor word wrap state on, we should make sure users can't set WW preference 1 always on by default and wonder why the editors are slow during resizing/zooming.
If you want the wrapping to be persistent/automatic, the cdhq plugin seems to still work with the 2019-03 version of Eclipse.
After installing you can turn it on via
Original answer May 2010
Try the Eclipse Word-Wrap Plug-In here.
Just for the record, while Eclipse Colorer might bring wrapping for xml files, Eclipse has not in general a soft wrapping feature for Text editor.
Soft and hard. Soft will just warp the text at the right window border without adding new line numbers (so there are gaps in the list of numbers when you enable them).
This is one of the most upvoted bugs in Eclipse history: bug 35779 (9 years and counting, 200+ votes)
Update February 2013:
That bug references an old Word wrap plugin, but Oak mentions in his answer (upvoted) a new plugin for recent (Juno+) versions of Eclipse (so 3.8.x, 4.x, may have been seen working with 3.7)
That plugin is from Florian Weßling, who just updated it (March 2013)
Right click in an opened file and select "Toggle Word Wrap" (shortcut ctrl+alt+e)
- Does Eclipse have a shortcut to split a line and introduce a variable?
- Does Eclipse have line-wrap
- Why does my Eclipse project have phantom debugger breakpoints?
- Does Eclipse have a way to alphabetically sort lines within a selection of text?
- does netbeans have something like Eclipse Debug display view
- Does the Eclipse editor have an equivalent of Emacs's "align-regex"?
- Why does my eclipse project not have a build path?
- Does Eclipse have an editor/viewer for java serialized files?
- Why does eclipse always wrap after @param myParameter in JavaDoc?
- Change Eclipse tab to correctly indent line as Emacs does
- How to have eclipse add line comments at the indent instead at the beginning of the line?
- Does eclipse have a debugger "step into selected" option that prompts for the method to step into?
- How does eclipse figure if a file has unix or dos-style line endings?
- How to make (EPIC perl) plugin on eclipse do syntax coloring for a file that does not have .pl extension
- Does Eclipse have a tool to merge a type hierarchy into a single class?
- Does Visual Studio for C# have these Eclipse for Java features?
- BufferedImage bytes have a different byte order, when running from Eclipse and the command line
- Does Eclipse have "Syntax Aware Selection" feature?
- Eclipse - Does it have a method drop down like XCode?
- Step does not have a matching glue code error in cucumber eclipse
- Does PHP Eclipse Internal Browser usually have CSS issues?
- Does Eclipse have a bean builder UI for JavaBeans components?
- Does Eclipse have this extensibility Feature like Visual Studio without any coding?
- Eclipse 4 RCP - Application does not have an active window
- Eclipse word wrap line number mismatching
- Why does Eclipse have to be constantly cleaned/refreshed?
- Eclipse 3.7 line wrap early on comments
- Does eclipse have Graphviz plug-in?
- What does this eclipse error mean: "path for project must have only one segment"?
- Does Eclipse have equivalent of .svnignore/.cvsignore for Project Explorer?
More Query from same tag
- Which version of eclipse should i download?
- Running Emma with Eclipse on Ubuntu
- Eclipse Syntax error android:targetSdkVersion="10"
- Where does eclipse store information about open perspectives etc?
- JSF with eclipse, maven & glassfish - Error: com.sun.faces.context.FacesFileNotFoundException
- JavaFx in Eclipse on Mac OS
- Parsing a date which is a string from an rss feed and then displayed in a text view.
- Syntax error on token ";", invalid AssignmentOperator
- Unity project exported to android project exception (Multiple dex files define Lcom/qualcomm/QCARUnityPlayer/BuildConfig)
- Failed to create 'E:\HashMap\workspace\YbyUser\bin\YbyUser.apks': Access denied
- Eclipse deletes java files on build of an android project
- Exporting an app with Sikuli
- Is there a way to update an object from the main class to all the other classes within the program?
- error inject EJB in JSF project
- Using tortoise for existing project
- Dropbox issues not able to Upload a text file in Android
- Eclipse PHP SIGSEGV When Opening Project File
- How does Git Eclipse plugin know revisions from before I installed the plugin?
- Eclipse not opening Websphere Liberty console
- Liclipse/Eclipse: setup debugging environment for a django project alongwith its virtualenv
- Using jts topology suite with android
- how do I make eclipse not add javadoc tags in new method comments?
- IBM Worklight 220.127.116.11 server not starting on Windows 8.1 Pro 64 bits
- How to reference a different Java project in Eclipse
- Eclipse CDT shows some errors, but the project is successfully built
- Eclipse+Pydev: "cleanup" functions aren't called when pressing "stop""?
- maven-shade-plugin does not include org/apache/commons/vfs2/impl/StandardFileSystemManager
- Installing different Eclipse IDE distro vs. installing plugins to existing Eclipse IDE
- Syntax-dependent fonts in Eclipse?
- AVD does not shows up when build target is higher