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. Codeforces 38G Queue 伸展树

    题目链接:点击打开链接 题意: 给定n个人来排队 每一个人有2个參数.身份优先级和脸皮厚度 == 来的那个人会排到队尾 假设这个人的优先级比他前面那个人的优先级大就会和前面那个人交换位置. 交换一次脸 ...

  2. windows 10右键项添加Notepad++

    1.打开注册表编辑器,开始->运行->regedit. 2.在HKEY_CLASSSES_ROOT→ * → Shell 下,在Shell下,新建项命名为Open With Notepad ...

  3. JSP(Java Server Pages,即:Java服务器页面

    是一种跨平台的动态网页技术标准,由Sun Microsystems公司倡导.多家公司参与建立. 它在HTML文件中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(* ...

  4. js中return;return true return false 的区别

    return 定义: return 语句会 终止函数的执行 并 返回函数的值. 注意这两个: 1.终止函数的执行 2.返回函数的值 返回函数的值这里就不过多叙述了,就是 return 变量 先看下面的 ...

  5. 地形混合shader

    1.四个贴图混合 Shader "Custom/BlendTex_surface" { Properties { _RTexture("Red Channel Textu ...

  6. 2016 acm香港网络赛 C题. Classrooms(贪心)

    原题网址:https://open.kattis.com/problems/classrooms Classrooms The new semester is about to begin, and ...

  7. php函数unserialize数据返回false问题分析

    unserialize的这个问题是由一个emlog论坛用户在使用时报错而发现的 问题表现情况如下: emlog缓存的保存方式是将php的数据对象(数组)序列化(serialize)后以文件的形式存放, ...

  8. mysql 不同库不同表字段数据复制

    需求:把一个表某个字段内容复制到另一张表的某个字段. 实现sql语句1: UPDATE file_manager_folder f1 LEFT OUTER JOIN file_manager_fold ...

  9. CF#256(Div.2) A. Rewards

    A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...

  10. 自定义TextView带有各类.ttf字体的TextView

    最近项目遇到了将普通文字转化为带有字体样式的文字,这里就涉及到了.ttf文件,我上网百度了不少资料最终终于实现了,现在想想其实并不复杂 1,你需要下载一种.ttf字体文件,你可以从网上找到一种字体的. ...