Expand/Shrink Selection

One more chance to leave your mouse aside!

00:00
00:00

Fiddling around trying to get the right selection? 😭

Using the Expand Selection and Shrink Selection actions is an effective way to select the right text fragments. Knowing how CSharp, JSON, XML, and other formats syntactically work, they will always lead us to the next logical element or construct. For instance, we can easily select strings, block statements, methods/classes, JSON properties, or just text paragraphs. This naturally improves how we can introduce variables, move code blocks, or just fix a typo in a single word.

Shrinking a selection works context-sensitive, meaning that if we accidentally expanded too much, we can easily go back to the previous selection.

Note that Editor | General | Typing Assistance | Use CamelHumps can be enabled to treat camel-humps in single words as a next selection target.

While technically possible, we strongly advice not to use this shortcut to select a whole file. Please consider Ctrl+A for that matter. 😅


Related Resources

Arrays
Arrays
Arrays are a straightforward and traditional way to work with a set of data.
HashSet<T>
HashSet<T>
Use the HashSet<T> type for high performing data sets with unique elements.
Dictionary<T>
Dictionary<T>
Use the Dictionary<TKey, TValue> type for strongly-typed, dynamic, sets of data stored with keys and values.