You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: I want to be able to surround a selection with a sequence of (possibly different) delimiters, e.g.:
selection: abc
goal: { [(abc)] }
currently, I do this with ms(ms[ms ms{, which is almost easier to do without the ms subcommand.
I would like to be able to do this with a dedicated sub-mode. I don't want to bikeshed keymapping, but as an example, it could be mS:
the command would therefore be: mS([ { followed by escape.
broken down step by step:
Note that at each step, the selection contains the added delimiters, like the ms subcommand does.
There could also be a use-case for a surround-insert mode, which keeps the selection around the inner text, and as a consequence the delimiters are added in the reverse order. However I don't think there would be a need to have both, and I find the former version more intuitive, especially as it mirrors the existing ms behaviour.
Note that this is distinct from #4825, which is just for repeating the same surround (e.g. abc -> [abc] -> [[abc]] -> [[[abc]]])
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Use case: I want to be able to surround a selection with a sequence of (possibly different) delimiters, e.g.:
selection:
abc
goal:
{ [(abc)] }
currently, I do this with
ms(ms[ms ms{
, which is almost easier to do without thems
subcommand.I would like to be able to do this with a dedicated sub-mode. I don't want to bikeshed keymapping, but as an example, it could be
mS
:the command would therefore be:
mS([ {
followed by escape.broken down step by step:
selection:
abc
press
mS
: enters persistent surround modepress
(
selection:
(abc)
press
[
selection:
[(abc)]
press
selection:
[(abc)]
press
{
selection:
{ [(abc)] }
press escape: back in normal mode
Note that at each step, the selection contains the added delimiters, like the
ms
subcommand does.There could also be a use-case for a surround-insert mode, which keeps the selection around the inner text, and as a consequence the delimiters are added in the reverse order. However I don't think there would be a need to have both, and I find the former version more intuitive, especially as it mirrors the existing
ms
behaviour.Note that this is distinct from #4825, which is just for repeating the same surround (e.g.
abc
->[abc]
->[[abc]]
->[[[abc]]]
)Beta Was this translation helpful? Give feedback.
All reactions