在Visual Studio 2008中是否有一种方法可以将结束大括号转换为开始大括号?我发现了大量关于突出显示大括号的内容,但没有关于将光标移到大括号上的内容。
(VB。这个问题的NET版本:键盘快捷键在“If/End If”之间跳转)
在Visual Studio 2008中是否有一种方法可以将结束大括号转换为开始大括号?我发现了大量关于突出显示大括号的内容,但没有关于将光标移到大括号上的内容。
(VB。这个问题的NET版本:键盘快捷键在“If/End If”之间跳转)
当前回答
我为你找到了这个:在Visual Studio的括号之间跳转:
将光标放在大括号的前面或后面(由您选择),然后按CTRL +]。它适用于括号(),大括号[]和大括号{}。从现在开始你不需要玩沃尔多在哪?为了找到那个支架。
使用上述快捷键,也可以按住SHIFT键进行选择。
在MacOS上,使用CMD + SHIFT + \。
其他回答
在土耳其键盘上,它是Ctrl + ü。
在德语键盘上的Visual Studio Code中是ctrl+shift+^
但是你必须用正确的扩展名打开一个文件——例如,它不能在新的未保存的文件中工作。
有点相关,但对于HTML标签:(因为没有内置的解决方案,Ctrl + J不适用于HTML标签:)
下面是答案,作为一个宏,我已经建立了它(切换),包括去焦点:
下面是演示:
这是代码。享受吧!
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.Windows.Forms
Public Module Module2
Sub beginToEnd()
'Place the cursor somewhere in the beginning tag, run the macro, to select from beginning to end tag
DTE.ActiveDocument.Selection.SelectLine()
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim topPoint As TextPoint = objSel.TopPoint
Dim lTopLine As Long = topPoint.Line
objSel.GotoLine(lTopLine, False)
' DTE.ActiveDocument.Selection.StartOfLine()
DTE.ActiveDocument.Selection.SelectLine()
Dim line1 As String = DTE.ActiveDocument.Selection.Text()
If InStr(line1, "/") Then
' MsgBox(line1)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, True)
objSel.GotoLine(lTopLine, False)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
Else
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
DTE.ActiveDocument.Selection.EndOfLine(False)
DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
End If
DTE.ActiveDocument.Selection.SelectLine()
Dim line2 As String = DTE.ActiveDocument.Selection.Text()
Dim objSel3 As TextSelection = DTE.ActiveDocument.Selection
Dim topPoint3 As TextPoint = objSel3.TopPoint
Dim lTopLine3 As Long = topPoint3.Line
objSel.GotoLine(lTopLine3, False)
DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, False)
End Sub
End Module
在我的意大利语键盘上,CTRL + ^。
在我的斯洛文尼亚键盘上是ALT + Đ