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

An option to jump backwards

Open eyalk5 opened this issue 3 years ago • 4 comments

Hi, I would like to be able to jump to the start of the previous pair of brackets or to the previous block. For example,

[^ tohere ] [ fromhere ] where ^ is the exact final position.

where the forward motion(the opposite) is already implemented by z%.

Thanks.

eyalk5 avatar Dec 02 '20 22:12 eyalk5

Interesting idea. Can you suggest a convenient mapping? Otherwise this can be an opt-in <plug> map.

andymass avatar Dec 02 '20 22:12 andymass

Great. Actually, I reserved this to something really similar, but & or c-%.

eyalk5 avatar Dec 06 '20 13:12 eyalk5

I think this issue can be closed pending some documentation as the opposite of z% is already implemented as <plug>(matchup-Z%). There are no default key mappings, though, and Z% is not listed in the docs. I am not sure if there is a reason Z% doesn't appear in the docs or if a PR would be welcome? In any case, both of these motions are very helpful - thanks!

adriantrunzo avatar Feb 26 '23 20:02 adriantrunzo

@adriantrunzo Thanks, I was never really satisfied with this motion's implementation, I kept running into ergonomic issues when testing, and never got a chance to revisit it. Would you mind testing it a bit and raising some issues?

nmap Z% <plug>(matchup-Z%)

andymass avatar Mar 04 '23 17:03 andymass