tags:

views:

111

answers:

4

I often want to paste some text after the last space in line. If I have

sometext <cursor>

and press Ctr+O, P, I got

sometext<pasted_text>

instead

sometext <pasted_text>

How do I achieve the latter in vim?

+7  A: 

Are you using (upper-case) P? That inserts text before the current cursor position. Lower-case p puts it after.

Jefromi
A: 

You should type (without comma)
$, p

Vereb
+2  A: 

If your line is

sometext$

where $ is the end of the line, then try o<Esc>pkJ to get

sometext pastedtext$

If your line is

sometext $

then just do $p to get

sometext pastedtext$
rampion
This is exactly the approach I take, paste it on the next line, then move up and `shift+j` it. Alternatively, you could do `shift+a` then `esc` then `p`.
Topher Fangio
+2  A: 

You can just go

<c-r><register key>  
eg <c-r>0  for last yank
<c-r>" for last deleted text

Assuming your cursor is where you want it to be and you're in insert mode.

This may be more fluid.

note also works on the : command line

michael