Accepted answer

place the cursor next to an opening or closing brace and punch ctrl + shift + p to find the matching brace. if eclipse can't find one you'll get a "no matching bracket found" message.

edit: as mentioned by romaintaz below, you can also get eclipse to auto-select all of the code between two curly braces simply by double-clicking to the immediate right of a opening brace.


i found that if the chosen perspective doesn't match the type of the current file, then "go to matching brace" doesn't work. however, changing perspectives makes it work again. so, for example, when i have a php file open, but, say, the java perspective active, pressing ctrl + shift + p does nothing. for the same file with the php perspective active, pressing ctrl + shift + p does exactly what you'd expect and puts my cursor beside the closing brace relative to the one it started at.


press ctrl + shift + p.

before eclipse juno you need to place the cursor just beyond an opening or closing brace.

in juno cursor can be anywhere in the code block.


to select content use alt + shift + up arrow

to select content up to the next wrapping block press this shortcut again

to go back one step press alt + shift + down arrow. this is also a useful shortcut when you need to select content in a complex expression and do not want to miss something.


on the macintosh, place the cursor after either the opening or closing curly brace } and use the keys: shift + command + p.


with ctrl + shift + l you can open the "key assist", where you can find all the shortcuts.


as the shortcut ctrl + shift + p has been cited, i just wanted to add a really interesting feature: just double-click to the immediate right of the {, and eclipse will select the whole code block between the opening { and corresponding closing }. similarly, double-click to the immediate left of the closing '}' and eclipse will select the block.

Related Query

More Query from same tag