Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
  • I am Vim fan for most of my editing purposes.
  • But these days when I have to open huge file ~1-2 gigs, its is vert slow to load and perform operations
  • What are the other ways I can edit such huge files efficiently
share|improve this question
2  
Turn off syntax can make vim run a little faster. – ajreal Dec 2 '11 at 18:10
In my experience loading a big file like that takes some time, but once it is loaded Vim is actually pretty fast. – Brian Rasmussen Dec 2 '11 at 18:15
You can always use sed. – Vlad Lazarenko Dec 2 '11 at 18:43
1  
Duplicate of stackoverflow.com/questions/159521/… – MετάEd Dec 2 '11 at 18:54

migrated from stackoverflow.com Dec 2 '11 at 18:41

5 Answers

See my answer here (not vim specific).

What kind of huge file do you want to edit?

share|improve this answer
text file, is that you want to know? – daydreamer Dec 2 '11 at 18:17
No, more precisely: a log file, a mysql dump, a big generated assembly code, ...? – Basile Starynkevitch Dec 2 '11 at 18:18
a log file is that – daydreamer Dec 2 '11 at 18:18
Then my answer applies very well: just csplit your log file into manageable pieces, edit them with your favorite editor, and rebuild the log file. Or develop your own editing scripts (perhaps with sed)... – Basile Starynkevitch Dec 2 '11 at 18:21

vim you can

:set binary

first.

or use hexedit. as Edit very large sql dump/text file (on linux)

share|improve this answer

This article explains what you can do to Vim itself to reduce the overhead associated with opening a large file.

share|improve this answer

Set

:syntax off
:se binary nospell 
:setgl noswap
:set undolevel=0
:set undofile=

You can also use directory/undodir to put swapfiles and undofiles in another location

share|improve this answer

Look here: http://askubuntu.com/questions/28847/text-editor-to-open-4-3-gb-plain-text-file

  • Divide the file in parts : split -b 53750k <your-file>
  • Edit sigle parts with vim ( I don't like it but it works fast here )
  • Merge the parts cat xa* > <your-file>

Done :)

Sorry but free editor larks good support for big files ( cannot find a reason for that )

p.s.
learn Vim is not so difficult: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

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.