Skip to main content

Expand/Collapse Regions

You can use the Space keyboard shortcut to expand and collapse a code region.

  1. Place the caret at the start of the #region or #endregion directive.

  2. Press the Space key.

    DotToRight

CodeRush also allows you to expand/collapse a region when the caret is at the beginning of the code line that contains the #region directive.

Config_Shortcuts_Access

To enable this functionality, do the following actions:

  1. Choose CodeRush | Shortcuts… from Visual Studio’s menu to open the Shortcuts configuration page.

    Config_Shortcuts_Access

  2. Find the Space shortcut with the [OnOutliningStartLine]&&[AtBeginningOfLine] context and enable the Enabled check box.

    Enable shortcut

  3. Click OK to close the Shortcuts page and save the changes.