Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I sometimes run into the problem where I need to replace just a few characters in files ~10Gb. As I only have 2Gb RAM, opening such a file with Vim or nano will consume all system resources.

The way I do it now is I either do my changes with sed, which is not very convenient, or I use a combination of head and tail to split out a smaller part of the file, edit that, then cat back together the pieces. Even less convenient.

So, does anyone know an editor that doesn't load the whole file into memory (or perhaps a switch I can use with vim or another popular editor)?

share|improve this question
1  
related question: stackoverflow.com/questions/159521/… –  akira Dec 3 '10 at 13:34
    
@akira: thanks, I thought SuperUser is for things like this so I forgot to check StackOverflow first. –  Attila O. Dec 3 '10 at 14:03
1  
the question is just perfectly fine here (better than on SO, imho), but the link might help others and linking is the way how the web works. –  akira Dec 3 '10 at 14:09

1 Answer 1

up vote 2 down vote accepted

you can configure vim to behave better with large files:

http://www.vim.org/scripts/script.php?script_id=1506

Editing large files can be a time consuming process as Vim is working on 
a number of things behind the scenes, such as maintaining an undo database, 
searching for a syntax highlighting synchronization point, etc.  

LargeFile.vim is a very small "plugin"; mostly, its just an autocmd that 
disables certain features of vim in the interests of speed. 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.