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:
How to add the same Visual Studio Code shortcut to Visual Studio ?
You can change binding with this configuration and add more key binding
Go to File->Preferences->Keyboard Shortcut
This will open two files beside each other like in the screenshot below:
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" } ]
Option A: The Microsoft-provided "Visual Studio Keymap" extension for VS Code at https://marketplace.visualstudio.com/items?itemName=ms-vscode.vs-keybindings (I don't know if it has the specific mapping(s) you want)
Option B: The "Visual Studio Code" keyboard mapping scheme within Visual Studio's keyboard options (but you said that one didn't have the specific mapping(s) you want)
Option C: Manually edit the key bindings, which can then sync in VS Code and/or Visual Studio with the built-in https://code.visualstudio.com/docs/editor/settings-sync
/ https://learn.microsoft.com/en-us/visualstudio/ide/synchronized-settings-in-visual-studio but I can understand if manual edits aren't preferred.
Related
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.
If you go to Tools -> Options -> Environment -> Keyboard. There should be an option to select Visual Studio Code as a Keyboard mapping scheme
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
In Windows Explorer when I double-click on any Visual Studio file (*.cs, *.csproj, etc.), it's opening an old version of VS instead of the latest one (VS 2017). And VS has associations with too many file types.
How can I change the default Visual Studio (for all those files that VS can handle)?
There is a similar old question about Visual Studio 2008 (Move file associations from Visual Studio 2005 to 2008) but the solution in there doesn't work anymore (there is no "Restore File Associations" button on the settings of Visual Studio 2017).
Each version of Visual Studio registers itself in the Set Default Programs panel of the Control Panel.
Go to Control Panel\Programs\Default Programs
Then choose Set Default Programs:
In there you can simply choose the Visual studio version of your choice and then click the button Set this program as default in order to associate every file type that VS handles.
Or you might prefer to click the button Choose defaults for this program to review the current associations of those file types and change only the ones you want.
Yet another in a long list of previously working-just-fine things which Microsoft have managed totally #$#%# up. If I try to change defaults the 'right' way I get this kind of thing:
i.e. completely ignored. The only way I've managed to solve it is by removing the file association entirely through the registry. Let's take .asm as an example:
Open Registry Editor / "regedit.exe"
Navigate to HKEY_CLASSES_ROOT\.asm\OpenWithProgIds
Delete any Visual Studio values you see
From there, you can (finally) open files with whatever you choose instead of having the association clamped to Visual Studio:
For the record, I believe this to be a problem with Windows 10. Not with Visual Studio. See: https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-change-default-programs-in-windows-10/229fc3a9-25c9-433b-a333-5806bc5090db
On the file you will always open with vs17, click right and choose open with and there choose another app. On win10 it pop out a dialog with some proposals. If vs17 is there, choose your favorite and activate the always open with. then ok and your done.
For example, IntelliJ IDEA's keymap action Main menu -> Edit -> Copy reference would map to ReSharper_CopyFqn action in Visual Studio keyboard setup. Is there a more complete list somewhere? Ideally, the list should also contain key shortcuts which I could edit and import to Visual Studio.
I have attempted to map IntelliJ commands to Visual Studio commands and have an XML file that provides Visual Studio keyboard bindings based on my mappings.
I have include additional information in the comments about how closely the various Visual Studio features align with the IntelliJ commands.
You can view the IntelliJ-VisualStudio keyboard mapping file here:
https://github.com/justcla/KeyBindings/blob/master/KeyboardSchemes/VSSettings/IntelliJ.vssettings
I moved from Visual Studio 2008 to Visual Studio 2010.
My code snippets work good in Visual Studio 2010 on the start of a line, but not when adding parameters to a methodcall. This did work in Visual Studio 2008.
So when i type this : "DoSomeMethod([nowiwantmycodennippets!]", the code snippets are not in the intellisense list.
Does anyone know if this is a setting, or just not working anymore, and if it can be fixed?
This appears to be bug. If you type your snippet name (i.e. noiwantmycodesnippets) and press ESC to dismiss the completion list (if open), then you can press Tab to insert your code snippet. So it's just a matter of the code snippets missing from the completion list.
You can use the Control+K, Control+X key chord to show the code snippets' list also. But this isn't as nice as using it through the completion list.
Are you using ReSharper? If so, Resharper Intellisense overwrites the VS default one, so that i.e. code snippets do no appear in the completions. Try turning off ReSharper Intellisense in the ReSharper Options (Environment->Intellisense->General, choose Visual Studio).
If ReSharper Intellisense is a must, you'll have to create a ReSharper "Live Template" which opens up for "code snippets" behaviour, only ReSharper is way more advanced -- see for example this one http://www.brianlow.com/index.php/2009/04/06/resharper-live-templates-for-nunit/.
On my machine I just type "public void Test(" and than ctrl+space and type the name of my snippet. Works like a charm. I've got the C# keyboard shortcuts, I think.
Is there any way to launch Visual Studio 2010 with a new document instead of the usual start tab?
I'm just curious--I usually use Notepad++ to jot down quick things, but Visual Studio seems like it would be preferable.
Here are your choices.
Curious, though, as to why you would want to open a full-fledged IDE just to take notes. That seems like precisely the kind of thing a notepad application is suited for...
You can make a shortcut that always launches a specific file, e.g.:
Put a document called "notes.txt" on your desktop.
Copy the Visual Studio 2010 shortcut to your desktop (to a new shortcut)
Edit the shortcut properties (right click → properties → Shortcut tab → Target) to add this to the end of the Target:
/edit "%USERPROFILE%\desktop\notes.txt"