Monday, June 28, 2010

Re: pasting a block multiple times to the end of lines after a visual select (Ctrl+v)

Hi,

Rahul wrote:
>
>
> On Jun 24, 11:56 pm, Jürgen Krämer <jottka...@googlemail.com> wrote:
>> in this case Rahul doesn't even have to type the text, he could
>> copy it from the line above the visual block selection by keeping
>> Ctrl-Y pressed.
>>
>
> Thanks Juergen! But I am not sure I understand this method. Do I keep
> Ctrl+Y pressed all through? Can you explain a bit more?

let's take the example you gave in your original mail:

1277336401; 0; 0; 0
1277336701; 0; 0; 0
1277337001; 0; 0; 0
1277337301;
1277337601;
1277337901;
1277344801;
1277345101;
1277345401;
1277345701;
1277346001;
1277346301; 0; 226; 94
1277346601; 0; 226; 94
1277346901; 0; 226; 94

Put the cursor at the end of the first short line, enter visual block
mode with <Ctrl-V> and move the cursor down to the last short line.
Enter insert mode by pressing <A>. Now you could type the whole text by
hand, but you can also tell Vim to copy the character above your current
cursor position by pressing <Ctrl-Y> (see :help i_CTRL-Y). Because you
want to copy the whole rest of the line, you can keep <Ctrl-Y> held
down; Vim will stop copying as soon as it reaches the end of the line
above.

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)

--
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:

Post a Comment