Take the 2-minute tour ×

is there a keyboard shortcut to select all the line your cursor is currently on? In Eclipse? Or even in general on Windows/Linux?

Thanks in advance.

share|improve this question

8 Answers 8

up vote 16 down vote accepted

Solution for Eclipse:

Hold Alt and press and .

Alt + and will move an entire line up or down, so just move it back and you end up with the entire line selected. Thus, the order of and does not matter.

share|improve this answer

What i use is Home, then Shift+End, that will go to the beginning of the line and then select until the end, which effectively selects the whole line. Once you get used to it you can do it really fast. To get a quick view of all current shortcuts you can use Shift+Ctrl+L.

share|improve this answer
Yeah, that's what I'm currently using, though I'm searching for something more direct shortcut, since my home - end buttons are really uncomfortable on this keyboard. Thanks for the list of shortcuts shortcut, that's really useful! –  Arturas M Oct 20 '12 at 23:56
I use ctrl+d a lot to delete a complete line –  Raunak Agarwal Oct 20 '12 at 23:58

There is no single keyboard shortcut in Eclipse. If using the mouse is not completely ruled out, a triple mouse click selects the line you clicked at.

share|improve this answer

There seems to be no command to do that; however, under:


there are the commands Cut Line and Copy Lines, which I think is what you need basically.

Copy Lines makes a copy of the current line below it and then selects the new line. You can use it in combination with Cut Line to move the new line somewhere else.

share|improve this answer
I think that holding alt and pressing up + down is easier. (the order of up + down does not matter - see my answer below). –  Lucas Apr 2 at 8:40

You can always configure it the way you want in the preferences.

Preferences - select line end

share|improve this answer
This doesn't really solve the problem. It is pointed out later that "select line" does not exist in the preferences... would be nice to have. –  Colin Dec 4 '12 at 18:22
It did solve the problem a month ago, so I do not understand your comment. –  Jagger Dec 4 '12 at 23:09
See for yourself in the screenshot, there is no "Select Line" command (ie. select the entirety of whatever line my cursor is on). There is "Select Line Up", "Select Line Start", etc. Ie. so there is no simple way to map a hotkey for select line. (See the comments below for more on the subject.) –  Colin Dec 6 '12 at 17:07

Actually, there is a plugin (copycutcurrentline) for copying/cutting the whole current line (looks like the author has this problem). It works as following:

  1. Press Ctrl+C to copy or Ctrl+X to cut the whole line in an editor if you select nothing. (It works as usual if you select some text.)
  2. Put the caret on any line on any position.
  3. Press Ctrl+V to paste the line above. (You will not lose the caret position.)
share|improve this answer

For MacOS you can use the combo:

Cmd+ then Cmd+Shift+

share|improve this answer
Or vice-versa, which seems more intuitive to me. –  arlomedia Feb 5 at 4:36
@arlomedia: Think different ;-) –  xav Apr 23 at 20:02

I use Control+D to delete the current line, followed by Control-Z, that restores the line and selects it.

share|improve this answer

Your Answer


