Paste multiple times

后端 未结 6 1447
有刺的猬
有刺的猬 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条回答
  •  旧时难觅i
    2021-01-29 22:54

    Instead of using copy/paste, it is often better to use a text object command such as ciw to change the inner word. This method has the advantage of being easily repeatable using the . repeat command.

    1. yiw Yank inner word (copy word under cursor, say "first").
    2. ... Move the cursor to another word (say "second").
    3. ciw0 Change "second", replacing it with "first" ( is Ctrl-R).
    4. ... Move the cursor to another word (say "third").
    5. . Change "third", replacing it with "first".

提交回复
热议问题