是否有“在文件中查找”选项? Eclipse 中的快捷方式?
Eclipse 中是否有像 Visual Studio 中那样的“在文件中查找”快捷方式(Ctrl+Shift+F)?
我查看了这两个列表:
- Eclipse 快捷方式
- “显示所有快捷方式”快捷方式:Ctrl+Shift+L。
谢谢。
Is there a "Find in Files" shortcut in Eclipse, as there is in Visual Studio (Ctrl+Shift+F)?
I have looked in these two lists:
- Eclipse Shortcuts
- "Show All Shortcuts" shortcut: Ctrl+Shift+L.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
选择工作区并按 Ctrl-H
选择哪个对话框取决于在 Project Explorer 视图中选择的文件类型。例如,如果您选择了 .js 文件并按 Ctrl-H,它将打开一个对话框,其中选择了“Javascript 搜索”选项卡。如果要搜索所有文件,可以按 Ctrl-F7 选择 Project Explorer 视图,使用箭头键选择文件上方的文件夹,然后按 Ctrl-H(或选择一个文件,其类型不会触发自定义对话框选项卡)。
select workspace and press Ctrl-H
Which dialog is selected, depends on which file type is selected in the Project Explorer view. For example, if you selected a .js file and press Ctrl-H, it will bring up the dialog with the "Javascript Search" tab selected. If you want to search all files, you can press Ctrl-F7 to select the Project Explorer view, use arrow keys to select a folder above your files, then press Ctrl-H (or select a file, whose type doesn't trigger a custom dialog tab).
感谢其他两个解决方案,但这是我正在寻找的完整答案,它解决了我如何搜索文件中的所有文本,而不仅仅是类型、方法、包、构造函数和字段:
Thanks to the other two solutions, but here is the complete answer I was looking for, which addresses how I search all the text within the files, not just types, methods, packages, constructors, and fields:
如果您仅使用文件搜索,则可以在搜索面板(自定义...左下角)中禁用所有其他搜索。然后每次按 Ctrl+H 时都会进行文件搜索
If you are using only the File Search, you can Disable all other Searches in the Search Panel (Customize... lower left Corner). Then you have the File Search everytime you Press Ctrl+H
如果您想使用特定类型的搜索(Java、Javascript ...等),您可以使用 Ctrl+H,这将打开搜索对话框,然后单击“搜索”按钮。
如果您只想搜索整个工作区中出现的所有文本,请单击要搜索的单词(或选择文本),然后按 Ctrl+Alt+G。您将直接获得所有找到的事件,甚至无需使用对话框。
我发现 Ctrl+Alt+G 是最好的解决方案,因为它在不同的相关文件(例如 Java 和 XML,或 Javascript 和 HTML)中显示变量名称,同时仍然具有可用的特定于类型的搜索功能通过 Ctrl+H
您可以将 Ctrl+Alt+G 重新绑定到在项目或工作集中而不是整个工作区中查找文本(如果这对您更有吸引力)。
If you want to use the type-specific search (Java, Javascript ...etc) you can use Ctrl+H, which opens the search dialog, then click the Search button.
If you simply want to search for all text occurrences in the whole the workspace click the word (or select the text) you want to search then hit Ctrl+Alt+G. You will directly get all the found occurrences without even using a dialog box.
I find Ctrl+Alt+G is the best solution because it shows the variable name in different by related files (e.g. Java and XML, or Javascript and HTML) while still having the type-specific search feature available through Ctrl+H
You can rebind the Ctrl+Alt+G to finding text in a project or a working set instead of the whole workspace if that's more appealing to you.
是的,Eclipse 有搜索快捷键,当我们用关键字搜索特定的 html、jsp、xml、java、properties、class、jar、搜索文件时,这些快捷键非常有用。
Yes, there is shortcuts for searching Eclipse, these shortcuts are very useful when we search for particular html, jsp , xml, java, properties ,class, jar,search file with keywords.
按 Ctrl + H 。然后选择“文件搜索”选项卡。
其他搜索选项
搜索资源按 Ctrl + Shift + R
搜索 Java 类型按 Ctrl + Shift + T
press Ctrl + H . Then choose "File Search" tab.
additional search options
search for resources press Ctrl + Shift + R
search for Java types press Ctrl + Shift + T
来源: Eclipse:默认为“文件”搜索对话框中的“搜索”选项卡
Source: Eclipse: Default to "File Search" Tab in Search Dialog
我相信添加插件可以满足您的需求。
如果您安装名为 InstaSearch 的插件,它会使您在当前活动的工作项目中搜索速度更快。
它会在您键入时显示结果.
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
I believe adding plug-ins power your needs.
If you install Plug-in named InstaSearch it makes your searching faster inside current active working projects.
It shows the result as you type.
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
正如所指出的,
CTRL + H
打开“搜索”对话框。由于我仅使用“在文件中查找”(并在需要时设置文件名模式),因此我单击“搜索”对话框底部的“自定义...”按钮。它打开搜索页面选择对话框,我在其中关闭了所有其他选项。
您还可以在同一对话框中单击“记住上次使用的页面”。
As pointed out,
CTRL + H
opens the Search dialog.Since I use only Find in Files (and set File name patterns when needed), I clicked on Customize... button on the bottom of the Search dialog. It opens Search Page Selection dialog, where I turned off all other options.
You can also click on Remember last used page in the same dialog.
Ctrl+Alt+F(在项目中查找文本 -自定义键)
注释 - Ctrl+Alt+G 用于在工作区中查找文本,而不是在项目中
如何自定义此键
窗口->首选项->常规->按键->搜索“在项目中查找文本”->在绑定中键入“Ctrl+Alt+F”->应用
注释 - 如果开发人员同时处理多个项目,这将很有帮助。
Ctrl+Alt+F (Find Text in Project -Customized Key)
Note - Ctrl+Alt+G is for Find text in a workspace, not in a project
How to customize this Key
Window->Preferance->General->Keys-> Search for 'Find Text in Project'->Type 'Ctrl+Alt+F' in binding ->Apply
Note - this will be helpful if the developer is working on multiple project simultaneously.