【问题标题】:Edit.GotoBrace shortcut for Visual Basic (Visual Studio)Visual Basic (Visual Studio) 的 Edit.GotoBrace 快捷方式
【发布时间】:2021-08-31 12:38:30
【问题描述】:

使用 Visual Studio 2019 专业版。 C/C++ 和 C# 代码有一个不错的键盘快捷键,可以带您开始/结束大括号。这可以在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)

【问题讨论】:

    标签: vb.net visual-studio visual-studio-2019


    【解决方案1】:

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

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

    快捷键是Edit.PreviousHighlightedReferenceEdit.NextHighlightedReference,可以在Options &gt; Environment &gt; Keyboard找到。

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

    【讨论】:

    猜你喜欢
    • 2010-09-06
    • 2021-12-15
    • 2015-12-02
    • 1970-01-01
    • 2020-01-16
    • 1970-01-01
    • 1970-01-01
    • 2023-01-02
    • 2012-02-19
    相关资源
    最近更新 更多