0

For vertical scrolling, I am used to using page up and page down keyboard keys. I also know that I can hold alt to scroll quickly vertically with the scrollwheel / touchpad. Are there analogous actions for scrolling horizontally quickly in VS Code?

starball
  • 20,030
  • 7
  • 43
  • 238

1 Answers1

0

As far as I'm aware, at the time of this writing, there is no keyboard shortcut command in VS Code for scrolling horizontally by pages, but you can hack a shoddy solution by just using runCommands and binding keyboard shortcuts to invoke the horizontal scroll commands multiple times. Ex.

{
    "key": "ctrl+alt+left",
    "command": "runCommands",
    "args": {
        "commands": ["scrollLeft","scrollLeft","scrollLeft","scrollLeft","scrollLeft"],
    },
},
{
    "key": "ctrl+alt+right",
    "command": "runCommands",
    "args": {
        "commands": ["scrollRight","scrollRight","scrollRight","scrollRight","scrollRight"],
    },
},

If you like history, the feature-request that got the horizontal scrolling commands added was Add keyboard shortcuts for scrolling horizontally #143466.

As for the scrollwheel and touchpad, the same alt feature should work for horizontal scrolling (which is done by holding shift), so you'd hold shift+alt while scrolling.

starball
  • 20,030
  • 7
  • 43
  • 238