By default when you scroll down to the end of a displayed buffer in a vim window, you can scroll until the last file line is on first line of the vim display area. All other lines of the display area are marked with “~” characters.
Is there a configuration to stop scrolling when the last file line is at the bottom of the vim window?
Edit:
To be more precise this behavior only apply to mouse wheel scroll or PgDown key navigation that fill the screen with those non-existant line marks. I the cursor is moved line by line using the down arrow key, it stops correctly at the last file line.
Simply zb to align the current line to the bottom of the window.
E.g. Gzb
Not surpisingly there is a family of related panning motions:
For completeness:
Also, have a look at
scrolloffI use
to always keep a minimum buffer of 2 lines before or after the current cursor line. This makes these panning motions almost magical. I spend all day browsing code bases using nothing but