28

In Visual Studio Code, how do I adjust the scrollable lines when scrolling with the mouse?

It scrolls 8 lines, but I want it to scroll 3 lines only.

2
  • for keyboard users moving the caret, see stackoverflow.com/q/70561889/11107541. Commented Nov 17, 2023 at 19:34
  • I'm surprised both that it has a setting for this, and that the default behaviour apparently doesn't match an OS-level setting. Commented Nov 17, 2023 at 19:35

5 Answers 5

34

You should be able to adjust that using this setting:

// A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events "editor.mouseWheelScrollSensitivity": 1 

Being a multiplier for example setting it to 2, you will double the scroll. But I don't know to be honest if you can use decimals. So for example putting 0.5 you should be able to have half of the scroll you have by default.

I hope it helps

Sign up to request clarification or add additional context in comments.

2 Comments

Is there a way to make it affect the Alt + PageDown/PageUp as well?
On Win11 with my mouse scroll wheel set to 12 lines in Control Panel, I had to set this to 4.0 to get 12 lines of scroll in VSCode.
23

Using the "editor.mouseWheelScrollSensitivity" setting.
(Go to settings and type in "scroll" to find the setting).

A value of:

  • 0.45 will give you 1 line
  • 0.9 will give you 2 lines
  • 1.35 will give you 3 lines
  • and so on...

2 Comments

I think this depends on the font size and zoom level. For me, it is 1.14 for exactly 3 lines.
Thank god it supports factions as values. For some reason it went mad and default scroll was scrolling 15 lines at once scroll. So 0.25 multiplier gave me 4 lines I wanted to have. Thanks stranger
4

For the terminal, there is the terminal.integrated.mouseWheelScrollSensitivity setting (see also related issue ticket).

For the editor, there is an open issue ticket: Option to scroll a fixed, whole number of lines with the mouse wheel #188057. I suggest that you give that issue ticket a thumbs up to show support for it. You can also subscribe to it to get notified about discussion and progress. Please avoid making noisy comments there like ones that just consist of "+1" / "bump". See also the related setting editor.mouseWheelScrollSensitivity.

Comments

1

Quirimmo I correct. A multiplier of "0.4" works nicely to change the scroll-height from about 2-1/2 lines to about 1 line, with each 'notch' as I spin my mouse wheel.

To be safe: Always use a leading 0, in-front-of a decimal-point, for decimal numbers less-than 'one'.

In other words, 'Never' express a decimal number by starting it with a decimal-point: Use a zero first, as for example: 0.9, 0.666, 0.003,...

Comments

1

It scrolls 8 lines, but I want it to scroll 3 lines only.

In VSCode terminal, this should now be adjustable, with VSCode 1.71 (Aug. 2022). See issue 125950 and PR 156993, trakced by xtermjs/xterm.js issue 1140.

This comes in addition of the existing terminal.integrated.mouseWheelScrollSensitivity setting.

This is visible in VSCode Insiders today.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.