Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can 'vim' open a large file in read only mode as fast as 'less'? [closed]

Tags:

linux

vim

I usually use 'less' to browse log files. But, sometimes, I need to use vim for its superior navigation facilities. But, the larger the log files, the longer it takes for vim to load them. 'less' seems to load them almost instantly.

Opening in read-only mode using 'vim -R' doesn't help. Are there any other options using which I can open large files with vim quickly? Please let me know if any other information is needed.

like image 748
vrk001 Avatar asked Oct 03 '22 18:10

vrk001


1 Answers

Try starting vim without plugins:

vim -u NONE

You might also want to consider other options outlined here.

Alternatively, consider removing portions of log files before opening up in an editor. Try using ack instead of grep. The -Q option makes ack treat the pattern as a literal and should be considerably faster (similar to grep -F).

awk -Q pattern huge-file | vim -

Prefixing the above command with LANG=C might help if you're using UTF-8 locale.

like image 73
devnull Avatar answered Oct 07 '22 19:10

devnull