How can I expand multi-line selection to full lines in PHPStorm?

前端 未结 4 2003
清酒与你
清酒与你 2020-12-18 00:56

In Sublime Text I can arbitrarily select a set of lines and then use ⌘+L to expand the selection to the full lines. Is there a similar command in PHPStorm / Web

相关标签:
4条回答
  • 2020-12-18 01:04

    Update

    Nowadays (welcome 2020) You can change or add the value to Add Carets to Ends of Selected Lines => CMD+SHIFT+L to have it behave like Sublimetext so it looks like

    Old Answer This is as close as I could get it (before 2020):

    Go to settings > Keymap. Search for Clone Caret Above/Below.

    On a Mac, it looks like this

    The keys are:

    CMD+SHIFT+CTRL+ARROW_UP for Clone Caret Above

    CMD+SHIFT+CTRL+ARROW_DOWN for Clone Caret Below

    Click on Apply and it will work

    0 讨论(0)
  • 2020-12-18 01:08

    Hold down Alt + Shift and left click on the lines you want to select. This will put multiple cursors on the editor. Now you can use the Select Line at Caret option you mentioned to select all those lines.

    You can find more about multiple selections here.

    0 讨论(0)
  • 2020-12-18 01:10

    This is currently not possible with a selection. However, you can still do that from the keyboard. Instead of doing selections set up a shortcut for Clone Caret Above (Alt+Shift+U for me) and Clone Caret Bellow (Alt+Shift+D for me). This allows to go up or down a line and add a caret there. So instead of selecting each line, you directly move the caret there and clone it.

    I am also coming from Sublime Text and missing that feature, but this worked also pretty well.

    0 讨论(0)
  • 2020-12-18 01:20

    With WebStorm 11 (at least) the multi-caret keyboard shortcut is:

    Ctrl then Ctrl+Arrow Up (or click & drag with the middle mouse button/scroll wheel)

    then to select the full lines:

    Home then Shift+End

    which you could even create as a macro with a keyboard shortcut.

    I used to accidentally activate the multi-caret all the time (I scroll with Ctrl+Up/Down), so I knew how to do part of it, but it took me ages to figure out that extra Ctrl tap at the beginning.

    0 讨论(0)
提交回复
热议问题