Open only the first few lines of a file in Vim

Joe Mornin picture Joe Mornin · Mar 22, 2011 · Viewed 16.2k times · Source

I'm working with a CSV that's just shy of 1 GB. I want to see the the file's structure and a sample of the data, but I don't want to open the entire file. How can I load the first few rows in Vim? If it makes a difference, I'm using MacVim.

Answer

Vijay picture Vijay · Mar 22, 2011

I generally use a command like head or tail for seeing partial content of large files.

$head -10 <large file>