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. MapReduce源码分析之新API作业提交(二):连接集群

    MapReduce作业提交时连接集群是通过Job的connect()方法实现的,它实际上是构造集群Cluster实例cluster,代码如下: private synchronized void co ...

  2. 【ubantu】在Ubuntu上安装tar.gz,tar.bz以及deb文件(例:libreoffice安装)

    参考文章: https://blog.csdn.net/zhuquan945/article/details/52986712 ==================================== ...

  3. 取消eclipse js验证

    去掉Eclipse中的Validating 最近我的Eclipse一直经常效验javascript,我疯了校验了一个多小时还是在验.我只能在项目的.project文件中: 去掉.project文件中的 ...

  4. 函数柯里化常见应用---add(1,2) add(1)(2) add(1)(2)(3) add(1,2,3)(4)

    这是一道经典的题目,先上代码: 解法1: function add () { var args = Array.prototype.slice.call(arguments); var fn = fu ...

  5. ShareSDK 微博空间分享

    本文转载至 http://blog.csdn.net/learnios/article/details/8992346 ShareSDK微博分享空间分享新浪微博腾讯微博 第一步:首先导入ShareSD ...

  6. gulp安装教程

    1.安装nodejs并选装cnpm: npm install cnpm -g --registry=https://registry.npm.taobao.org 2.全局安装gulp: cnpm i ...

  7. jquery 通过属性选择器获取input不为disabled的对象

    $("input[id^='input_001']:not(:disabled)").each(function(){ console.log(this); });

  8. mybatis 视频总结

    [说明]mabatis卡住了,理解的不深,配置文件的格式太多看不懂(除了连接数据库的部分),听说还可以和log4j集成,怎么个方法 一:今日完成 1)一些语言细节和操作细节 比如在servlet里面操 ...

  9. POJ1942

    Paths on a Grid Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 24236   Accepted: 6006 ...

  10. 洛谷P2661 信息传递==coedevs4511 信息传递 NOIP2015 day1 T2

    P2661 信息传递 题目描述 有n个同学(编号为1到n)正在玩一个信息传递的游戏.在游戏里每人都有一个固定的信息传递对象,其中,编号为i的同学的信息传递对象是编号为Ti同学. 游戏开始时,每人都只知 ...