The problem is that yy is copying the entire line, including the newline. An alternative would be to copy from the beginning to the end of the line, and then paste.
^y$
- ^ Go to the first character of the line.
- y Yank till
- $ End of line.
// Credit to: tester and Idan Arye for the Vim golf improvements.