Is there a hotkey in VS code to jump to the content space of the next element of html?

Viewed 40

I have some html like:

<section>
   <h5>|</h5>
   <h3></h3>
   <p></p>
</section>

where the vertical line | is the cursor. Is there a hotkey to make it jump from between one set of tags to the next?

So, from <h5>|</h5> to <h3>|</h3> and so on?

1 Answers

You can use the extension Select By and the command moveby.regex

Define the following key binding:

  {
    "key": "shift+f7",  // or any other key combo
    "when": "editorTextFocus",
    "command": "moveby.regex",
    "args": {
      "regex": "<(?!/)[^>]+>",
      "properties": ["next", "end"]
    }
  }
Related