Reputation: 12003
is there a key shortcut in Eclipse to copy the whole method body into buffer?
Upvotes: 6
Views: 5283
Reputation: 1323293
Little know trick, use the folding feature:
If a method is folded, and if you select the folded line, you will actually copy the full body of said method.
If the Alt+Shift+Up does not work for large number of lines, this will.
Upvotes: 7
Reputation: 1255
If you just want to copy a code block (including a method body), double click to the right of the first curly brace, the whole block will become highlighted, then it's just a Control-C, Control-V thing :)
Upvotes: 0
Reputation: 61695
You can find a list of shortcuts in Eclipse by typing Ctrl+Shift+L.
While you are exploring this list, you will find Alt+Shift+Right which selects the next element. This may be what you are looking for.
Upvotes: 8
Reputation: 3454
You can press alt+shift+up several (5-10 if you start from empty selection) times to expand selection to include the whole method body.
Upvotes: 5