Quick tip: Comment out Visual Studio code (keyboard shortcut)

Most starting developers always ask if there is a quicker method to commenting out a piece of code, than having to select the Comment Selection from the Edit menu.

There is in fact a keyboard combination, even if it requires the sequential performance of two keyboard shortcuts.
In order to comment out a selection, first select the piece of code you wish to comment out and then, tap on CTRL+K, followed by CTRL+C.
In order to un-comment a selection, select the piece of code that you wish to un-comment and then, tap on CTRL+K, followed by CTRL+U.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.