ReSharper Help

Extend/Shrink Selection

ReSharper | Edit | Extend/Shrink Selection
Ctrl+W / Ctrl+Shift+W
ReSharper_ExtendSelection / ReSharper_ShrinkSelection

The Extend Selection command allows you to successively select expanding logical blocks of code so that you can easily select any expression in the code by placing the caret somewhere inside it and pressing Ctrl+W a few times. The command is also available in the main menu: ReSharper | Edit | Extend Selection .

Coding_Assistance__Extend_Selection_02
Coding_Assistance__Extend_Selection_03
Coding_Assistance__Extend_Selection_01
Coding_Assistance__Extend_Selection_04

Shrink Selection does exactly the opposite. Press Ctrl+Shift+W or choose ReSharper | Edit | Shrink Selection in the main menu to apply this command.

With CamelHumps (the Use CamelHumps check box on the Environment | Editor | Editor Behavior options page), the Extend/Shrink selection commands work in a slightly different way.

If the CamelHumps is enabled, the Extend/Shrink Selection commands take into account parts of compound names. Suppose you have placed the caret in the middle of a compound name with several parts that begin with uppercase letters:

ExtendSelection_CamelHumps_1
With CamelHumps, pressing Ctrl+W for the first time selects the current part of the word:
ExtendSelection_CamelHumps_2
Only after pressing this keystroke for the second time ReSharper selects the whole word:
ExtendSelection_CamelHumps_3
All subsequent presses are processed as usual.

This feature is supported in the following languages/technologies:

C# VB.NET C++ HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see corresponding topics in the ReSharper by Language section.

See Also

Last modified: 27 August 2015