Enable syntax highlighting in vim based on each buffer

Currently, I have to edit some very large XML files, which slows down the syntax highlighting to the point where it is completely unusable - for example, it takes a few seconds to refresh the screen after a search operation.

When you turn off syntax highlighting ( :syn off ), the same operations occur instantly. Unfortunately, syntax highlighting is disabled worldwide, so now all other files are also disabled.

So: is there a way to turn off syntax highlighting for a given buffer?

+8
vim syntax-highlighting
source share
3 answers

You can set :syntax manual , and then turn it on with set syntax=ON in the buffers you like. Also see :help :syn-manual .

+13
source share

Answering my own question: a simple hack should have forced the file syntax to something that vim doesn't know how to allocate :set syntax=unknown

However, this seems a bit hacked - maybe there is another solution?

+5
source share

To edit a large file, I usually use the Chip LargeFile plugin . It disables syntax highlighting, cancels the database and other functions that create problems with large files.

+3
source share

All Articles