免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5896 | 回复: 10
打印 上一主题 下一主题

Help::如何让vim能自动完成STL的函数! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-29 15:42 |只看该作者 |倒序浏览
各位CU朋友, 现在写prog常用到一些STL组件,list,vector,map。。。。等等!
但是vim不能在tags插件中提示函数!
如:
    vector<int> int_vector;
       .
       .
       .

    int_vector.  些时没有vector的可用函数可用!

有没有朋友能生成STL的tags文件! 还有没有其它的办法呀!

还有就是如何让它能识别出重载呀!!


多谢各位支持回贴!thanks ^_^ thanks!

[ 本帖最后由 liu1061 于 2008-6-29 16:04 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-06-29 16:05 |只看该作者
安装ctags和cppomni插件

7. FAQ & TIPS~
                                                                 *omnicpp-faq*

* How to complete STL objects ?
    If you have some troubles to generate a good ctags database for STL you
    can try this solution :

    1)  Download SGI's STL from SGI's site
        (http://www.sgi.com/tech/stl/download.html)
    2)  Replace all __STL_BEGIN_NAMESPACE by "namespace std {" and
        __STL_END_NAMESPACE by "}" from header and source files. (with Vim,
        or with tar and sed or another tool)
    3)  Run ctags and put the generated tags file in a directory eg:
        ~/MyTags/stl.tags
    4)  set tags+=~/MyTags/stl.tags

    The main problem is that you can't tell to ctags that
    __STL_BEGIN_NAMESPACE = "namespace std {" even with the option -I.
    That's why you need the step 2).

    Here is another solution if you have STL sources using _GLIBCXX_STD macro
    (Tip by Nicola Bonelli) : >

        let OmniCpp_DefaultNamespaces   = ["std", "_GLIBCXX_STD"]

论坛徽章:
0
3 [报告]
发表于 2008-06-29 16:14 |只看该作者

回复 #2 redhat008 的帖子

2)  Replace all __STL_BEGIN_NAMESPACE by "namespace std {" and
        __STL_END_NAMESPACE by "}" from header and source files. (with Vim,
        or with tar and sed or another tool)

The main problem is that you can't tell to ctags that
    __STL_BEGIN_NAMESPACE = "namespace std {" even with the option -I.
    That's why you need the step 2).

是什以意思呀!!

Here is another solution if you have STL sources using _GLIBCXX_STD macro
    (Tip by Nicola Bonelli) : >

        let OmniCpp_DefaultNamespaces   = ["std", "_GLIBCXX_STD"]
这个呢!!

多谢,这么快就回贴,thank you very much!!! ^_^

论坛徽章:
0
4 [报告]
发表于 2008-06-29 16:31 |只看该作者
我在找到两个呀,
__STL_BEGIN_NAMESPACE        .\stl_config.h        495;"        d
__STL_BEGIN_NAMESPACE        .\stl_config.h        511;"        d

__STL_END_NAMESPACE        .\stl_config.h        496;"        d
__STL_END_NAMESPACE        .\stl_config.h        512;"        d

要如何换呀!!不了解哦!!

我下载的stl文件有一组是有stl前缀的,有一组是没有的,它们有什么区别吗

并且在stl_config.h中有如下宏定义,
#   define __STL_BEGIN_NAMESPACE namespace std {

[ 本帖最后由 liu1061 于 2008-6-29 16:39 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2008-06-29 16:35 |只看该作者

论坛徽章:
0
6 [报告]
发表于 2008-06-29 16:54 |只看该作者
有不有办法让他能识别重载呢!!   要是能就好了!!

论坛徽章:
0
7 [报告]
发表于 2008-06-30 10:13 |只看该作者
我生成的stl tags文件有问题,  能不能传一个已经做好的stl tags文件给我呀!
呵呵, 多谢!!
我的email : liu1061@sina.com!!

论坛徽章:
0
8 [报告]
发表于 2008-06-30 18:05 |只看该作者
有那位朋友能忙我一下呀!!!

论坛徽章:
0
9 [报告]
发表于 2008-06-30 20:33 |只看该作者
Ctrl + E 自动补齐~~~~

论坛徽章:
0
10 [报告]
发表于 2008-06-30 20:49 |只看该作者
原帖由 77h2_eleven 于 2008-6-30 20:33 发表
Ctrl + E 自动补齐~~~~

不会吧, 能自动补齐!! 我这里不行哦!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP