Skip to main content
added 173 characters in body
Source Link
B Layer
  • 20.1k
  • 2
  • 32
  • 59

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rowssequence down one column.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

Note that you can't apply this to multiple columns of numbers at once. You'll need to run it separately five times, in your case. However, since the numbers are the same in each of the columns you should be able to use the repeat command after you run it once: move the cursor to the appropriate column of the second row (no need to visually select the whole column) and hit ..

So, once you've placed the cursor at row 2 column 3 you could do, for example...

<c-v>{R-2}jg<c-a>fal.f1.fal.f1.

Where {R-2} is replaced with total rows - 2.

See :h v_g_CTRL-A.

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rows.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

Note that you can't apply this to multiple columns of numbers at once. You'll need to run it separately five times, in your case. However, since the numbers are the same in each of the columns you should be able to use the repeat command after you run it once: move the cursor to the appropriate column of the second row (no need to visually select the whole column) and hit ..

See :h v_g_CTRL-A.

Using regex/substitution won't help much. Fortunately, Vim has a command for generating a sequence down one column.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

Note that you can't apply this to multiple columns of numbers at once. You'll need to run it separately five times, in your case. However, since the numbers are the same in each of the columns you should be able to use the repeat command after you run it once: move the cursor to the appropriate column of the second row (no need to visually select the whole column) and hit ..

So, once you've placed the cursor at row 2 column 3 you could do, for example...

<c-v>{R-2}jg<c-a>fal.f1.fal.f1.

Where {R-2} is replaced with total rows - 2.

See :h v_g_CTRL-A.

added 255 characters in body
Source Link
B Layer
  • 20.1k
  • 2
  • 32
  • 59

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rows.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

Note that you can't apply this to multiple columns of numbers at once. You'll need to run it separately five times, in your case. However, since the numbers are the same in each of the columns you should be able to use the repeat command after you run it once: move the cursor to the appropriate column of the second row (no need to visually select the whole column) and hit ..

See :h v_g_CTRL-A.

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rows.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

See :h v_g_CTRL-A.

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rows.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

Note that you can't apply this to multiple columns of numbers at once. You'll need to run it separately five times, in your case. However, since the numbers are the same in each of the columns you should be able to use the repeat command after you run it once: move the cursor to the appropriate column of the second row (no need to visually select the whole column) and hit ..

See :h v_g_CTRL-A.

Source Link
B Layer
  • 20.1k
  • 2
  • 32
  • 59

Using regex/substitution won't help much. Fortunately, Vim has a command for generating sequences on a set of rows.

Use ctrl-v to select the third column (the digits) on all but the first row and type g then ctrl-a.

That will add 1 to the selected number on the second row, 2 to the number on the third row, and so on.

See :h v_g_CTRL-A.