From the course: Visual Studio Code Productivity Tips

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Expand selection with keyboard shortcuts

Expand selection with keyboard shortcuts

From the course: Visual Studio Code Productivity Tips

Expand selection with keyboard shortcuts

- [Instructor] Selecting text is a common task when editing. In this tip, let's look at the keyboard shortcuts for the grow selection and shrink selection command. The grow selection command enables us to expand our current selection incrementally. This is handy when you need to select a larger block of code or text without using the mouse. Here's how it works. I'm in a C# file. My cursor is set within the word hello in this string. The keyboard shortcut is Alt + Shift or Option + Shift, and then the left and right arrows. So, hold down Alt and Shift and tap the right arrow, and you can see that it selects the content of the string. If I tap it a second time, it increments it. So now, it's selecting the entire line of code. Not entirely though, but let's tap it one more time. You'll see, now it selects the extra space at the beginning of the line. Now, one more time expands it to the content within the curly braces, then to the curly braces, and it keeps expanding outward. To go the…

Contents