Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing line numbers for copied code in eclipse

Tags:

eclipse

I am wondering if I have some code with line numbers embedded,

 1 int a;     
 2 MyC b;    
 3 YourC c;

etc., and then I copy them and try to paste them in Eclipse, how to get rid of these line numbers to make the source code valid? Is there any convenient way, or a short-cut key?

Thank you.

like image 816
Qiang Li Avatar asked Nov 29 '11 22:11

Qiang Li


1 Answers

Simply use the Alt+Shift+A (Eclipse 3.5 M5 and above) shortcut to toggle block selection mode. Then select the column with line numbers and delete it!

To make it easier you could setup a macro, but for that you need additional plug-in. I'm not aware of how to do it even easier.

like image 67
Roman Byshko Avatar answered Oct 08 '22 00:10

Roman Byshko