How do you enable word-wrap by default in Eclipse?
Asked Answered
A

3

54

Simple question: how do you enable word-wrap by default in Eclipse? I looked at this plugin but it only goes up to Luna. In addition, this plugin is a separate text editor and does not have syntax highlighting or validation. I'm open to other suggestions.

Aronarondel answered 20/9, 2016 at 14:37 Comment(0)
A
72

Word wrap is available in Eclipse Neon IDE: https://www.eclipse.org/neon/noteworthy/#_word_wrap_in_text_editors.

Just consider using the latest version.

Keyboard shortcut: Alt+Shift+Y

Or button:

enter image description here

Or menu Window > Editor > Toggle Word Wrap:

enter image description here

Aguie answered 20/9, 2016 at 14:42 Comment(6)
But as default it is disabled. When I enable it and open new file, it is disabled again.Verbenaceous
Indeed. Please consider creating an enhancement request (via bugs.eclipse.org ) to suggest the setting to be global and propagated to all editors.Aguie
The shortcut Alt + Shift + Y works in S32 Design studio based on the eclipse framework.Vibrate
I don't see this in Mars.2 Release (4.5.2)Aeronaut
Mars 2 is seriously outdated; it's been release more than 6 years ago, and 16 major release took place since then. You won't ever get more support for it. Just drop it and use latest release.Aguie
Using STS 4, word wrap isn't listed in menus but Alt-Shift-Y works.Torrential
R
49

As pointed out by @KrisWebDev in this answer, Eclipse supports soft line/word wrapping as of Eclipse Neon but the GUI to control this setting does not exist yet. There should be a global settings to enable soft word wrapping by default in any text editor in Window > Preferences > General > Editors > Text Editors > Enable Wordwrap and it is not there.

Instead, you have to manually edit the org.eclipse.ui.editors.prefs file (.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs) in your eclipse workspace. There, you can add the settings wordwrap.enabled=true.

Reg answered 16/12, 2016 at 8:12 Comment(11)
on windows installations, the file is in the workspace at <workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefsFinicking
The GUI is still not there as of Eclipse Oxygen :-/Reg
Note that the option is not there intentionally until bug 484142 gets resolved - in short, in order to avoid potential persisting slowness, every newly editor has got the word wrap feature turned off as a workaround for now.Callipygian
Thanks for the notice about the bug, I added my vote on it.Reg
@EmmanuelGuiton This setting enables word wrap for code editors. How to permanently enable word wrap for console logs?Answer
@Answer I do not know if there is an option for that.Reg
@Answer by the way : this is another topic, you should open a new question for that.Reg
It worked for Oxygen as of Nov 07, 2017. After adding the value in the org.eclipse.ui‌​.editors.prefs file lines were wrapped.Yean
@Answer You can set the preferences for Run/Debug Console to a fixed width like 120 characters. It doesn't break at word boundaries, though, it just prints exactly 120 characters and continues on the next line.Sp
my org.eclipse.ui.editors.prefs file gets overwritten at restart. I'm using the 2021-03 edition of EclipseSinglecross
I don't see this in Mars.2 Release (4.5.2)Aeronaut
L
1

For windows this worked for me(change workspace6 if not works), open settings file

%APPDATA%\DBeaverData\workspace6\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs

add

wordwrap.enabled=true
Logogriph answered 24/3, 2021 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.