修改~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py的flags变量

未改前如下:

flags = [ 

'-Wall',

'-Wextra',

'-Werror',

'-Wc++98-compat',

'-Wno-long-long',

'-Wno-variadic-macros',

'-fexceptions',

'-DNDEBUG',

# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM

# source code needs it.

'-DUSE_CLANG_COMPLETER',

# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which

# language to use when compiling headers. So it will guess. Badly. So C++

# headers will be compiled as C headers. You don't want that so ALWAYS specify

# a "-std=<something>".

# For a C project, you would set this to something like 'c99' instead of

# 'c++11'.

'-std=c++11',

# ...and the same thing goes for the magic -x option which specifies the

# language that the files to be compiled are written in. This is mostly

# relevant for c++ headers.

# For a C project, you would set this to 'c' instead of 'c++'.

'-x',

'c++',

'-isystem',

'../BoostParts',

'-isystem',

# This path will only work on OS X, but extra paths that don't exist are not

# harmful

'/System/Library/Frameworks/Python.framework/Headers',

'-isystem',

'../llvm/include',

'-isystem',

'../llvm/tools/clang/include',

'-I',

'.',

'-I',

'./ClangCompleter',

'-isystem',

'./tests/gmock/gtest',

'-isystem',

'./tests/gmock/gtest/include',

'-isystem',

'./tests/gmock',

'-isystem',

'./tests/gmock/include',

'-isystem',

'/usr/local/include']

在后面添加搜索路径:如/opt/nginx/include

则:

flags = [ 

'-Wall',

'-Wextra',

'-Werror',

'-Wc++98-compat',

'-Wno-long-long',

'-Wno-variadic-macros',

'-fexceptions',

'-DNDEBUG',

# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM

# source code needs it.

'-DUSE_CLANG_COMPLETER',

# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which

# language to use when compiling headers. So it will guess. Badly. So C++

# headers will be compiled as C headers. You don't want that so ALWAYS specify

# a "-std=<something>".

# For a C project, you would set this to something like 'c99' instead of

# 'c++11'.

'-std=c++11',

# ...and the same thing goes for the magic -x option which specifies the

# language that the files to be compiled are written in. This is mostly

# relevant for c++ headers.

# For a C project, you would set this to 'c' instead of 'c++'.

'-x',

'c++',

'-isystem',

'../BoostParts',

'-isystem',

# This path will only work on OS X, but extra paths that don't exist are not

# harmful

'/System/Library/Frameworks/Python.framework/Headers',

'-isystem',

'../llvm/include',

'-isystem',

'../llvm/tools/clang/include',

'-I',

'.',

'-I',

'./ClangCompleter',

'-isystem',

'./tests/gmock/gtest',

'-isystem',

'./tests/gmock/gtest/include',

'-isystem',

'./tests/gmock',

'-isystem',

'./tests/gmock/include',

'-isystem',

'/usr/local/include',

'-I',

'/opt/nginx/include']

ycm添加自定义补全路径的更多相关文章

  1. 源码安装Vim并配置YCM自动补全插件

    Compiling Vim from source is actually not that difficult. Here's what you should do: 1. Install all ...

  2. 在Idea中添加自定义补全代码设置(Main方法为例)

    一.打开File->setting->Editor->Live Templates 二.注意右边有“+”.“-”号,点击+号选择第二个Template Group...,并输入新组名 ...

  3. AutoFileName 使用src ,href 引入文件时,会自动补全路径的插件

    AutoFileName功能:快捷输入文件名 简介:自动完成文件名的输入,如图片选取 使用:输入”/”即可看到相对于本项目文件夹的其他文件 只要输入 src="" 输入双引号就立马 ...

  4. 开启mac terminal 命令/路径自动补全功能

    用惯了windows命令行工具的按Tab自动补全路径功能后,在mac terminal上敲命令很不习惯.其实mac terminal也有这个功能. 在命令行输入nano .inputrc 进入.inp ...

  5. vim代码补全-spf13,YouCompleteMe

    vim代码补全 现在的图形界面的IDE(Integrated Development Environment)一般具有语法高亮,语法检查,自动补全功能,大大提高了编程的效率. vim作为文本编辑器其强 ...

  6. 跟我一起学Vim补全神级插件--YouCompleteMe

    最近重拾Vim,编译部署来补全插件YCM,这个插件的补全效果和在写C代码的时候的自动提示错误信息等还是十分棒的,写点心得下来,也算给自己做个备忘. 快速安装: 首先参考我的.vimrc配置,用Vund ...

  7. 【vim】插件管理及代码智能提示与补全环境的配置

    1. 引言 可以使用脚本/插件来给vim添加各种神奇的功能,从更换颜色主题.到代码智能提示,甚至项目管理.无数开发者通过开源社区贡献自己开发的插件,使得vim有可能变得无比强大.这儿http://vi ...

  8. Linux 中 10 个有用的命令行补全例子

    在 Linux 系统中,当你输入一个命令,再按两次 TAB 键,就会列出所有以你输入字符开头的可用命令.这并不新鲜,可能你已经知道了.这个功能被称作命令行补全bash completion.默认情况下 ...

  9. java随笔1 Ctrl+1补全

    Ctrl+1补全变量时,如果补全后的不是自己想要的, 比如:补全后这样 修改后 这时要对更改变量进行Ctrl+1补全路径 并且后者要进行Ctrl+1强转

随机推荐

  1. Squid代理服务器

    缓存代理概述:做为应用层的代理服务软件,squid主要提供缓存加速,应用层过滤控制的功能. 1.代理的工作机制 当客户机通过代理来请求web页面时,指定的代理服务器会先检查自己的缓存,如果缓存中已经有 ...

  2. switch

    关于java中switch使用的一些说明 switch(表达式) { case常量表达式1:语句1; .... case常量表达式2:语句2; default:语句; } default就是如果没有符 ...

  3. 阿里云的9折推荐码 8DIER4

    推荐码: 8DIER4 我有一个阿里云9折推荐码:8DIER4,分享给你,第一次购买云服务器或云数据库可享受原价9折优惠,还可多人使用,拿走不谢. 阿里云地址:http://www.aliyun.co ...

  4. MySQL binlog的格式解析

    我搜集到了一些资料,对理解代码比较有帮助. 在头文件中binlog_event.h中,有描述 class Log_event_header class Log_event_footer 参见[Myst ...

  5. centos6.5 安装mysql 的过程

    Linux中使用最广泛的数据库就是MySQL,使用在线yum的方式安装的版本落后MySQL网站好几个小版本, 所以折腾了几个星期,终于在CentOS 装好了mysql5.6,装完之后,对整个linux ...

  6. OAF_文件系列6_实现OAF导出XML文件javax.xml.parsers/transformer(案例)

    20150803 Created By BaoXinjian

  7. jquery autocomplete实现读取sql数据库自动补全TextBox

    转自我本良人 原文 jquery autocomplete实现读取sql数据库自动补全TextBox 项目需要这样子一个功能,其他部门提的意见,只好去实现了哦,搞了好久才弄出来,分享一下. 1.前台页 ...

  8. jvm是如何管理内存的

    1.JVM是如何管理内存的 Java中,内存管理是JVM自动进行的,无需人为干涉. 了解Java内存模型看这里:java内存模型是什么样的 了解jvm实例结构看这里:jvm实例的结构是什么样的 创建对 ...

  9. 设计一个Stack,要求Push、Pop、获取最大最小值时间复杂度都为O(1)

    面试的时候,面试官让设计一个栈,要求有Push.Pop和获取最大最小值的操作,并且所有的操作都能够在O(1)的时间复杂度完成. 当时真没啥思路,后来在网上查了一下,恍然大悟,只能恨自己见识短浅.思路不 ...

  10. Linux系统挂载数据盘

    参考:http://help.aliyun.com/knowledge_detail/5974154.html?spm=5176.788314850.3.2.hUqwXo 1.在阿里云上购买了服务器, ...