In VSCode, how can I select current element and it"s surroundings like in WebStorm?

205 Views Asked by At

In WebStorm you can select an element and it's surrounding when you do Alt + Arrow Up.

How can you achieve that in VSCode ?

1

There are 1 best solutions below

0
Gustavo Daniel On

You can try with VSCode buit in Emmet: Balance (outward) command: Ctrl+Shift+A

If the shortcut does not work, follow these steps:

  • Press Ctrl+Shift+P to open the Command Palette
  • Type Emmet
  • Select Emmet: Balance (outward)

This will select the tag where you have your cursor currently in, and all its contents (I understand that by its surroundings you mean the tag contents and the tag itself).

If the tag has as a content a combination of text and tags and your cursor is in the text, the command will select all the content. A new hit of the command will grow the selection to include the tag itself.