Visual Studio Tips and tricks: Subword navigation

 
 
  • Gérald Barré

Starting with Visual Studio 2022, the Subword Navigation feature lets you move the caret between parts of an identifier. For example, PascalCaseIdentifier has 3 subwords: Pascal, Case, and Identifier. Subword navigation moves the caret to the next or previous subword with a single keystroke. This also works with other separators, such as _.

#Method 1: Ctrl + Alt + Left and Right

Use Ctrl + Alt + Left and Ctrl + Alt + Right to move the caret to the previous or next subword:

Use Ctrl + Alt + Shift + Left and Ctrl + Alt + Shift + Right to select the previous or next subword:

#Method 2: Always enable Subword Navigation

You can configure Visual Studio to always enable Subword Navigation. With this option enabled, Ctrl + Left and Ctrl + Right will navigate to the previous or next subword instead of using the default word navigation.

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?