hadronized / hop.nvim

Neovim motions on speed!
Other
2.47k stars 137 forks source link

Jump to pattern that is not currently visible #360

Open blasco opened 1 year ago

blasco commented 1 year ago

I'm not sure how to describe the issue, maybe it is already built in. In easy motion I could jump to mattches that were not visible, just like a normal search. Maybe the following screenshot helps to explain:

image

I'm looking for "AFTER", the cursor is in the top window, I've split it to show that there is a match at the bottom of the file. The expected beahviour would be for the top window to scroll and see the match, but currently I simply get no match and the search fails. Also, when using hop pattern, it would be nice to save the pattern as a search so that n and N work after landing on the pattern.

Does anybody know how to configure it to have this behavior? Or is this something missing? Thank you in advance!

TxHawks commented 1 year ago

I literally just came here to write a feature request for exactly this. With EasyMotion easymotion-sn and easymotion-tn you can search for a pattern and while searching, you can use and to scroll down/up a page and see targets there. This is by far the beast / and '?' functionality I've ever seen.

Edit: the description of the feature in the EasyMotion repo can be found here

blasco commented 1 year ago

@TxHawks that's also nice, but for me at least specially important that its crolls the view to the first match if there are no matches in the current view