How to Go to the Matching Brace in Visual Studio


When working with TypeScript or other languages in Visual Studio, I often find it useful to quickly navigate between matching braces, parentheses, or brackets. Visual Studio has a built-in shortcut that makes this incredibly easy.

Thank me by sharing on Twitter 🙏

My Stackoverflow answer on this topic here.

Steps to Quickly Navigate Between Matching Braces

  1. First, place your cursor either right before or after the brace, depending on your preference.
  2. Then, press Ctrl + ]. Visual Studio will automatically jump to the matching brace. Whether you’re working with parentheses (), brackets [], or braces {}, this shortcut works consistently.
  3. Additionally, if you need to select the code block between those matching braces, just hold down Shift while using the shortcut. This comes in handy when refactoring or copying code segments.

macOS Users

For those using Visual Studio on a Mac, the equivalent shortcut is Cmd + Shift + \.

Customizing the Shortcut

If you find that the default shortcut isn’t working, or you prefer using a different key combination, it’s easy to customize:

  1. Navigate to Tools -> Options -> Environment -> Keyboard.
  2. In the search box, look for Edit.GotoBrace.
  3. Here, you can see the current key combination assigned and change it if needed.

This customization is especially useful if there’s a conflict with the default keybinding or if you have a specific workflow in mind.

Share this:

Leave a Reply