I find myself unintentionally hitting j
(or some other downward cursor movement key) when I'm at the bottom of a file. Then the next thing I do is to hit Ctrl-E
to scroll the current line up - I may even just hit zt
to move the current line to the top of the window.
My question is: Is there a way I could configure vim to automatically scroll for me (I am ok with just using Ctrl-W
in this case) when I hit j
at the last line of a file?
I know there's already a similar question, but the answer is to persist the cursor in the middle of the screen, which is not what I'm looking to do.