I need to make next task:
file:
string1 data1 data
I need to create more strings with only changes in digits
string2 data2 data
string3 data3 data
string4 data4 data
How can i do it fast ?
select that input line, yank it into buffer a: "ayy
.
Then record the following sequence: qq
"ap
Paste the line belowctrl-a
Increment the digitw
Move forward one wordctrl-a
Increment the digit"ayy
Yank this line in as your new baselineEnd your macro with q
Then repeat it as many times as you need (let's say 42), with 42@q
Several plugins manage that: visincr.vim, increment.vim.
I use visincr and that is very easy: Visual block, :I
.
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