Eclipse line shortcuts

You can only have one thing in your clipboard, right ?

So you end up having to paste somewhere temporarily to avoid overwriting your clipboard content…you lose time and you mess up your files with temporary pastes that you forget to clean up…

There are other ways. If you want to clone a block of lines and move it somewhere nearby, proceed this way:

  1. Select the block of lines by pressing Shift + Arrow up/down.
  2. Press Ctrl + Alt + Arrow down, this will clone the block of lines.
  3. Move the lines where you want them: Alt + Up/Down.

You may still think copy & paste is faster, but notice how these shortcuts are similar, if you put your fingers on Alt and Ctrl and the up/down arrows you can combine them very quickly. It gets even faster for a single line.

In addition to that I would recommend using Ctrl + D for quickly removing lines and Ctrl + Shift + C to comment/uncomment lines. There are many other shortcuts,  but it does not make much sense to list them without giving a use case, simply press Ctrl + Shift + L.

There are various Multi clipboard tools/plugins, but I do not like depending on those.

Conclusion

This is very similar to copy & pasting, but it allows you to keep your clipboard content where you would normally not. These shortcuts can prove very effective when combined.

Related posts