如何直接热键到 Eclipse 中的“文件搜索”选项卡

发布于 2024-07-05 07:54:03 字数 248 浏览 4 评论 0原文

当我使用 CTRL+H 时,我最终会进入 Java 搜索选项卡。 我非常想要一个直接进入文件搜索的快捷方式。 那可能吗?

请参阅此处的图片了解我正在谈论的内容: 输入图像描述这里

When I use CTRL+H I end up on the Java Search tab. I would very much like a shortcut to go directly to File Search instead. Is that possible?

See image here for what I'm talking about:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

彼岸花ソ最美的依靠 2024-07-12 07:54:03

您只需定义一个打开文件搜索的键绑定即可:

  1. 转到首选项 > 一般 > 按键
  2. 在搜索框中键入“文件搜索”。 (如果没有结果,并且您使用的是非常旧的 Eclipse 版本,请选中包括未绑定命令复选框。)
  3. 将插入符号放入绑定文本框中,然后按您要使用的组合键:

在此处输入图像描述

您可以重复使用 CTRL +H 绑定(在这种情况下删除其他绑定)或定义另一个绑定(例如 CTRL+SHIFT+H)。 要删除其他绑定,请搜索“打开搜索对话框”,然后单击取消绑定命令


其他解决方案:您可以在编辑器中按 CTRL+3,输入“file s”,然后按 Enter。 下次按 CTRL+3 时,“文件搜索”位于顶部。

You can just define a key binding that opens the file search:

  1. Go to Preferences > General > Keys
  2. Type "file search" in the search box. (If there are no results, and you have a really old Eclipse version, select the Include Unbound Commands check box.)
  3. Put the caret into the Binding text box and press the key combination you want to use:

enter image description here

You can either re-use the CTRL+H binding (delete the other binding in that case) or define another one (e.g. CTRL+SHIFT+H). To delete the other binding search for "Open Search Dialog" and click on Unbind Command.


Other solution: You could press CTRL+3 in your editor, type in "file s", press Enter. The next time you press CTRL+3 "File Search" is at the top.

Saygoodbye 2024-07-12 07:54:03

我以前也遇到过这个问题。

我尝试按照@Martin 给出的问题回复中的建议将 Ctrl+H 重新绑定到 Window | 中的“文件搜索” 偏好 | 一般| 键,但由于某种原因,我在命令栏中没有“文件搜索”条目。 (我当前正在运行 Eclipse 3.3;也许后续版本中添加了“文件搜索”条目?)

更新: 正如 Martin 在评论中指出的那样在这个答案中,我没有在首选项 | 中选中“包含未绑定命令”复选框。 键对话框,这就是为什么我没有显示“文件搜索”。 我现在将 Ctrl+H 绑定到“文件搜索”,正如 Martin 在本页的回答中所建议的那样,而且效果很好。 谢谢 Martin!

我最终通过使用 Ctrl+H 打开“搜索”对话框解决了最初的问题,然后单击对话框上的“自定义”按钮,这弹出“搜索页面选择”对话框,允许您隐藏或显示“搜索”对话框上的选项卡。 我隐藏了“文件搜索”以外的选项卡,这会导致以后使用 Ctrl+H 时默认激活“文件搜索”。

I've run into this problem before, too.

I tried following the advice in the question response given by @Martin to rebind Ctrl+H to "File Search" in Window | Preferences | General | Keys, but for some reason, I don't have a "File Search" entry in the Command column. (I'm running Eclipse 3.3 currently; maybe the "File Search" entry was added in a subsequent release?)

Update: As Martin pointed out in a comment on this answer, I didn't have the "Include unbound commands" checkbox checked in the Preferences | Keys dialog, which is why "File Search" wasn't showing up for me. I now have Ctrl+H bound to "File Search", as Martin suggested in his answer on this page, and it works great. Thanks Martin!

I ended up working around the original problem by bringing up the Search dialog with Ctrl+H, then clicking the Customize button on the dialog, which brings up a "Search Page Selection" dialog which allows you to hide or show tabs on the Search dialog. I hid the tabs other than "File Search," which causes "File Search" to be activated by default on future uses of Ctrl+H.

情仇皆在手 2024-07-12 07:54:03

另一种选择是打开搜索对话框 (Ctrl+H),然后单击自定义并隐藏 Java 和任务搜索选项卡,下次执行 Ctrl 时+H,文件搜索将是唯一显示的,因此默认选择它

Another option is to open the search dialog (Ctrl+H) then click customize and hide java and task search tabs, next time you do Ctrl+H, file search will be the only one showing, thus it will be selected by default

失去的东西太少 2024-07-12 07:54:03

实际上,我认为最好的(也是最简单的方法)是简单地打开搜索对话框(ctrl + h),点击“自定义”,然后选中“记住上次使用的页面”复选框。 然后用 Tab 键切换到“文件搜索”一次。 只要这是您最后使用的搜索选项卡,它就会始终在那里打开。 这样做的好处是,如果您确实需要其他选项卡,您不会失去对它们的轻松访问! (在 Eclipse Kepler 中工作)。

自定义视图

I actually think the best (and easiest way) is to simply open the search dialog (ctrl + h), hit customize, and then select the checkbox for "Remember last page used." Then tab over to the File Search once. So long as that is the last search tab you used, it will always open there. The advantage to this is that you don't lose easy access to the other tabs, should you actually need them! (working in Eclipse Kepler).

Customize view

べ映画 2024-07-12 07:54:03

我学会了使用“伪热键”ALT+A F(也可用作 ALT+A ALT+F),解析为:“Menu Se[a]rch → [F]ile...” 并且具有始终存在的优点,无需重新配置。

I learnt to use a "pseudo-hotkey" ALT+A F (works also as ALT+A ALT+F), which resolves to: "Menu Se[a]rch → [F]ile..." and has the advantage of being always present, without need for reconfiguration.

强辩 2024-07-12 07:54:03

据我所知,搜索窗口选项卡取决于调用搜索功能时您所在的打开文件。 因此,例如,如果您在 web.xml 文件上,它将打开“插件搜索”而不是“java-search”。

编辑:有一种方法可以通过在“键”首选项面板中为“文件搜索”操作分配快捷方式来强制默认打开选项卡。

As far as I know, the search window tab depend of the open file you're on when calling the search function. So, for example if your on a web.xml file, it will open the "plug-in search" instead of the "java-search".

Edit: there is a way to force the default open tab, by assigning a shortcut to the "File Search" action in the "Keys" preference panel.

≈。彩虹 2024-07-12 07:54:03

也许这个功能是最近才出现的[确认它自朱诺号以来就存在]并且看起来很聪明。
按 Ctrl+H --> 定制--> [复选框]记住上次使用的页面。
这样,如果您随时需要,您离其他选择就不远了。 因此,如果您经常使用文件搜索,那么您将不会因为最后选择的内容而感到烦恼。

Probably this feature came recently [confirmed its there in since Juno] and looks intelligent.
Press Ctrl+H --> Customize --> [Checkbox] Remember last used page.
This way you are not far from other options if required anytime. So if you use File search often then you will not get annoyed getting what you last chose.

嘦怹 2024-07-12 07:54:03

更新:用户@muescha,在问题下方的评论中,只是向我指出我不小心回答了错误的问题!尽管如此,它仍然是一个有价值的答案(只是不是针对这个问题),所以我要离开它了。

这回答了一个相邻的问题:如何直接使用热键在 Eclipse 中搜索文件?

Ctrl + Shift + R 效果非常好! 使用星号 (*) 表示通配符。 它与 Sublime Text 3 中的 Ctrl + P 模糊搜索非常相似。

使用 Ctrl + Shift + R Eclipse 中的“开放资源”搜索:

rea

在此处输入图像描述

*.txt

在此处输入图像描述

*32*f1*c

在此处输入图像描述

*3*1*c*h
请注意,如果您只是在搜索字符串中的每个字符之间放置一个星号 * ,它的工作方式就像 Sublime Text 3 的 Ctrl + P “模糊搜索” ! 美丽的!

输入图片此处描述


旁注:您还可以使用搜索 --> 用于搜索文件的文件菜单对话框。

另请参阅

  1. 我的文档:Google 文档:有关新版本的 Eclipse 设置说明Linux(或其他操作系统)计算机 - 搜索“4 查找快捷方式”。

UPDATE: user @muescha, in the comments underneath the question, just pointed out to me that I accidentally answered the wrong question! Nevertheless, it is still a valuable answer (just not to this question), so I'm leaving it.

This answers an adjacent question: How do I use a hotkey directly to search for a File in Eclipse?

Ctrl + Shift + R works fantastically! Use asterisks (*) for wildcards. It is very similar to the Ctrl + P fuzzy search in Sublime Text 3.

Sample searches using the Ctrl + Shift + R "Open Resource" search in Eclipse:

rea

enter image description here

*.txt

enter image description here

*32*f1*c

enter image description here

*3*1*c*h
Notice if you just put an asterisk * between every character in the search string it works just like Sublime Text 3's Ctrl + P "fuzzy search"! Beautiful!

enter image description here


Side note: you can also use the Search --> File menu dialog to search for files.

See also

  1. My document: Google Docs: Eclipse setup instructions on a new Linux (or other OS) computer - search it for "4 find shortcuts".
无名指的心愿 2024-07-12 07:54:03

我想在这里提供一个解决方法:
您可以“记住上次使用的页面”以避免一遍又一遍地打开它。

输入图片此处描述

I would like to provide a workaround here:
you can 'remember last used page' to avoid opening it over and over again.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文