1) Reference:

Linux 平台下阅读源码的工具链

程序员的利器 – cscope

2) cscope help:

:help cscope

:help cscope-suggestions

:cs help

3) Generate index files:

find fullpath/of/your/project –type f > cscope.files

cscope -bq

4) cscope command:

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

5) Add cscope setting in .vimrc:

if has("cscope")     

  set csprg=/usr/local/bin/cscope     

  set csto=     

  set cst     

  set nocsverb     

  " add any database in current directory     

  if filereadable("cscope.out")         

    cs add cscope.out     

  " else add database pointed to by environment     

  elseif $CSCOPE_DB != ""         

    cs add $CSCOPE_DB     

endif     

set csverb endif

nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR> 

nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR> 

nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR> 

nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR> 

nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR> 

nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR> 

nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> 

nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>

" Using 'CTRL-spacebar' then a search type makes the vim window 

" split horizontally, with search result displayed in 

" the new window.

nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR> 

nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> 

nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>

" Hitting CTRL-space *twice* before the search type does a vertical 

" split instead of a horizontal one

nmap <C-Space><C-Space>s     \:vert scs find s <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space><C-Space>g     \:vert scs find g <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space><C-Space>c     \:vert scs find c <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space><C-Space>t     \:vert scs find t <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space><C-Space>e     \:vert scs find e <C-R>=expand("<cword>")<CR><CR> 

nmap <C-Space><C-Space>i     \:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> 

nmap <C-Space><C-Space>d     \:vert scs find d <C-R>=expand("<cword>")<CR><CR>

cscope usage的更多相关文章

  1. 将Vim改造为强大的IDE—Vim集成Ctags/Taglist/Cscope/Winmanager/NERDTree/OmniCppComplete(有图有真相)(转)

    1.安装Vim和Vim基本插件首先安装好Vim和Vim的基本插件.这些使用apt-get安装即可:lingd@ubuntu:~/arm$sudo apt-get install vim vim-scr ...

  2. 〖Linux〗(2013.08.02)使用ctag+cscope查看Android源代码

    1. 安装ctags和cscope sudo apt-get install -y exuberant-ctags cscope 2. vimrc中的配置 """&quo ...

  3. vim插件cscope使用方法

    一.安装cscope 安装方式比较多样,可以在各自linux软件管理工具中安装,也可以去官网下载安装. sudo apt-get install cscope 二.插件安装 这里选择的是Vundle来 ...

  4. 安装windows下的Cscope

    http://blog.csdn.net/maxiee/article/details/10034263 Cscope 是一款用于查看大型工程中的代码的软件.它使用方便,支持快速查找 C Symbol ...

  5. intellij IDEA 出现“Usage of API documented as @since 1.6+”的解决办法

    问题 在导入java.io.console的时候出现"Usage of API documented as @since 1.6+"

  6. Disk Space Usage 术语理解:unallocated, unused and reserved

    通过standard reports查看Disk Usage,选中Database,右击,选择Reports->Standard Reports->Disk Space Usage,截图如 ...

  7. OpenCascade MeshVS Usage

    OpenCascade MeshVS Usage eryar@163.com Abstract. MeshVS means Mesh Visualization Service. It can be ...

  8. Usage: AddDimensionedImage imageFile outputFile eclipse 运行程序出错

    关于这个在eclipse中运行java程序的错,首先确认你的jdk,jre是否完整,并且与你的eclipse的位数相同,当然我相信这个错误大家应该都会去检查到. 第二个关于addDimensioned ...

  9. Please allow Subclipse team to receive anonymous usage statistics for this Eclipse intance(info)

    本文转载自:http://blog.csdn.net/myfxx/article/details/21096949 今天在用eclipse启动项目的时候发现了一个问题,就是每次启动项目的时候,ecli ...

随机推荐

  1. MySQL_使用时遇到的问题汇总

    一.data too long for column 'name' at row 1 1.现象:把数据库的字符集编码设置为utf-8,通过DOS界面向表的某一列插入汉字时会遇到类似 data too ...

  2. JFinal中Controller的应用

    部分方法: 1.获取参数:getPara(String name); getParaToInt(String name) ,将返回参数的值转为int: getPara() ,url中参数连接为/v1- ...

  3. iOS SDWebImage加载大图导致内存崩溃解决方案

    static BOOL SDImageCacheOldShouldDecompressImages = YES; static BOOL SDImagedownloderOldShouldDecomp ...

  4. Eval,Bind,<% %>,<%# %>和<%= %> 笔记

    1.<% %>用来绑定后台代码 如: < % for(int i=0;i<100;i++) { Reaponse.Write(i.ToString()); } %> 2. ...

  5. php编译安装与配置

    php编译安装与配置 =========================================== 官网:http://php.net/ 官网下载:http://php.net/downlo ...

  6. vim visual模式 复制

    按ESC再按“V”,进入visual模式 用键盘向左向右箭头选中要复制的文字,按两下"Y"键 再到要粘贴的地方,按“P”键即可. 转自: http://jingyan.baidu. ...

  7. html5+css3实现手机下拉和下拉刷新

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  8. swift 使用运行时进行属性关联

    1.用OC思想写swift代码真得很爽,swift需要的OC基本上都有,只不过略微改变了一下,例如以前的Foundation库前缀NS全部去掉了,等等...思想其实都一样,不过swift确实非常精简, ...

  9. 我的Android进阶之旅------>如何获取Android控件的宽和高

    本文转载于:http://blog.csdn.net/johnny901114/article/details/7839512 我们都知道在onCreate()里面获取控件的高度是0,这是为什么呢?我 ...

  10. delete 和 truncate 的 区别

    如果要清空表中的所有记录,可以使用下面的两种方法: DELETE FROM table1     TRUNCATE TABLE table1 以下 为之区别: 1)执行速度和灵活性    trunca ...