Closed srithon closed 1 year ago
Hi there, I'm a bit busy right now due to school, but this is something that I would like to implement later. It's been on the TODO list for a while, but I never got around to it (mostly because somehow nobody has asked for it up until this point).
As for your suggestion, I believe that option 2 is both more useful and more consistent, as we are essentially replacing {...}
with {\n...\n}
, as opposed to option 1, which replaces it with \n{\n...\n}
.
Checklist
:h nvim-surround
to see if there might be any relevant information there?Is your feature request related to a problem? Please describe. In
vim-surround
, there's acS
mapping which effectively performs a regulards
surround deletion, followed by ayS
on the selection within the deleted surrounding delimiters. Other than this,nvim-surround
supports pretty much everything that I used invim-surround
, so I was surprised that it didn't have this feature.Describe the solution you'd like I would like there to be a
change_line
mapping which would delete a pair of surrounding delimiters and add a new pair of delimiters on their own lines, surrounding the same region.Also, in the most common case I would use
cS
to replace a pair of delimiters with the same pair, except on their own lines. Having another mapping for this would be really nice, as it could (not exactly this since it wouldn't be the default behavior) cut downcS{{
tocS{
.Additional context For example:
After doing
cS{{
(option 1):(option 2):
I think option 1 would make more sense for consistency with
yS
, but I also like the option 2 behavior. I believe (I don't remember exactly) that option 2 is thevim-surround
behavior, and I think for most use cases it's more useful.