I am aware about surrounding selection in quotes or braces
PhpStorm wrap/surround selection?
I need similar but surround selection into array Assume I have text separated with newline or text separated with space
a
b
c
d
e
a b c d e
I need after selection get [a,b,c,d,e]
Please advice any IDE or method how to achieve this
Make sure the following option is enabled:
For text separated with spaces:
Ctrl+R
and R
again (to enter 'In selection' mode),
in the secondEsc
[
: the closing bracket will be added automaticallyFor multi-line text:
Ctrl+R
, enable 'Regex'\n +
in the first field, ,
in the secondEsc
[
: the closing bracket will be added automaticallyThe sequence of actions can be wrapped into a macro and assigned a single shortcut.