Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
related question:… – 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
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
up vote 2 down vote accepted

you can configure vim to behave better with large files:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .