1. Veera
  2. Blog

Copy paste code directly in Eclipse

Recently learned a really cool trick for copy-pasting code in Eclipse.

Let's say you have the following code:

package com.veerasundar.demo;

    public class CopyCode {
    	private int nothing;
    }

Now copy the above code, go to any Eclipse project and right click on *source *folder and paste. See what happens! Impressive isn't it!?

Here's what Eclipse did: it parsed the clipboard, found that there's a Java code in it, create the necessary package structure for the code to fit in and then copied the code there.

Neat!

Written by

Veerasundar profile photo

Hey, I'm Veerasundar.
Senior Full Stack Developer

I build scalable web applications and engineering teams. Over the last 20 years, I’ve worked across frontend engineering, full stack development, architecture, and engineering leadership.

See my Resume