When doing multi cursor selection, often you need to type a different value for each, you've to cancel selection even though all cursors are where you want them to be.
Is it possible to activate some sort of mode and press tab to automatically iterate through each one by one on every tab and type your value. Esc to cancel the mode.
Note: how in end I had to type 1, 2, 3, 4 manually. Those could have been food categories, clothing size, select options etc.
In case you don't want to install extension, you can copy sample data (which is generated by your favorite scripts or tools, for example) then paste it to the current cursors.
For example, I generate numbers by
Array(10).fill(0).map((a, i) => i + 1).join('\n')
shell / bash
script:seq 10
Then,
For the special case of when you want to insert values that follow a sequence at your multiple cursor locations, then the powerful Insert Nums package for Sublime Text can help.
Insert Nums can fill in numbered blanks (1,2,3,4, ... 10), and much more. Just about anything you could write as a for loop can be generated and inserted at the multiple cursors. This includes integer/float/string, count up/down, arbitrary start/stop/step values, and formatting to hex, binary, etc., representation. You can also evaluate an expression at each index, so for example you can create a geometric or power series or a pattern of bit shifts.
The default case for Insert Nums is integers, starting at 1, incrementing by 1, and ending when all selections are filled. For the example problem in the question of numbering Items
, all you'd have to do is Ctrl+Alt+N, then Return. The numbers 1 through 5 would be filled in.
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