Feature Request: support for surround-plugin
I would like to be able to create multiple cursors and then, surround the underlying words say with quotation marks using surround.vim. For example, I would like to change
Some text quote more text quote and even more text quote.
to
Some text "quote" more text "quote" and even more text "quote".
by issuing S" after entering the multiple cursor mode. This does not work yet. It would be really great to combine these two wonderful plugins to work together!
Agree this would be great! PR always welcome
:map B ysiw"
vB
works
@nagarajasr is there a way to set Vim up so it can wrap / surround a word with any character ? Your command above uses the quote, but I'd love to be able to use the same type of command for {} () "" or others w/ Multiple Cursors as well. Any thoughts? Thank you!
sure go right ahead and use whatever character instead of ", it just works :-)
e.g., with ysiw{ or ysiw( the word is correctly surrounded with matching closing character (i.e., { with }, ( with ) ) with angle bracket <, the behaviour is slightly different, vim waits for further input terminated by carriage return, and the word is surrounded with a html start and end tag like this:
if you key in ysiw<span<span>word</span>
use ysiw> to surround the word itself in <> instead of surrounding the word with a html tag.
another cool thing is if you ysiw(, the word is padded with a space, with ysiw), there is no padding.
use ysiw
Hey @nagarajasr thank you!
While the proposed solution "kind of" works is not actually flexible :/ And you would need to do a lot of mappings: ys.. ds.. cs.. and text objects and enclosures, the combinations are quite a lot.
My new hope is this: https://github.com/neovim/neovim/issues/7257