A shortcut to select a line in Eclipse?

JavaEclipseKeyboard ShortcutsShortcut

Java Problem Overview


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

Java Solutions


Solution 1 - Java

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.

Solution 2 - Java

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.

Solution 3 - Java

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

Solution 4 - Java

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.

Solution 5 - Java

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

Preferences - select line end

Solution 6 - Java

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.

Solution 7 - Java

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.)

Solution 8 - Java

For MacOS you can use the combo:

Cmd+ then Cmd+Shift+

Solution 9 - Java

  1. To select all lines where your cursor is present ctrl + A.
  2. To undo ctrl + Z .
  3. To redo ctrl + Y.
  4. To delete ctrl + D.
  5. To select specific lines shift + /

Solution 10 - Java

alt + Shift + Up couple of time will do the trick

Solution 11 - Java

If you are using windows :

  1. Put the cursor at the beginning of this line.
  2. Press Shift + Down.
  3. Press Shift + Left. (to unselect the extra space at the beginning of the following line - if there is one - )

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
QuestionArturas MView Question on Stackoverflow
Solution 1 - JavamodulitosView Answer on Stackoverflow
Solution 2 - JavaChirloView Answer on Stackoverflow
Solution 3 - JavaCarlosView Answer on Stackoverflow
Solution 4 - JavaBananeweizenView Answer on Stackoverflow
Solution 5 - JavaJaggerView Answer on Stackoverflow
Solution 6 - JavaGismo RanasView Answer on Stackoverflow
Solution 7 - JavaOleg SvechkarenkoView Answer on Stackoverflow
Solution 8 - JavaTheITView Answer on Stackoverflow
Solution 9 - JavaJencyView Answer on Stackoverflow
Solution 10 - JavaItamar KadoshView Answer on Stackoverflow
Solution 11 - JavaMohamed AtefView Answer on Stackoverflow