当使用exuberant-ctags时,你会使用哪些选项?

18

使用exuberant-ctags 5.8为gcc 4.4.3 c89

我刚开始使用exuberant-ctags,想知道应该添加哪些选项。

这里有一个列表,我在想是否添加太多会不会过度。

$ ctags --list-kinds=c
c  classes
d  macro definitions
e  enumerators (values inside an enumeration)
f  function definitions
g  enumeration names
l  local variables [off]
m  class, struct, and union members
n  namespaces
p  function prototypes [off]
s  structure names
t  typedefs
u  union names
v  variable definitions
x  external and forward variable declarations [off]

我将使用以下内容:

我原本打算使用以下内容:

ctags -e --c-kinds=+defgpstux -R

我只是好奇:这是否有些过度?

c  classes                      No -- I don't have any classes as this is c
d  macro definitions            YES -- I have many macros  
e  enumerators (values inside an enumeration) YES
f  function definitions         YES
g  enumeration names            YES
l  local variables [off]        NO
m  class, struct, and union members NO
n  namespaces NO 
p  function prototypes [off]    YES
s  structure names              YES -- Is there any difference with m
t  typedefs                     YES 
u  union names                  YES
v  variable definitions         NO
x  external and forward variable declarations [off] YES
2个回答

8

我不会说这是过度的,但我会打开m(结构体和联合成员搜索非常好)

Ctags通常很好,如果您从命令行或支持它的编辑器(例如gvim)中工作。如果您真的想要高级功能,我建议选择一个好的IDE。有些事情您无法直接使用ctags完成(例如调用层次结构或重构,良好的C/C++索引支持的好IDE将为您提供)


4

我认为这些都不会过度,但是您可能想调查一下CScope来“提高到下一个级别”。看起来您可能已经挤出了ctags的最大效能,而这就是CScope发挥作用的地方。


2
但是Cscope不支持C++。在这里,通用的ctags是正确的选择。 - Pascalius

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接