Visual Studio 中 VSCode 的 CTRL + D ("add selection to next location match") 的等效快捷方式是什么?

What is the equivalent shortcut for CTRL + D ("add selection to next location match") of VSCode in Visual Studio?

VSCode 有一个非常有用的快捷方式:CTRL + D - 添加选择到下一个查找匹配项。

Visual Studio 中的等价物是什么?


下面是一个例子:

我发现此功能(Multi-Caret 支持)是通过 Visual Studio 2017 年的更新添加的。

使用 Ctrl + Alt + Click 您可以添加多个插入点或插入符,如此处所示 here.

据我所知,Visual Studio 中没有直接的等效项,但您可以使用模仿此行为的 Select Next Occurrence 扩展。

更新 Visual Studio 2017+

从 Visual Studio 2017 年开始在以下命令下本地可用:

  • Shift + Alt + . - Edit.InsertNextMatchingCaret
  • Shift + Alt + ; - Edit.InsertCaretsatAllMatching

如果需要,您可以在 keyboard options 中更改快捷方式。

比较 VS Code 和 Visual Studio

Visual Studio Code Visual Studio
Ctrl + D

editor.action.addSelectionToNextFindMatch
Add Selection to Next Find Match
Shift + Alt + .

Edit.InsertNextMatchingCaret

Ctrl + Shift + L

editor.action.selectHighlights
Select All Occurrences of Find Match
Shift + Alt + ;

Edit.InsertCaretsAtAllMatching

进一步阅读

  • Multiple select in Visual Studio?
  • Highlight all occurrences of a selected object with ReSharper