visual-studiovisual-studio-code

Same shortcut in Visual Studio and Visual Studio Code


Is there a way to setup up the same shortcuts in both Visual Studio Code and Visual Studio (without having to change them all manually each time)?

I for example use Alt+Shift+A in Visual Studio Code quite frequently. But the same shortcut in Visual Studio opens a "Add Existing Item" explorer.

I found out this, but it doesn't change the shortcut as I was expecting:

enter image description here

How to add the same Visual Studio Code shortcut to Visual Studio ?


Solution

  • You can change binding with this configuration and add more key binding

    1. Go to File->Preferences->Keyboard Shortcut

    2. This will open two files beside each other like in the screenshot below: vs-code-keybinding-shortcut

    3. Now, on the window on the right i.e. the keybindings.json file, you can define your own shortcut in the below format:

    // Place your key bindings in this file to overwrite the defaults [ {
    "key": "ctrl+k ctrl+d", "command":"editor.action.format" } ]