linuxphpstormphpstorm-2016.3

PhpStorm - Mark multiple lines


Is it possible to mark multiple lines in PhpStorm?

e.g.

LineA
LineB
LineC

lets say I try to mark LineA and LineC to copy paste them to another place, is this possible?

LineA
LineC

Solution

  • Sure .. but it requires a bit of "precision pointing" and using mouse (not sure if it's easily doable with keyboard only).

    Basically -- the idea is to use Multiple Carets functionality:

    1. Place caret at the beginning of first line
    2. Now Alt + Click on the beginning of the other line to create new caret there (shortcut depends on OS -- on Linux it might be different shortcut/combo as that shortcut may used by Desktop/Window manager for own stuff)
    3. Now you have 2 carets on the beginning of Line A and Line C
    4. Just use Shift + End to select text to the end of line -- it will be done in both lines.
    5. Now just Copy + Paste it elsewhere (or whatever you wanted to do).
    6. Use Esc to get rid of carets.