Number repeated lines in one gesture
V2j g<C-a>
Example
Normal mode on the first 0. Lines: 0. alpha, 0. beta, 0. gamma.
0. alpha
0. beta
0. gammaCursor on line 1, column 1- V2j Three lines selected · Visual Line mode
- g<C-a> Add 1, 2, then 3 · 1. alpha, 2. beta, 3. gamma
1. alpha
2. beta
3. gammaCursor on line 1, column 1Details & Vim help
Visual g Ctrl-a applies progressively larger increments across selected lines.
Turn repeated zeroes into a numbered list.
Plain Visual Ctrl-a adds the same amount to each line. g Ctrl-a increases the amount on successive affected lines; use a count to change the step.
Try it in Vim
- Start on the first 0 in the example.
- Press V2j to select all three lines.
- Press g, then Ctrl-a.