I am going to suggest using Ctrl + v to make a block.
It sounds as if putting the second block after the first doesn't do what you want. However, if you put the first block in front of the second block, it should work.
So, if your cursor is over the
apple, (and there is a space at the end of every item in the first block), you can do:
/------ Delete the first block v <C-v>jj$xjjP ^ ^ ^ ^ ^ | | | | \--- Put the content of the first block before the second block | | | \----- Go to the first line of the second block | | | | | \------- Highlight the block to the end of every line | | | Go to bottom of first block \ Start Visual mode in Block version (Ctrl + v)
Start a visual block (Ctrl + v)
Go to bottom of the the block (2j)
Go the the end of all lines ($)
Go the the start of the next block (2j)
Put before (P)
This leaves a block worth of empty lines above the second (now expanded) block. This can easily be removed (with
kdgg, for example).
Caveat: This requires that all the lines in the top group end with a single space (
One way to put a space at the end of every line is to select it all, and replace.
Go to top of file (
gg), start visual line block (
V), go down a block (
}), and up a line (
k) (now the entire top block is selected), and press
:: gets you to command mode with a starting line of
:'<,'>. The replace is
s/$/ /, which will replace the end of line (
$) with a space (
So, to wrap up, to go from your first block to the second block, I would run (starting from
Vjj:s/$/ /<enter>C^v2k$x4jPgg4dd ^---------------^ ^^ ^---^ Put a space @ end *1 *3 ^-----^ ^ Cut top 2 *1 - Go down *2 - Paste *3 - Cleanup
I don't know why you are against macros, but another simple way to do it would be to use
} to jump to between the two blocks, and delete the top item in the bottom block, them jump back to where you were using Ctrl + o (
put, go up a line,
Join the new line to the first, and then advance (
k) to the next line to start all over again.
Or, if I was creating a macro (in register
And then repeat with:
20@@, or however many times you want .