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?
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?
Are you using (upper-case) P
? That inserts text before the current cursor position. Lower-case p
puts it after.
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$
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