Thursday, June 24, 2010

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

Hi,

Dominique Pellé wrote:
> Rahul wrote:
>
>> I have a file that looks like below. Frequently I encounter this
>> scenario where all the shorter lines need to be padded with the zero
>> blocks on the right hand side. I can visual select with a Ctrl+v on
>> the segment
>>
>> ; 0; 0; 0
>>
>> But I have to go to the end of each line and press a p. I cannot do a
>> 8p as I would have done if I was pasting whole lines (Shift+v). Is
>> there a better solution to this procedure?
>>
>> In some other editors I've found a mode where I can select a block of
>> text and then anything I type get's added to each line in that block.
>> Does VIM have a similar mode?
>>
>> 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
>
>
> You can select a visual rectangular block (with CTRL-V)
> then press A then type the text which will be added at the
> end of visual block, finally press Esc and added text will
> be repeated for all lines in visual block.

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.

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: