用于在“If/End If”之间跳转的键盘快捷键
我知道在 C# 中很简单,但是在 VB.Net 中的 If/End If 标记之间跳转的命令是什么,就像在 C# 中的大括号之间跳转一样?
(此问题的 C# 版本:转到 Visual Studio 中的匹配大括号?)
I know it's simple to do in C#, but what is the command to jump between If/End If marks in VB.Net like you can jump between braces in C#?
(C#-version of this Question: Go to Matching Brace in Visual Studio?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用的是 Visual Studio 2010,则可以使用 Ctrl+Shift+Up 和 Ctrl+Shift+向下 在突出显示的参考文献和关键字之间跳转。
由于这些是
If
块,IDE 也会突出显示Then
关键字,因此只需快速连续点击向上/向下两次即可。向上/向下环绕,因此如果您确实想保存按键,请以“错误”方向敲击按键以到达您想要的位置。If you're using Visual Studio 2010, you can use Ctrl+Shift+Up and Ctrl+Shift+Down to jump between highlighted references and keywords.
Since these are
If
blocks, the IDE will highlight theThen
keyword as well, so just tap Up/Down twice in rapid succession. Up/down wraps, so if you really want to save a keypress, hit the key in the "wrong" direction to get where you want.我将左大括号放在 THEN 之后的注释中,并将匹配的右大括号放在 EndIf 之前的注释中。这是一种允许 VI 使用 % 击键来匹配块的开始/结束的贫民窟方式。
一种更优雅的方法是使用某种能够理解您正在编辑的语言中的块概念的 IDE。有时,此功能称为“折叠编辑器”,根据 http://en.wikipedia.org/wiki/Folding_editor
I've resorted to putting the opening curly-bracket in a comment just after the THEN and a matching closing curly-bracket in a comment before the EndIf. This is a ghetto way of allowing VI to match the start/end of the block using % keystroke.
A more elegant way would be to use some sort of IDE that understands the block concept in the language you are editing. Sometimes this feature is called a "folding editor" as per http://en.wikipedia.org/wiki/Folding_editor
当我的插入符位于
if
(在 PHP 代码中)时,我看到else
被标记,https://google.com/search?q=jump+ Between+if+and+else+in+vscode带我来这里,
并且将各种提示拼凑在一起使我得到了以下命令,
绑定在 Visual Studio Code 又名 VSCode
@ Command Palette (⌘+⇧+P @ macOS)
转到上一个符号突出显示
转到下一个符号突出显示
反向工程默认 F7 / ⇧+F7 @
keybindings.json:
为了将右手放在小键盘上,
并且有很多组合绑定到其他命令,
我的
keybindings.json
(语法是.jsonc
- 带有注释的 JSON)添加:As I saw
else
marked when my caret stood at anif
(in PHP code),https://google.com/search?q=jump+between+if+and+else+in+vscode brought me here,
and patching together various hints led me to the following commands,
bound in Visual Studio Code aka VSCode
@ Command Palette (⌘+⇧+P @ macOS)
Go to Previous Symbol Highlight
Go to Next Symbol Highlight
Reverse engineered default F7 / ⇧+F7 @
keybindings.json
:To fit the right hand over a numpad keyboard,
and having a lot of combinations bound to other commands,
my
keybindings.json
(syntax is.jsonc
- JSON with Comments) adds: