I currently have to edit some very large XML files, which slows down syntax highlighting to a point where it's absolutely unusable - it takes multiple seconds to update the screen after a search operation, for example.
When disabling syntax highlighting (:syn off
), the same operations happen instantaneously. Unfortunately, disabling syntax highlighting appears to happen globally, so all other files now have it disabled as well.
So: Is there a way to only disable syntax highlighting for a given buffer?
You can set :syntax manual
and then enable it with set syntax=ON
in the buffers you like. Also see :help :syn-manual
.
Answering my own question: A simple hack would be to force the syntax of the file to something that vim doesn't know how to highlight: :set syntax=unknown
However, this seems a bit hacky - maybe there's another solution?
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