Eclipse Zone is brought to you in partnership with:

Erich is Professor at Lucerne University of Applied Sciences and Arts and Distinguished Member of Technical Staff at Freescale Semiconductor. Erich has a MsCS degree and 18+ years of experience in the embedded software and tools world. He created many embedded cross C/C++ compilers and debuggers. Additionally he is researching in the domain of programming languages, real time and mechatronic systems. Erich is a DZone MVB and is not an employee of DZone and has posted 130 posts at DZone. You can read more from them at their website. View Full User Profile

Bracketeer: the Ultimate Bracket Plugin

06.19.2012
| 9820 views |
  • submit to reddit

If you are like me, then it is easy to miss a bracket or two in my source code. Or I have tons of closing brackets at the end of a function, and it is hard to tell which one is which? Eclipse comes with basic bracket support: you select/click a bracket, and it helps you to find the closing one. I was pretty happy about that, unless I saw a list of most popular Eclipse plugin. One plugin stood out of the masses in the Top 10 Most Popular New Eclipse Plugins review: Bracketeer. That plugin exactly helps me to solve my problem: which bracket is which?

Brackets

Brackets

It would be really cool to know to which code block each ‘}’ belongs. And Bracketeer can do this for me!

Installation

To install the plugin, use the menu Help > Install New Software and point the Eclipse updater to following site:

http://chookapp.github.com/ChookappUpdateSite/

Bracketeer Installation

Bracketeer Installation

Bracketeer comes with support for CDT (C/C++) and JDT (Java). Just install for what you have installed in your Eclipse IDE.

Features

The plugins installs a new toolbar with 3 functions:

Bracketeer Toolbar

Bracketeer Toolbar

  1. It shows matching brackets surrounding the cursor. I simply can place my cursor somewhere in the code, and it shows me the different levels of surrounding brackets in different color: Show matching cursor brackets

    Show matching cursor brackets

  2. It shows matching brackets while hovering over it. Similar to the ‘cursor’, but only if hover with the mouse cursor. And it shows just the matching bracket: Matching Brackets with Mouse Hover

    Matching Brackets with Mouse Hover

  3. And this is the coolest thing of all! It shows hints in the editor view: Bracketeer Hints

    Bracketeer Hints

The really cool thing of the last features is that it does auto-commenting: It shows you the corresponding block condition in the source view, *without* touching the source code.

Plus it allows you as well to use a hyperlink to the corresponding block: simply press CTRL and use your mouse to jump to the block other end:

Hyperlink with Bracketeer

Hyperlink with Bracketeer

Plus it informs me about unpaired/wrong brackets too:

Wrong Brackets

Wrong Brackets

Cool, eh?

Preferences

Bracketeer has as well rich settings where you can configure the look and feel of it:

Bracketeer Preferences

Bracketeer Preferences

Happy Bracketeering :-)

Published at DZone with permission of Erich Styger, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags: