Question

Our Java code style has a maximum line width for comments of 255. While I'm fine with this value (I hate when automatic formatting wraps comments), I sometimes want to (hard) wrap a paragraph manually to improve readability (like the Emacs fill-paragraph command does):

Is there a plugin that allows to wrap a line with a specified max width, e.g. 72, similar to what Ctrl+Shift+F does with the maximum line width for comments (in my case 255)?

Note: I'm not looking for soft wrap as covered by question Eclipse: Automatic line wrapping to specified width.

Was it helpful?

Solution

There ain't such a plugin, as eclipse will always reformat your specific wrapped code again with CTRL-SHIFT-F.

Though at least you are able to prevent Eclipse from formatting your code & comments with a special comment: @formatter.

// @formatter:off

... 

// @formatter:on
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top