visual-studio “查找和替换”对话框中“替换”按钮的快捷方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4087999/
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
Shortcut for Replace button in "Find and Replace" dialog
提问by Miroslav Zadravec
I call up Find and Replace dialog with Ctrl+H. On F3it 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?
我用Ctrl+调用查找和替换对话框H。在F3它上面找到结果,但我必须用鼠标寻找替换按钮。每次新发现时,它都会改变屏幕位置。有没有办法只使用键盘来使用这个对话框?
It will save me a few precious seconds multiplied by some very large number (I'm in the middle of heavy refactoring).
乘以一些非常大的数字(我正在进行大量重构),它将为我节省几秒钟的宝贵时间。
采纳答案by bahadir arslan
Sorry,
对不起,
As microsoft there is no keyboard shortcut as Replace Next,
由于微软没有替换下一个键盘快捷键,
You can check this url
你可以检查这个网址
回答by Ben
In visual studio 2015:
在视觉工作室 2015 中:
- Ctrl+Hopens the Replace dialog.
- Ctrl+Fopens the Find dialog.
- Ctrl+H打开替换对话框。
- Ctrl+F打开查找对话框。
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
- Alt+ N- 聚焦“Fi nd”输入字段
- Alt+ P-焦点访谈“再p花边”输入字段
- Alt+ C-切换匹配ÇASE
- Alt+ W-切换全W¯¯ORD
- Alt+ E-切换普通ËXpressions的
Alt+ L-打开“大号OOK在”下拉列表中。使用 Up/Down 和 Enter 从此列表中选择:
- 当前块
- 选择
- 当前文件
- 所有打开的文件
- 当前的项目
- 当前解决方案
Alt+ R- - [RE放置下一页
Alt+ A-更换一个LL
Esc- 关闭对话框
For example, to replace "foo" with "bar" within the current selection:
例如,要将当前选择中的“foo”替换为“bar”:
- 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.
- Ctrl+ H- 打开替换对话框,重点放在“搜索词”上。
- 输入“富”
- Alt+ P- 现在关注“替换条款”
- 输入“栏”
- Alt+ L,选择“选择”,按 Enter。
- Alt+ W- 仅全字
- Alt+ R- 替换第一项
- Esc- 关闭替换对话框。
回答by rstackhouse
You could simply copy your desired replacement text before starting to F3through your source text, and hit Ctrl+Vwhen you hit the next match as VS selects the match text for you.
您可以在开始F3浏览源文本之前简单地复制所需的替换文本,并在您点击下一个匹配时点击Ctrl+ V,因为 VS 会为您选择匹配文本。
It is a hack, but it works.
这是一个黑客,但它的工作原理。
回答by WladiBeck
It is possible to deactivate Resharper default behavior of "Alt+R" which provides a quick access to Resharper menu in Visual Studio.
可以停用“Alt+R”的 Resharper 默认行为,这提供了对 Visual Studio 中 Resharper 菜单的快速访问。
Just uncheck it in Resharpers options: enter image description here
只需在 Resharpers 选项中取消选中它: 在此处输入图像描述
回答by JumpingJezza
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.
然后,您可以在 F3 上交替使用 1 个手指移动到下一个查找,同时将鼠标悬停在非移动替换按钮上以替换您需要的内容。

