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
Basic idea: extend [ and ] with the option to goto (select) the next or previous "pair" by using the m key in the [ and ] minor modes.
I have looked around the discussions and issues and found a related one each: #7847 and the very last comment of #1072
This would basically enable VIMs vi" (or related pairs) functionality, but in a much more powerful way:
All the goodness of the match minor mode combinded with the ability to goto (or select) the next or previous pair by prefixing m with either [ or ].
Examples: This is a line that contains some (brackets) as well as a second (pair) of brackets.
The caret is on the first character of the line (T).
By pressing ]mim (or ]mi(), "brackets" would be selected. By pressing 2]mim instead, "pair" would be selected.
Note: Since the behaviour of 2]<char> is inconsistent at the moment though (2]p selects the next two paragraphs while 2]f selects only the second function), it could be discussed if 2]mim should select only the second matching pair (behaviour like 2]f) or if it should create two simultaneous selections which would be more in line with with behaviour of 2]p; albeit a little different still since <num>]p is always just one (big) selection and <num>]mim would then be n-multiple selections.
Since <num>]p behaviour seems to be an outlier though compared to the others, I think it would be more consistent though to make <num>]mim select only the second one and if you want to select both then this should be handled by searching for brackets and extending the search with v.
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.
-
Basic idea: extend
[
and]
with the option to goto (select) the next or previous "pair" by using them
key in the[
and]
minor modes.I have looked around the discussions and issues and found a related one each:
#7847 and the very last comment of #1072
This would basically enable VIMs
vi"
(or related pairs) functionality, but in a much more powerful way:All the goodness of the
match
minor mode combinded with the ability to goto (or select) the next or previous pair by prefixingm
with either[
or]
.Examples:
This is a line that contains some (brackets) as well as a second (pair) of brackets.
The caret is on the first character of the line (
T
).By pressing
]mim
(or]mi(
), "brackets" would be selected. By pressing2]mim
instead, "pair" would be selected.Note: Since the behaviour of
2]<char>
is inconsistent at the moment though (2]p
selects the next two paragraphs while2]f
selects only the second function), it could be discussed if2]mim
should select only the second matching pair (behaviour like2]f
) or if it should create two simultaneous selections which would be more in line with with behaviour of2]p
; albeit a little different still since<num>]p
is always just one (big) selection and<num>]mim
would then ben
-multiple selections.Since
<num>]p
behaviour seems to be an outlier though compared to the others, I think it would be more consistent though to make<num>]mim
select only the second one and if you want to select both then this should be handled by searching for brackets and extending the search withv
.Beta Was this translation helpful? Give feedback.
All reactions