Paste multiple times

后端 未结 6 1527
有刺的猬
有刺的猬 2021-01-29 22:30

What is the best way replace multiple lines with the contents of the clipboard?

The problem I\'m having is when I yank a line and paste it over another line the \"yank\

6条回答
  •  死守一世寂寞
    2021-01-29 23:03

    When you paste over a selection in Vim it will replace the default register with the contents of the selection. If pasting over a selection is wiping out the contents of the clipboard register then very likely you have the following line in your .vimrc

    set clipboard=unnamed
    

    One option is to remove that and use the explicit clipboard register "+

    Another option is to use any of the other explicitly named registers (a-z). After the first paste yank the line back into "c for example and then use "cp to paste from there on out.

提交回复
热议问题