user11534866
user11534866

Reputation:

How to skip end-tags (HTML) in VS code editor?

I have installed VS code editor with default settings. When I type a html code, for example the starting tag, <title> the ending tag is automatically generated i.e. </title>. But after typing the title inside those tags. I have to press 'right arrow' button repeatedly(here, 8 times) to come out of this HTML element(</title> tag).

Is there any shortcut such that I don't have to press 'right arrow' button repeatedly and instead any single key, which will skip the closing tag in one stroke of any button ?

Upvotes: 1

Views: 3718

Answers (4)

Yousaf
Yousaf

Reputation: 29282

Open keyboard shortcut settings, press Ctrl + Shift + P on windows or Cmd + Shift + P on mac and type keyboard shortcuts. Select the first option.

enter image description here

search for cursorLineEnd. Set any keyboard key combination, if not already set.

enter image description here

Result:

enter image description here

Upvotes: 1

Luke-zhang-04
Luke-zhang-04

Reputation: 793

If you're on Mac, it's cmd + right arrow. If you're on Linux/Windows, it's ctrl + right arrow. This doesn't skip the closing tag but skips to the end of the line, which close to what you want.

Upvotes: 1

Alexis Richard
Alexis Richard

Reputation: 35

I know that you can type the ending tag and it'll also progress through it as if the autocompleted version wasn't there.

You can also use ctrl+right arrow to skip to the end of the line.

And if you use the Emmet extension, you can just press tab.

Upvotes: 0

Related Questions