Help::如何让vim能自动完成STL的函数!

liu1061
Help::如何让vim能自动完成STL的函数!

各位CU朋友, 现在写prog常用到一些STL组件,list,vector,map。。。。等等!
但是vim不能在tags插件中提示函数!
如:
    vector<int> int_vector;
       .
       .
       .

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

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

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


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

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

redhat008
安装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
        ([url]http://www.sgi.com/tech/stl/download.html[/url])
    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"]

liu1061
回复 #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!!! ^_^

liu1061
我在找到两个呀,
__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 {

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

redhat008
看这个
[url]http://blog.sina.com.cn/s/blog_4b0d4cdd0100076e.html[/url]

liu1061
有不有办法让他能识别重载呢!!   要是能就好了!!

liu1061
我生成的stl tags文件有问题,  能不能传一个已经做好的stl tags文件给我呀!
呵呵, 多谢!!
我的email : [email]liu1061@sina.com[/email]!!

liu1061
有那位朋友能忙我一下呀!!! :em16:

77h2_eleven
Ctrl + E 自动补齐~~~~

liu1061
[quote]原帖由 [i]77h2_eleven[/i] 于 2008-6-30 20:33 发表 [url=http://bbs.chinaunix.net/redirect.php?goto=findpost&pid=8705655&ptid=1183773][img]http://bbs.chinaunix.net/images/common/back.gif[/img][/url]
Ctrl + E 自动补齐~~~~ [/quote]
不会吧, 能自动补齐!! 我这里不行哦!!