Eclipse copy/paste entire line keyboard shortcut

后端 未结 25 3001
感动是毒
感动是毒 2020-12-07 07:05

Anyone know the keyboard shortcut to copy/paste a line into a new line in Eclipse, without having to highlight the entire line?

ctrl-alt

相关标签:
25条回答
  • 2020-12-07 08:01

    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).
    
    0 讨论(0)
  • 2020-12-07 08:03

    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.

    0 讨论(0)
  • 2020-12-07 08:03

    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 :)

    0 讨论(0)
  • 2020-12-07 08:05

    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.

    0 讨论(0)
  • 2020-12-07 08:08

    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 :)

    0 讨论(0)
  • 2020-12-07 08:11

    (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.

    0 讨论(0)
提交回复
热议问题