Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split selection into lines in PHPStorm

Tags:

phpstorm

In Sublime I was quite fond of the "Split selection into lines" shortcut (super+shift+l). However I cannot find an equivalent of that in PHP Storm 8, I've found a "Split into lines" function in the Edit menu but feeding it either \n or \r doesn't seem to work. Does that function exist in PS ?

like image 897
Maxime Fabre Avatar asked Jun 25 '14 22:06

Maxime Fabre


People also ask

How do I split a line in Intellij?

Another way of splitting a string literal is to set the caret where you want to split the string, press Alt+Enter and choose Split string. This context action will also add necessary quotation marks and + , but both parts of the string will stay on the same line.

How do I select multiple lines in Intellij?

To select ranges as multiple rectangular selections, Ctrl+Alt+Shift+Click and drag the mouse over the desired parts of code. As a result, you will have multiple selection ranges in each affected document line. On lines that are shorter than the rectangle, the selection will only span to the last character.


2 Answers

By default on PHPStorm 10+, you can toggle the Column Selection Mode with:

CMD + SHIFT + 8

Of course, you can configure any stroke you like. I like to keep the original one and add the one that matches Sublime which is CMD + SHIFT + L. Here is how:

How to configure column selection mode stroke in PHPStorm

like image 168
Arian Acosta Avatar answered Oct 02 '22 17:10

Arian Acosta


There is a "Split Selection into Lines" action in the Extra Actions plugin.

Compatible with: Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio

like image 42
Drarok Avatar answered Oct 02 '22 16:10

Drarok