Eclipse: I turned on hidden characters now I can&#

2019-01-07 12:53发布

问题:

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?

回答1:

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 "whitespace characters" link 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! ;-)



回答2:

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



回答3:

A great tip about using 'quick access' from eclipse forum:

CTRL+3 swc

Allows to turn them on and off



回答4:

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



回答5:

CTRL + . does the job.



回答6:

For Aptana Users

To toggle hidden characters in Aptana on and off, use the following keyboard shortcut:

Ctrl+Alt+W



回答7:

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.



回答8:

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.



回答9:

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?


回答10:

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



回答11:

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.



回答12:

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



回答13:

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.



回答14:

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



标签: eclipse