I would like to make Vim behave a little more like the less(1) pager: if I scroll to the bottom of the document (e.g. using Ctrl-F), I want the last line of the file to be displayed at the bottom of the screen, not any higher. Is there a setting that will get me this behavior?

If there isn’t a setting, I imagine I could rig up some kind of mapping where Ctrl-F behaves like Gzb when the last line is visible after scrolling. But of course a built-in setting would be preferable!

(This is sort of the opposite of this question and this question.)

  • The vimscript code I provided in this answer could be modified to produce the desired window scrolling. @OP, if you want, I can take a stab at it and provide an answer here.
    – dsimic
    Sep 1, 2023 at 17:30

1 Answer 1


There is a workaround to achieve this:

:set scrolloff=999

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.