Netbeans – Goto matching brace/bracket

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)

 

12 comments on “Netbeans – Goto matching brace/bracket

  1. Yatin February 25, 2015 12:11 pm

    what about curly brace and round ( bracket?

    • admin March 2, 2015 9:33 am

      Not sure. I don’t use Netbeans these days…

    • Fernando March 10, 2015 5:18 pm

      Same shortcut works for all brackets [, {, (, even for jumping betwen opening and closing xml/html … for that type of file.

      • admin March 10, 2015 5:46 pm

        I thought that might be the case, but couldn’t confirm… Thanks!

    • admin March 12, 2015 9:02 am

      I don’t use Windows…

  2. Casak November 11, 2016 8:30 pm

    I have a italian keyboard and the key [ is out by pressing Alt gr+[ (I have a multipurpose button)

  3. Ikram September 25, 2017 11:47 am

    Thanks Buddy!

  4. Ivan September 11, 2018 9:52 am

    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?

    • admin September 11, 2018 10:05 am

      Have you read Casak’s reply? He has an Italian keyboard. I’m afraid I no longer use NetBeans so cannot help.

      • Frank November 19, 2018 2:50 pm

        But the left CTRL key is not recognized if one presses Alt gr. The right CTRL key triggers a curly brace “{“

        • admin November 19, 2018 3:08 pm

          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

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

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