Delete a line in Eclipse

JavaEclipse

Java Problem Overview


In a Visual Studio, you would use Ctrl+L, whereas in Eclipse I am forced to select a line or, if it is empty, go the beginning of the line before clicking delete/backspace.

Is there a quick shortcut? Thanks!

Java Solutions


Solution 1 - Java

Ctrl + D

From Help->Key Assist... there are all kinds of useful keyboard shortcuts for Eclipse.

For Mac users: + D

Solution 2 - Java

In the future, if you need to quickly find a keyboard shortcut for something simple, just hit Ctrl+Shift+L.

Solution 3 - Java

Ctrl + D should delete the line.

Solution 4 - Java

You can reassign the Delete Line command to your favourite hotkey.
Window->Preferences
General->Editors->Keys.

Now type "Delete" and reassign the filtered commando.

Solution 5 - Java

if your are using MAC then it is

command + D  => ⌘ + D

Solution 6 - Java

To quickly find shortcuts, hit Ctrl + L, Ctrl + L (Ctrl+L twice), then type something approximating what your command does in the filter text for the key assignments. This works pretty well for most shortcuts, although it can be a bit tricky for some where the name of their menu assignment bears no relation to that of their command in this list (for instance, Team->Revert to base appears in the keys list as 'Replace with latest from repository'), so sometimes a little lateral thought is required :-) If no shortcut exists, it's easy to add one in the keys dialog.

Solution 7 - Java

And if you want it as a list to take a print or something, here is a link to the eclipse shortcut pdf.

shortcut to pdf page

Solution 8 - Java

press Ctrl+Shift+L TWICE and press TAB then you can type to find your shortkeys

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSashaView Question on Stackoverflow
Solution 1 - JavaJoshua McKinnonView Answer on Stackoverflow
Solution 2 - JavamandaleekaView Answer on Stackoverflow
Solution 3 - JavaDan LewView Answer on Stackoverflow
Solution 4 - JavaguerdaView Answer on Stackoverflow
Solution 5 - JavaMd Ayub Ali SarkerView Answer on Stackoverflow
Solution 6 - JavaEwen CartwrightView Answer on Stackoverflow
Solution 7 - JavaReal Red.View Answer on Stackoverflow
Solution 8 - Javauser6817230View Answer on Stackoverflow