How to achieve auto increment for multiple selection in PhpStorm ie. If I have lines like this selected or taged with multiple cursors
my line das
my line asd
my line sda
my line poi
my line uio
my line kjy
And I want to have them automatically numbered like this
my line das 1
my line asd 2
my line sda 3
my line poi 4
my line uio 5
my line kjy 6
Is there any simple method to this with Emmet or any other plugin?
Press Ctrl+Home to set the caret at the beginning of the first line, enable the column selection mode (press Alt+Shift+Insert ), and then press Ctrl+Shift+End .
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.
Update: This feature is now available in the String Manipulation plugin v4.5
Old: It's far from ideal, but you can use the Duplicate and increment
action from the String Manipulation
plugin. It's quite easy to do and it does the job:
Add a shortcut to this action or execute it multiple time to increment a line containing a number.
So far no PhpStorm plugin allows to do exactly what to describe.
It may be the occasion to create one !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With