How to duplicate a line without yanking it?

I'm currently using yyp or yy(n)p to duplicate lines. Can I do it without yanking lines?

Upvotes: 3

Views: 3546

Answers (3)

j15k
j15k

Reputation: 155

You can delete the line with dd and then paste (put) it with p multiple times. E.g. 2p to duplicate.

Upvotes: 0

r00tandy
r00tandy

Reputation: 996

View Duplicate a whole line in Vim

Explicitly the not so upvoted answers (like :t.). - but why not yyp?

Upvotes: 4

Josh Lee
Josh Lee

Reputation: 177875

If you use :co. then the " register will be left alone.

Upvotes: 7

Related Questions