【发布时间】:2012-05-19 11:06:44
【问题描述】:
我喜欢在 vim 中使用 clang。
我一直遇到的一个问题是,每当我包含 boost 时,每次我输入 "." 时,clang 都会通过 boost 库。在对象名称之后。需要 5-10 秒。
由于我没有对 boost 标头进行更改,有没有办法通过 boost 缓存搜索? 如果没有,有没有办法从自动完成搜索中删除提升?
更新 (1) 以回应 adaszko 的回答 后 :let g:clang_use_library = 1
- 我键入了一个变量的名称。
- 我按 ^N。 Vim 开始搜索 boost 树。它自动完成变量。
- 我按“。”并得到以下错误:
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
...并且没有自动强制
更新(2)
不确定 clang_complete 是否应该通过 boost 来解决这个问题。没有插件的 vim 会通过 boost 进行搜索。
超级用户有一个 answer 可以使用 set include=^\\s*#\\s*include\ \\(<boost/\\)\\@! 注释掉通过 boost 目录进行的搜索
【问题讨论】:
-
Vim 的变量 g:clang_use_library 的值是多少?
-
@adaszko
:let g:clang_use_library返回g:clang_use_library #0
标签: vim boost clang code-completion clang-complete