Poor Man’s Bracket Matching Macro

David sent me mail about his "Poor Man's Bracket Matching Macro".  (Click link for Macro Code)

From his site:

"I usually assign it to CTRL + 9 key combination. Now, go to your source and put caret before or after any bracket. Press CTRL + 9. Matching bracket should appear bold for a second or two, just as it does when you first write it. As with all macros it will be rather slow when you run it for the first time, so don't dump it right away.

And it also helps if you set brace matching color to something bright, like red. Go to Tools / Options / Environment / Font and Color / Display Items: Brace Matching and set it's foreground color."

Enjoy! Josh

Comments (2)

  1. Jason Coyne says:

    Why not just use ctrl-]

  2. josh ledgard says:

    True, but this is a good example set of code anyway. I think we also ship a sample macro that does something similar as well. But who can remember all this stuff and keyboard shortcuts?

Skip to main content