简体   繁体   中英

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?

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.

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 .

我使用Ctrl + D删除当前行,然后使用Ctrl + Z ,恢复该行并选择它。

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.

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

首选项 - 选择行尾

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.

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

For MacOS you can use the combo:

Cmd + then Cmd + Shift +

  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 + /

alt + Shift + Up 几次就可以了

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM