Hi,

Suppose I have the following text in my file:

9
7 4
5 8 3

And I need it appearing as an array initialization like so:
int a[3][3] = {
{9,1,1},
{7,4,1},
{5,8,3}
};

That is, with all the additional array elements filled with 1's.

The construction of the array ('{', '}, ',') using a recording is easy, but 
since the number of 1's that need to be inserted is  a function of the row 
number, I am not sure how to automate it using a recording.

I am sure a script can do it, but I am not a vim expert by any means.

Thanks, Michal


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

Reply via email to