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

后端 未结 5 1152
悲哀的现实
悲哀的现实 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:14

    Step 1 - goto to the start of the SPP... lines, then start Visual mode linewise with V (capital V), press j two times to get the desired lines selected then press y.

    Step 2 - goto the start of the TIL0... lines, then start Visual mode linewise with V (capital V), press j two times to get the desired lines selected then type...

    :s;$;\=' ' . split(@")[line('.')-line("'<")];g`
    

    and press Enter.

提交回复
热议问题