4 ms·
Is there a vim with support for large files, i.e. only reading a chunk/window of data at a time as I browse? My use case is that I sometimes need to inspect la
by snthpy 8y ago
Is there a vim with support for large files, i.e. only reading a chunk/window of data at a time as I browse?
My use case is that I sometimes need to inspect large CSV files and vim will take a long time and then abort saying that it couldn't complete loading the file.
I guess I could use
head -n 100 data.CSV | vim
but it would be nice if I could scroll through the file in vim.
- copperx 8y agoI think less does exactly what you're asking for, unless you need to edit the file. less and vim have similar keybindings. For multi-gigabyte files, you may want to disable line counting and perhaps seek ahead via command line options to make startup instantaneous.
- Asooka 8y agoYou don't even have to disable line counting explicitly, less is kind enough to tell you "counting lines is taking a long time, interrupt to disable". So you can just ctrl-c if the file is too long and you don't want to wait.
- cuillevel3 8y ago`vim -n` should avoid the initial swap file. Or was it `-b` that triggered in-place editing? You might want to tune `set syn_maxcol=256` to avoid highlighting or disable syntax completely. It might help to set the filetype to something else for CSV. If plugins slow you down use `-u NONE`.
- u801e 8y ago> I guess I could use > head -n 100 data.CSV You could do something similar with sed -n '101,200p' data.CSV | vim -
- oftenwrong 8y agoYou could actually use ed [0] or you could split the file: split data.CSV; vim x* [0] https://sanctum.geek.nz/arabesque/actually-using-ed/ https://sanctum.geek.nz/arabesque/actually-using-ed/