加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vim-cscope插件

发布时间:2020-12-15 23:14:52 所属栏目:安全 来源:网络整理
导读:在工程根目录生成cscope.out 索引文件的脚本 rm -f cscope*currentPath=$(pwd )echo $currentPathfind $currentPath -name "*.h" -type f -o -name "*.c" -type f -o -name "*.cc" -type f -o -name "*.cpp" -type f cscope.filescscope -bkq -i cscope.file

在工程根目录生成cscope.out 索引文件的脚本

rm -f cscope*
currentPath=$(pwd )
echo $currentPath
find $currentPath  -name "*.h" -type f -o -name "*.c" -type f -o -name "*.cc" -type f -o -name "*.cpp" -type f > cscope.files
cscope -bkq -i cscope.files

vim命令模式查找:cs find 可以简写为 cs f
eg 查找文件名: cs f f filename

以下为引用

在vim中使用cscope非常简单,首先调用”cscope add”命令添加一个cscope数据库,然后就可以调用”cscope find”命令进行查找了。
vim支持8种cscope的查询功能,如下:

0或者s: 查找C语言符号,即查找函数名、宏、枚举值等出现的地方
1或者g: 查找函数、宏、枚举等定义的位置,类似ctags所提供的功能
2或者d: 查找本函数调用的子函数
3或者c: 查找调用本函数的父函数
4或者t: 查找指定的字符串
6或者e: 查找egrep模式,相当于egrep功能,但查找速度快多了
7或者f: 查找并打开文件,类似vim的find功能
8或者i : 查找#include这个文件的文件(们)
---------------------

原文:https://blog.csdn.net/magiclyj/article/details/79660259

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读