wrapping selection of multiple lines with multiple tags

Hi,

I know that I can wrap a selection with a tag or other items using CTRL + ALT + T or CTRL + ALT + J
This however just wraps the selection with a single tag (no matter how many lines the selection covers)

What I'm looking for is to wrap a multi-line selection with a tag and for the tags to wrap each line.
Like turning lines into paragraphs, list items or table cells.

so turning this

line 1
line 2
line 3

into this

<p>line 1</p>
<p>line 2</p>
<p>line 3</p>

Is this possible at all ??

3 comments
Comment actions Permalink

Hi there,

Sure.

Ctrl+Alt+T and choose Emmet option. Then use p* as a rule/pattern.

2
Comment actions Permalink

OK - so that's very nearly there.

it turns

line 1
line 2
line 3

into

<p>line 1</p><p>line 2</p><p>line 3</p>

How can I keep the carriage returns ?
so it stays as

<p>line 1</p>
<p>line 2</p>
<p>line 3</p>

Also - is there anyway to assign a keyboard shortcut to this, or at least "Surround with and then choose emmet"

0
Comment actions Permalink
How can I keep the carriage returns ?

Check your Emmet settings (Settings | Editor | Emmet) -- must be one of the Filters

Also - is there anyway to assign a keyboard shortcut to this, or at least "Surround with and then choose emmet"

"Settings | Keymap" and search for "emmet"

1

Please sign in to leave a comment.