Is it possible to have multiple actions assigned to one keyboard shortcut in visual studio code?
For example: Move cursor up x 3 set to "ctrl + w"
Thanks in advance.
Is it possible to have multiple actions assigned to one keyboard shortcut in visual studio code?
For example: Move cursor up x 3 set to "ctrl + w"
Thanks in advance.
It's possible with extensions like Commands [Note: Created by the post's author]
settings.json
"commands.commands": {
"down3": {
"sequence": [
"cursorDown",
"cursorDown",
"cursorDown",
],
},
},
keybindings.json
{
"key": "ctrl+w",
"command": "down3",
},
Or with just keybindings.json
{
"key": "ctrl+w",
"command": "commands.run",
"args": [
"cursorDown",
"cursorDown",
"cursorDown"
]
},
Feature request to support Macro like keybindings #871.
Although, for this particular example it's better to use the built-in
command (to avoid any jumpiness):
{
"key": "ctrl+w",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
"value": 3
}
}
I use the macros extension:
in settings.json:
"macros": {
"showGit": ["workbench.view.scm", "git-graph.view"]
}
then in keybindings.json:
{
"key": "ctrl+shift+g",
"command": "showGit"
}
© 2022 - 2024 — McMap. All rights reserved.