Eclipse highlighting the same occurrence of the word
EclipseEclipse PluginSyntax HighlightingEclipse Problem Overview
In Notepad++ , it has a very nice feature that if I select a word , it will highlight all the same words throughout the text . Added to this , I can set the hot-keys to highlight up to five different words with different styles (See the effect below) .
Is there any ways /plug-ins to get this similar effect in eclipse ? I know when editing Java , it will highlight all the same variables ,but it will not work when I highlight the comments and editing other files type (e.g. xml, html, js, css and etc).
Eclipse Solutions
Solution 1 - Eclipse
I've been working with Eclipse for quite a while and I'm pretty certain that there is no canonical way of doing this.
In Eclipse these things are managed on a per-editor basis and the Java editor does not support what your looking for for all I know. At least for the Java editor you can do some minor configuration in what is highlighted and how (Preferences > Java > Editor > Mark Occurrences
), but I guess you already know that.
As for plugins, I'm not aware of any plugin that achieves what you're looking for. As a matter of fact I'd be surprised if there really was a plugin which achieves what you're looking for.
If something comes up I'd much appreciate you sharing it here, I've been trying to get decent highlighting into Eclipse for years unsuccessfully... :)
Solution 2 - Eclipse
Here is a plugin for eclipse: http://ystrot.github.io/glance/
It highlights all occurrences as with notepad++ upon hitting Ctrl + Alt + F.
Solution 3 - Eclipse
If you enable "Mark Occurrences" , then all words that are the same as the one you have marked will be highlighted.
You can enable it in two following ways
-
Alt + Shift + O
-
Preferences > Java > Editor > Mark Occurrences
Solution 4 - Eclipse
Below is what I found works for me but you can also assign a key shortcut to 'Find Text in File':
- Select the word or section of text
- Press
CTR+3
to activate 'Quick Access' search - Type 'Find Text in File'
- Execute
As mentioned by @Kislingk you can modify how the words are highlighted/marked in 'Preferences > General >Editors>Text Editors > Annotations'.
Solution 5 - Eclipse
Here is the closest solution I have found:
-
Create a shortcut in Preferences/General/Keys type in the search field: "Find Text in File" By default it has nothing assigned so just assign your key binding to it.
-
Annotations can help with displaying it in the sidebar
Solution 6 - Eclipse
Use file search to search selected resource can highlight same word in single file.
Solution 7 - Eclipse
Another useful eclipse plugin is eclipse instasearch. It has extensive feature set. This is also available in eclipse marketplace.
Solution 8 - Eclipse
There are other options needed to enable.(Preferences > General >Editors>Text Editors > Annotations). Find Occurrences and WriteOccurrences and enable Text as 'Hightlight'
Solution 9 - Eclipse
Have tried all of the above answer, but all not working. At the end, i found that it's due to i have accidentally remove some of the JRE System Library, after add back, it's work correctly
Solution 10 - Eclipse
Window > Preferences > Java > Editor > Mark Occurrences