46

I know there are a bunch of posts about this already, stackoverflow: word wrap in netbeans, for one, and there are some people that say it is already included in netbeans 7, but for the most part they are all old, or inconclusive. I use netbeans 7.0.1 and the included word wrap is half-assed and glitchy at best. Going to Tools > Options > Editor > Formatting > Line Wrap and setting it to either "After Words" or "Anywhere" both result in practically the same sort of wrapping and neither one is very reliable. On occasions it will wrap as expected, but more often than not you can end up with anywhere from one word to an entire paragraph past the vertical scrollbar. Is there something I am missing or is that really the way that's supposed to work?

I'm still looking and will post any significant finds, but does anyone know of a way to fix this, or a plugin to install for it, or anything? I would have figured after 4 years of inquiries (2008 is the oldest post I've found about this) netbeans would have fixed it :(

BTW: Not looking for reasons why my code shouldn't be more than 80 character long, there's no helping it sometimes and that answer isn't helpful. I have also tried adding "-J-Dorg.netbeans.editor.linewrap=true" in the netbeans.conf file, but from what I gather that is for enabling the feature in older version and did nothing in mine (I removed it).

Community
  • 1
  • 1
mseancole
  • 1,662
  • 4
  • 16
  • 26

7 Answers7

89

On Netbeans 7 and 8, you can use Tools/Options/Editor/Formatting/LineWrap.

It can only be globally enabled.

enter image description here

Cary Bondoc
  • 2,923
  • 4
  • 37
  • 60
sk_buff
  • 891
  • 6
  • 3
  • 3
    Hello, I've edited your answer because even in netbeans 8.0 it is the same, also I've added a picture for future users who will encounter the same needs. – Cary Bondoc Aug 09 '14 at 01:43
  • The dark theme is cool, how did you do that? And its wired, after follow the detailed instruction the text still not properly wraped, even restart the IDE. @AppsDev – XY L Jan 27 '15 at 14:10
  • 1
    The dark theme is : Darcula (install the plugin "Darcula LAF for netbeans", see in tools>plugin). Once it is installed, go in tools>options>appearance>Darcula Look and Feel , then click on the checkbox "invert icon color". Enjoy. – Cedric Feb 11 '16 at 16:31
7

you can do it from:

1) Tools -> Options -> Editor -> Formatting(Tab)

2) Select Your Language in "Language Drop down"

3) Select "Wrapping" from "Category and do what ever you want

Note: this is for Windows OS

Ahmed Ali
  • 342
  • 6
  • 16
6

I have done it in netbeans 8.0
Goto -> Tools-> options-> Editor-> Formatting-> language(dropdown-All languages) -> Category(dropdown-Tabs and indents) -> Line wrap(After word)

Make sure you re-open the file to see the change.

4

In case any one is looking for this with NetBeans 8 on OSX and ends up here, it's preferences/Options/Editor/Formatting/LineWrap

NetBeans8

CervEd
  • 3,306
  • 28
  • 25
  • I am not able to see these options in Ubuntu operating system, its just showing blank options like: language drop down have: item1, item2... and so on and same contents showing in category tab. I have just install netbeans7.3.1. Can you please suggest how can i fix it? – Raghbendra Nayak Oct 29 '15 at 06:36
3

you can do it from:

1) Tools -> Options -> Editor -> Formatting(Tab)
2) Select Your Language in "Language Drop down"
3) Select "Tabs and Indents" from "Category
4) Dropdown" select any of the desired option from "Line Wrap drop down" i.e After words or Anywhere

Note: this is for Windows OS

Web Dev
  • 306
  • 3
  • 5
2

In Netbeans 7.2 it's actually, "Wrapping" instead of "Line Wrapping" and it's "If Long" instead of "After Words", but that probably doesn't answer your question.

You posted this almost one year ago, and you still haven't found anything yet?

I don't like how they decide to wrap by way of creating actual new lines in the editor. I would prefer if it just line-wrapped but you didn't have to make a new line - like, what you have with Notepad. However, I would prefer if you had a symbol to show that you're line wrapping on the next line, like I have seen in other IDE's before.

user919860
  • 3,083
  • 4
  • 19
  • 16
  • No I haven't found anything, but I've also upgraded to 7.2 since then. I don't seem to be having the problem anymore either. Then again, I primarily only use it for debugging, setting up new projects, and version control now, so I don't spend nearly as much time typing in it. So who knows, this may still exist. I think I'm going to flag this to be closed, it never really got any attention and its no longer an issue, at least not for me. Thank you for your interest though. – mseancole Oct 02 '12 at 19:30
1

I done in Netbeans 8.0.2 as following way : NetBeans->preferences/Options/Editor/Formatting/LineWrap

Hope this is useful.

Prabhu Nandan Kumar
  • 1,205
  • 12
  • 22