103

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.

8
  • Found this .vssetting file with some of VS Code shortcuts: 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
    – Renat
    Commented Jun 13, 2020 at 18:26
  • @Renat I need to try this out. Can you move this to one of the answers so you can get credit? Commented Jun 16, 2020 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
    Commented Jun 16, 2020 at 21:50
  • 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
    Commented Jun 17, 2020 at 23:04
  • 2
    Is there a way to do the opposite? I want my VS shortcuts in VSCode
    – Killbunny
    Commented Mar 1, 2021 at 16:23

2 Answers 2

209
+50

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

6
  • 11
    I'm not getting all of the functionality of the vscode key bindings. Could something be interfering? Specifically ctrl+d still copy/paste my current selected text.
    – Jay Jordan
    Commented Oct 21, 2020 at 18:48
  • 1
    @JayJordan I believe something might be interfering, testing ctrl+d on both VS Code and VS 2019 (Version 16.7.2) selects the next occurrence of the current selection for me Commented Oct 27, 2020 at 14:07
  • 1
    I have a feeling that Jetbrains Resharper is probably the culprit.
    – Jay Jordan
    Commented Oct 27, 2020 at 16:26
  • 2
    On 8.10.8 for Mac I found this on Preferences > Key Bindings > Scheme (the dropdown) Commented Aug 31, 2021 at 0:18
  • Amazing! Just wondering... wth my VS 2022 has its default set to VC++ 6? 🤔🐶
    – Domi
    Commented Nov 8, 2022 at 9:51
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

9
  • 1
    visual studio only imports .vssettings file. how can I import keyboardbindings.json
    – Abraham
    Commented May 2, 2021 at 15:09
  • @Abraham you can try to create your own .vssettings based on keyboardbindings.json and than try to import it to Visual Studio. Commented Aug 30, 2021 at 13:24
  • 1
    This is a 1:1 copy from newbedev.com/… . Please refer to the sources when you quote like this.
    – Markus
    Commented Sep 5, 2021 at 13:08
  • @Markus source link has been added Commented Sep 23, 2021 at 10:41
  • 1
    @Markus i think that Newbedev is one of those sites that just scrape StackOverflow and make it look like they wrote it. reddit.com/r/webdev/comments/pozzgr/…
    – Matthei
    Commented Nov 20, 2022 at 22:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.