Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

In the VSCode editor when you pull the scroll bar down to the bottom of the file, all you see is a blank page, since the text has scrolled up past the top of the text editor window. This makes scrolling to the bottom difficult because you can't just pull the scroll bar quickly all the way down but have to carefully position the cursor so you can still see your code.

Very similar to How to make Visual Studio editor stop scrolling past bottom of a file?, but comments have pointed out that question/answer is for Visual Studio. This answer is for VSCode on the macOS and Windows.

like image 974
dmorrow Avatar asked Aug 17 '17 14:08

dmorrow


People also ask

How do I enable smooth scrolling in Vscode?

Update November 2020 VS Code has been updated and its settings UI also has changed. So to enable smooth scrolling in VS Code. Go to settings and just search smooth you can just enable this setting to enable smooth scrolling.


1 Answers

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.

like image 152
dmorrow Avatar answered Oct 04 '22 09:10

dmorrow