vimpluginsemmetsurround

How to surround multiple lines individually with surround.vim


I have these three (or more) lines that I want to surround with li (or any other) tag :

Bananas
Citrus
Orange

I can do it this way: qaysstli>jq then 2@a.

Is there a way to do this faster and without a macro ?


Solution

    1. Select visually all the lines with <S-v>
    2. Type :norm yss<li> then <CR>

    Result:

    <li>Bananas</li>
    <li>Citrus</li>
    <li>Orange</li>
    

    Ranges are good too: :.,+2norm yss<li><CR> does the same, as well as :1,3norm yss<li><CR>.