Faster keyword completion for multiple files in Vim?

While searching for my nirvana to complete python in vim, I really liked <Cx> <Ci>: "keywords in current and included files". This almost always gives me a long nasty name from another completed module, which is great.

(Omni termination is obviously better when it works, but too often it reports that it cannot find matches. Ok, Python is not Java, I get it)

The only problem with this multi-file termination is very slow: on my netbook, a file with a reasonable set of imports can take up to 4 or 5 seconds to parse every time I press <Cx> <CZ>. It seems that every imported file is loaded every time I press <Cx> <CX>. Is there a way to cache files or speed up this process? Will tag execution be faster?

+6
vim autocomplete tab-completion code-completion
source share
1 answer

It is possible that this process takes some time if you are working on projects with multiple source files (vim needs to parse all included source files to find more included source files and build a list of words.) You can use tag-completion, which uses the output ctags to do almost the same thing, but you will need to run a few tests to report the difference in speed.

I personally use full completion ( <CP> or <CN> in insert mode). By default, it matches all words in all buffers (even buffers that were unloaded, i.e. files that were closed), but actually fast. I found that the completion works exactly fine, even if you activate it after 2-3 characters.

+6
source share

All Articles