If using Netbeans for your development and you have a horrendous spagetti coded “if” statement, you can use a keyboard shortcut to go to the matching opening or closing bracket.

Simply click on the first (or last) bracket, and then press CTRL + [ and Netbeans will move the cursor to the matching bracket. Its not CTRL + ] for the reverse, its CTRL + [ for both.

I can confirm that this works in Netbeans 7.0.1 on Linux and Mac (seeing as its a Java app, it should be the same on Windows too)

 

By admin

12 thought on “Netbeans – Goto matching brace/bracket”
    1. Same shortcut works for all brackets [, {, (, even for jumping betwen opening and closing xml/html … for that type of file.

  1. Only english keyboards have “[” or “]” keys, most of countries have not theses keys (Layout danish, canadian, french, german, Italian, norwegian, portuguese, spanish, swedish, finish, etc)

    (on these the simbol “[” is a subsymbol of other key) ┬┐how to do this shortcut?

        1. Sorry buddy – I don’t use NetBeans any more. I’m a Microsoft (would you believe it) Code user or PHPStorm…

          Highly likely that the keymapping could have changed. This was an old post.

Leave a Reply to Ivan Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.