vim-surround
vim-surround copied to clipboard
Repeating cst<c-t>div<cr>
Thanks for this super helpful extension, it really improves my productivity by an order. Though there's this minor issue I found:
Suppose that I have these lines of html code:
<div || class="some-class">text</div>
<div class="some-class">text</div>
double pipe indicates my cursor position, if I press cst<c-t>div<cr>
(without double quotes) it changes to:
<div class="some-class">
text
</div>
<div || class="some-class">text</div>
and if I change cursor position to double pipe and hit dot key, it'll change to:
<div class="some-class">
text
</div>
<div>
text
</div>
Removing the class (or any other html tag attribute) like I had >
instead of <cr>
in my command. Is there any workaround for this?
More generally, no tag replacement works with repeat
█tr class="myclass">a</tr>
<tr class="myclass">b</tr>
<tr class="myclass">c</tr>
When I hit csttspan↵j.j.
, I get
<span class="myclass">a</span>
<span>b</span>
█span>c</span>
I've noticed this, as well. I was going to file a bug. Glad I found this.
I got around it using a macro with the extended functionality of %
in addition to markers.
Would be nice if this worked, though.
@dylnmc Could you elaborate on your solution? This bug still exists and is quite annoying. (Repeating cst
discards all attributes of the tag you use the repeat on.)