A shortcut to select a line in Eclipse?
JavaEclipseKeyboard ShortcutsShortcutJava 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.
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
- To select all lines where your cursor is present
ctrl
+A
. - To undo
ctrl
+Z
. - To redo
ctrl
+Y
. - To delete
ctrl
+D
. - 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 :
- Put the cursor at the beginning of this line.
- Press Shift + Down.
- Press Shift + Left. (to unselect the extra space at the beginning of the following line - if there is one - )