how to hide the text limit line in netbeans 6.5? - netbeans

Is there a way to hide the text limit line in netbeans 6.5?

In NetBeans 6.9, setting Right Margin to 0 effectively hides the text limit line.
Set the value in Preferences > Editor > Formatting > All Languages > Right Margin.
(Mac OS X 10.6.4, NetBeans 6.9)

line is not moving to 200 column, but you can hide it setting its color to same as the background

You can set it to 0. So It will not be visible.

Are you talking about the line running thru the right side, by default at the 80 column point? That is Options -> Editor -> Indentation -> Right margin. I have it set at 200 columns which pushes it off the right side of the screen.

Hi~ I found out how to hide "Text limit line" :)
Tools -> Options -> Export(Popup Win) -> Browse.. (Select target "ccc.zip" file)
Select Options for Export : Check at "Editor" -> OK
Edit xml file "\Editors\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml" in "ccc.zip" file.
<entry javaType="java.lang.Boolean" name="text-limit-line-visible" xml:space="preserve">
<value><![CDATA[false]]></value></entry>
Tools -> Options -> Import "ccc.zip" file
Done

As for now (October '18) in NetBeans 8.2 + 9 you can hide the text limit line or actually change its color by going to Options -> Fonts & Colors -> Highlighting -> Text Limit Line -> Foreground

Remember to go to tools, options, fonts & colors, highlighting tab, text limit line selected before exporting ccp.zip....

There is an easy way to disable the warning generated by NetBeans for number of lines.
Goto Tools > Options > Editor > Hints
Find the checkbox Too Many Lines > un-check the checkbox
and click Apply.
Enjoy :)

Have you tried to see if your project properties have formatting that overwrites the global properties?
See below:
https://bz.apache.org/netbeans/show_bug.cgi?id=223329

Related

Eclipse won't acknowledge print margin column setting

In Eclipse 4.6.2, I tried to put a print margin indicator line at 80 characters using Preferences -> General -> Editors -> Text Editors -> [Checkbox] Show Print Margin. However, no matter what value I put in the Print Margin Column box, the line stays at column 120.
I'm certain the line I'm looking at is the Print Margin, because I can change its color in the same Preferences page. I've hit Apply and restarted Eclipse, but no luck.
Welcome to bug 468307, where your maximum line wrapping length is what matters.
2020-12-04:
I'm on eclipse-CDT version 2020-06 and the bug is still not fixed IMO.
the workaround is to modify the "Maximum line width" for your language
for example in C++: File --> Window --> Preferences --> C/C++ --> Code Style --> Formatter --> Edit --> Line Wrapping --> Line width and indentation levels --> click the "Maximum line width" textedit widget and modify the value to 80 or 100 or your desired value --> click "ok" (if your "ok" button is gray then read [gotcha-1] footnote)
other languages like Java require modifying the same "Maximum line width" but getting there might be different in the GUI
[gotcha-1]
gotcha: if the "ok" button is gray then you have to edit the "Profile name:" because it does not let you override a default profile.
For the other newcomers here, the line wrapping bug mentioned by #nitind can be solved at:
Preferences -> Language (i.e. C/C++, Java) -> Code Style -> Formatter -> Edit (or create new of your own) -> Line Wrapping (tab) -> Maximum line width

Where to change highlight color for selected occurrences in Eclipse?

When a method or variable is selected it is highlighted in Eclipse with some color. Can anyone advice where to change that color? I'm working under Windows OS.
I've found where to change it:
Preferences -> General -> Editors -> Text Editors -> Annotations
and there you have to change both "Occurrences" and "Write occurrences".
Preferences -> General -> Editors -> Text Editors
Current Line Highlight
I think you want the above
else
Preferences -> Java -> Editor -> Syntax Coloring
Element -> Java -> Method or Variable
Check Enable and select color
This has made me mad for about half an hour.
If the issue appears in JavaScript files, the option is under Preferences -> General -> Editors -> Text Editors -> Annotations and in the Annotation types choose JavaScript Occurences. Mine was set to black, nasty little thing took me too long to fix.
If you're using eclipse with PHP package and want to change highlighted colour then there is slight difference to above answer.
Right click on highlighted word
Select 'Preferences'
Go to General > Editors > Text Editors > Annotations. Now look for "PHP elements 'read' occurrences" and "PHP elements 'write' occurrences". You can select your desired colour there.

How to customize Eclipse's text editor code formatting

How can I set my Eclipse's code formatter to allow code rows longer than 80 characters. I know that very long lines is hard to read but in my opinion 80 characters per line is very small value for wide screen monitors.
In Preferences, go to Java > Code Style > Formatter and edit/create the formatter and go to tab Line Wrapping. There in you can set the Maximum line width.
Further on you can in General > Editors > Text Editors also set the Print margin column which should shift up that margin (a 1px wide vertical line in the right side of your code) to the desired position. This however doesn't affect the formatter, only the human eye.
This answer was a bit old, and the path have changed with new versions of Eclipse.
To set the Maximum line width, go to Project > Properties. In the Properties window, go to Java Code Style > Formatter. Select your Active Profile (let the one which is already selected, this is the one you are currently using) and click on Edit. In the tab Line Wrapping, you can set the Maximum line width (80 by default). You can also go to the tab Comments and uncheck Enable Line Comment Formatting if you want your comments not to be formatted on multiple lines with Ctrl+Shift+F.
Don't forget to change the name of the Profile Name; if you don't change it, you won't be able to save your changes (provided the one you are editing is Built-In
Also, you can set the Print margin column in Window > Preferences > General > Editors > Text Editors.
Regarding the "small" value (80), this has just changed (in August 2014).
See "Eclipse is not a terminal anymore – Default line size of Java code formatter is now 120"
(By Lars Vogel)
Project > Properties, Java Code Style > Formatter.
Edit tab Line Wrapping
A three-years old issue is finally addressed:
bug 356851: Default line size of Java code formatter should be increased to 120
It is not mentioned in the Eclipse Project 4.5 (Mars) M1 - New and Noteworthy, but it is still "Verified for 4.5 M1 using I20140804-2000 build".

How can I configure NetBeans to insert tabs instead of a bunch of spaces?

When I hit Tab for indenting code, I like to get a real tab. Meaning that when I select that, I only have one large thing selected. NetBeans inserts 5 spaces instead of a tab when I hit Tab. Is there a way I can change that?
Go to Tools-> Options-> Editor-> Formatting and uncheck Expand tabs to spaces:
Ensure you also pick coherent values for "Number of Spaces per indent" and "Tab Size".
Additionally, you can check all the items in the Language combo and make sure they all use the general setting.
You can also change it in a per-project fashion. Right click on the project icon, select Properties and review the Formatting category.
These menu items remain valid as of NetBeans 8.0.
It seems to work if you select the same value for "Number of Spaces per Indent" and "Tab Size", after unchecking the "Expand Tabs to Spaces" Option, in Tools -> Options -> Editor -> Formatting, for example:
[ ] Expand Tabs to Spaces
Number of Spaces per Indent: [ 4]
Tab Size: [ 4]
....
For NetBeans 7.1.2,
I needed to go to Tools -> Options -> Editor -> Expand Tabs to Spaces and uncheck that one (make sure you have "All Languages" selected). And also put an "8" for both Number of Spaces per Indent and Tab Size.
Just having the same value there does not do the trick for me. It must be 8.
In Tools-> Options-> Editor-> Formatting Expand tabs to spaces should be unchecked and Number of Spaces per Indent should be equal with Tab Size. Also check when you change Language from All languages to other there Override Global Options should be unchecked, too.
Netbeans IDE 8.2 (OSX)
Goto File -> Project Properties (Your Project)
Select Formatting in Categories:
Click on Edit global options.
Then Click on Ok
Uncheck : Expand tabs to space.
Click on : Apply
Click On : Ok
If you want set project specific then :
Select : Use project specific options.
Uncheck : Expand tabs to space.
You can also select Language (PHP)
Then Click on Ok

How can I show line numbers in Eclipse?

How can I show line numbers by default in Eclipse?
Window → Preferences → General → Editors → Text Editors → Show line numbers.
Edit: I wrote this long ago but as #ArtOfWarfar and #voidstate mentioned you can now simply:
Right click the gutter and select "Show Line Numbers":
If this doesn't work it may be overridden by your current settings. You can right-click in the bar to the left of the code where line numbers would normally appear and turn them on with the context menu.
Update November 2015:
In Eclipse Mars 4.5.1, line numbers are (annoyingly) turned off by default again. Follow the below instructions to enable it.
Update December 2013:
Lars Vogel just published on his blog:
Line numbers are default in Eclipse SDK Luna (4.4) as of today
(December 10, 2013)
We conducted a user survey if users want to have line numbers activated in text editors in the Eclipse IDE by default.
The response was very clear:
YES : 80.07% (1852 responses)
NO : 19.93% (461 responses)
Total : 2313
Skipped: 15
With Bug 421313, Review - Line number should be activated by default, we enabled it for the Eclipse SDK build, I assume other Eclipse packages will follow.
Update August 2014
Line number default length is now 120 (instead of 80) for Eclipse Mars 4.5M1.
See "How to customize Eclipse's text editor code formating".
Original answer (March 2009)
To really have it by default, you can write a script which ensure, before launching eclipse, that:
[workspace]\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.ui.editors.prefs does contain:
lineNumberRuler=true
(with [workspace] being the root directory of your eclipse workspace)
Then eclipse will be opened with "line numbers shown 'by default' "
Otherwise, you can also type 'CTRL+1' and then "line", which will give you access to the command "Show line numbers"
(that will switch to option "show line numbers" in the text editors part of the option.
Or you can just type "numb" in Windows Preferences to access to the Text Editor part:
Picture from "How to display line numbers in Eclipse" of blog "Mkyong.com"
As simple as that.
Ctrl+F10, then N, to Show or hide line numbers.
Reference : http://www.shortcutworld.com/en/win/Eclipse.html
Slight variation on Mac OSX:
Eclipse → Preferences → General → Editors → Text Editors → Show line numbers
Windows → Preferences → General → Text Editors → Show numberlines
in this file
[workspace].metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.ui.editors.prefs
make sure the parameter
lineNumberColor=0,0,0
is NOT 255,255, 255, which is white
Go to Windows → Preferences → General → Text Editors → Show numberlines. Click OK, then Apply changes. Then it will show the line count automatically.
one of the easy way is using shortcuts like : Ctrl+F10, then press n "it show line number and hide line numbers.
The top answer is good but you can also bind it to a key ( shorcut ) to toggle it..
Window > Preferences > Keys then enter "Line Numbers" in filter and bind it to a key.
I use CTRL + S + L.
Open Eclipse
goto -> Windows -> Preferences -> Editor -> Text Editors -> Show Line No
Tick the Show Line No checkbox
click on window tab and click on preferences
do this and check show line number
the eclipse changes the perferences's position
to eclipse -> perferences
On a Mac do this:
cmd + , or ADT -> Preferences
Expand General -> Editors ->Text Editors
Check box: Show line numbers
Eclipse has a search feature in the top left box of the Preferences.
Type in 'line numbers' in that search box, and presto...
In case you're tired of googling each time you forget...
this will be the appropriate solution for asked question:
String lineNumbers =
AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER;
EditorsUI.getPreferenceStore().setValue(lineNumbers, true);