How to merge two multi-line blocks of text in Vim?

I’d like to merge two blocks of lines in Vim, i.e., take lines k through l and append them to lines m through n. If you prefer a pseudocode explanation: [line[k+i] + line[m+i] for i in range(min(l-k, n-m)+1)].

For example,

abc
def
...

123
45
...

should become

abc123
def45

Is there a nice way to do this without copying and pasting manually line by line?

9 Answers
9

Leave a Comment