Move the Visual Studio cursor to the end of the opening HTML tag

Visual studio will automatically end the <div> for you when you finish the tag > . This places the cursor between the open and close tags as follows:

 <div>|</div> 

(where | is your cursor)

However, when you add a class (or another html attribute) to the html element, Visual Studio will leave the cursor inside the quotation marks, for example:

 <div class="foo|"></div> 

Is there a command to automatically move the cursor to the first bracket of the closing angle as follows:

 <div class="foo">|</div> 

It seems small, but I need to move my hand through the keyboard to move the cursor 2 spaces. The Edit.GotoBrace command, ctrl + ] , does not do this for me, because the cursor is here:

 <div class="foo"></d|iv> 

for some reason.

+5
source share
1 answer

Do not think that this is possible in VS. You can do the following:

  • Word navigation using Ctrl + SideArrow
  • Scroll to the beginning or end of a line using Home or End.
  • Move to the beginning or end of a document using Ctrl + Home or Ctrl + End
  • Move the corresponding tag using Ctrl + [or Ctrl +]
0
source

Source: https://habr.com/ru/post/1208611/


All Articles