VsCode - Bind keyboard-key to scroll horizontaly
Asked Answered
H

4

11

Is there a way to bind a keyboard-key to scroll horizontally?

I tried many different things and I cannot seem to put it together.

Hypogeum answered 19/10, 2018 at 11:45 Comment(5)
Horizontal scroll? Haven't heard that name in years... "editor.wordWrap": "on",Bezoar
Horizontal scroll also works in the file explorer for exampleSelsyn
Thank you alex, but with wordWrap it really gets difficult for me to read my code and to navigate through it. (Because I split my view a lot.).Hypogeum
Thanks Mark, but I do not really understand what you are tring to say. What do you mean by that and what is your advice?Hypogeum
There's an issue for that: github.com/microsoft/vscode/issues/143466 Upvote it to show support!Pseudonym
E
4

Not a keyboard-only solution, but to scroll horizontally you can do Shift + ScrollUp / ScrollDown

Enos answered 4/11, 2019 at 19:24 Comment(2)
Is this related to any VSC config? I am asking since I remember this worked for me before, but it doesn't work on the same VSC app recently. I'm not sure if this caused by touching any config by mistake for me.Messing
Still works fine for me with the default settings in (Windows 10, VS Code v.1.63.2)Enos
S
4

There is a recent commit for new commands to scroll horizontally in the editor, see commands for scrolling horizontally.. From the PR:

Each of scrollLeft and scrollRight scroll two columns (this more or less matches the pace of the vertical scroll)

so those are the new commands.

For example:

{ "key": "ctrl+alt+left", "command": "scrollLeft" },
{ "key": "ctrl+alt+right", "command": "scrollRight" },
Selsyn answered 20/10, 2022 at 21:21 Comment(2)
Afaict, this has only been released to insiders so far - github.com/microsoft/vscode/issues/143466Shear
@Shear Those commands: scrollLeft and scrollRight are working fine in Stable now - have probably been in Stable for awhile.Selsyn
O
1

Not find keyboard-key solution, I provide an useful mouse-using method here.

vertial scrolling : Mouse Wheel Up / Down
horizontal scrolling : Shift+Mouse Wheel Up / Down

Odisodium answered 8/7, 2020 at 13:59 Comment(0)
A
0

There is one now with VSCode 1.40 (Oct. 2019) for List/Tree:

You can now press Ctrl+Up and Ctrl+Down to scroll lists and trees using the keyboard.

If horizontal scrolling is enabled, Ctrl+Left and Ctrl+Right will also scroll horizontally.

Allow answered 8/11, 2019 at 7:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.