Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl+K, Ctrl+C is a command no longer working in Visual Studio 2010

I am using Visual Studio and Resharper 8.

For some reasons, my favorite shortcut Ctrl+K, Ctrl+C or Ctrl+D no longer works.

Indeed, the application shows in the status bar the message: The key combination is(Ctrl K Ctrl C ) is not a command.

Any ideas how to reset them?

Many thanks.

like image 964
user9969 Avatar asked Jan 15 '14 15:01

user9969


2 Answers

Very strange problem. Yes, it is possible to edit the command in Visual Studio. Select Tools and then Options. Once the window is shown, select the Environment option group and then Keyboard, as shown in the picture below:

enter image description here

There, you can edit the shortcuts:

  • Edit.CommentSelection for commenting a selection (Default shortcut: Ctrl+K, Ctrl+C)
  • Edit.FormatDocument to format the document (Default shortcut: Ctrl+K, Ctrl+D)
like image 179
Alberto Solano Avatar answered Sep 20 '22 12:09

Alberto Solano


I have had this issue off and on myself in different versions of VS (now VS 2017). I just figured out that it is a combination of two keys to comment and uncomment code in VS.
To comment code: Press Ctrl+K, then also press C while still holding the Ctrl key. To uncomment code: Press Ctrl+K, then also press U while still holding the Ctrl key. You can release the Ctrl key after pressing K, then press Ctrl+C (or Ctrl+U to uncomment), but is just easier to press the keys in succession.

I had never noticed the status bar at the bottom of the window stating it was waiting on the second key press (C or U).

like image 42
Lonnie Avatar answered Sep 19 '22 12:09

Lonnie