Editing xml files with long lines is really slow in vim. What can I do to fix this?

后端 未结 13 935
情书的邮戳
情书的邮戳 2021-01-31 02:24

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

13条回答
  •  情歌与酒
    2021-01-31 02:50

    Comment out the line

    syn sync match xmlSyncDT grouphere  xmlDocType +\_.\(

    in your xml.vim file (with ").

    This kind of issue can be debugged in a vim session by typing :syntime on, doing something that demonstrates the slowness of concern, and then :syntime report. In my case it reported xmlSyncDT taking over 10 seconds in my 6MB xml file with 4000-character lines just to display the last page of the file. Commenting out the line above has not affected syntax highlighting as far as I've noticed except that it now never takes more than a fraction of a second to display a screen.

提交回复
热议问题