Visual Studio Code - multiple keyboard shortcuts?

Visual Studio-Code

Visual Studio-Code Problem Overview


Is there any way to set two keyboard shortcuts for one action in VS code? For example, I want to move the cursor to the left by pressing left arrow key or Alt+A.

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

> Edit: Starting from 1.52 it's possible from keybindings GUI:

keybindings gui context menu add keybinding


What stops you from editing keybindings.json?

{
	"key": "left",
	"command": "cursorLeft",
	"when": "textInputFocus"
},
{
    "key": "alt+a",
    "command": "cursorLeft"
}

It can be opened from Command Palette Preferences: Open Keyboard Shortcuts (JSON)

Or by clicking the file icon from keybindings GUI page:

enter image description here

Solution 2 - Visual Studio-Code

Updating the previous answer and adding tiny more details, atleast in the current 2020 version it seems like after changing the keybindings (atleasy cursor up & down), VSCode creates an entry in the JSON file that can be accessed from Alex's answer. The JSON will contain the new entry you made but also the changed entry with a '-' negative sign on the key instruction. Just remove the '-' negative sign and both your keybindings should work like a charm! Obviously don't forget to save!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionYounghoon JeongView Question on Stackoverflow
Solution 1 - Visual Studio-CodeAlexView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeYashankView Answer on Stackoverflow