You can try to activate Toggle Mark Occurrences with icon on Toolbar:
- 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
- Once in
C/C++ Occurrences(it will be language specific) and select
Include in next/previous navigationwith
Text as Highlighted.
This should enable the feature of highlighting all occurences of the selected word in the opened file.
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.
Java> Editor > Mark Occurrences
Uncheck "Keep Marks when the section changes" then click Ok
This work for me.
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.
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:
Text Editors ==>
Annotations ==> On right Annotations types box:
Occurrences ==> Select all check boxes.
Restart Eclipse and check if highlighting works. If still doesn't work, then Go to 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 + Fshortcut on Mac or
Ctrl + Alt + Fon other platforms
- Enter text you want to search
**Shift + Enter**to find next/previous match
- Close search box using
EscYou can also customize Glance from
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).
Check out options that are checked in Preferences -> Java -> Editor -> Mark occurrences. Then restart Eclipse.
General > Editors > Text Editors > Annotations
Preferences --> Java --> Editor --> Mark Occurrences
- Cannot highlight all occurrences of a selected word in Eclipse
- How to select all the occurrences of a word in Eclipse
- Eclipse 3.7 (Indigo) + Tomcat7 --- Cannot create a server using the selected type
- Find all occurrences of a function in Eclipse
- Eclipse cannot create runnable jar - No resources selected
- Where to change highlight color for selected occurrences in Eclipse?
- Highlighting all occurrences of a search string in Eclipse Java editor
- Eclipse mark occurrences doesn't mark all occurrences
- Cannot find button "Show Selected Element only" Eclipse Java EE
- eclipse coloring : what is the pref item for background color of all occurrences of selection
- eclipse - Cannot resolve selected text to a defined function or member
- eclipse rcp e4: how to highlight the selected tab in part stack?
- Eclipse hotkey that word wraps all my code?
- How to highlight function in all project with Eclipse (C/C++) by default?
- Eclipse mark occurrences Scala doesn't work at all
- Eclipse shortcut to select or remove all spaces up to (but excluding) the next word
- cannot paste clipboard contents into selected elements Eclipse
- Eclipse - Extract local variable replace all occurrences only in scope
- Method/Symbol cannot be resolved doesn't highlight in Eclipse C
- Make eclipse to highlight every other instances of selected text ? (like notepad++)
- Eclipse highlight all changes since revision X
- How to highlight specific word in Eclipse
- How do you make Eclipse not edit all the occurrences found by "Find Next"?
- cannot retrieve the selected java filename/path in eclipse plugin
- Eclipse Neon 2, "No local history available for selected resource" for all files
- Spell Check All of the Same Word In Eclipse
- How to shade all occurrences of highlighted word in custom editor plugin
- is it possible to commit all selected projects from Eclipse to one github repository
- Eclipse says: “Workspace in use or cannot be created, chose a different one.” How do I unlock a workspace?
- Eclipse doesn't highlight references anymore
More Query from same tag
- Eclipse outgoing changes asterisk icon
- Error connecting LG nexus 4 to Eclipse
- Eclipse Android Emulator loads slow?
- Recover GIT delete Eclipse
- m2eclipse imported project naming
- Prompt from Spinner is not showing the items
- Use groovy plugin and jboss tool simultaneously in eclipse
- Comparable error
- Eclipse: Nested Editor Tabs?
- eclipse: Do not show references from binary types in call hierarchy
- ANTLR4 Swift grammar cannot identify a for-in statement
- Using Android project with Team Foundation Server 2010 and branching. Is there a simpler way?
- Java - Create a web service from an available class
- Add SWT dependency to POM
- Eclipse color does not change
- What is the meaning of pull strategy when creating a branch with egit?
- Plugin execution not covered by lifecycle configuration AppEngine
- context.xml duplicate attribute uses with the same name and target namespace
- JAVA and JAVAX core imports for Web Services with Android
- Issue with Proguard
- logback.xml not scanned anew
- How do I load/unload a Linux kernel module with a Java Program?
- Trouble following the HelloWorld instructions in Eclipse IDE with Java
- Eclipse multi-line indent uses tabs instead of spaces (pydev)
- Associating existing Eclipse project with existing SVN repository
- Cassandra Eclipse Maven Project
- Eclipse LibGdx GPGS
- What is org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER and how do I make it work in IntelliJ?
- Eclipse: Cannot run program "make" (in directory "[path is given]")
- Eclipse : Whether to select Local Or Shared File during Remote Debugging