I often use Ctrl + D to copy one line of the code.
Is there a keyboard shortcut in IDEA where I can put a caret on the method name and pressing the shortcut combination duplicate the whole method? Ctrl + D does not help in such case.
Until IDEA does not get a built-in feature like this, you can use this approach (it's pretty quick):
Or make a Macro like @CrazyCoder suggested.
You can use first Ctrl + W to select method. Then Ctrl + D to duplicate selected lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With