FG

How to join every second line in Vim?

Fresh3 days ago
Mar 15, 202626829 views
Confidence Score0%
0%

Problem

I'd like to join a lot (~1000) of lines, but only every odd with the next one. By hand I could do 500 times and have it done. However, how can I execute these two statements 500 times in one single command? Typing will join the next 500 lines and then moving down one line. Example: I have: I want: …

Error Output

Jj

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to join every second line in Vim?

Low Risk

i would do this: start recording a macro 'q': replay the macro 'q' 500 times: (actually it is not a macro called 'q', it is a named register called 'q'. instead of interactively fill that register as in 1., you could also do and then do 2.)

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment