Eclipse: I turned on hidden characters now I can't turn off - eclipse

Somehow I've turned on hidden characters in Eclipse. It's not the "whitespace" characters in the general editor preferences. When turned on, it adds another layer of hidden characters over the existing ones.
Then I have things like
\r\n
Does anyone know what these are and how to remove them?

It is under Preferences > General > Editors > Text Editors. There is a checkbox labeled "Show whitespace characters". If you uncheck this the editor switches back to normal.
If you click on the link (whitespace characters) (<= v3.6) or (configure visibility) (>= v3.7) in this line you will get a popup window, in which you can define which characters eclipse is supposed to consider as whitespace characters.
In this popup window you also get the option to define the transparency in which each whitespace character is displayed in the editor, which you can use to (indirectly) change their foreground colour. I'm just mentioning it here, because it took me about half an hour to find this setting! ;-)

There is a toggle button 'Show Whitespace Chars' on the Eclipse toolbar

A great tip about using 'quick access' from eclipse forum:
CTRL+3 swc
Allows to turn them on and off

The right shortcut is Ctrl + N
UPDATE From Eclipse 3.7 version, something is changed... Now you have to go to:
Window > Preferences > General > Editors > Text Editors

CTRL + . does the job.

For Aptana Users
To toggle hidden characters in Aptana on and off, use the following keyboard shortcut:
Ctrl+Alt+W

I am using Eclipse Oxygen and can see this option to toggle whitespace characters:

It is actually in two places...
Sandkastenliga points out the obvious one, but you can also show white space with a shortcut key combination. The key combination is separate from the text editor preferences and will superimpose additional characters when active (it uses \r and \n for carriage return an line feed respectively instead of the symbols used by the text editor preference.)
Go to preferences > general > keys and look for the binding for the 'Show Whitespace' command.
I have the text editor preference turned on, so I removed the binding for this command altogether (it was set to Ctrl+. in my profile) to prevent accidental activation as it doesn't affect the other preference.

Go to Window > Preferences > General > Editors > Text Editors
Uncheck the "Show whitespace characters" option on the right side of the page, then click "Apply" at the bottom of the page.

Since this is not a standard setting, it could be the result of one of your extra plugin.
Did you try starting your eclipse with the -clean parameter?
Do you reproduce the issue with a fresh Eclipse installation?

Go to Preferences > General > Editors > Text Editors and restore defaults.

I have done this several times by accidentally hitting some keystrokes.
If you go to Windows/Preferences/General/Keys you will see all the keyboard shortcuts you have.
Mine is set to Control + .
I had to place my cursor inside the document and do it a couple of times to make it work because there is also a keyboard shortcut for Control +
Hope that helps.

You can add "Show Whitespace Characters" button in toolbar by customizing your perspective.
It also contains buttons to toggle word wrap, and toggle selection mode.
Go to Window > Perspective > Customize Perspective > Action Set Availability, then select "Editor Presentation" action set:
This works in Eclipse Neon.
You can also add a key binding for this action.
Go to Preferences > General > Keys > "Show Whitespace Characters"

Sorry this is a bit vague but it's a while since i used Eclipse and i do not have it installed. I think this is it ..... in one of the menus you will find the Eclipse settings, there are two set's of settings, current project and overall Eclipse, you mat need to check them both. In there are various menus in tree form that allow you control the actions and look and feel. But some of them are nested so there is an overall control but some packages have their own options in a sub menu set. The menu's will expand when you click them and i'm afraid you need to walk through them all.

Eclipse > Preference > General > Editors > Text Editors > Show WhiteSpace characters.

Related

Aptana tab indentation guides

I recently moved from geany to Aptana as I'm working on some bigger projects and felt I would benefit from a full IDE.
One feature I'm really missing is the little grey line every four spaces to help me maintain indentation consistency. Does anything like this exist for Aptana/Eclipse?
get the PDT tools Indent Guide plugin
Under
Preferences -> General -> Editor -> Texteditor you can activate "Show whitespace characters". If you click on "whitespace characters", you can define, which character should be displayed. Here you can active "Tabs". It's not as good as the lines from Notepad++, but better than nothing.
You can set a print margin indicator (vertical line) in Preferences > General > Editors > Text Editors - but this would only be a single line. You could use tabs instead of spaces - there are options to insert spaces when you use the Tab key. In this same menu, you can choose to show whitespace characters, which will help keep your spacing in order. I don't know of any grid options.

How do I turn off Tab and New Line markers in Eclipse?

I am using Adobe's ColdFusion Builder, an Eclipse-based IDE built on top of Aptana.
All of a sudden, I am getting a type of whitespace marker showing in my Eclipse Editor. I must have accidentally hit a key combination.
Here is a screen dump.
I have already tried "General > Editors > Text Editors > Show whitespace characters" and it is not this. I already have show whitespace characters turned off. If I turn it on, then the Whitespace Characters display over the top of what I am already seeing.
Can anyone tell me how this can be turned off? Most annoying.
Many Thanks
It's under Preferences -> General -> Editors -> Text Editors
Just uncheck 'Show Whitespace Characters':
Did you try Restarting Eclipse? If that didn't work, you might try this http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka11640.html which explains which file to delete to force eclipse to revert to use default settings.
I have done this several times by accidentally hitting some keystrokes.
If you go to Windows/Preferences/General/Keys you will see all the keyboard shortcuts you have.
Mine is set to Control + .
(that's a period by the way) I had to place my cursor inside the document and do it a couple of times to make it work because there is also a keyboard shortcut for Control +
On a Mac it is Cmd +.
Hope that helps.

Cannot highlight all occurrences of a selected word in Eclipse

I tried using the Toggle mark occurrences (Alt + Shift + O) button and also in Preferences -> General -> Editors -> Text Editor -> Annotations and setting the C/C++ Occurrences and C/C++ Write occurrences. But still when I select a word it won't highlight all occurrences of that specific word.
What I am using is Eclipse Indigo Service Release 2 in XP, with a C++ project.
You can try to activate Toggle Mark Occurrences with icon on Toolbar:
Preferences --> Java --> Editor --> Mark Occurrences
In General > Editors > Text Editors > Annotations
Check out options that are checked in Preferences -> Java -> Editor -> Mark occurrences. Then restart Eclipse.
Find the Preferences under Window,
In General > Editors > Text Editors > Annotations(1)
(5) is to select the color and press apply.
The standard "Mark Occurrences" functionality included in Eclipse that everyone recommends only highlights identifiers in editors of whatever language. For example, it won't highlight int in C editors, and it won't help at all in the Console pane.
So if you want to highlight ALL occurrences on ANY word in ANY Eclipse pane (kinda like Notepad++ does), try the Glance plug-in for Eclipse.
As of November 2017 Glance works for Eclipse Neon and Oxygen. There was a period of time in which Neon was unsupported, and a fork appeared, but it seems unnecessary now (and abandoned).
There are two ways to highlight all occurences. First is using Eclipse options, which is not very reliable, because in many versions of Eclipse it is not supported.
Second is using a plugin called Glance which is available in Eclipse marketplace. This is supereasy and effective.
First Method
In the toolbar, there is button for Toggling Mark Occurrences. So, once you selected the text/word whose occurences you wish to highlight, then click this toggle button.
Let's say this step doesn't work for you. Then, Follow this step:
Goto: Window ==> Preferences ==> General ==> Editors ==> Text Editors ==> Annotations ==> On right Annotations types box: Occurrences ==> Select all check boxes.
You can also go to Window ==> Preferences ==> Java ==> Editor==> Mark Occurrences ==> Check all the checkboxes.
Restart Eclipse and check if highlighting works.
If still doesn't work, then Go to Second Method
Second Method
From Eclipse marketplace, install Glance. Once installed, restart Eclipse.
Now select any word in your eclipse editor
Move focus to component where you want to search
Open Glance using Ctrl + Cmd + F shortcut on Mac or Ctrl + Alt + F on other platforms
Enter text you want to search
Use Enter or **Shift + Enter** to find next/previous match
Close search box using Esc
You can also customize Glance from Window ==> Preferences ==> Glance
For Eclipse Mars:
Window --> Preferences --> Check (Mark occurrences of the selected element in the current file.)
As shown if figure:
Go
Java> Editor > Mark Occurrences
Uncheck "Keep Marks when the section changes" then click Ok
Restart Eclipse.
This work for me.
If you go into the window-prefrences, select the language you want/are working with. Select the editor under this specific language and then there is a mark occurrences there that has some options. Where it says keep marks when the selection changes, for me this was checked. When I unchecked it the system started highlighting correctly.
For folks who are using a dark background with light font colors, you may want to check out the highlight color in Preferences -> General -> Editors -> Text Editor -> Annotations. Mine was defaulted to black, which does not stand out on a black background.
Glance does not work anymore, but in current Eclipse Versions (Eclipse 2020) you can
highlight any word by selecting the word and pressing CTRL+F. The word is now highlighted. In the small search input, you can toggle 'match whole word' and case sensitivity.
I'd like to complement the other answers - which work in Java editor only or require plugins - with a way to highlight all occurrences of any text (not just a word or identifier) in any editor of text files (e.g. SQL, CSV, HTML, TXT, Java, etc ...).
There is a standard/built in command called Find Text in File (under Window -> Preferences -> Keys)
By default it has no keyboard shortcut assigned. Simply give it a shortcut (e.g. Ctrl+Alt+S) select some text (not necessarily a word) and it will find and highlight all occurrences of that selected text.
It can also be invoked from the menu as Search -> Text -> File.
Enjoy 🙂
Click the word and hold until a popup appears as shown in the figure.
On the popup, there is a little right arrow, after clicking it, a new icon shows up.
Click that link to open preferences.
Once in preferences, select C/C++ Occurrences (it will be language specific) and select Include in next/previous navigation with Text as Highlighted.
This should enable the feature of highlighting all occurences of the selected word in the opened file.

How to collapse blocks of code in Eclipse?

Some days ago my Eclipse was working fine and a +/- appeared in every block that could be collapsed (functions, classes, etc.)... but now it does appear, and I don't know how to activate that feature again.
It's Eclipse Helios, running on a Gentoo Linux box.
Preferences -> C++ -> Editor -> Folding ?
Make a right click in the editor window and go to preferences there, then only the editor-relevant section of the preferences dialog will appear. This works for JDT, CDT etc...
You can do ( Ctrl + Numpad_Divide ) to enable folding.
Also if you Right Click on the area where the + or - was supposed to be, you can see there is a folding option.
Try this option: Preferences > Java > Editor > Folding > Enable folding
To collapse all code blocks
Ctrl + Shift+ /
To expand all code blocks
Ctrl + Shift+ *
pydev:
To collapse all code blocks :
Ctrl + 0
To collapse all code blocks :
Ctrl + 9
Is there a way to collapse all code blocks in Eclipse?
by #partizanos and #bummi
For Python it is as follows:
collapse all 1 level: Ctrl+9
expand all 1 level: Ctrl+0
collapse current: Ctrl+-
expand current: Ctrl++
Hope that helps.
In Preferences, you'll find General > Keys. It's for setting your keyboard shortcuts.
What I use it for more often, though, is to find stuff in Eclipse. You should see an input box labelled "type filter text." It's as close as Eclipse comes to a search feature for every Eclipse command.
I assume you are using Java, but look under the settings for your particular language.
Under the Window menu, select Preferences.
Under Java->Editor->Folding. Select "Enable Folding".
If you want folding an all your editors, I found you can enable Folding in
Preferences > Editors > Structured Text Editors
Enable Folding
For windows eclipse using java: Windows -> Preferences -> Java -> Editor -> Folding
Unfortunately this will not allow for collapsing code, however if it turns off you can re-enable it to get rid of long comments and imports.
Here you go!
Right Click on + button appeared on numbering strip on left most side --> Folding --> Expand All
Right Click on + button appeared on numbering strip on left most side --> Folding --> Collapse All
This way you can expand and collapse all the methods on the file.
Plus Buttons on numbering strip
Context Menu:
Context Menu
In CFEclipse:
Preferences > CFEclipse > Editor > Code Folding > Initially Collapse column, you can uncheck to see all expanded when opening, or check all boxes to close all when opening a file.
I was using salesforce apex classes with Eclipse Neon 3.3 for Java. I found an option "define folding region" on right click in the editor, I selected the block of code i wanted to collapse and selected this property for that code. Now I am seeing + and - symbol to expand and collapse that block of code

Eclipse shortcut CTRL+M behavior

In eclipse we have the ctrl+m shortcut for maximizing windows.
But when you have two editors opened side by side, it maximizes both editors.
Is there anyway to change the default behavior of ctrl+m so it only maximizes one window?
(Personally this is the behavior i need 9 out of 10 times using ctrl+m)
Thanks.
you can enable this by changing your presentation preference. normally maximizing single editors is not possible (since 3.2 the maximize action is only available for views and the complete editor area, you can't maximize a single editor)
but how to change the presentation then?
click Window -> Preferences
in the preferences goto General -> Appearance, and the change the 'current presentation' to 'Eclipse 2.1 Style Presentation' or 'Classic' and restart eclipse. now you can maximize the editors on their own.
I don't want to change my eclipse' appearance into classic since I used to be with Dark.
So what I do is change the shortcut keys on "Preferences > General > Keys". You can define whatever you want from here.