I'm currently using yyp
or yy(n)p
to duplicate lines. Can I do it without yanking lines?
Asked
Active
Viewed 277 times
1
Umut Çağdaş Coşkun
- 639
- 9
- 20
3 Answers
3
If you use :co.
then the "
register will be left alone.
Josh Lee
- 149,877
- 34
- 253
- 263
-
Thank 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
- 135
- 1
- 9