How to make VSCode editor stop scrolling past bottom of a file?

The correct answer is seen here: https://stackoverflow.com/a/40588828/1189470

There is a configuration option provided in VSCode for the functionality you specified. To enable it, go to File -> Preferences -> user settings

On the right side of the editor in settings.json paste the below line at the bottom (before closing bracket), save and close.

"editor.scrollBeyondLastLine": false

This will prevent the editor from scrolling beyond the last line.


If just for readability you would like some space at the bottom of the file - a configurable amount - try this setting as of v1.43:

editor.padding.bottom in pixels

Editor> Padding: Bottom

Controls the amount of space between the bottom edge of the editor and the last line.

and/or

editor.padding.top // but this isn't sticky in the sense that you can scroll right past the padding top and it is gone. It doesn't stay.


This is now exposed as a simple checkbox labeled "Editor: Scroll Beyond Last Line" in File/Apple -> Preferences.