>>>>  I did th3 follwing: With a program, which generates random numbers in
>>>>  different formats, I created a file, which consists of _one_ line of
>>>>  2097152 characters ("0"-"9","A"-"F").
>>>>
>>>>  To split the line into lines of 72 characters each, I started vim and
>>>>  let it read the file.
>>>>
>>>>  I postioned the cursor at position 0 and entered the following in
>>>>  normal mode:
>>>>
>>>>  qq72<right>i<return><esc>0q
>>>>
>>>>  Then I did a
>>>>
>>>>  [EMAIL PROTECTED]
>>>>
>>>>  After only 10 or 15 (guessed) executions of the macro the system
>>>>  freezes while constantly swapping (?) and became unuseable and did no
>>>>  longer respond.
> 
> I think the problem with the way lines are split here is that you go in
> and out of Insert mode for every change.  This causes the current line
> to be saved for undo every time.  With a function that gets the line and
> inserts every 72 chararacters it's probably a lot faster.

Or even a quality :s command instead of a function:

        :%s/.\{72}/&r/g

I suspect this one command will run rather quickly, not have to
guess at the number of iterations (1000 in the above example),
and won't thrash the undo history.

> It doesn't really matter what you are able to do if you don't do it.
>                               (Bram Moolenaar)

Thanks for the kick in the pants...I've got a pet project on the
back burner that just keep sitting there.  It's got a lot of
potential, but if I don't do it, it doesn't matter how great the
project is :)  Your motivation is much appreciated (whether you
intended it or not).

-tim




Reply via email to