eclipse 在日食中搜索
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2972705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
searching in eclipse
提问by Maysam Torabi
how can I search something in all files in a given folder in eclipse also how can I search up, it's seems like only going down the document
如何在 Eclipse 中给定文件夹中的所有文件中搜索某些内容以及如何向上搜索,似乎只能向下搜索文档
sometimes I am working on single files, so there is no project defined. I know about the search in project feature
有时我正在处理单个文件,所以没有定义项目。我知道在项目功能中搜索
采纳答案by Julian
If you go to Search>Files... you'll have an advanced search dialogue where you amongst others can specify the scope to search in (all of the workspace, selected resources only etc.). Is this what you're looking for?
如果您转到“搜索”>“文件...”,您将看到一个高级搜索对话框,您可以在其中指定要搜索的范围(所有工作区、仅选定资源等)。这是你要找的吗?
And also, if searching through a single file (+), you have the standard search dialogue where you can specify search direction to either forward or backward.
此外,如果搜索单个文件 (+),您将拥有标准搜索对话框,您可以在其中指定向前或向后的搜索方向。
回答by aioobe
- Search forward in file: Edit -> Incremental Find Next
- Search backward in file: Edit -> Incremental Find Previous
- Search in multiple files: Search -> File -> Containing Text.
- Search files in a specific subdirectory: Select the sub-directory -> Search -> File -> Scope: Selected resources.
- 在文件中向前搜索:编辑 -> 增量查找下一个
- 在文件中向后搜索:编辑 -> 增量查找上一个
- 搜索在多个文件中:搜索- >文件- >包含文字。
- 搜索特定子目录中的文件:选择子目录-> 搜索 -> 文件 -> 范围:选定的资源。
I reccomend that you learn the short-cuts for these tasks. (Key-combination is found right beside the menu-item.)
我建议您学习这些任务的捷径。(组合键位于菜单项旁边。)
回答by Witold Kaczurba
When you are searching "Java Resources" with "File Search" with "Selected resources" checkbox checked - you will not get any results.
当您通过选中“选定资源”复选框的“文件搜索”搜索“Java 资源”时,您将不会得到任何结果。
To search recursively a chosen folder for any files:
要递归搜索所选文件夹中的任何文件:
- Select folder (it has to be folder)
- 选择文件夹(必须是文件夹)
- Select FileSearch with "Selected resources" checked.
- 选择 FileSearch 并选中“Selected resources”。
Good luck
祝你好运
回答by fklappan
Use the Remote Search Feature. Here you can browse for local folders. Some stupid name...
使用远程搜索功能。您可以在此处浏览本地文件夹。一个愚蠢的名字...
回答by Sairam Krish
If default eclipse search is not sufficient for your needs, eclipse instasearch pluginis a very useful plugin for search needs inside eclipse.
如果默认的 eclipse 搜索不足以满足您的需求,eclipse instasearch 插件是一个非常有用的插件,可以满足 eclipse 内部的搜索需求。
It is based on lucene. This is also available in eclipse marketplace. It has extensive feature set.
它基于lucene。这也可以在 eclipse 市场中获得。它具有广泛的功能集。
- 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
- 即时显示搜索结果
- 使用相关行显示预览
- 定期更新索引
- 匹配部分单词(例如 CamelCase 中的大小写)
- 打开并突出显示文件中的匹配项
- 搜索 JAR 源附件
- 支持按扩展/项目/工作集过滤
回答by Pejman Saberin
If you want to search for anything without telling Eclipse what it is, use ctrl+shift+L (QuickEclipseSearch). This is the quickest way. You can also use 'file search' (press ctrl+H) and navigate into file search using left and right arrrows on the top right corner of your windows. Or type 'file search' in the 'Quick Access' window. If you are looking for a specific method, package, field,type or constructor use JAVA search.
如果您想搜索任何内容而不告诉 Eclipse 它是什么,请使用 ctrl+shift+L (QuickEclipseSearch)。这是最快的方法。您还可以使用“文件搜索”(按 ctrl+H)并使用窗口右上角的左右箭头导航到文件搜索。或者在“快速访问”窗口中输入“文件搜索”。如果您正在寻找特定的方法、包、字段、类型或构造函数,请使用 JAVA 搜索。
回答by mannedear
Read all the answers above but couldn't figure out the solution working for me. Finally gave a thought process keeping in mind all the solutions provided here and voila it worked for what I'm looking here. Thanks stackoverflow, this site is awesome.
阅读上面的所有答案,但无法找出适合我的解决方案。最后给出了一个思考过程,记住这里提供的所有解决方案,瞧它对我在这里寻找的东西有效。感谢stackoverflow,这个网站很棒。
Solution I worked out: Goto Navigator window in eclipse, select the folder where you want to perform the search operation, now click Alt a & f (shortcut) which opens the file search window. Now select the option "Selected resources" in 'scope' section and hit 'Search' button.
我制定的解决方案:转到eclipse中的导航器窗口,选择要执行搜索操作的文件夹,现在单击Alt a&f(快捷方式)打开文件搜索窗口。现在选择“范围”部分中的“选定资源”选项,然后点击“搜索”按钮。
回答by Rupeshit
If you want search in a particular file then just press ctr+F and type whatever you want to search in that current file.
如果要在特定文件中搜索,只需按 ctr+F 并键入要在当前文件中搜索的任何内容。
回答by Yash Bansal
In MAC I use, control+H (^H), it opens a window, where you can search for any text within all the files.
在我使用的 MAC 中,control+H (^H) 会打开一个窗口,您可以在其中搜索所有文件中的任何文本。