How to jump to matching braces?

Couldn't manage to find any shortcuts in Keymap predefined for finding matching braces. Any ideas?

13 comments
Comment actions Permalink

Hi Egor,

These shortcuts should do the job:
Ctrl+[
Ctrl+]

9
Comment actions Permalink

It works! Thank you, Andriy!
How this shortcut named in Keymap BTW?

0
Comment actions Permalink

It is called "Move Caret to Code Block Start/End".

File | Settings | Keymap. Click on the Filter/Funnel icon (the one next to the Bin icon) -- now you can search for an action by its shortcut.

1
Comment actions Permalink

Found! Thanks again, Andriy!

0
Comment actions Permalink

no !

He wanted ^M 

^M -> move Caret to matching brace.

13
Comment actions Permalink

Ctrl+[ and Ctrl+] worked for me in resolving the dreaded

     "Missing }" error

at the very bottom of a 9000-line source file. Here are the steps I followed:

1. Click on the last close-curly brace in the file.

2. Type Ctrl-[ to find it's twin.

3. Is that open-curly brace is correct? If so move up to the nearest close-curly-brace.

4. Repeat until you find an improperly matched pair.

In my case I found the function that was missing a close-curly-brace in an if-clause. 

Thanks @AndriyBazanov!

0
Comment actions Permalink

This seems to be a little off for Rider for Mac.

If you are at the end brace, cursor is before or after the '}', the Command + '[' works but will take you to the function name, overshooting the '{' by one line.

But putting the cursor before or after the beginning brace, '{', and then typing Command + '[' or ']' doesn't seem to really work.

0
Comment actions Permalink

Ctrl+[ looked promising but failed to find matching square-bracket for me on Windows 10, IntelliJ 2017.1.  Possibly intended for curlys

^M might be a Mac key-map(?).

I found Ctrl+W useful to (increasingly) select the block where caret was found, then right or left arrow to place caret at beginning/end of block. 

2
Comment actions Permalink

I am on mac and can confirm that ^M did it for me! What a relief, since none of the mappings using [ worked

1
Comment actions Permalink

In Rider only Ctrl+[ works.

Does not jump back on Ctrl+]

0
Comment actions Permalink

that's a bug...why only jump one way?

0
Comment actions Permalink

@David Brown, @Jay Freyensee

It works just fine in PHP, JS and HTML code for me (at least those cases that I use on daily basis).

You must check (report that via ticket on YouTrack) for your IDE as such functionality is language specific and there may be some nuances (and even bugs) for specific cases (e.g. in PhpStorm some time ago it worked in HTML .. but some bits did not worked when it was a mix of HTML with PHP code in it).

Reporting bugs in PhpStorm thread does not make much sense and can easily be unnoticed by devs.

0
Comment actions Permalink

CTRL + SHIFT + M

2

Please sign in to leave a comment.