Hi,

Meino Christian Cramer wrote:
> From: "Yakov Lerner" <[EMAIL PROTECTED]>
> Subject: Re: gP-confusion
> Date: Wed, 16 Aug 2006 12:54:52 +0000
> 
>> On 8/16/06, Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
>>>   ...and what is the difference between
>>>
>>>   y$$gp
>>>
>>>   and
>>>
>>>   y$$gP
>>>
>>>   then. Or in other words: In what case I would prefer gP instead of
>>>   gp ?
>> gp  puts after the cursor, gP puts before the cursor.
>>
>> When you want to paste at the front of the line, you want
>> gP, like 0gP. When you want to paste at the end of the
>> line, you'll want to use $gp.
> 
>   ?Hu?
> 
>   ...of the line ???
> 
>  May be it should be: In front og the pasted text or afer the
>  pasted text?

"gp" puts the text after the current cursor position, then positions the
cursor after the end of the newly yanked text: suppose you have "123" in
the register and the cursor is on the "b" in the current line:

  abc

Executing "gp" results in

  ab123c

with the cursor on the "c".

"gP" puts the text before the current cursor position and positions the
cursor after the end of the newly yanked text, too. With the same values
and the cursor on the "b" again,

  abc

becomes

  a123bc

with the cursor on the "b".

The examples Yakov provided -- 0gP and $gp -- combine "moving to the
start of line" with "putting before the cursor" and "moving to the end
of line" with "putting after the cursor", respectively. Thus they
provide a way to prepend and append text to a line.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

Reply via email to