我有一个文件包含一些很长的字符串(大约3000个字符),当我用Vim打开它,并用h,l,j,k导航.Vim变得非常慢,每次我键入一个键,我需要等待几秒钟.但是当我用Vi打开它时,它看起来非常快,所以我想知道是否有任何选项我可以设置为让vim处理长字符串快?
我在SunOS上使用Vim 7.3.我的工作每天涉及很多长文本行.
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.