I'm really missing vim's normal mode zt (scroll top), zz (center) and zb (scroll bottom) key mappings. The reference point could be the current focus or the last search match. Would it be possible to implement this feature in vimium?
I like the idea of being able to focus around the last search match. To me, this would be more useful than pressing nN
(jump to next match, then back to the one I was at). Some concerns I have:
zz
when at the bottom of the file lets you scroll past the end of the file. In chrome, I don't think this would be possible. What would be useful behavior in this case for Vimium?zz
scrolls such that the center of the window is now around the cursor. In Vimium, do we have the same notion of a cursor? And if we use last search match as a substitute, what happens when there is no last search match?The use case for this would be when a "find" ends up selecting text at the bottom of the viewport, and you can't see the following context, right? In this case, why not just use d
? Granted, it's not quite the same thing. But, since there normally is no notion of a cursor in a web browser, the use case in Vimium doesn't seem as compelling as it is in vim, say.
I was thinking only about the results of find command.
The use case I had in mind was being able to find the result of the find command on the screen when the page is really colorful and it's hard to find the yellow highlight, but when I think about it now I believe that we could benefit from this feature even with plain white pages - the user wouldn't have to search the whole page for the highlight, he could just put the result in the expected place of the screen.
The use case for me is as follows:
Search for 'is' (or something very common) on a webpage (such as this one). Press n
to jump to each match. It can be hard to see which 'is' is highlighted. If we can press zz
to adjust the window to be centered around the match, that would be helpful in finding the match on the page (because the orange highlight can be hard to see).
I'm concerned with the edge cases though, as I mentioned above. And a little concerned that zz
in vim doesn't exactly translate. Maybe this could be an option for n
's behavior, that the user could select or not select via a checkbox in the settings?
I believe caret mode
also begs the implementation of zz
, zt
, and zb
, as well as every other vimium operation whose vim equivalent would reposition the caret (search, n/N, visual mode). As for not being able to scroll past the end of the page, it's not such a nasty edge case, and there doesn't need to be full parity with vim - just needs to come as close as it makes sense.
I use this all the time in vim
, would love this so much here!
I would also like to see this feature implemented. Why? Because I use zz all the time in other programs with Vi keybindings. I'd rather not have to learn to use d (which really should be Ctrl-d to be like default Vi) to go up 1/2 page to "center this text in the middle of the page" only while using Vimium and zz everywhere else.
As far as what would be the behavior if the text is at the bottom of the page? Scroll up as far as you can go, the same as if you hit 'd' while at the bottom of the page.
Regarding not having a cursor? Just use it with search.
Most helpful comment
The use case for me is as follows:
Search for 'is' (or something very common) on a webpage (such as this one). Press
n
to jump to each match. It can be hard to see which 'is' is highlighted. If we can presszz
to adjust the window to be centered around the match, that would be helpful in finding the match on the page (because the orange highlight can be hard to see).I'm concerned with the edge cases though, as I mentioned above. And a little concerned that
zz
in vim doesn't exactly translate. Maybe this could be an option forn
's behavior, that the user could select or not select via a checkbox in the settings?