cscope

来源:互联网 发布:网络教育好考不 编辑:程序博客网 时间:2024/06/10 15:01

安装ubuntu时需要:sudo umount -l /isodevice


vi的配置:

 55 set number
 56 set cindent
 57 set autoindent
 58 set smartindent
 59 set showmatch
 60 set ruler
 61 set tabstop=8
 62 set shiftwidth=4
 63 set autochdir
 64 "make the /home/lxj/test directory the default directory
 65 cd /home/lxj/test
 66 set tags=tags
 67 filetype on
 68 set nocompatible
 69 set history=1000
 70 set guioptions-=T
 71 set incsearch
 72 if has("vms")
 73         set nobackup
 74 else
 75         set backup
 76 endif
 77 "split two.c
 78 set cscopequickfix=s-,c-,d-,i-,t-,e-
 79 if has("cscope")
 80         set csprg=/usr/bin/cscope
 81         set csto=1
 82         set cst
 83         set nocsverb
 84         "add my database in current directory
 85         if filereadable("cscope.out")
 86                 cs add cscope.out
 87         endif
 88         set csverb
 89         endif
 90 set clipboard+=unnamed

“在操作行添加下划线

set cursorline     


:DoMatchParen       //vi中括号匹配高亮显示


在一个括号上命令模式按%会跳转到对应的括号上去


cscope的使用:apt-get install cscope然后vimrc下添加 set cscopequickfix=s-,c-,d-,i-,t-,e-

在需要阅读的代码目录如/home/***/source_code下命令行敲cscope -Rbkq然后阅读一个代码文件vi /home/***/source_code/hello.cpp后在命令模式下敲击:cscope add /home/***/source_code/cscope.out这样才能与刚才建立的数据库连接,需要绝对路径why?,现在就可以任意查找hello.cpp下的关键字比如:cs f f fun查找source_code这个目录下哪些文件有fun这个函数

一篇比较好的配置教程:http://blog.csdn.net/sgs5476/article/details/1699697

查看的工程顶级目录下cscope -Rbq

在vi文件的时候一定要首先:cs add filename  //其中filename是你要搜寻的函数的cscope.out的包含目录名

c: 查找该函数被调用的位置
d: 查找该函数调用了哪些函数
e: 查找指定的正规表达式
f: 查找指定的文件
g: 查找指定标识符的定义位置
i: 查找该文件在哪些地方被包含
s: 查找指定标识符的使用位置
t: 查找指定的文本字符串


apt-get //  apt-cache search  //whereis 



graphlab的学习


原创粉丝点击