vim-matchup
vim-matchup copied to clipboard
FR: Optional Highlight the position `%` would jump to
Is your feature request related to a problem? Please describe.
When you are not on a bracket or (keyword with a counterpart), you do not get any matchparen-like highlighting. In those cases, using % is sometimes a bit hard to predict.
Describe the solution you'd like
An option to highlight the position % would jump to, even when not on a bracket.
Describe alternatives you've considered I couldn't really think of any
Additional context
Highlighting the position where a motion would move to is really more useful than one would think in my view. Using an extra colorcolumn helped me learning gm, and without quickscope, I wouldn't use ft as much. I think making % more predictable with a highlight would make the whole motion more popular
So there is :help g:matchup_matchparen_hi_surround_always but it's not equivalent to what you're asking for.
The logic for this is actually quite simple and has been the same since the time of vi.
- Scan ahead for the next "active" text- by default
({[)}]but depends on the file type. b. If the cursor was already on active text, don't move. - Jump to the match of the text found in 1.
I guess it's reasonable to highlight that target (which is not the same as surrounding pairs).