Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcut for Visual c# block comment in Visual Studio 2015?

I know there is keyboard shortcut for single line(//....) commenting Ctrl + K + C and uncommenting Ctrl + K + U .

My question is that, is there any default keyboard shortcut for block (/* ...... */) commenting and uncommenting? If yes how?

And If there is no default block commenting keyboard shortcut defined, So is there a way i could add my own keyboard shortcut for this? How do i do that?

I have found lot of questions regarding commenting, but haven't found spoken about block commenting anywhere. Any help is appreciated :)

like image 533
aimme Avatar asked Sep 16 '15 13:09

aimme


People also ask

What is the keyboard shortcut for C?

Alternatively referred to as Cmd+C, Command+C is a keyboard shortcut used to copy highlighted text or other object to the clipboard in a graphical user environment. On Windows computers, the keyboard shortcut to copy is Ctrl + C .

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.


1 Answers

for me, in Visual Studio 2015 community edition, when I select full lines it will insert // comments. If I select the lines only partially (the first line is not selected from the very beginning or the last line is not selected till the end), it will insert /* comments. The shortcut is the same, Ctrl + K + C.

Full lines selected:
These lines will be commented with //

Press Ctrl + K + C

Result:

//These lines will //be commented with //

Partial lines selected:
These lines will be commented with /*

Press Ctrl + K + C

Result:

These /*lines will be commented*/ with /*

like image 177
GoTo Avatar answered Sep 25 '22 17:09

GoTo