I'm currently using yyp or yy(n)p to duplicate lines. Can I do it without yanking lines?
Asked
Active
Viewed 841 times
1
Umut Çağdaş Coşkun
- 1,197
- 2
- 15
- 33
3 Answers
5
If you use :co. then the " register will be left alone.
Josh Lee
- 171,072
- 38
- 269
- 275
-
1Thank you I used it like this: `nnoremap yyp :co.
` – Umut Çağdaş Coşkun May 15 '17 at 21:42
1
View Duplicate a whole line in Vim
Explicitly the not so upvoted answers (like :t.). - but why not yyp?
-
I'm using clipboard as vim's default register. So when I duplicate a line, vim is writing the line over system clipboard. – Umut Çağdaş Coşkun May 15 '17 at 21:45
-
Your solution working well too, bu I should accept Josh's answer because he is first. Sorry :( – Umut Çağdaş Coşkun May 15 '17 at 21:46
0
You can delete the line with dd and then paste (put) it with p multiple times. E.g. 2p to duplicate.
jonasjacek
- 145
- 1
- 9