Opening first lines of large files in VIM

3

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?

Christian

Posted 2010-03-18T10:30:37.920

Reputation: 1 750

Answers

9

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.

akira

Posted 2010-03-18T10:30:37.920

Reputation: 52 754

3

Also you can just:

head -1000 large_file.xml | vim -

Alexei Bordei

Posted 2010-03-18T10:30:37.920

Reputation: 31

head/tail for windows: http://unxutils.sourceforge.net/

– zcrar70 – 2011-06-22T11:09:39.420

2

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.

goedson

Posted 2010-03-18T10:30:37.920

Reputation: 896