June Lee
June Lee

Reputation: 417

How to set the number of lines when scrolling with the mouse in VS Code?

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.

Upvotes: 28

Views: 13530

Answers (5)

starball
starball

Reputation: 50024

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.

Upvotes: 4

VonC
VonC

Reputation: 1323115

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.

Upvotes: 1

JD Tripp
JD Tripp

Reputation: 231

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...

Upvotes: 23

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,...

Upvotes: 1

quirimmo
quirimmo

Reputation: 9988

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

Upvotes: 34

Related Questions