When pasting from the system buffer in a line like
foo( someVal , <cursor is here>, someVal3);
If I use "*p I get
foo( someVal, , someVal3);
<pasted text>
If I use "*P I get
<pasted text>
foo( someVal, , someVal3);
but I want
foo( someVal, <pasted text>, someVal3 );
How can I get the result I want?
edit
If there is a newline in the buffer as @amardeep suspects, is there a way I can tell vim to ignore it?
Press y to copy, or d to cut the selection. Move the cursor to the location where you want to paste the contents. Press P to paste the contents before the cursor, or p to paste it after the cursor.
You can use :set mouse& in the vim command line to enable copy/paste of text selected using the mouse. You can then simply use the middle mouse button or shift insert to paste it. Save this answer.
You can type <C-r>*
in insert mode and then use <BS>
to remove trailing newline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With