Article 5SV30 vi - joining consecutive lines

vi - joining consecutive lines

by
ArfaSmif
from LinuxQuestions.org on (#5SV30)
I map a key in vi to help me join two lines together and then move to the next line. Rinse and repeat. This is part of the process to help me shuffle some #EXTM3U style playlists for my portable music player.

I map the key [ to do the following:-
1. Go to the end of the line ($)
2. Join two lines together (J)
3. Down arrow key to go to next line.

Like this in vi:-

:map [ $J(CTRLV)(DOWN ARROW KEY)(PRESS RETURN KEY)

This works well except for the fact that some playlists may have 6000 lines in them. In which case, I sit there for a minute or so holding my finger down on the [ key.

My question is this. Is there a simple command in vi that I can use to achieve the same result? Or is there a more elegant way to do this, perhaps with sed or awk etc?

Thanks for your help.latest?d=yIl2AUoC8zA latest?i=Np2QZWD48TM:GU4kXXHiodw:F7zBnMy latest?i=Np2QZWD48TM:GU4kXXHiodw:V_sGLiP latest?d=qj6IDK7rITs latest?i=Np2QZWD48TM:GU4kXXHiodw:gIN9vFw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments