Currently search in viminum starts from beginning or last stopped position. This is a little annoy because there is no cursor which is always in current visible Window like Vim. Make search (both / and ?) beginning from current visible windows will be very helpful for context based search.
This is supported in VimFx. Just thought I'd pitch in with how VimFx deals with it, in case it is of any help.
Firefox searches from the current selection in the page, or from the top of the page if there is none. So what VimFx basically does is:
if selection in page:
if selection on screen:
return // Let the search go from there.
else:
clear selection
find first text in the viewport
make a selection there
return // let the search go from there.
Here's most of the logic:
And here are most of the really tricky helper functions used defined:
A few tricky things:
position: fixed;
elements.One fix for this might be to hit v
to lay down and position a cursor. Then use /
to make your search? It's not perfect but it is better than nothing. v
will typically place your cursor at the top of current visible window.
Most helpful comment
This is supported in VimFx. Just thought I'd pitch in with how VimFx deals with it, in case it is of any help.
Firefox searches from the current selection in the page, or from the top of the page if there is none. So what VimFx basically does is:
Here's most of the logic:
https://github.com/akhodakivskiy/VimFx/blob/168021b756ce4d7cece363a46dc2419e3e74bd55/extension/lib/commands-frame.coffee#L546-L589
And here are most of the really tricky helper functions used defined:
https://github.com/akhodakivskiy/VimFx/blob/168021b756ce4d7cece363a46dc2419e3e74bd55/extension/lib/viewport.coffee
A few tricky things:
position: fixed;
elements.