问题
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.
回答1:
If you go to Tools -> Options -> Environment -> Keyboard. There sould be an option to select Visual Studio Code as a Keyboard mapping scheme
回答2:
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\
来源:https://stackoverflow.com/questions/62050877/make-visual-studio-use-vs-code-shortcut-keys-key-bindings