Vim autocomplete painfully slow

In most cases, the autocomplete function in Vim works fine for me, but sometimes it seems like it scans files referenced by the current file and then becomes painfully slow, sometimes it takes a few seconds to return focus to me. / p>

Sometimes Vim just tells me that itโ€™s a โ€œCrawlโ€ at another time, it says โ€œCrawl a tagโ€

I only happen in Ruby files, and this happens mainly when the file contains a request.

I suppose this is some kind of function that checks related files for autocomplete options, but I really don't need this, and I would prefer a faster autocomplete.

+53
vim autocomplete code-completion
Jan 30 '10 at 22:10
source share
3 answers

As I mentioned in the comment, I had the same problem. Here is what I found;

There is a parameter that tells VIM where to look for completion, called complete .

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

this is the default value. My problem (actually ..) is "i", which scans all included files. Here are two problems: first, finding all these files may take some time, especially if you, like me, have

 :set path=** 

The second problem, after detecting it, must be read, and if you use a network file system (I am on my suitcase), then searching and reading all these files can lead to a cache failure, which makes it painfully slow.

I deleted it at the moment, because I have file tags and most often I also have corresponding files in my buffers (loaded or unloaded) that will be found as a result of "b", and 'u'.

Using

 set complete-=i 

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

+96
Mar 17 '10 at 7:53
source share

You had a very similar problem since upgrading to Vim 7.3 (from 7.2): I used the (excellent) ACP plugin and in a longer source files (C files, 1700 LOC), the popup window took ages to skip with sentences when I edited at the bottom of the file.

Using PerformanceValidator (from Softwareverify ), I found out that some reset methods were called again and again and resulted in very high processor load and slow completion.

My workaround was to set foldmethod ( fdm ) to manual . And that solved it ...

+39
Nov 25 '10 at 13:11
source share

Do you have a tag file for the project you are working on? If you do not try to create one with exuberant-ctags, and Vim should pick it up using the taglist pluglin.

+4
Jan 30 '10 at 22:24
source share



All Articles