Saturday, May 12, 2012

Matching braces in code

In day-to-day life developers use to write huge logic involving many braces ({,}) in the code. Reaching to end/start of any condition gets complex as the lines of code increases. To simplify the same, one can use key combination of Ctrl+].


To use the given key combination, place the cursor on any brace and hit Ctrl+]. If the brace is an end brace, the control will move to the matching brace i.e. start brace of the condition and vice versa.


Also the same key combination can be used to navigate to the matching comment (/*, */) or region (#region). In these cases, the cursor position should be on the comment or the region respectively.


Hope this helps !!!

No comments:

Post a Comment