Home > Selection > Selection – Quick Comment/Uncomment

Selection – Quick Comment/Uncomment

November 10th, 2010

The Selection Comment feature adds the capability to quickly comment or uncomment a multi-line block of code (or any text in the code editor) via a single shortcut. Only one shortcut is used to comment and uncomment of the current selection. The shortcut is easy to remember. For example, in Visual Basic it is (‘)(Apostrophe) and in CSharp (or C++) it is (/) (Slash).

Here’s a sample:

CodeRush Selection Comment Uncomment

You can customize shortcuts within the IDE | Shortcuts options page in the Options Dialog.

Products: CodeRush Pro
Versions: 11.1 and up
VS IDEs: any
Updated: Aug/30/2011
ID: C035

Similar Posts:

  1. viktor
    December 2nd, 2011 at 01:46 | #1

    well, that’s perfectly fine

    but how can i comment a SINGLE line? i still can do it with integrated VS shortcuts (ctrl-e, ctrl-c), but it seems silly to use different keys for the same action.

  2. Viktor
    December 2nd, 2011 at 01:48 | #2

    OK, but it works only on multiple lines. Is there a way to do it with a SINGLE line? if try to select the whole line and press “/”, it just replace selection with /, as usual.

  3. December 5th, 2011 at 02:07 | #3

    @ Viktor
    To comment a single line, you need to select the entire line including the leading whitespace (starting from the 1st character to the last character).