Eclipse是否有像Xcode的“在项目中查找”功能那样的方法来搜索整个项目中的某些文本?
当前回答
Ctrl+H在这里非常方便。我主要在当前项目中搜索,而不是在整个工作空间中搜索。要查找当前缓冲区中字符串在整个项目中的所有出现情况,只需选择该字符串,按Ctrl+H并按enter。就这么简单!
Use Resource Filters! Eclipse will restrict the search result using the Resource Filters defined for your project (eg. right click on you project name and select Properties -> Resource -> Resource Filters). So if you keep getting search hits from parts of your project that your not interested in you could make Eclipse skip those by adding a Resource Filter for them. This is especially useful if you have build files or logs or other temporary files that are part of your projects directory structure, but you only want to search amongst the source code. You should also be aware of that files/directories matched for exclusion in the Resource Filters will not show up in the Package Explorer either, so you might not always want this.
其他回答
按Ctrl + H打开搜索,其中包括通过项目、目录等进行搜索的选项。
有一个非常好的工具“Eclipse Quicksearch”可用。检查Eclipse的SpringSource更新站点,即:http://dist.springsource.com/release/TOOLS/update/e4.6/(您可以尝试使用e4.4或e4.5替换URL的最后一部分)
它可以很好地与Neon Release(4.6.0)一起工作。它为您提供了良好的增量文本搜索与源文件预览。到目前为止还没有问题。
用法: Alt +的“快速搜索命令”打开“快速文本搜索”对话框。您可以选择搜索是否区分大小写。非常好的工具。
1. Ctrl + H 2. 选择“文件搜索”在工作区/所选项目中进行纯文本搜索
对于特定的表达式搜索,选择相关的选项卡(例如允许您搜索特定标识符的Java Search)
整个项目搜索:
3.范围(在表单部分)>封闭项目(单选按钮选择)。
Ctrl+H在这里非常方便。我主要在当前项目中搜索,而不是在整个工作空间中搜索。要查找当前缓冲区中字符串在整个项目中的所有出现情况,只需选择该字符串,按Ctrl+H并按enter。就这么简单!
Use Resource Filters! Eclipse will restrict the search result using the Resource Filters defined for your project (eg. right click on you project name and select Properties -> Resource -> Resource Filters). So if you keep getting search hits from parts of your project that your not interested in you could make Eclipse skip those by adding a Resource Filter for them. This is especially useful if you have build files or logs or other temporary files that are part of your projects directory structure, but you only want to search amongst the source code. You should also be aware of that files/directories matched for exclusion in the Resource Filters will not show up in the Package Explorer either, so you might not always want this.
你应该看看新的Eclipse 2019-09 4.13快速搜索功能
新的快速搜索对话框提供了一种方便、简单和快速的方式,可以在工作空间中运行文本搜索并跳转到代码中的匹配项。 该对话框提供了一个快速概述,一目了然地显示匹配的文本行。 它的更新速度和你打字的速度一样快,并且只允许使用键盘快速导航。
典型的工作流程由按键盘快捷键Ctrl+Alt+Shift+L开始 (或Cmd+Alt+Shift+L在Mac)。 键入几个字母就会更新搜索结果。 使用上下方向键选择匹配项,然后按Enter键在编辑器中打开它。
推荐文章
- Eclipse错误:间接引用所需的.class文件?
- 如何在Eclipse中只使用键盘去一个错误?
- 如何在Eclipse中生成Javadoc注释?
- 如何在EPF Composer 1.5中删除一个规程?
- Eclipse调试器总是阻塞在ThreadPoolExecutor上,没有任何明显的异常,为什么?
- 查找文件名以指定字符串开头的所有文件?
- 在find中使用分号(;)vs +(+)和exec
- 是什么原因导致Eclipse中导入的Maven项目默认使用Java 1.5而不是Java 1.6,我如何确保它不使用?
- 如何从Eclipse设置java.library.path
- 如何进入每个目录并执行命令?
- 如何使Eclipse/EGit在更新后识别现有的存储库信息?
- 为什么每当我创建一个新项目时,Eclipse都会自动添加appcompat v7库支持?
- 如何在Eclipse CDT中启用c++ 11/ c++ 0x支持?
- Eclipse错误:“创建Java虚拟机失败”
- 是否有Eclipse行宽标记?