how to comment/uncomment XAML code in vs2010 by keyboard shortcut - visual-studio-2010

I would like to know is there any keyboard shortcut available for xaml code comment and uncomment. I don't want to type all the time. is there any faster way to do it?

Comment
Ctrl+K, Ctrl+C
Uncomment
Ctrl+K, Ctrl+U

Related

In visual studio, my hotkey F12 doesn't expand my inherited functions

I'm not exactly a programmer, but I've just started learning C# for Unity so I can design a simple game.
The tutorial I'm following says to press F12 to expand the inherited functions. When I press F12, nothing happens. One solution was to try CTRL F12, but that also didn't expand anything. I'm not sure if I'm missing something, since I'm very new to all of this, any help would be appreciated.
The standard definition for the F12 shortcut is Go To Definition. This option can be seen with right clicking what you want to, well, see the definition.
If you think you accidentaly changed the shortcut somehow, then you can check your actual shortcuts going on Tools > Options... > Environment > Keyboard
This is where you change your shortcuts if you want.
On the searchbox you can type Definition and it will show the command you are looking for.
I also recommend checking Visual Studio's documment about shortcuts for a list with all standard shortcuts.

VS 2017 (Ctrl+R) was pressed. Waiting for second key of chord

In Visual Studio 2015, Ctrl+R was globally mapped to Edit.NavigateTo. In VS 2017 Community, they've renamed this to Edit.GoToAll, which Ctrl+R is globally mapped to. But when I press Ctrl+R in C# editor, I get "(Ctrl+R) was pressed. Waiting for second key of chord..." and the dialog does not open.
What is hijacking Ctrl+R and how do I prevent it?
Aah, didn't notice that shortcuts in use was a dropdown with multiple values - thank you Hans Passant. Looks like Edit.ViewWhiteSpace defaults to Ctrl+R, Ctrl+W and that was making Ctrl+R not work at all. Odd.
I had a massive problem with chords where I couldn't even use "command Z" anymore. The way I was able to fix my chords issue was by editing the JSON file by following:
settings
preferences
keyboard shortcuts
while in keyboard shortcuts on the top right you will see an icon that looks like a file with an arrow on it. Click this. It will take you into keybindings.json.
Here you can view all chords, add, edit and delete chords. I removed my command z chord and everything was back to normal.

Microsoft Visual Studio Hotkey waiting for another keypress

I'm used to Netbeans and all its shortcuts (e.g. ctrl+e to delete a line), but I'm new to Visual Studio, so I don't like its keypress combinations that much.
When I changed all the hotkeys I need (e.g. alt+shift+up/down to move lines up and down), I also tried to set deleting a line to ctrl+e.
The problem is that when I press ctrl+e now, the IDE waits for me to press another key, because there are hotkeys that go like "ctrl+e followed by ctrl+something".
Do I have to disable all the other hotkeys if I just want to use ctrl+e, or can I tell the IDE something like "when nothing is pressed after ctrl+e for 500ms, then dont wait any longer"?
Thanks in advance.
PS: Microsoft Visual Studio Enterprise 2015
These multi-sequence keystrokes are called chords, and Visual Studio uses them because it has so many commands that there would otherwise be nowhere near enough keyboard shortcuts to invoke them all. And no, you cannot set a timeout value.
You have to disable all of the other keyboard shortcuts that involve Ctrl+E, otherwise the software will have no way of knowing if it should keep waiting for you to press the second part of the chord.
Here's a hint that may make your life easier. When you arrive at the Environment → Keyboard options, don't bother to select anything. Just leave everything at their defaults and click in the "Press shortcut keys" box. Type Ctrl+E. Now, the dialog will give you a list of all the currently-mapped shortcuts that use Ctrl+E.
On my installation, all but one of them are specific to the "Workflow Designer". Only one is used by the "Text Editor"—Edit.ToggleWordWrap, which is mapped to Ctrl+E, Ctrl+W. Since you will only be deleting lines in the text editor, you don't actually need to worry about unmapping all of the shortcuts for the Workflow Designer scope. You can just set up your shortcut as being specific to the text editor. Stepwise:
Remove the keyboard shortcut for Edit.ToggleWordWrap. (You can do this quickly by typing "toggleword" into the "Show command containing" textbox.) Click the "Remove" button.
Now, switch to Edit.LineDelete.
Change the "Use new shortcut in" combobox to "Text Editor".
Click in the "Press shortcut keys" box, and type a good old chordless Ctrl+E.
Click "Assign", and you're done (unless you want to change ToggleWordWrap to something else).

How can I change the keyboard shortcuts in Visual Studio?

I would like to change the keyboard shortcut for quick fix in Visual Studio 2013, so that it matches the ReSharper equivalent (which I only use on my office machine). How can I do it?
One way to do it is to enter on the menu 'Tools', 'Customize' and click on the 'Keyboard...' button near the 'Close' button.
Inside this option you can search for the commands by name (I couldn't find the Quick Fix here), maybe you want the Edit.FormatDocument one, that makes the indentation for the documents automatically.
If you can't find this option, tell me your quick fix actual keyboard shortcut, so I'll be able to check which function it calls.
I did some research on the R# QuickFix option and maybe what you want is this is the option you want: View.ShowSmartTag.
Look at this doc: Identify and customize keyboard shortcuts in Visual Studio

What key shortcuts are to comment and uncomment code?

There were Ctrl+E+C (comment) and Ctrl+E+U (uncomment) in older versions, or Ctrl+K+C and Ctrl+K+U.
But in VS 2012, I can't see key shortcuts:
How to enable those shortcuts?
Keyboard accelerators are configurable. You can find out which keyboard accelerators are bound to a command in Tools -> Options on the Environment -> Keyboard page.
These commands are named Edit.CommentSelection and Edit.UncommentSelection.
(With my settings, these are bound to Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U. I would guess that these are the defaults, at least in the C++ defaults, but I don't know for sure. The best way to find out is to check your settings.)
You can also add the toolbar in Visual Studio to have the buttons available.
View > Toolbars > Text Editor
Use the keys CtrlK,C to comment out the line and CtrlK,U to uncomment the line.
From your screenshot it appears you have ReSharper installed.
Depending on the key binding options you chose when you installed it, some of your standard shortcuts may now be redirected to ReSharper commands. It's worth checking, for example Ctrl+E, C is used by R# for the code cleanup dialog.
This is how I did it,
Menu Tools → Options on the Environment → Keyboard window
One can alter the default shortcuts following the below steps
Select Edit.CommentSelection in the listbox
Click on "Remove" button
Select "Text Editor" option in the dropdown under "Use new shortcut in:"
Press your own shortcut in the textbox under "Press shortcut keys:"
Example: Pressing Ctrl+E and then C will give you Ctrl+E, C
Click on "Assign" button
Repeat the same for Edit.UnCommentSelection (Ctrl+E, U)
I went to menu: Tools → Options.
Environment → Keyboard.
Show command containing and searched: comment
I changed Edit.CommentSelection and assigned Ctrl+/ for commenting.
And I left Ctrl+K then U for the Edit.UncommentSelection.
These could be tweaked to the user's preference as to what key they would prefer for commenting/uncommenting.
"commentLine" is the name of function you are looking for. This function coment and uncoment with the same keybinding
Shift + alt + a
the command palette is great for finding shortcut keys.

Resources