IntelliJ IDEA shortcut keymap for matching brace

Intellij IdeaShortcut

Intellij Idea Problem Overview


What is the keymap for navigating to the matching brace in IntelliJ IDEA?

public void blah() {|
   ...

}

If | is my cursor, I would like to jump to the closing brace with this keymap.

Intellij Idea Solutions


Solution 1 - Intellij Idea

I've only verified this with IntelliJ 9 but:

On Windows:

  • Ctrl+} will move to the close bracket.

  • Ctrl+{ will move to the open bracket.

On Mac:

  • Use cmd instead of Ctrl.

Solution 2 - Intellij Idea

As an alternative to Ctrl+} and Ctrl+{ you can by default use Ctrl+Alt+Shift+9 and Ctrl+Alt+Shift+8 respectively. I haven't even tried to remember that yet. ;)

Also in Settings -> (IDE Settings ->) Keymap -> Editor Actions there's an entry called "Move Caret to Matched Brace" that doesn't have a default key mapping. I mapped it to Ctrl+< because the key combination was unmapped and the keys are close to each other on a german keyboard.

This applies to IDEA 12.

Solution 3 - Intellij Idea

Its ^M (control + M) on my Mac using IDEA v15 and keeping the default keymap for MacOSX 10.5+

If you are not sure go to prefs and search for "Move Caret to Matching Brace". That's the name of the command and you can set your own shortcut!

Solution 4 - Intellij Idea

On some keyboards, including Swedish ones, it's not practical to use Ctrl-} or Ctrl-{. The best approach I've found under those circumstances is to double-click the bracket in view, which highlights everything between the brackets, then use left-arrow or right-arrow to move to the appropriate end of the highlighted region.

Solution 5 - Intellij Idea

Ctrl+} and Ctrl+{ only moves the cursor to the closes corresponding brace that embraces ( with its counterpart) the place where you called the shortcut.

Ctrl+Shift+} and Ctrl+Shift+{ moves the cursor to the same brace as the first mentioned shortcut and highlights all the area between start point and the result brace.

Ctrl+Shift+M moves the cursor to the opposite or nearest embracing brace or bracket of any sort ( ), { }, < >, [ ].

The last one can be changed in the settings.

Solution 6 - Intellij Idea

@dhable is also right but you can also do this mouse

> place the cursor with braces and double click so this will select or highlight the code bw braces

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGlideView Question on Stackoverflow
Solution 1 - Intellij IdeadhableView Answer on Stackoverflow
Solution 2 - Intellij IdeaOderikView Answer on Stackoverflow
Solution 3 - Intellij IdeaHussain AlQatariView Answer on Stackoverflow
Solution 4 - Intellij IdeaChristopher WView Answer on Stackoverflow
Solution 5 - Intellij IdeaGangnusView Answer on Stackoverflow
Solution 6 - Intellij IdeaAdiiiView Answer on Stackoverflow