A shortcut to select a line in Eclipse

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.

8 Answers
  1. 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.

    2014-04-23 18:34:19
  2. 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.

    Chirlo2013-08-05 23:32:04
  3. 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.

    2014-04-23 18:32:14
  4. There seems to be no command to do that; however, under:

    window->preferences->keys 
    

    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.

    Robert2012-10-20 23:32:12
  5. You can always configure it the way you want in the preferences.

    A shortcut to select a line in Eclipse

    2012-10-21 06:48:39
  6. 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.)
    2013-06-14 08:23:35
  7. For MacOS you can use the combo:

    Cmd+ then Cmd+Shift+

    TheIT2013-06-14 07:56:34
  8. I use Ctrl+D to delete the current line, followed by Ctrl+Z, that restores the line and selects it.

    Neftas2012-10-21 00:05:58
Related Articles
You Might Also Like