vim-surround icon indicating copy to clipboard operation
vim-surround copied to clipboard

Adding a wildcard quote

Open blasco opened this issue 7 years ago • 1 comments

This are some ideas inspired from vim-targets, I wonder if there is already a solution or if this could be easily implemented. Most of the time there is only one pair of surrounding objects in the line. Would it be possible to providing a "any quote" text object so we can do for example:

dsq: delete surrounding quotes

So if we have: this is an "example setence"

and we do dsq (delete surrounding quotes) it would become: this is an example setence no mater the cursor position at the line (just like in vim-targets)

similar for changing quotes, we don't need to hit the right key, just use the any quote and what we want:

So if we have: this is an "example setence"

and we do csq': change surrounding quotes with ' this is an 'example setence'

even cooler, we could add the next and last modifiers just like in vim-targets: this is an 'example setence'. And this 'is another'

if we do csnq": change surrounding next quotes with " this is an 'example setence'. And this "is another"

Any guidance on how to achieve this or how to contribute to get closer to this would be very much appreciated.

blasco avatar Oct 02 '19 18:10 blasco

+1

I am struggling with something similar - wanting to replace only the outermost quotes:

- "while ! (mongo --host mongo --eval "rs.initiate()"); do sleep 1; done"

mliker avatar Nov 27 '19 12:11 mliker