Vim的YouCompleteMe配置 [英] Vim YouCompleteMe configuration

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

问题描述

我刚安装YouCompleteMe Vim的通过vundle。它的工作原理,但它表明只包含在当前文件中的话。我想用它来开发C ++程序,我该怎么配置它从C显示自动完成++头文件在/ usr /包括例如?非常感谢。

i just installed YouCompleteMe for Vim through vundle. It works, but it shows only the words contained in the current file. I want to use it to develop c++ programs, how can i configure it to show autocompletion from c++ headers file in /usr/include for example? Thanks a lot.

推荐答案

而在这里的建议可能会在一开始工作,我不知道这是去的正确方法。据YCM开发者,当你启动一个项目,你需要一个新的 .ycm_extra_conf.py 文件

While the suggestions here might work in the beginning, I am not sure it's the proper way to go. According to YCM developer, whenever you start a project, you need a new .ycm_extra_conf.py file

从的https://valloric.github.io/YouCompleteMe/#ubuntu-linux-x64-super-quick-installation

永会在已打开文件的目录或在层次结构(递归),它上面的任何目录中的文件.ycm_extra_conf.py;当文件被发现,它被加载(只有一次!)作为一个Python模块。 YCM调用模块应该向它提供给编译当前文件所需的信息在一个FlagsForFile方法。还可以提供到全局.ycm_extra_conf.py文件,该文件将被用来作为一个备用的路径。以prevent从一个文件中的恶意code的执行你没有写YCM会问你一次,每.ycm_extra_conf.py是否安全加载。这可以被禁用,您可以涂白/黑名单文件。见选项部分的更多细节。

YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a FlagsForFile method in that module which should provide it with the information necessary to compile the current file. You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback. To prevent the execution of malicious code from a file you didn't write YCM will ask you once per .ycm_extra_conf.py if it is safe to load. This can be disabled and you can white-/blacklist files. See the Options section for more details.

虽然你可能只需要从香草.ycm_extra_conf.py修改编译标志,我觉得最好是创建每次启动项目中的新文件。

While you might only need to modify the compile flags from the vanilla .ycm_extra_conf.py, I feel it is advisable to create a new file for every project you start.

这篇关于Vim的YouCompleteMe配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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