90

I've been using VSCode a lot lately and have gotten used to the keys-shortcuts/key-bindings (Ctrl+D, Ctrl+P, Alt+leftArrow, etc). However I've recently had some work where I needed to use regular Visual Studio (Microsoft Visual Studio Enterprise 2019) and it's painful remembering two different shortcut keys.

Is there a way to import VSCode key-shortcuts to into regular Visual Studio?

I've looked at this question and there wasn't much help besides manually changing them one at a time.

UPDATE: now the above post answers the question now that I posed Francois du Plessis's answer there.

RayLoveless
  • 19,880
  • 21
  • 76
  • 94
  • Found this `.vssetting` file with some of VS Code shortcuts: https://gist.github.com/jaywick/588ea04e11f74c726a9eed3ccc684bf6 . To be used in Visual Studio it needs to be imported via `Tools`->`Import and Export Settings` as described [here](https://learn.microsoft.com/en-us/visualstudio/ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio?view=vs-2019#to-import-only-keyboard-shortcuts) – Renat Jun 13 '20 at 18:26
  • @Renat I need to try this out. Can you move this to one of the answers so you can get credit? – RayLoveless Jun 16 '20 at 20:42
  • Thanks, but Francois du Plessis' answer is actually a correct one for Visual Studio 2019. So I will leave mine as a comment. – Renat Jun 16 '20 at 21:50
  • Does this answer your question? [How to import VSCode keybindings into Visual Studio?](https://stackoverflow.com/questions/51786288/how-to-import-vscode-keybindings-into-visual-studio) – Mikael Jun 16 '20 at 22:23
  • @Mikael now it does answer the question( Now that I posted the answer there ). – RayLoveless Jun 17 '20 at 18:32
  • 1
    @RayLoveless my bad, I mistakenly flagged the question as duplicate and promptly removed the flag a few seconds later, this comment seems to be auto generated. – Mikael Jun 17 '20 at 23:04
  • 2
    Is there a way to do the opposite? I want my VS shortcuts in VSCode – Killbunny Mar 01 '21 at 16:23
  • For the opposite side, see https://github.com/microsoft/vscode-vs-keybindings – HamedH May 06 '21 at 11:28

2 Answers2

178

If you go to Tools -> Options -> Environment -> Keyboard. There should be an option to select Visual Studio Code as a Keyboard mapping scheme Screenshot of the configuration

SinusQuell
  • 19
  • 7
Francois du Plessis
  • 2,143
  • 2
  • 17
  • 17
5

You can create your own settings file based on an existing Visual Studio file. Simply add your settings to it from VSCode keybinding setting file.

VSCode's keybinding settings is stored in keybindings.json json-formated file. open file in menu File->Preferences->Keyboard Shortcuts or on Windows file path like that C:\Users\<user name>\AppData\Roaming\Code\..\keybindings.json

Visual Studio's keybinding settings is stored in CurrentSettings.vssettings xml-formated file. on VS menu: Tools->Import and Export Settings then select 'Import select environment setting' radiobutton and click 'Next' you'll see browser for import your file. on Windows file path like that C:\Users\<user name>\Documents\Visual Studio 2019\Settings\

You can read more about it at this: Make Visual Studio use VS code shortcut keys/key bindings

timnavigate
  • 741
  • 4
  • 12
  • 23