clang为vim完成 [英] clang complete for vim

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

问题描述

我将 clang_complete.vim 复制到插件,但是当我键入 p>

 未找到模式


$ b b

我搜索这个问题,有人说我应该配置 g:clang_complete_auto: g:clang_complete_copen:



<$>

解决方案

p $ p> vim /tmp/sample.cpp

  #include< iostream> 

int main(){
std :: //< - 这应该完成
}

注意,你实际上需要包含头,因为完成是使用编译器完成的。如果这个工作,但你的项目仍然说模式未找到,然后clang ++可能无法编译您的项目。在编译代码时,是否使用任何 -I 开关?将它们添加到项目目录中名为 .clang_complete 的文件中。



对我来说, c $ c> .vim / plugin 文件夹,只包含可供下载的 clang_complete.vim 文件:

  $ find .vim 
.vim
.vim / plugin
.vim / plugin / clang_complete.vim

...但在此问题报告中 https://github.com/Rip-Rip/clang_complete/issues/39 建议您可能需要更多的文件(额外的文件在git repo)。


I copied clang_complete.vim to plugin, but when I typed . after some variable, it says

pattern not found

I searched this issue, and somebody said I should configure g:clang_complete_auto: and g:clang_complete_copen:. How can I do this?

解决方案

Try opening a sample file

vim /tmp/sample.cpp

and enter some cpp code

#include <iostream>

int main() {
  std:: // <-- this should complete
}

Note that you actually need to include the headers, since completion is done with the compiler. If this works, but your project still keeps saying "Pattern not found" then clang++ is probably not able to compile your project. Do you use any -I switches when you compile your code? Add them to a file named .clang_complete in your project directory.

For me this works fine with my .vim/plugin folder containing only the clang_complete.vim file that is available for download:

$ find .vim
.vim
.vim/plugin
.vim/plugin/clang_complete.vim

... but in this issue report https://github.com/Rip-Rip/clang_complete/issues/39 it is suggested that you might need more than that file (additional files are in the git repo).

这篇关于clang为vim完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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