当我在VIM上使用cscope时
我必须输入完整的功能名称。
for ex
cscope找到了SearchGoIndexOne
当我知道完整的功能名称时,它是可能的,但当我只知道一个部分单词时,它是不可用的。
有什么好的解决方案吗?
或用cscope替换的任何插件?
答案 0 :(得分:3)
您可以将cscope设置为您的标签系统:
set cst
这将允许您使用普通标签功能来执行标签搜索。 tag
命令将为您完成标记名称。 E.g。
:tag MyFunc<TAB>
哪个可以给你你想要的东西。另外请不要忘记您可以使用cscope进行正则表达式搜索,这些搜索也可用于查找部分符号名称:
cscope find e SearchGo.*
最后但并非最不重要的一点是,使用cscope可以做的最好的事情之一是映射一些关键笔划,它们对光标所在的单词起作用。这给你一个非常漂亮的IDE感觉:
fun! MapCSKeys()
nmap cF :cs f f <C-R><C-F><CR>
nmap cS :cs f s <C-R><C-W><CR>
nmap cI :cs f i <C-R><C-W><CR>
nmap cE :cs f e <C-R><C-W><CR>
nmap cG :cs f g <C-R><C-W><CR>
nmap cD :cs f d <C-R><C-W><CR>
nmap cC :cs f c <C-R><C-W><CR>
nmap cT :cs f t <C-R><C-W><CR>
nmap cWF :vert scs f f <C-R><C-F><CR>
nmap cWS :vert scs f s <C-R><C-W><CR>
nmap cWI :vert scs f i <C-R><C-W><CR>
nmap cWE :vert scs f e <C-R><C-W><CR>
nmap cWG :vert scs f g <C-R><C-W><CR>
nmap cWD :vert scs f d <C-R><C-W><CR>
nmap cWC :vert scs f c <C-R><C-W><CR>
nmap cWT :vert scs f t <C-R><C-W><CR>
endfun