“查找和替换”中的替换按钮的快捷方式对话

发布于 2024-09-30 14:34:13 字数 180 浏览 0 评论 0原文

我使用 Ctrl+H 调用“查找和替换”对话框。在 F3 上,它找到结果,但随后我必须使用鼠标寻找“替换”按钮。每次新发现时,它都会改变屏幕位置。有什么方法可以仅使用键盘来使用此对话框吗?

这将为我节省几秒钟宝贵的时间,乘以一个非常大的数字(我正在进行大量重构)。

I call up Find and Replace dialog with Ctrl+H. On F3 it finds the result but then I must hunt the Replace button using the mouse. And on every new find, it changes the screen position. Is there any way to use this dialog using only keyboard?

It will save me a few precious seconds multiplied by some very large number (I'm in the middle of heavy refactoring).

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

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

发布评论

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

评论(5

无人接听 2024-10-07 14:34:13

在 Visual Studio 2015 中:

  • Ctrl+H 打开“替换”对话框。
  • Ctrl+F 打开“查找”对话框。

在该对话框中:

  • Alt+N - 聚焦“Find”输入字段
  • Alt+P - 聚焦“替换”输入字段
  • Alt+C - 切换匹配Case
  • Alt+W - 切换整个W
  • Alt+E - 切换常规< strong>E表达式
  • Alt+L - 打开“查找查找”下拉列表。使用向上/向下和 Enter 从此列表中进行选择:

    • 当前区块
    • 选择
    • 当前文档
    • 所有打开的文档
    • 当前项目
    • 当前解决方案
  • Alt+R - R< /strong>替换下一个

  • Alt+< kbd>A - 替换All

  • Esc - 关闭对话框

例如,要在当前选择中将“foo”替换为“bar”:

  • Ctrl +H - 打开“替换”对话框,重点关注“搜索词”。
    • 输入“foo”
  • Alt+P - 焦点现在位于“替换术语”上
    • 输入“栏”
  • Alt+L,选择“选择”,按 Enter。
  • Alt+W - 仅整个单词
  • Alt+R - 替换第一个术语
  • Esc - 关闭替换对话框。

In visual studio 2015:

  • Ctrl+H opens the Replace dialog.
  • Ctrl+F opens the Find dialog.

Within that dialog:

  • Alt+N - Focus "Find" entry field
  • Alt+P - Focus "Replace with" entry field
  • Alt+C - Toggle Match Case
  • Alt+W - Toggle Whole Word
  • Alt+E - Toggle Regular Expressions
  • Alt+L - Open "Look In" dropdown list. Use Up/Down and Enter to select from this list:

    • Current Block
    • Selection
    • Current Document
    • All Open Documents
    • Current Project
    • Current Solution
  • Alt+R - Replace Next

  • Alt+A - Replace All

  • Esc - Dismiss dialog

For example, to replace "foo" with "bar" within the current selection:

  • Ctrl+H - Opens the Replace dialog, with focus on "Search Term".
    • Enter "foo"
  • Alt+P - Focus is now on "Replacement Term"
    • Enter "bar"
  • Alt+L, choose "Selection", press Enter.
  • Alt+W - Whole word only
  • Alt+R - Replace first term
  • Esc - Close replace dialog.
乞讨 2024-10-07 14:34:13

抱歉,

由于微软没有“替换下一个”键盘快捷键,

您可以检查此网址

http ://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

Sorry,

As microsoft there is no keyboard shortcut as Replace Next,

You can check this url

http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx

十级心震 2024-10-07 14:34:13

您只需在开始按 F3 浏览源文本之前复制所需的替换文本,然后在按下下一个匹配项时按 Ctrl+V 即可VS 为您选择匹配文本。

这是一个 hack,但它确实有效。

You could simply copy your desired replacement text before starting to F3 through your source text, and hit Ctrl+V when you hit the next match as VS selects the match text for you.

It is a hack, but it works.

别把无礼当个性 2024-10-07 14:34:13

如果您停靠查找/替换窗口,那么它不会随着每个新查找而移动。

然后,您可以用 1 个手指按 F3 交替移动到下一个查找,同时将鼠标悬停在不移动的替换按钮上以替换您需要的内容。

If you dock the find/replace window then it will not move with each new find.

You can then alternate with 1 finger on F3 to move to next find, while hovering the mouse over the non-moving replace button to replace what you need.

小ぇ时光︴ 2024-10-07 14:34:13

可以停用“Alt+R”的 Resharper 默认行为,从而可以快速访问 Visual Studio 中的 Resharper 菜单。

只需在 Resharpers 选项中取消选中它即可:
在此处输入图片说明

It is possible to deactivate Resharper default behavior of "Alt+R" which provides a quick access to Resharper menu in Visual Studio.

Just uncheck it in Resharpers options:
enter image description here

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