Share via


how to move to end of closing tag </>

Question

Sunday, July 26, 2015 12:14 PM | 1 vote

Apologies if this has been asked before but I really couldn't find anything on here.

How can I move to the end of a closing HTML tag smartly? Typing right arrow keys is just cumbersome.

Example:

When entering <div> VS adds </div> and the curser is in between the tags. Is there a shortcut to jump to the end of the closing tag?

Thanks

All replies (3)

Tuesday, July 28, 2015 5:11 PM âś…Answered | 1 vote

Hi Wyck,

Not quite like this. I am just trying to find the easiest way to move to the end of a closing tag in a single line HTML tag statement.

<div>Cursor is here</div>

What the quickest way to move to the end of the closing div tag?

Pete

"The end of the closing div tag"?  Where excatly do you want your cursor to go?

|</div>

</|div>

</div|>

</div>|

Regardless...the answer is going to be something very similar to:  Ctrl+I, <


Sunday, July 26, 2015 12:48 PM | 1 vote

Try Ctrl+I, <

...which is an incremental search, followed by the open angle-bracket character.  (Doesn't work if there are nested tags.)

Ctrl+I, Shift+Comma  (on my keyboard, anyway)

But in general this is hard. Consider this:

<div>this is <b>bold</b> text and| this <br> is <i>italic</i> text</div>

I presume you are looking for a key that would navigate you directly to here:

<div>this is <b>bold</b> text and this is <i>italic</i> text|</div>

That's difficult because of the nested tags, and would require an extension to implement.  You might be able to do it with a regular expression search--because it allows for the depth matching required.  But you'd still be looking at an extension to bind your regular expression search to a keyboard shortcut.


Tuesday, July 28, 2015 3:04 PM

Hi Wyck,

Not quite like this. I am just trying to find the easiest way to move to the end of a closing tag in a single line HTML tag statement.

<div>Cursor is here</div>

What the quickest way to move to the end of the closing div tag?

Pete