39

I am using Eclipse. You see this ending curly bracket next to catch(FileNotFoundException fne) {:

enter image description here

How do I make it more noticeable when I select on starting curly brackets so I can clearly see where it ends?

1
  • 2
    Actually, it's a brace: [] = brackets () = parentheses {} = braces Commented Mar 19, 2019 at 14:33

5 Answers 5

66

From Window > Preferences, go to Java > Editor and Select Matching brackets highlight and pick a color that will stand out and also make sure Highlight matching brackets is checked :)

enter image description here

I changed mine to red and this is what it looks like now.(and I did not have to restart eclipse)

enter image description here

6
  • I did not have to restart eclipse. Make sure Highlight matching brackets is checked :)
    – Bala R
    Commented May 8, 2011 at 3:52
  • @Jahkr : What else do you want ? I think BalaR has rightly provided with the solution. +1 from me. :) Commented May 8, 2011 at 3:58
  • Yes it works... but I don't see the new color option. My only solution: Stop using Vista. :| Thanks.
    – test
    Commented May 8, 2011 at 4:02
  • For me, the highlight was checked by default when I installed eclipse. It was not highlighting for me though. When I changed the color to red and then restarted it started working.
    – grinch
    Commented Jan 18, 2013 at 18:35
  • 5
    uncheck the highlighting, apply, check it again, apply, worked for me
    – kiltek
    Commented May 6, 2013 at 19:05
3

In newer versions (mine is 4.2.1 installed with ADT) you can also select the type of Bracket highlighting to:

  • Matching bracket - you must have cursor right next to the bracket and it will highlight only the corresponding bracket
  • Matching bracket and caret location - same as matching bracket, only it will highlight both brackets
  • Enclosing brackets - highlight both brackets that enclosing the place where your cursor is located

For my, I prefer Enclosing brackets for better orientation in general with red color as Bala R has shown.

2

Many thanks for tips. Indeed these are helpful. I also find following a convenient way to see how brackets can be matched. if you just want to see where the matching bracket is, use ctrl+shift+p to navigate to the matching bracket. This is especially helpful for those who have used "vi" editor a lot and were used to "%" feature of "vi" to match brackets.

0

This worked for me . Go to Window>Preferences>General>Editors>Structured Text Editors . Select appropriate color and you are good to go.

enter image description here

0

For Eclipse IDE Version 2022-06.

  • Windows and Linux: Window > Preferences > Java > Editor
  • Mac: Eclipse > Preferences > Java > Editor

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.