According to Tim Pope , we can do the following:
Finally, let try out visual mode. Press a capital V (for linewise visual mode) followed by S<p class="important">.
And you get it
<p class="important"> <em>Hello</em> world! </p>
I tried and it works. But how can I repeat this command on many other visual blocks? I have tried . but did not work.
Update:
With this text:
foo foo foo
I tried this qqgvS<p class="important">q . He gives correctly
<p class="important"> foo </p> foo foo
But when I repeat @q with this (with the cursor on the letter of the second line), it gives the following:
<p> <p class="important"> foo </p> </p> foo foo
Instead
<p class="important"> foo </p> <p class="important"> foo </p> foo
What is the right way to do this?
source share