tags:

views:

98

answers:

4

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?

+1  A: 

Use capital P instead of lower case p in that command.

Amardeep
then the pasted text is above the line. Updating question with example.
BioBuckyBall
It worked fine when I tried it. The text in your buffer might have newlines in it.
Amardeep
newlines would be fine, at least it would result syntactically correct code :)
BioBuckyBall
A: 

Oh well, I just recorded macros to workaround it for now. Thanks @Amardeep for the attempts.

BioBuckyBall
A: 

"*p or "+p works for me. Are you sure that's what you're actually typing?

scomar
yes, I'm positive.
BioBuckyBall
+1  A: 

You can type <C-r>* in insert mode and then use <BS> to remove trailing newline.

ZyX
This worked, thanks.
BioBuckyBall