我使用gvim / vim和cscope / ctags在linux内核中查找符号定义。 源代码很大。当我想用"标记设备"来搜索结构设备时以命令为例,vim会向我提出数百次事件。因为它将提出名为device的设备,结构的成员的全局变量。 反正有没有改善这个? 是否有可能告诉vim / cscope / tag只查看结构定义?
答案 0 :(得分:1)
这个,你可能已经知道了。我通过cscope vim命令缩小范围
:cs f e struct device {
请参阅cscope vim命令的用法
cscope commands:
add : Add a new database (Usage: add file|dir [pre-path] [flags])
find : Query for a pattern (Usage: find c|d|e|f|g|i|s|t name)
c: Find functions calling this function
d: Find functions called by this function
e: Find this egrep pattern
f: Find this file
g: Find this definition
i: Find files #including this file
s: Find this C symbol
t: Find assignments to
help : Show this message (Usage: help)
kill : Kill a connection (Usage: kill #)
reset: Reinit all connections (Usage: reset)
show : Show connections (Usage: show)