• 解决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

  • 相关阅读:
    自动补全命令插件的安装(centos)
    vim tab设置为4个空格
    CentOS系统将UTC时间修改为CST时间
    Zabbix报错 zabbix:cannot convert value to numeric type解决
    php-fpm平滑重启开启关闭
    虚拟机启动network服务失败,Job for network.service failed because the control process exited with error code问题
    Tomcat中设置站点子目录的方法
    WordPress添加背景音乐plus教程
    WordPress使用必应每日一图作登录页面背景
    WordPress自定义美化
  • 原文地址:https://www.cnblogs.com/weiweishuo/p/3002830.html
Copyright © 2020-2023  润新知