In vim, how do I paste a column of text to the end of irregular length lines?

后端 未结 5 1154
悲哀的现实
悲哀的现实 2020-12-30 00:39

I would like to paste a column of text at the end of irregular-length lines.

For example, I would like to paste the following:

SRR447882.fastq.gz
SRR         


        
5条回答
  •  再見小時候
    2020-12-30 01:25

    You can do it like this:

    • Start on the first line of the second block
    • qq, start recording the q macro
    • 4k, go up four lines
    • d$, delete till the end of line
    • 4j, go back to the previous line
    • $p, paste the line at the end of the line
    • q, stop recording the macro
    • jVG, go down one line and select the remaining lines
    • :norm! @q, apply the macro to the selection

    It does however leave space where the previous text was. @Kent one's is still easier.

提交回复
热议问题