I search a way to paste/merge 2 block of text
apple pear banana
tomato beans potato
apple tomato pear beans banana potato
I'm looking for an easy way to do this using macros.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
Visual block mode is a good route....
<C-V>: we'll visually select the whole block...
}kis good (line count agnostic)
$A<space><esc>- this adds a space after every line
gvrecreates the previous visual selection,
Move cursor to "t" in tomato and hit
P to paste.
This can be used directly in a macro.
Update: I just remembered that I wrote a fairly substantial answer to a somewhat similar question: Add a block of text to end of lines. It doesn't have an exact answer to your question like I've written here but you might find it useful/interesting.