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]]