That brings me to my question.  I have noticed that when
editing large files (millions of lines), deleting a large
number of lines (say, hundreds of thousands to millions) takes
an unbelieveably long time in VIM--at least on my systems.

The issue of editing large files comes up occasionally. A few settings can be tweaked to vastly improve performance. Notably, the 'undolevels' setting can be reduced to -1 or 0 for improved performance. If your lines are long, it can also help to disable syntax highlighting as well. You can drop in on one such thread here:

  http://www.nabble.com/Re%3A-editing-large-file-p3665161.html

or the associated vim-tip at

  http://www.vim.org/tips/tip.php?tip_id=611

Another option might be to use a stream-oriented tool such as sed to edit your file:

  sed '100000q' < infile.txt > outfile.txt

Fortunately, Vim has oodles of knobs to twiddle, so you can monkey with 'undolevels', 'swapfile', and the 'bufhidden' setting, as well as turning off sytnax highlighting, all of which can improve the performance of vim under uncommon load.

This struck me as so odd, I looked you up (for the first time
in all my years of use) so I could ask why!

Welcome aboard...the list is friendly, informative, on-topic, and an all-round example of what a mailing-list should be. :)

-tim





Reply via email to