How to wrap words/lines in NetBeans IDE 6.9.1? - netbeans

I searched for "wrap" in keyboard mappings without success. I don't see this option in menu neither.
EDIT: I was thinking about result the you get let's say in Notepad2 by pressing Ctrl+W (or selecting View -> Word Wrap). So I'am asking about toggling such Word Wrap

In Tools->Options there is a whole section on line wrapping. The options you choose here will depend on how you need to do the wrapping - it is quite configurable.
Go to Tools->Options.
Click on Editor in the ribbon at the top.
Choose the formatting tab.
Choose the language you require the wrapping for it the Language combobox.
In the Category, choose Wrapping.
Configure how you would like the wrapping to take place.
Hope this helps...

Stolen from Sidarta's tip in this SO post:
You can use word wrap in Netbeans.
Add to netbeans.conf
(netbans_instalation_path/etc/netbeans.conf):
-J-Dorg.netbeans.editor.linewrap=true and restart Netbeans.
In Options->Editor->Formating there is
Line Wrap dropdown option
Works fine for me in Netbeans 6.9

Are you talking about "soft wrapping"? That is, there are no line breaks inserted into the text file, but each line is wrapped to fit in the editor window?
NetBeans doesn't support that. Hard to believe, I know. I think it might be coming in the 7.0 version, I'm not sure.

Since Netbeans 7, word wrap is available. See this blog for directions:
Netbeans & Wordwarp

As Daniel says, after Netbeans 7 this is possible. Just go to your NetBeans options and select the editor tab. In languages (dropdown) selection choose "all languages". Then you will see the option Line Wrap. Change it to "After Words" or "Anywhere".

Go to toolbar-> option ->Editor(Tab)
view this picture..
soft wrap in netbean
select your line wrap 'after words' .
after apply these settings. you will see the code responsive way. you don't need to scroll horizontal to see code.view the picture for resutl.
soft wrap in netbean

Related

Eclipse word wrap line number mismatching

I'm using Texlipse to edit some LaTeX files, so it is very helpful to have the line wrap functionality. The one (the only one I found) I'm using now is Eclipse word-wrap plugin. However, the line numbers do not show correctly with this plugin.
How can I fix it?
Unfortunately the Word-Wrap plugin has this problem, as is stated at the bottom of the page you link to. There is no way around it.
This plug-in is only a quick hack to switch on the word wrap functionality of the text box widget that the Eclipse editors are build on top of, not a solid solution to the problem. Eclipse is not good with texts that need word wrap.
As Google led me here first - I will provide an update on this 2 year old question:
This issue has been solved in another plugin which is based on word-wrap:
Eclipse Word-Wrap Plug-In
Additional remark: After the installation it might be needed to run eclipse with the "- clean" parameter to enable the LineNumbering fix (mentioned here)

all spaces replaced by tabs when ctrl+shift+f

working in eclipse,when I type 'tab',it insert 4 spaces,it works well.but after ctrl +shift +f to format,all the 4 space will been replaced by tabs.how to stop it?
Window->Preferences->Java->Code Style->Formatter: Edit Active profile->Indentation->Tab Policy: Select Spaces
You can't change the default profiles so you must provide a new profile name, then press the Apply button, then the Okay button. It may help to press the Apply button once you have returned to the Formatter screen. Go back and look at the Tab Policy again to verify that your changes were saved.
Including the above suggestions, I recommend searching for code style or style to get to the coding standard being applied with the user requests formatting of the code. It is possible that the code style uses tabs instead of spaces.
The only way that currently works is to use Ctrl-A Ctrl-X Ctrl-V on all code after using Ctrl-Shift-F. This will replace all tabs with spaces.
Don't know which version of Eclipse you are using but for
Eclipse 3.6 (for example) you may go to
Window->Preferences->General->Editors->Text Editors->Insert spaces for tabs
This will change Eclipse to use spaces instead of tabs
The place in the Preferences may be different depending on which version of Eclipse you use. If you load the preferences window you can use the search function there to find "Formatters" and set your preferences for different types of files, or generally.

How to replace Eclipse search dialog?

Is it possible to replace Eclipse search dialog to something more convenient, like the search dialog in Firefox or Chrome? The default one doesn't support F3 to search for the next match, it doesn't move itself away if the match is underneath the box and doesn't allow to highlight all the matches - and these are the features I really miss...
I don't think you can replace the Find dialog easily. You would probable need to (re-)write parts of Eclipse. Definitely doable, but not a small task...
That said, most of your problems can probably be addressed by the current dialog:
The default one doesn't support F3 to search for the next match
"search next match" is Ctrl-K by default. You can configure the keybindings under "Preferences / General / Keys": change the keybinding for "Find Next".
it doesn't move itself away if the match is underneath the box
Yes, that would be nifty. The dialog does however remember where you last put it, so just put it somewhere out of the way (e.g. over the package browser, or to the right), and it will stay there.
and doesn't allow to highlight all the matches
This is not yet available (though it has been discussed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692 ). There are however two ways of getting a similar result:
Use the search function from the toolbar ("File Search" from the "torch" button). If you search there, it will highlight all matches in the editor (and provide marks in the editor ruler, and a list in the search view).
For Java elements, activate "Mark Occurences" ("highlight pen" button). This will highlight all occurences of a Java element if you mark in in the editor.
Maybe one of these will help you.
Finally, you can just open any file in an external editor (like (g)vim or Notepad++) right from inside Eclipse (right-click -> Open with). Then you can use any editor you want...
While it may not be exactely what you want, have you ever used the incremental search (Ctrl + J)? In my opinion it is much more convenient than the standard search.
A newer alternative is InstaSearch.
Information:
InstaSearch is an Eclipse plug-in for doing fast text search in the workspace. The search is performed instantly as-you-type and resulting files are displayed in an Eclipse view. It is a lightweight plug-in based on Apache Lucene search engine.
Each file then can be previewed using few most matching and relevant lines. A double-click on the match leads to the matching line in the file.
The "search the next match" is Ctrl-K. Previous is also available, see the "Edit" menu...
Only the highlight feature does not seem to be present. You might need a plugin for that (everythinhg is possible with plugins).
There was a Summer of Code project to implement a Firefox like search in Eclipse in 2007.
This is the official page, and this Blog shows a promising screenshot.
I never tried to install it, and I didn't find a final release or something though :(
SearchTab is an Eclipse plugin that shows a Firefox-like search tab
You do this by changing the key bindings under Preferences -> General -> Keys

Display Eclipse tabs on several lines

I'm using eclipse galileo. Is it possible to display the tabs of my open files on several lines instead of using the >> sign. I still want a unique window to view the code though.
If there is no such settings, do any plugin exists ?
No.
Bug 58945: CTabFolder should support multi row and vertical style options, opened since 2004! (other bugs exist on the same topic)
(Update Feb. 2017: it seems to be assigned, with Oxygen 4.7 as target!
Thank you specializt for mentioning that in the comments)
CTRL+F6 is one workaround for now.
Other "workarounds" are listed in this thread:
turn on the "close editors automatically" option (preferences > General > editors), which will close editors automatically when the limit is reached an a new editor is to be opened.
make use of multiple windows each with a set of editors for areas you are editing or browsing or searching
CTRL+Shift+W to close all tabs quickly
As mention by Big Chair in the comments:
Someone made a workaround here: "Eclipse multiple tab rows"
Wes explains:
I've discovered that while it is true that you cannot have multiple rows of tabs for the same code-space, it is possible to have multiple rows of tabs showing on your window at the same time:
To accomplish this, simply drag a tab up to your title bar and release. It will create another row of tabs.
ctrl+shift+e gives a nice dialog with all open windows.
ctrl+e gives the "quick" version of this dialog.
I found this plugin, which lists all open windows in a separate tab, and lets you open windows with a single click:
http://sourceforge.net/projects/editorviewer/
As far as I know, there is neither such setting nor plug-in (at least freely available). But if there is, I'd like to be corrected.
The Open-Editor plugin does it. But it has issue.

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with PyDev.
EditBox since v0.0.20 is fixed for support Pydev. Thanks for reporting this. Some default preferences for Python included now, but you are welcomed to share yours here.
This can be achieved this is EditBox.
With some customization through it's preferences you can get to some nice code blocks highlighting of python code (or any other where blocks are signified with whitespace).
It is highly customizable and can achieve the vertical rules codekana style, and various other layouts.
The problem is it doesn't work on PyDev editor from what I see (at least for now). I've opened a feature request for it.
If it's any good, you can still view it's layout when opening a python file with right click "Open With/Text editor". From version 0.20, EditBox fully supports PyDev.
I also tried AnyEdit which has some whitespace highlighting amongst other features, but was not too happy with the results. For example, I had to press they're "show whitespace" button after each change to show the background, and it's not very visually pleasing (it uses eclipse's annotations to highlight whitespace).
IndentGuide is a plugin that does this for Eclipse. I am not sure whether it works for PyDev though.
The closest approximation would be to combine:
showing the whitespace characters (which shows tabs and spaces, but not just tabs)
code folding (available with PyDev)