Ability to delete a surround similar to how we can add a surround(re: textobjects) #347
Open
1 task done
Labels
enhancement
New feature or request
Checklist
:h nvim-surround
to see if there might be any relevant information there?Is your feature request related to a problem? Please describe.
If I have a buffer like this:
I can do
ysa"_
to give me:if I want to delete a surround
ds_
, I get:What would be awesome is if I could delete similar to how I can add. So something like
dsa"_
([D]elete [S]urround [A]round ["]quote [_]undescore`I understand that these keymaps are a bit unvim-like, and would conflict with the existing ones(i.e.
dsa"_
would triggerdsa
which would delete the closest surroundinga
), so maybe an alternative, more vim-like approach, would be to have this only work in visual mode. So it would be more likeva"D_
(D
being an example key for triggered surround delete in visual mode). Then it would work just like the existing delete functionality, except instead of finding the closest surround to the cursor, it finds the closest surround to the edges of the visual selection.Additional context
I did take a look at the existing code to see if I could easily implement it with existing functions, but it seemed like the current delete functionality is all cursor/single position based. I would be happy to take a stab at it, but wanted to check first if this was something you'd be interested in adding to the plugin or not, or if you had any suggestions on the best way to implement it.
Thanks! And I appreciate all your work on this plugin. It's one of my most used, if the not the most used plugin for me.
EDIT: I changed the
(spaces) to
_
underscore to make it more clear.The text was updated successfully, but these errors were encountered: