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 ?
<S-v>
: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>
.
Use Visual Block and then surround.
<c-v>
to start visual block mode and then move to the last line of the text. Use $
to select to the end of each line then S<li>
All together:
<c-v>2j$S<li>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With