When you scroll with the mouse, it moves the viewport up and down without moving the cursor.
Scroll Viewport adds keybindings for that behavior:
keybinding |
command |
Ctrl+Down / Cmd+Down |
scroll down |
Ctrl+Up / Cmd+Up |
scroll up |
Extension Settings
name |
default |
effect |
scrollViewport.lines |
10 |
How many lines to scroll up / down |
VSCode already has a similar built-in command called editorScroll
:
[
{
"key": "ctrl+down",
"command": "editorScroll",
"when": "textInputFocus",
"args": {
"to": "down",
"by": "line",
"revealCursor": true,
"value": 10
}
},
{
"key": "ctrl+up",
"command": "editorScroll",
"when": "textInputFocus",
"args": {
"to": "up",
"by": "line",
"revealCursor": true,
"value": 10
}
}
]
ScrollViewport exists to address a few editorScroll
problems:
editorScroll
gets stuck if you use code folding
editorScroll
won't preserve & expand your selection
Similar Projects