mini.surround: Support auto-target similar to vim-sandwich #1498
-
Contributing guidelines
Module(s)mini.surround Questionvim-sandwich has a concept of an "auto target", e.g.: *<Plug>(sandwich-delete-auto)*
[count] <Plug>(sandwich-delete-auto)
Delete the [count]th closest surroundings from the cursor.
>
[foo(bar)baz] cursor is on "bar"
-- sdb --> [foobarbaz]
-- 2sdb --> foo(bar)baz
<
<Plug>(sandwich-delete-auto) is available in normal mode. It is mapped
at sdb in default.
>
nmap sdb <Plug>(sandwich-delete-auto) I've found this to be very useful and I believe I use it more or less everyday. I'm curious, does something similar exist in mini.surround? Or do you have a suggestion of a different (perhaps even better) workflow? May this be a useful feature request? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I don't remember having this brought or even knowing about it when I used 'vim-sandwich' prior to 'mini.surround'. At the moment, it is not possible to achieve in 'mini.surround' to 100% (at least without major hackery). There is a way to group some surroundings under a single id (see, for example, implementation of I'll think a bit more it, but it doesn't look like a good fit in 'mini.surround', as it would require a new built-in surrounding id (which is a bit breaking) and non-trivial implementation specifically for that surrounding. |
Beta Was this translation helpful? Give feedback.
I don't remember having this brought or even knowing about it when I used 'vim-sandwich' prior to 'mini.surround'. At the moment, it is not possible to achieve in 'mini.surround' to 100% (at least without major hackery). There is a way to group some surroundings under a single id (see, for example, implementation of
b
identifier), but not all of them.I'll think a bit more it, but it doesn't look like a good fit in 'mini.surround', as it would require a new built-in surrounding id (which is a bit breaking) and non-trivial implementation specifically for that surrounding.