In a previous post, Sebastian drawed our attention to a nice selection expansion feature of ReSharper. I also think this feature is cool, and want to present it here in more depth.
Visual Studio by itself supports the expansion of the current selection in a text editor window by pressing Ctrl+W.
With this command you can change a current selection like this …
… to a selection of the whole word:
If your existing selection spans several words like this …
… after pressing Ctrl+W you end up with the word selected that is at the end of the selection:
(Funnily, if you made your selection from right to left the left word gets selected:
Further pressing Ctrl+W does not do anything more.
Text Expansion With ReSharper
ReSharper has taken that expansion feature to the max (that’s why we love this tool!).
Beginning with no selection …
… by pressing Ctrl+W ReSharper selects the whole word:
But now, you can press Ctrl+W several times more to expand the selection to several areas, one larger than the one before.
From the single word selection you get the selection of the whole string without the quotes:
Then ReSharper selects the string including the quotes …
… then the whole concatenated string from the beginning of the expression …
… and then incrementally the whole string expression line by line:
And so it goes on with every stroke on Ctrl+W until the whole file content is selected:
The whole statement …
… the whole block without the braces …
… the block including the braces …
… the whole member …
… the type’s content without the braces …
… the whole namespace’s content without the braces …
… the whole namespace …
… and finally the complete content of the file:
As you may guess, the whole stuff can be done in reverse order pressing Ctrl+Shift+W.
Good to know!
No comments:
Post a Comment