Enable Line Wrap option in NetBeans Nightly
I always download NetBeans nightlies PHP pack since the beginning of April. However, I couldn’t download them during the last two weeks because of the huge workload that I had. I downloaded the latest NetBeans nightly 201004260200 and noticed that my useful line wrap feature is grayed out. I don’t know why is this feature disabled and since when. After I researched around the Internet, I found this bug report on the NetBeans website. According to one of the comments, the feature was disabled by default since April 13. Based on the bug report, to enable the line wrap feature, you need to edit the netbeans.conf file inside the /etc folder of the NetBeans installation directory, for example, mine is ~/netbeans-dev-201004260200/etc. Then add the line below inside the double quote of the netbeans_default_options variable:
-J-Dorg.netbeans.editor.linewrap=true
The whole line should now be
netbeans_default_options=”-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dorg.netbeans.editor.linewrap=true”
After that, restart the NetBeans IDE and the line wrap feature should enabled by default and set to “Anywhere”. To verify, go to Tools -> Options -> Editor -> Format. You should see Line Wrap option enabled at the bottom .
The bug report stated that it will slow the performance of the application if this feature is enabled by default. In my experience, after enabled this feature by editing the above config file, it actually perform faster than before. I hope that the line wrap feature will be enabled by default in the final release of 6.9 on June 9 because I really like this feature.
You can download NetBeans nightlies at http://bits.netbeans.org/netbeans/trunk/nightly/.
There are no posts related to Enable Line Wrap option in NetBeans Nightly.
But when I have added the line with that variable and then tried to save, it says, Access is denied.
Hi Ronidhbd,
Where did you install your NetBeans installation? If it’s your home directory, it should work fine without root, except you changed the permission of the files in your home directory. In this case, just type the following command to give you the full access to the files in the home directory:
sudo chmod -R 777 /home
Otherwise if your NetBeans installation is not in your home directory, either in the /opt directory or another “root” directory, you need root to be able to edit the config file by adding the sudo in front of the command you were using to open the file, for example:
sudo gedit netbeans.conf
Press enter and type your account password, and then you can edit the file and save it without problems.
Hope this is helpful. If it still doesn’t solve your issue, please reply this comment.
thanks that was a life saver!
Thanks man, you saved me!
Thank you, worked great!
Thanks mate..it wroks..Linewrap is such a useful feature and dont know why they keep it disabled.
Thanks again..
You are welcome. I think Netbeans keep this feature disabled because it would cause performance issue. Regarding to this post about why the option is grayed out even in Netbeans 7, I have no idea.
hi,
.
it worked greatly. I will in really problem without line-wrap feature in netbeans. now I love it even more
thanks a lot
Thanks for this great tip, Robby! This was bugging me for a while now. I can’t live without linewrap when editing large html files.
You are welcome.