I edit a lot of xml files with vim. The problem is that, because of the long lines, navigation/editing in vim is extremely slow. Is there something I can do (besides turning off
The simplest and most effective solution I have found is to simply disable syntax highlighting:
syntax off
This seems to be the culprit when dealing with long lines. Also, from my experience with vim and xml, the size of the file doesn't seem to matter - it's the long lines that cause these slowdowns.
Another work-around I found useful is to wrap areas with long lines in folds:
A reeealy long line
Closing the folds will spare vim from parsing the syntax of those lines. Of course, this approach is not always practical, but it worked very well where I had only a few long lines, or they were in a specific area of the file.
Often, Vim is still noticeably slower, but in most cases the performance becomes acceptable.