如何通过boost减少clang_complete搜索的时间

kir*_*gum 7 vim boost clang code-completion clang-complete

我喜欢和vim一起使用clang.

我一直有的一个问题就是每当我加入boost时,每当我输入"."时clang就会通过boost库.在一个对象名称之后.这需要5-10秒.

由于我没有对boost标题进行更改,有没有办法通过boost缓存搜索?如果没有,有没有办法从自动完成搜索中删除提升?

更新(1)以回应adaszko的回答:let g:clang_use_library = 1

  1. 我输入变量的名称.
  2. 我按^ N. Vim开始搜索boost树.它自动完成变量.
  3. 我按下"." 并得到以下错误:
Error detected while processing function ClangComplete:
line   35:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
NameError: name 'vim' is not defined
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   40:
E121: Undefined variable: l:res
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   40:
E15: Invalid expression: l:res
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   58:
E121: Undefined variable: l:res
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   58:
E15: Invalid expression: l:res
Press ENTER or type command to continue
Run Code Online (Sandbox Code Playgroud)

......而且没有自动强制

更新(2) 不确定clang_complete是否应该解决boost的问题.没有插件的vim会搜索boost.超级用户有一个答案,通过boost dirs评论搜索set include=^\\s*#\\s*include\ \\(<boost/\\)\\@!

kir*_*gum 0

这里,您可以将以下内容添加到您的.vimrc

:set include=^\\s*#\\s*include\ \\(<boost/\\)\\@!
Run Code Online (Sandbox Code Playgroud)

(通过 boost 缓存搜索的问题仍然悬而未决)