views:

14

answers:

2

When editing text files in Eclipse, for instance, a README file, I have not yet found a way to get the editor to reformat paragraphs of text so that they fit in a reasonable width (typically 80 characters). This seems like it should be a very common thing to want to do, but I haven't found it. Can anyone help?

Note that I'm not talking about soft text wrapping here - I want to hit some key combination and have Eclipse insert and remove actual newline characters so that the file looks OK when viewed in a basic text editor. Essentially, the same thing that the 'fill-paragraph' function on Emacs does. I'm aware that certain specific source code editors have intelligent reformatters that work with comments, but the basic text editor doesn't seem to have anything.

If this doesn't exist I may have to go and write something myself...

+1  A: 

No, Eclipse is not able to format plain text files.

But, there is a workaround: create a new empty Java class, place your text inside comments (/* ... */), and click Source -> Format (Ctrl+Shift+F).

lashtal
A: 

You could try some Monkey script for wrapping selected text (but that was for Eclipse 3.2 or 3.3 with Eclipse Monkey, not sure about a current Helios Eclipse).

You can check if this TeXlipse plugin would still be compatible with an Eclipse 3.5 or 3.6, but it is a Latex Mode Editor plugin only...

alt text

But other than those attempts to bring wrapping to the Eclipse Editor world, no, so far no luck.
The famous bug 35779 presents all the gory details of the wrapping affair and Eclipse.
There was a project back in 2006 to introduce true wrapping.
But its only conclusion was... that is wasn't so easy: see his comment#75.

VonC