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 (look at screenshot) ... Maybe should I enable those shortcuts anywhere???
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
Keyboard accelerators are configurable. You can find out which keyboard accelerators are bound to a command in
Tools -> Options
on theEnvironment -> 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.)
I know this is an old post. However I didn't see a solution for the question asked.
This is how I did it,
Tools -> Options on the Environment -> Keyboard window
One can alter the default shortcuts following the below steps
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.
Use the keys CtrlK,C to comment out the line and CtrlK,U to uncomment the line.
I went to menu: tools > options.
Environment > Keyboard.
Show command containing and searched: comment
Changed Edit.CommentSelection and Assigned Ctrl+/ for commenting.
And I left Ctrl+K then U for the the Edit.UncommentSelection.
These could be tweaked to the user's preference as to what key they would prefer for commenting/uncommenting.
You can also add the toolbar in Visual Studio to have the buttons available.
View > Toolbars > Text Editor