本文共 954 字,大约阅读时间需要 3 分钟。
#!/bin/shfind $(pwd) -name "*.h" -o -name "*.c" -o -name "*.cc" > cscope.filescscope -bkq -i cscope.filesctags -R将以上代码保存为.sh文件,例如cs.sh,然后终端中修改其属性,增加执行属性;
将以下内容增加到 .vimrc 内
" tags 设置set tags=tags; set autochdirif has("cscope") set csprg=/usr/bin/cscope "指定用来执行 cscope 的命令 set csto=1 "先搜索tags标签文件,再搜索cscope数据库 set cst "使用|:cstag|(:cs find g),而不是缺省的:tag set nocsverb "不显示添加数据库是否成功 " add any database in current directory if filereadable("cscope.out") cs add cscope.out "添加cscope数据库 endif "显示添加成功与否 set csverbendif:set cscopequickfix=s-,c-,d-,i-,t-,e-nmap运行cs.sh,此后可以参考其他的教程~~s :cs find s =expand(" ") nmap g :cs find g =expand(" ") nmap c :cs find c =expand(" ") nmap t :cs find t =expand(" ") nmap e :cs find e =expand(" ") nmap f :cs find f =expand(" ") nmap i :cs find i ^ =expand(" ") $ nmap d :cs find d =expand(" ")
转载地址:http://afmti.baihongyu.com/