Eclipse 中是否有“在文件中查找”快捷方式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7569630/
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
Is there a "Find in Files" shortcut in Eclipse?
提问by Xonatron
Is there a "Find in Files" shortcut in Eclipse, as there is in Visual Studio (Ctrl+Shift+F)?
有没有在Eclipse中“查找文件”的快捷方式,因为在Visual Studio(Ctrl+ Shift+ F)?
I have looked in these two lists:
我查看了这两个列表:
- Eclipse Shortcuts
- "Show All Shortcuts" shortcut: Ctrl+Shift+L.
- Eclipse 快捷方式
- “显示所有快捷键”快捷方式:Ctrl+ Shift+ L。
Thanks.
谢谢。
采纳答案by Xonatron
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+Hto open the "Search" dialog box
- "File Search" tab, if it does not appear, expand the window or use the left/right arrows
- type in the text to search for
- Use "*.java", in my case since I am coding in Java, to search just these files
- Click "Search"
- Ctrl+H打开“搜索”对话框
- “文件搜索”选项卡,如果没有出现,请展开窗口或使用左/右箭头
- 输入要搜索的文本
- 使用“*.java”,在我的情况下,因为我用 Java 编码,只搜索这些文件
- 点击“搜索”
回答by Gordon Glas
select workspace and press Ctrl-H
选择工作区并按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-F7to 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).
选择哪个对话框取决于在项目浏览器视图中选择的文件类型。例如,如果您选择了一个 .js 文件并按Ctrl- H,它将显示选择了“Javascript 搜索”选项卡的对话框。如果要搜索所有文件,可以按Ctrl-F7选择项目资源管理器视图,使用箭头键选择文件上方的文件夹,然后按Ctrl- H(或选择一个文件,其类型不会触发自定义对话框选项卡) .
回答by Salazaar
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
如果您只使用文件搜索,您可以在搜索面板(自定义...左下角)中禁用所有其他搜索。然后每次按Ctrl+ 时都会进行文件搜索H
回答by cabow01
- Ctrl+Hto bring up the search box
- Click 'Customize' in the lower left
- Checkmark 'Remember last used page'
- Click OK.
- Select the file search tab and do a search
- Ctrl+ 调H出搜索框
- 点击左下角的“自定义”
- 勾选“记住上次使用的页面”
- 单击确定。
- 选择文件搜索选项卡并进行搜索
回答by Organic Advocate
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.
如果您想使用特定于类型的搜索(Java、Javascript ...等),您可以使用Ctrl+H,这会打开搜索对话框,然后单击“搜索”按钮。
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.
如果您只想搜索整个工作区中出现的所有文本,请单击要搜索的单词(或选择文本),然后点击Ctrl+Alt+G。您甚至无需使用对话框即可直接获取所有找到的事件。
I find Ctrl+Alt+Gis 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
我发现这Ctrl+Alt+G是最好的解决方案,因为它通过相关文件(例如 Java 和 XML,或 Javascript 和 HTML)显示不同的变量名称,同时仍然具有特定类型的搜索功能Ctrl+H
You can rebind the Ctrl+Alt+Gto finding text in a project or a working set instead of the whole workspace if that's more appealing to you.
Ctrl+Alt+G如果这对您更有吸引力,您可以重新绑定以在项目或工作集中而不是整个工作区中查找文本。
回答by chandrashekar.n
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.
是的,Eclipse 有搜索快捷方式,当我们搜索特定的 html、jsp、xml、java、properties、class、jar、带有关键字的搜索文件时,这些快捷方式非常有用。
- Ctrl+His used open Tag, in that you can select type of file Remote Search, File search, git search, java search, javascript search , etc
- Ctrl+Shift+Ris used to search all files in the current project
- Ctrl+Shift+Tis used to search all files in the workspace
- Ctrl+H用于打开标签,您可以选择文件类型远程搜索、文件搜索、git 搜索、java 搜索、javascript 搜索等
- Ctrl+ Shift+R是用于搜索在当前项目中的所有文件
- Ctrl+ Shift+T是用于搜索工作空间中的所有文件
回答by shiluka
press Ctrl+ H. Then choose "File Search" tab.
按Ctrl+ H。然后选择“文件搜索”选项卡。
additional search options
其他搜索选项
search for resources press Ctrl+ Shift+ R
搜索资源按Ctrl+ Shift+R
search for Java types press Ctrl+ Shift+ T
搜索 Java 类型按Ctrl+ Shift+T
回答by Ajeeb.K.P
I believe adding plug-ins power your needs.
我相信添加插件可以满足您的需求。
If you install Plug-in named InstaSearchit makes your searching fasterinside current active working projects.
如果您安装插件名为InstaSearch它使你的搜索速度内当前活动的工作项目。
It shows the result as you type.
它会在您键入时显示结果。
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
http://marketplace.eclipse.org/content/instasearch#.VIp-_5_PGPQ
回答by Birol Efe
Source: [Eclipse: Default to "File Search" Tab in Search Dialog][1]
来源:[Eclipse:默认为搜索对话框中的“文件搜索”选项卡][1]
- Go to your key bindings Windows > Preferences > General > Keys
- Unbind the Shorcut "Ctrl+H" for the "Open Search Dialog"
- Filter/Search for "File Search" and use the "Ctrl+H" here instead.
- 转到您的键绑定 Windows > Preferences > General > Keys
- 取消绑定“打开搜索对话框”的快捷键“Ctrl+H”
- 过滤/搜索“文件搜索”并在此处使用“Ctrl+H”。