Vi Editor - How to paste the line concatenated with current line

I generally use yy to copy a line and then p to paste the line at end of current line.

But is there a way to paste the copied line in concatenation with the current line with out going to next line.

I am not sure if there is a direct command for that. I always just use

p <arrow up> J

or

p <arrow up> gJ

If I do not want the extra space.

instead of yy, copy the current line using y$ ( but you should be at the starting position to copy the line )..

go to the position where you want to paste, and press p to paste .. ( so it will not go to the next line also )

1 Like

Go to first character of the line.
Press ESC then v then go to the end of line.
Press y and go to the last character of the line.
Press p.