linux - How to repeat VIM surround with HTML tag on Visual mode -
according tim pope, can following:
finally, let's try out visual mode. press capital v (for linewise visual mode) followed s<p class="important">. and this
<p class="important"> <em>hello</em> world! </p> i tried , works. how can repeat command on many other visual blocks? tried . didn't work.
update:
with text:
foo foo foo i tried qqgvs<p class="important">q. correctly gives
<p class="important"> foo </p> foo foo but when repeat @q (with cursor on f letter of second row) gives this:
<p> <p class="important"> foo </p> </p> foo foo instead of
<p class="important"> foo </p> <p class="important"> foo </p> foo what's right way it?
you can't; repeat.vim plugin handles repetition normal mode. i've written companion visualrepeat plugin, surround.vim doesn't support that.
for built-in commands, execute on visual selection via gv:normal .<cr>, doesn't work here, neither.
the option see recording macro, , executing on each previous selection (via use of gv).
Comments
Post a Comment