分页: 1 / 1
vim 使用 ctags 的问题[已解决]
发表于 : 2007-05-17 6:30
由 antonym55
为 vim 装了 OmniCppComplete插件,
为测试stl 的效果,使用下面的命令生成了一个stl的tag,
代码: 全选
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/stltags /usr/include/c++/4.1.2
并在~/.vimrc 中设置了
代码: 全选
set tags+=~/.vim/stltags
发现ctags 对没有.h的 c++头文件处理不是很好(也有可能是自己用错命令)
只有string(basic_string.h) 能自动完成, map, vector, set 等都不能正常使用。
请问这个问题该如何解决,谢谢!
发表于 : 2007-05-18 20:56
由 antonym55
已解决,写信问了作者
具体解决方法请参见作者的邮件
=============
Hello,
Here is what I do, this solution works both for windows and unix system :
1) Download SGI's STL from SGI's site
(
http://www.sgi.com/tech/stl/download.html)
2) With vim replace all __STL_BEGIN_NAMESPACE by "namespace std {" and
__STL_END_NAMESPACE by "}" (I use a macro to do this but maybe there
is a better way eg: the command :bufdo) from header and source files.
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).
Best regards,
Vissale
发表于 : 2007-05-25 23:35
由 minjun
不错的方法,多谢分享

发表于 : 2008-06-29 7:05
由 kofshower
不需要--language-force=c++么,我使用的时候加上这个了。生成的tag是正确的
发表于 : 2008-06-30 10:48
由 liu1061
antonym55
我用这个方法生成的tags好像问题,但有不知问题在那里!
你能不能发个stl tags文件给我呀! 最近在用stl, 在vim下
没有提示真的好难做! 非常感谢!!!