Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete a line in Eclipse

Tags:

java

eclipse

People also ask

How do I delete a single line in Eclipse?

while Ctrl+L in Visual Studio is cut the line, Ctrl+Shift+L means just delete the line.

How do I cut a line in Eclipse?

Go to Menu "Window > Preferences > General > Keys". Search for "Cut Line" and set binding of your choice. In my case I did "Alt + X".

How do I select a single line in Eclipse?

Solution for Eclipse:Hold Alt and press ↑ and ↓ .


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.


Ctrl + D should delete the line.


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

Now type "Delete" and reassign the filtered commando.


if your are using MAC then it is

command + D  => ⌘ + D

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