I'm trying to make the key Ctrl+UpArrow
execute both commands
cursorUp
and
scrollLineUp
.
I was hoping that this would work, but it doesn't:
{
"key": "ctrl+up",
"command": ["cursorUp", "scrollLineUp"], // This doesn't work
"when": "editorTextFocus"
}
How do I do that in VSCode?
This is currently not possible, but the corresponding feature request is tracked here. However you should take a look to the macros extension. It enables you to chain different commands to a single custom command. This custom command then can be bound to a hotkey.
In your case you could add this to your settings.json
:
"macros": {
"myCustomCommand": [
"cursorUp",
"scrollLineUp"
]
}
And then add your custom hotkey to the keybindings.json
:
{
"key": "ctrl+up",
"command": "macros.myCustomCommand"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With