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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With