Collect text in one register
"ayyj"Ayy
Example
Normal mode on alpha. Next line: beta. Lowercase a replaces; uppercase A appends.
Before
Buffer lines: alpha, beta
Register a after "ayy: alpha
- "ayy Register a · alpha; previous contents replaced
- j"Ayy Move to beta and append · register a holds alpha, beta
- "ap Paste both lines below beta · originals remain
After
Register a: alpha followed by beta as two lines.
Buffer after "ap: alpha, beta, alpha, beta on four lines.
Details & Vim help
Use an uppercase register name to append to its lowercase register.
Collect nonadjacent lines without editing a temporary file.
Lowercase names replace; uppercase names append to the same register. Linewise and characterwise register types affect how appended text joins.
Lowercase a replaces register a. Uppercase A appends to that same register. "ap later pastes the collected lines.
Try it in Vim
- On the first desired line, type "ayy to replace register a.
- On another desired line, type "Ayy to append it.
- At the destination, use "ap to put the collected lines.