siva636
siva636

Reputation: 16441

Highlighting all occurrences of a search string in Eclipse Java editor

If you search for a String in Netbeans Java editor, it automatically highlights all occurrences of that string.

But, how can I achieve this feature in Eclipse?

(I checked Preferences > Java > Editor > Mark Occurrences, but it seems it is only for similar variables methods etc. but not for for search matches)

Upvotes: 16

Views: 13209

Answers (3)

Sam Su
Sam Su

Reputation: 6822

Have you tried the Glance plugin for Eclipse? fully meet your requirements and even with more features.

demo and Github of this project: http://ystrot.github.io/glance/


UPDATE: available in Eclipse marketplace

http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=1012

Upvotes: 17

Sairam Krish
Sairam Krish

Reputation: 11661

eclipse instasearch plugin is a very useful plugin for search needs inside eclipse. It is based on lucene. This is also available in eclipse marketplace.

It has extensive feature set.

  • Instantly shows search results
  • Shows a preview using relevant lines
  • Periodically updates the index
  • Matches partial words (e.g. case in CamelCase)
  • Opens and highlights matches in files
  • Searches JAR source attachments
  • Supports filtering by extension/project/working set

Upvotes: 4

Sstx
Sstx

Reputation: 604

You can enable "Toggle Mark Occurrences" (shortkey is ALT+SHIFT+O).

For the color of the select text,you can:

Window->Preferences->General->Editors->Text Editors->Annotations->Occurrences

Hope it useful.

Upvotes: 8

Related Questions