I found a really stupid solution. Ignoring that there are better ways to do this let's say that I want to create a macro that takes
0
and after running it 4 times produces:
0
1
2
3
4
Here are the steps I followed:
- type '0'
- start a macro in register 'q' with 'qq'
- With point on '0' I do a yw,
- Shift-o to get to the next line
- 'Control-o p' to paste the '0'
- Place point on the new '0'
- Control-A to increment to '1'
- yw to replace the '0' in the unnamed register with '1',
- 'q' to stop the macro
- replay the macro 4 times with '@q'
-deech