Tuesday, October 16, 2012

Re: Replacing current line with last-yanked register

On 10/15/2012 7:34 PM, Ben Schmidt wrote:
> On 15/10/12 12:16 AM, Dotan Cohen wrote:
>> On Sun, Oct 14, 2012 at 1:54 PM, Marcin Szamotulski
>> <mszamot@gmail.com> wrote:
>>> If you yanked the line then it is still in the 0 register. You can
>>> paste
>>> from it. Though this will be four keystrokes: V"0p
>>>
>>> If you do that often you could use a map:
>>>
>>> vnoremap P "0p
>>>
>>> and then there are only two keystrokes: VP
>>>
>>> Best,
>>> Marcin
>>>
>>
>> Thank you Marcin. I don't want to create a map as I've already got
>> every short combination that is mappable mapped and used often!
>>
>> `V"0p` would be a good solution if it were repeatable with the period
>> character. Is there any solution which is repeatable by the period
>> character? I tried `I<C-o>Vp` with the hope that the `i` would make it
>> repeatable, but this is not so!
>
> Well, if instead of yanking with yy, you yank with 0y$ or something like
> that, so you don't have the end-of-line in the buffer, you could put it
> in a repeatable way with S<C-r>0 I suppose.
>
> Ben.
>
>
>
this is a really nice tip , even if sound simple, vim-golf best practice
so far I heard.
I'll start re-train my finger on this...
not sure we have a place to maintain these "best-practice" stuffs that
people spend time to work out?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: