Nate
Nate

Reputation: 72

Is there a Visual Studio shortcut to give multiple lines html tags at the beginning and end of the line?

I can't seem to find a good answer for this. I want to know if there's a quick way to add both the opening and closing HTML tags far multiple lines at the same time.

Lets say I have a list of text that I want to surround with a p tag:

text line 1
text line 2
text line 3
text line 4
text line 5

I can hold the 'alt' key and click to the beginning of each line and start typing my tag. But then VS auto fills the closing p tag right beside the opening tag like this:

<p></p>text line 1
<p></p>text line 2
<p></p>text line 3
<p></p>text line 4
<p></p>text line 5

Then I have to drag each closing tag to the end of the line. Is there a quick way that I can highlight multiple lines of text and give each line an opening and closing tag at the same time?

Upvotes: 4

Views: 1702

Answers (1)

Ali Naderi
Ali Naderi

Reputation: 64

You can achieve this by using the Emmet plugin.

read this short article about Wrapping individual lines in Emmet.

Upvotes: 1

Related Questions