Skip to main content
A newer version of this page is available. .

Selection Expand/Reduce

  • 2 minutes to read

CodeRush provides the Selection Expand and Selection Reduce features. These features allow you to expand/reduce the selected text by logical code blocks.

Use the Selection Expand (Ctrl+W) command to select the code block when the caret is inside it. You can use the Selection Expand command multiple times to increase the selected box’s size.

The Selection Reduce (Ctrl+Shift+W) does the opposite: it undoes Selection Expand and reduces the selected block.

ExpandReduceSel

Enable Extra Shortcuts for Selection Expand/Reduce

You can also use NumPad Plus to expand and NumPad Minus to reduce the selection box’s size.

Num

Use one of the following ways to enable these shortcuts:

  • Refer to the IDE | Shortcuts options page, open the Selection | Defining group and check the Enabled checkbox for each shortcut.

ExpandReduceSel

  • Use the Setup Wizard page. Choose CodeRush | Setup Wizard… menu item to invoke this page. Enable the Add Numeric Keypad Bindings option on the Numeric Keypad Bindings page.

Nav

Note

You can use the Selection Expand/Reduce feature in combination with the Include Previous/Next Element feature.

Code Preview

CodeRush shows a code preview in the code editor if a portion of the selected code falls outside the screen boundaries.

Preview

The code preview is enabled initially. To disable it, go to the Editor | All Languages | Selection options page and uncheck the “Show code preview hints when selection changes” option.

Preview

Blazor Support

You can expand/reduce the selected code block in Blazor.

Preview