在 Eclipse 工作区中搜索字符串

如何在完整的 Eclipse 工作区中搜索字符串? 我无法在 Eclipse 工作区中找到文本,但是我无法在工作区中找到指定的字符串。

137919 次浏览

At the top level menus, select 'Search' -> 'File Search' Then near the bottom (in the scope) there is a choice to select the entire workspace.

For your "File search has encountered a problem", you need to refresh the files in your workspace, in the Project/Package Explorer, right click and select "Refresh" at any level (project, folder, file). This will sync your workspace with the underlying file system and prevent the problem.

Goto Search->File

You will get an window, you can give either simple search text or regx pattern. Once you enter your search keyword click Search and make sure that Scope is Workspace.

You may use this for Replace as well.

Ctrl+ H, Select "File Search", indicate the "file name pattern", for example *.xml or *.java. And then select the scope "Workspace"

Press Ctrl + H, should bring up the search that will include options to search via project, directory, etc.

Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.

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

A lot of answers only explain how to do the search.

To view the results look for a search tab (normally docked at the bottom of the screen):

Eclipse does not search if the "File name patterns" field is empty.
So, if you want to search some text, write within "Containing text" field and leave
by default "File name patterns" with asterisk (*).

enter image description here

Press Ctrl+shift+L and type your string

For Mac:

Quick Text Search: Shift + Cmd + L

enter image description here

All other search (like File Search, Git Search, Java Search etc): Ctrl + H

enter image description here

In your Eclipse editor screen, try Control + Shift + R buttons.