Go to tag closing in Visual Studio (using Resharper)?

I am using the latest Resharper (v 8.1) with visual studio 2010.

Is there a keyboard shortcut for the Go To Close Tag feature?

For example: if the cursor is on the first tr :

enter image description here

I want the cursor to move to a closing tr , which </tr>

Is there a shortcut for this?

(ps is something like goto matchine brace , but for Xml / html tags)

+6
source share
3 answers

Well, here is the answer as a macro that I built, which executes (switches) it, including focus:

Here is a demo:

enter image description here

And here is the code, enjoy!

 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 cursor somewhere in beginning tag, run 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 
+1
source

From what I have compiled, there is no shortcut for this in reSharper or Visual Studio. "Work around" is to collapse the tag using Ctrl + M + M, then go to the beginning or end of the line using the "Home" or "End" key. When you open it again using Ctrl + M + M, you will be either at the top or at the bottom of the tag.

  • Ctrl + M + M
  • Home / End (Depending on whether you want to go to the start or end tag)
  • Ctrl + M + M
+5
source

I heard that ctrl + ] does the trick

+3
source

All Articles