Can 'vim' open a large file in read-only mode as fast as less?

I usually use less to view log files. But sometimes I need to use vim for excellent navigational aids. But the more log files, the more time it takes for vim to download them. "less" seems to load them almost instantly.

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

+4
source share
1 answer

Try starting vim without plugins:

vim -u NONE

You can also consider the other options described here .

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

awk -Q pattern huge-file | vim -

The prefix of the above LANG=C command may help if you are using a UTF-8 locale.

+4
source

Source: https://habr.com/ru/post/1487829/


All Articles