zoukankan      html  css  js  c++  java
  • 解决omnicppcomplete显示"pattern not found"

      其实是tags文件有问题,确切说是生成tags文件时,使用的命令行参数有问题。

      我最开始这样:ctags -R -f ~/.vim/tags/c 。很好笑吧,我就为它折腾了半个下午。

      是在google上看了一篇帖子,改成:ctags -R -f ~/.vim/tags/c  --C-kinds=+p --fields=+aS --extra=+q就好了。

      原帖答案贴过来(是他自问自答):

    I found the problem.

    My tags file is NOT Ok as I thought.
    Incorrect version generated with:
    ctags -R --C-kinds=+p --field=+S

    This generates this tags file:
    -bash-3.2$ cat tags
    !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
    !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
    !_TAG_PROGRAM_AUTHOR Darren Hiebert /[hidden email]/
    !_TAG_PROGRAM_NAME Exuberant Ctags //
    !_TAG_PROGRAM_URL http://ctags.sourceforge.net        /official site/
    !_TAG_PROGRAM_VERSION 5.8 //
    a f1.h /^ int a; $/;" m struct:mystruct
    b f1.h /^ int b;$/;" m struct:mystruct
    main f1.c /^void main (void)$/;" f signature:(void)
    myType f1.h /^} myType;$/;" t typeref:struct:mystruct
    mystruct f1.h /^typedef struct mystruct {$/;" s
    -bash-3.2$

    tags that works for this particular example were generated with:
    ctags -R --C-kinds=+p --fields=+aS --extra=+q

    -bash-3.2$ cat tags
    !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
    !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
    !_TAG_PROGRAM_AUTHOR Darren Hiebert /[hidden email]/
    !_TAG_PROGRAM_NAME Exuberant Ctags //
    !_TAG_PROGRAM_URL http://ctags.sourceforge.net        /official site/
    !_TAG_PROGRAM_VERSION 5.8 //
    a f1.h /^ int a; $/;" m struct:mystruct access:public
    b f1.h /^ int b;$/;" m struct:mystruct access:public
    main f1.c /^void main (void)$/;" f signature:(void)
    myType f1.h /^} myType;$/;" t typeref:struct:mystruct
    mystruct f1.h /^typedef struct mystruct {$/;" s
    mystruct::a f1.h /^ int a; $/;" m struct:mystruct access:public
    mystruct::b f1.h /^ int b;$/;" m struct:mystruct access:public
    -bash-3.2$

    The help file in omniCppComplete plugin (in .vim/doc/ folder) calls for:
    ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .

    I had assumed that since I am not using C++ (simply C), that the +ia in --fields and +q in --extra would be irrelevant.

    Thanks

  • 相关阅读:
    数据库水平切分(拆库拆表)的实现原理解析(转)
    json序列化 & 反序列化
    数据库工作原理
    【原创】python多线程测试接口性能
    XML解析(DOM、ElementTree)及转换为JSON
    nginx+supervisor+gunicorn+flask
    3、爬取干货集中营的福利图片
    Python多环境扩展管理
    九、frp对外提供简单的文件访问服务
    八、frps服务端与nginx可共用80端口
  • 原文地址:https://www.cnblogs.com/weiweishuo/p/3002830.html
Copyright © 2011-2022 走看看