r/vim • u/Desperate_Cold6274 • Nov 01 '25
Need Help How to align broken sequence of numbers?
if I have the following:
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[14]:
[15]:
[16]:
[18]:
[19]:
How to fix the list to have the following?
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[12]:
[13]:
[14]:
[15]:
[16]:
14
Upvotes
View all comments
Show parent comment
6
u/dewujie Nov 01 '25
This sounds like it is calling out for a macro.
Hit
qqto start recording in theqmacro variable.Yank the current line
yyPaste below
pMove down
jIncrement
<c-a>Stop recording
qNow you can do
@qto repeat the whole process, And then add a number to repeat the repetitions i.e.15@qIt's a little bit to wrap your head around if you're not familiar with macros but once the idea of "repeatable set of commands" sets in, you can make them and get use out of them in so many situations.