score:402
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.
score:0
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.
score:0
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).
score:0
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
score:0
For personal usage, I add a vim plugin like Vrapper to Eclipse and just use yy
to copy entire line.
score:0
The combination of Ctrl + Shift + Alt + Down worked for me on Linux.
score:0
score:1
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 :)
score:2
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.
score:2
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 :)
score:2
For mac, shift+alt+down_arrow works in netbeans' editor.
score:2
It's working with me on , Eclipse + Spring tool suite .
ALT + COMMAND + DOWN
score:3
I have to change the assigned key, e.g.
Windows/Preference --> General --> Keys
Select "Duplicate Lines" under command Click on "Binding" Ctrl + Shift + D
score:3
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
score:3
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
score:4
If anyone using Mac computer the CTRL + ALT + DOWN keys doesn't work.
Try it with,
ALT + COMMAND + DOWN
It works.
score:5
Try this in MAC.
ALT + COMMAND + DOWN
it works.
score:7
score:10
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
score:11
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.
score:13
- Ctrl-D would delete a line
- Ctrl-Z would undo deletion, with highlithing entire line
- 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.
score:13
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
score:17
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.
score:28
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).
score:70
(Tested on Windows) [Per below comments, works as well in Ubuntu, IBM RTC 4 / RSA 9]
- In Eclipse, press Ctrl+Shift+L two times in succession (or Ctrl + 3 > type: Keys > Enter).
- In 'type filter text' (search) text box, type
Copy Lines
- Select the filtered row, right click the 'Binding' field, and do
Select All
- Press Ctrl+Shift+V
- Give
OK
From now on, for any line you want to duplicate, just press Ctrl+Shift+V.
Source: stackoverflow.com
Related Query
- Eclipse copy/paste entire line keyboard shortcut
- Eclipse Duplicate line keyboard shortcut on MAC
- Copy and paste in Eclipse adds window newlines at the end of each pasted line
- Is there a way I can copy code from Eclipse IDE with line numbers so I can paste it into a word document?
- Is there a way to copy the contents of a String in Eclipse using a keyboard shortcut or menu item?
- Keyboard shortcut to "untab" (move a block of code to the left) in eclipse / aptana?
- Eclipse shortcut "go to line + column"
- Eclipse keyboard shortcut to indent source code to the left?
- What is the keyboard shortcut to go to a file in Eclipse on Mac OS X?
- Is there a keyboard shortcut in Eclipse to fold the current method/block?
- What is the keyboard shortcut for method suggestions in Eclipse on Mac OS X?
- Redo keyboard shortcut for Eclipse
- what's the keyboard shortcut to toggle breakpoint in pydev using eclipse
- Keyboard shortcut synchronization with Eclipse and IDEA?
- Assigning a keyboard shortcut for a specific Eclipse build configuration
- Keyboard shortcut to navigate to next/previous search match in eclipse for java
- Unbind F1 'Help' keyboard shortcut in eclipse
- How do I compile my code in Eclipse using keyboard shortcut key
- Eclipse shortcut to end of line and beginning of line
- Keyboard shortcut to place tasktags in Eclipse
- Eclipse keyboard shortcut to an Ant task?
- Eclipse Terminate Keyboard Shortcut
- How to add a keyboard shortcut to the Team->Add command in eclipse
- Add Watch Expression in Eclipse using keyboard shortcut
- keyboard shortcut for showing proposal table for solving errors using Eclipse
- Eclipse MAC - Comment / Uncomment - keyboard shortcut
- Eclipse keyboard shortcut for passing a parameter to a method
- is there a key shortcut in Eclipse to copy the whole method body into buffer?
- Visual Studio equivalent to Eclipse keyboard shortcut Alt Shift L
- Keyboard shortcut for Run As -> Android JUnit Test in Eclipse
More Query from same tag
- How do I add an entry into the File Association preferences programmatically?
- Creating a new project from existing code
- Why doesn't Scala IDE recognise my Scala packages?
- Convert Unix Executable to Windows Executable
- Unable to instantiate activity com.google.android.gms.drive.sample.quickstart
- JUnit testing: Improvement to test case, testing for length of array List?
- Instantiate Error in Eclipse in calendar java code
- Why is my font not displaying correctly for Spring Tool Suite Dashboard on MacOS?
- How to change application theme in Eclipse
- Extra namespace in xsl output eclipse
- Referencing a new library in Eclipse
- Android: Switching between two activities Error - Unfortunately "App Name" has stopped
- Java Eclipse turn off auto build workspace on save
- Span class in opennlp is not working
- How to develop an algorithm for computing the month-by-month balance in savings accounts
- Get complete JDK source code in IntelliJ or other IDE
- Eclipse IDE setup for multi-language development
- Run program java with attributes from command line
- Export JAR with libraries
- Eclipse Members Sort Order vs Oracle Java Code Conventions
- Running a basic RMI cleint server from command line
- How to add build.gradle on existing Android app on Eclipse
- Eclipse can not commit all files to Git
- How to analyze MAT with eclipse
- Android Spinner Help
- How to get line by line coverage xml file in Emma- maven project
- Eclipse: Error ".. overlaps the location of another project.." when trying to create new project
- Unable to Start a Django Project
- LibGDX 'MyFirstTriangle' example crashes on startup
- How to Override request logging mechanism in Jetty 11.0.6