Syntax highlighting is defined via regular expressions, and the matching can consume a lot of resources, especially on long lines and large buffers. You can turn off syntax for the problematic buffer with :setlocal syntax=
, or disable it completely with :syntax off
.
Recent Vim versions (7.4 with a "huge" build) also have a :syntime
command that can show you which syntax rule is problematic, so that you may be able to disable only parts of the syntax highlighting.
Other settings can make working with large files slow. The LargeFile - Edit large files quickly plugin detects and disables those automatically for you.