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 run Windows XP and gvim7.2. I want to inspect a large (130 MB) XML file with VIM. Is it possible to simply open the first 1000 lines of the file?

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

the main problem of vim is not the file size, but the syntax highlighting of the file. i use the 'large file' script to disable such timeconsuming things when working on large files.

share|improve this answer
add comment

Also you can just:

head -1000 large_file.xml | vim -
share|improve this answer
    
head/tail for windows: unxutils.sourceforge.net –  zcrar70 Jun 22 '11 at 11:09
add comment

You may use head or tail to cut specific parts of the file and then open them in vim. In your specific example, you could do:

head -1000 large_file.xml > small_file.xml

Then you would be able to open small_file.xml in gvim.

This, of course, you have the head and tail utilities installed.

share|improve this answer
add comment

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.