Search code examples
eclipseeclipse-cdt

Eclipse find all in one file


In Eclipse (CDT), is there a way to find all occurrences of a string in a single file? I can search the entire workspace easily enough using Ctrl-H, and can do "find-next" using Ctrl-F, but I want to be able to see a list of all matches for just one file.

It would be possible to do by setting up a custom file filter for each file I want to search, but that's very clunky. Eclipse should be able to work out which file I have open and just search that file.

This seems like it should be easy, but I can't find an appropriate option...does it exist?


Solution

  • Use CTRL+H and switch to File Search as you already mentioned, but set Scope to Selected resources. Now you can either search the current file, or selected multiple files and search all of them