Monday, 5 October 2009

 

Join Pairs of Lines

Compress every other line

Bob
Jones
Mary
Quite-contrary

:g//,//j

Bob Jones
Mary Quite-contrary

Now if there are empty lines eg
Bob


Jones
Mary
Quite-contrary

use
:g/./,/./j
or slightly tighter
:g/\w/,/\w/j

and to limit it to a range of lines (between markers a and b)
:'a,'bg/\w/,/\w/j

Tip from James Church

Labels:


Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]