Vim的自动完成速度奇慢 [英] Vim's autocomplete is excruciatingly slow

查看:249
本文介绍了Vim的自动完成速度奇慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数在VIM的自动完成功能很好地工作的我,但有时它似乎是扫描的文件的当前文件引用,那么它就变成痛苦的缓慢,有时需要几秒钟的时间释放焦点回到我的时间。

Most of the time the autocomplete feature in VIM works nicely for me, but sometimes it seems to be scanning files which the current file references, and then it becomes painfully slow, sometimes taking several seconds to release focus back to me.

有时VIM告诉我,只是说这是扫描其他时候,它说:扫描标签

Sometimes VIM tells me simply that it is "Scanning" other times, it's saying "Scanning tags"

我只过这种事情发生在Ruby文件,它主要发生时,有文件中的要求。

I've only this happen in Ruby files, and it happens mostly when there is a require in the file.

我的猜测是,这是某种功能的它检查相关文件来自动完成选项,但我并不真的需要这一点,将preFER更快的自动完成。

My guess would be that this is some kind of feature which checks related files for autocomplete options, but I don't really need that, and would prefer quicker autocomplete.

推荐答案

正如我在评论我有同样的问题提及。下面是我发现的;

As I mentioned in a comment I had the same problem. Here's what I found;

有一个设置告诉VIM到哪里找落成,名为完整

There's a setting telling VIM where to look for completions, called complete.

:set complete
complete=.,w,b,u,t,i

这是默认值。我的问题是(其实..)'我',它会扫描所有包含的文件。这里有两个问题,第一个,的找到的所有这些文件可能需要相当长的时间,特别是如果你像我一样,有

this is the default value. My problem is (was actually..) the 'i', which scans all included files. Here are two problems, first one, finding all those files might take quite a while, especially if you, like me, have

:set path=**

问题二,一旦发现,他们需要被读取,如果您使用的是网络文件系统(我在ClearCase的)查找和读取所有这些文件可能引发高速缓存未命中两个,使它十分缓慢。

Second problem, once found, they need to be read, and if you're using a networked file system (I'm on clearcase) both finding and reading all those files might trigger cache misses, making it painfully slow.

我已经删除了我现在,因为我有一个标签,文件,往往不是,我也有我的缓冲区的相关文件(加载或卸载),这将搜索为B的结果和U。

I've removed the i for now, as I have a tags-file and more often than not, I also have the relevant files in my buffers (loaded or unloaded) which will be searched as a result of 'b' and 'u'.

使用

set complete-=i

要删除列表中的我,注意,这是当地的缓冲区。

to remove the i from the list, note that this is local to the buffer.

心连心。

这篇关于Vim的自动完成速度奇慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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