Visual Studio Tips and tricks: Subword navigation

 
 
  • Gérald Barré

Starting with Visual Studio 2022, you can navigate between subwords using the Subword Navigation feature. This is very convenient when you want to move the caret to a part of an identifier, for example. So PascalCaseIdentifier has 3 sub-words, Pascal, Case, and Identifier. Using subword navigation, you can move the caret to the next or previous subword. Note that it also works with other separators, such as _.

#Method 1: Ctrl + Alt + Left and Right

You can use the keyboard shortcut Ctrl + Alt + Left and Ctrl + Alt + Right to navigate to the next or previous subword:

You can use the keyboard shortcut Ctrl + Alt + Shift + Left and Ctrl + Alt + Shift + Right to select the next or previous subword:

#Method 2: Always enable Subword Navigation

You can change the configuration of Visual Studio to always enable Subword Navigation. When you enable this option the shortcut Ctrl + Left and Ctrl + Right will navigate to the next or previous subword.

Visual Studio Options - Subword navigationVisual Studio Options - Subword navigation

This post is part of the series 'Visual Studio Tips and Tricks'. Be sure to check out the rest of the blog posts of the series!

Do you have a question or a suggestion about this post? Contact me!

Follow me:
Enjoy this blog?Buy Me A Coffee💖 Sponsor on GitHub