Accepted answer

ctrl-alt-down: copies current line or selected lines to below

ctrl-alt-up:: copies current line or selected lines to above

ctrl-shift-l: brings up a list of shortcut keys

see windows/preference->general->keys.


to copy text from the begining of line to the cursor position: ctrl + insert

it does the job and save a lot of time for me.


ctrl+alt+down/up/left/right takes precedence over eclipse settings as hot keys. as an alternative, i try different approach.

step 1: triple click the line you want to copy & press `ctrl`-`c`(this will
select & copy that entire line along with the `new line`).
step 2: put your cursor at the starting of the line where you want to to paste
your copied line & press `ctrl`-`v`.(this will paste that entire line & will
push previous existing line to the new line, which we wanted in the first place).


the ctrl+alt+down / ctrl+alt+up flips my screen so i overrode that in the eclipse shortcuts via window => preferences => general => keys. search for "dupl" to find the duplicate lines command. i overrode the default and chose ctrl+shift+d. for me, that's easy to remember just like ctrl+d to delete lines


for personal usage, i add a vim plugin like vrapper to eclipse and just use yy to copy entire line.


the combination of ctrl + shift + alt + down worked for me on linux.


another shortcut way to do this is press ctrl+shift+l and select which command you want to perform and hit enter enter image description here

its best practice for beginner.


i am using windows 7. to disable that all i did is to right click on the windows desktop and select "graphics properties" ->options. then selected "off" at the left side on the resulting screen. this disabled all hotkey combination. i think there is no way to disable only some them, its all or none. anyway i didn't need them. so now crtl+alt+up and crtl+alt+down works for me in eclipse and my screen stays same :) i think similar option also exist in other versions of windows. have fun :)


disabling the hot keys for the intel driver worked for me for windows 7. however, for windows 8, when i tried that, it prevented eclipse from getting the ctrl-alt-down keystoke. i had to change the intel driver key binding to ctrl-alt-f10 (or something else it will accept). eclipse then gets the ctrl-alt-down and copies the line.


just another approach:

1) alt+up and alt+down (or alt+down and alt+up, order does not matter)
2) ctrl+c

but of course vim's "yy" is the fastest :)


for mac, shift+alt+down_arrow works in netbeans' editor.


it's working with me on , eclipse + spring tool suite .

alt + command + down


i have to change the assigned key, e.g.

windows/preference --> general --> keys

select "duplicate lines" under command click on "binding" ctrl + shift + d


on mac, i've tried the linecopypaste and it works great cmd+c -> copy current (unselected) line, just like "yy" command in vi/vim cmd+v -> paste it, like "p" command in vi/vim

thank's larsch for your work!

pd: using eclipse luna 4.4.2 in yosemite


we can assign any command to any action(given) in eclipse from menu bar go to window > preferences then search for the keys then search copy line then click on copy line and then click on command in binding and peform a command which you wish to use for duplicating line i use ctrl+shift+d you can choose whatever you want enter image description here


if anyone using mac computer the ctrl + alt + down keys doesn't work.

try it with,

alt + command + down

it works.


try this in mac.

alt + command + down

it works.


ctrl+alt+down copies current line to below like notepad++ (ctrl+d)

if your whole screen is 180° rotted then you should disable your hotkey settings.

right click -> graphics options -> hot keys -> disable

enter image description here

that it now you done try shortcut ctrl+alt+down


on my mac the default setting is is alt+cmd+down

you can change/view all key bindings by going eclipse -> preferences (shortcut cmd+,) and then general -> keys


i've written the linecopypaste plugin for eclipse that mimics visual studio's copy/cut/paste behaviour. i've also found copycutcurrentline which appears to do the same.


  1. ctrl-d would delete a line
  2. ctrl-z would undo deletion, with highlithing entire line
  3. ctrl-x/c cut or copy entire line

the advantage over ctrl-alt-down followed by ctrl-x suggested by other users is that it doesn't make eclipse think that the file was changed in any way. it's also faster and causes no problems even if the user has rotating screen issue with ctrl-alt-down/up keyboard shorcut. so there's no need to remap shorcuts for this.

another way to go would be hitting alt-shift-up until the entire line gets selected. if you've gone too far, of course you can select less with alt-shift-down.


if your window pc, you may try this, it's also for sts:

ctrl + win + alt + down :: copy current line or selected line to below

ctrl + win + alt + up :: copy current line or selected line to above


if you want to copy a line to the clipboard you can also use the trick:

ctrl-alt-down followed by ctrl-x

the drawback is that the file where you copy the line from becomes dirty.


you have to turn off the graphics hot keys that flip the screen. if you're on windows, you need to right click on the windows desktop and select "graphics properties..." (or something similar depending on your version of windows). this will bring up a screen where you can manage graphics and display options, look for a place where you can disable hot keys, sometimes it's hidden under something like "options and support". turn off the ctrl + alt + and ctrl + alt + hotkeys (alternatively you can just disable all graphics hot keys if you're not using them).


(tested on windows) [per below comments, works as well in ubuntu, ibm rtc 4 / rsa 9]

  1. in eclipse, press ctrl+shift+l two times in succession (or ctrl + 3 > type: keys > enter).
  2. in 'type filter text' (search) text box, type copy lines
  3. select the filtered row, right click the 'binding' field, and do select all
  4. press ctrl+shift+v
  5. give ok

from now on, for any line you want to duplicate, just press ctrl+shift+v.

Related Query

More Query from same tag