Delete a line in Eclipse

Viewed 81120

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!

8 Answers

Ctrl + D

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

For Mac users: ⌘ + D

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

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

Now type "Delete" and reassign the filtered commando.

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.

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

Related