Make Visual Studio use VS code shortcut keys / key bindings
Asked Answered
H

2

100

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.

Hibernal answered 27/5, 2020 at 19:0 Comment(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 hereKirchhoff
@Kirchhoff I need to try this out. Can you move this to one of the answers so you can get credit?Hibernal
Thanks, but Francois du Plessis' answer is actually a correct one for Visual Studio 2019. So I will leave mine as a comment.Kirchhoff
Does this answer your question? How to import VSCode keybindings into Visual Studio?Brunabrunch
@Brunabrunch now it does answer the question( Now that I posted the answer there ).Hibernal
@Hibernal 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.Brunabrunch
Is there a way to do the opposite? I want my VS shortcuts in VSCodeMastermind
For the opposite side, see github.com/microsoft/vscode-vs-keybindingsRafael
C
203

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

Compulsory answered 16/6, 2020 at 17:58 Comment(6)
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.Suppressive
@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 meCompulsory
I have a feeling that Jetbrains Resharper is probably the culprit.Suppressive
On 8.10.8 for Mac I found this on Preferences > Key Bindings > Scheme (the dropdown)Gary
Amazing! Just wondering... wth my VS 2022 has its default set to VC++ 6? 🤔🐶Iila
what about the other way around? Visual Studio 2022 C# keybindings to VS Code?Inculcate
M
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

Mourning answered 16/6, 2020 at 8:14 Comment(9)
visual studio only imports .vssettings file. how can I import keyboardbindings.jsonArcboutant
@Arcboutant you can try to create your own .vssettings based on keyboardbindings.json and than try to import it to Visual Studio.Mourning
This is a 1:1 copy from newbedev.com/… . Please refer to the sources when you quote like this.Mears
@Mears source link has been addedMourning
@Mourning How do you create your own .vsettings based on the json fileAegospotami
@BobtheBuilder unfortunately, only in manual modeMourning
@Mourning what is manual modeAegospotami
@BobtheBuilder I meant that to create a .vssettings file, you can manually write xml-code of setting, manually transfer xml-syntax to json-syntax of keybindings.json file.Mourning
@Mears 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/…Tropicalize

© 2022 - 2024 — McMap. All rights reserved.