Edit.GotoBrace Visual Basic 的快捷方式 (Visual Studio)

Edit.GotoBrace shortcut for Visual Basic (Visual Studio)

使用 Visual Studio 2019 专业版。 C/C++ 和 C# 代码有一个很好的键盘快捷方式,可以将您带到 start/end 大括号。这可以在 Options > Environment > Keyboard > Edit.GotoBrace 中找到,在我的安装中配置为 Ctrl+]

if (something)
{ // <= Press CTRL+] here...
    SomeFunction();
    AnotherFunction();
} // <= ...and get taken here (or vice versa). Nice!

Visual Basic.NET 是否有类似的东西? Edit.GotoBrace 快捷方式不起作用。

If (something) Then ' <= I'd like to press CTRL+] here...
    SomeFunction()
    AnotherFunction()
End If ' <= ...and be taken here (and vice versa)

单击 IfThenElseEnd If 之一,它们将全部突出显示。这也适用于 TryCatch(以及其他相关关键字)。

然后使用CtrlShiftUpCtrlShift向下 在突出显示的引用和关键字之间跳转。

快捷键是Edit.PreviousHighlightedReferenceEdit.NextHighlightedReference,可以在Options > Environment > Keyboard中找到。

请注意,必须在 Options > Text Editor > Basic > Advanced > Highlighting > Highlight related keywords under cursor 中启用关键字突出显示。