Reputation: 87
In vim 8, ctrl+A
/ crtl+X
increases and decreases number for visual selected columns, respectively.
1
2
3
ctrl+A
2
3
4
However, both are not worked to multiple columns.
Is there any simple method to increase/decrease a constant number for all columns selected? Like,
1 10
2 11
3 12
Any commands
2 11
3 12
4 13
Upvotes: 3
Views: 2871
Reputation: 751
Not exactly what you asked for but might be close enough:
CTRL-V
and select all the columns you want to change.CTRL-A
. This will increment the numbers of the first column. At this point, the cursor should be at the top of the first column.w
to move the cursor to the second column..
to increment the second column.w
and .
until you're done with all the columns.This also works if you only select one column in step 1, but only if all the columns have the same width or if the selected column is the widest.
This may not work correctly if the columns do not have the same number of rows.
Upvotes: 7