Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA find matching parenthesis / bracket

Is there any keyboard shortcut to navigate from one parenthesis ( to the matching one ) in IntelliJ?

Or even to "jump to the next opening/closing parenthesis (/) from wherever my cursor is"?

And, if there's no way to do it 'natively', are there any plugins that could add this functionality quickly and easily?

EDIT: the best solution I've found is added as a comment in liango's answer below, namely to put the cursor on the first or last brace and then press CTRL-W twice. Not ideal, but it does the job!

like image 731
caponica Avatar asked May 01 '14 11:05

caponica


People also ask

How do I get matching brackets in Eclipse?

To see a bracket's pair, click to the right of the bracket. Its matching pair will be highlighted. To jump to the matching bracket, press Ctrl+Shift+P.


1 Answers

  • You can use Ctrl + [ and Ctrl + ] to navigate to a code block's start and end.

  • You can also use Ctrl + Shift + M to navigate between the start and end of a code block.

On Mac, you can use Option + Cmd +[ and Option + Cmd + ], and Ctrl + M


Source: https://www.jetbrains.com/help/idea/2016.2/navigating-to-braces.html

like image 121
Neerkoli Avatar answered Oct 07 '22 09:10

Neerkoli