在大C文件中启用VIM语法和语法折叠,使完成慢 [英] Enabling syntax and syntax folding in vim with large C file makes completion slow

查看:174
本文介绍了在大C文件中启用VIM语法和语法折叠,使完成慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在一个大的C文件都对语法(约8000)行
完成CTRL-P和CTRL-N是非常慢(超过20个)。当我打开语法关闭然后再完成需要不到一秒钟。

When I have syntax on in a large C file (about 8000) lines the completion ctrl-p and ctrl-n are very slow (more than 20). When I turn syntax off then completion takes less than a second.

我想通了,重现这种行为的一个最小的方式。使用空的.vim文件夹,并建立.vimrc只有这些行:

I figured out a minimal way of reproducing this behaviour. Use an empty .vim folder and create a .vimrc with only these lines:

set syntax on
set foldmethod=syntax

当你打开一个大的C文件,完成(甚至一般编辑)变得很慢。

When you open a large C file, completion (and even general editing) becomes very slow.

编辑:

此行​​为是由于这样的事实,我使用的是测试版。我不知道我是否应该完全删除了这个问题,或者离开它,所以如果别人有同样的问题可以有关于它的一些线索。

This behavior was due to the fact that I was using a beta version. I am not sure if I should delete this question altogether, or leave it so if others have the same problem can have some clue about it.

推荐答案

我猜你的竣工是由语法高亮文件进行调整。要查看是否是这样的话,使完成精益和快速不管,尝试

I'm guessing your completion is being adjusted by the syntax highlighting file. To see if this is the case, and make completion lean and fast regardless, try

:set complete=.

这将使得完成仅使用最新的文件。

which will make completion only use the current file.

了解更多有关完整的选项以

read more about the complete options with

:help 'complete'

这篇关于在大C文件中启用VIM语法和语法折叠,使完成慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆