安装

# apt-get install cscope

.vimrc中添加

if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else search cscope.out elsewhere
else
let cscope_file=findfile("cscope.out", ".;")
let cscope_pre=matchstr(cscope_file, ".*/")
if !empty(cscope_file) && filereadable(cscope_file)
exe "cs add" cscope_file cscope_pre
endif
endif
endif
set csverb
set cscopetag
nmap <C-c>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-c>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
nmap <C-c>d :cs find d <C-R>=expand("<cword>")<CR><CR>

先按Ctrl+c ,再按 s/g/c/t/e/f/i/d进行查找

s:查找C语言符号,即查找函数名、宏、枚举值等

g:查找函数、宏、枚举等定义的位置。类似ctags功能

d:查找本函数调用的函数

c:查找调用本函数的函数

t:查找指定的字符串

e:查找egrep模式。相当于egrep功能,但查找速度快多了

f:查找并打开文件。类似vim的find功能

i:查找包含本文件的文件

使用

生成cscope.in.out、cscope.po.out和cscope.out

# cscope -Rbkq

R:在生成索引文件时,搜索子目录树中的代码

b:只生成索引文件,不进入cscope的界面

k:在生成索引文件时,不搜索/usr/include目录

q:生成cscope.in.out和cscope.po.out文件,加快cscope的索引速度

cscope安装的更多相关文章

  1. Vim Cscope安装与使用

    问题描述:        Cscope是VIM适用的工具和插件,通过Cscope可以方便的获取某个函数的定义以及被那些函数调用 问题解决:         (1)Cscope安装    注:      ...

  2. Cscope 安装和使用

    CScope 安装和使用 一.安装 1. 软件下载 https://sourceforge.net/projects/cscope/files/ 2. 解压 3. 安装 ./configure --p ...

  3. Env:Cscope安装与配置

    1. 介绍 Cscope是类似于ctags一样的工具,但可认为他是ctags的增强版. 2. 安装 sudo apt-get install cscope 通过源码安装,参照http://blog.c ...

  4. Vim+Ctags+Cscope安装

    对比了下,感觉还是Vim比较专业. 一:使用说明: ‘/’查找忽略大小写,比如需要查找“book”,当输入/b的时候会自动找到第一个以"b"开头的单词 实现C程序的缩减 查询中自由 ...

  5. 非root用户 如何将cscope安装到指定目录,vim74安装

    随着Linux的普及,使用Linux进行软件开发的人也越来越多.而大多数公司都采用这种方式:提供一台高性能的中央服务器做为开发编译服务器,每个人登录这台服务器进行开发编译.在这种情况下,用户通常没有r ...

  6. Mac下安装cscope和ctags

    Mac下默认没有cscope和ctags,太不爽了,还好可以自己编译一个放进来 一.下载地址 cscope: http://downloads.sourceforge.net/project/csco ...

  7. Scope 安装和使用

    Scope 安装和使用 一.安装 1. 软件下载 https://sourceforge.net/projects/cscope/files/ 2. 解压 3. 安装 ./configure --pr ...

  8. cscope 的使用

    一. cscope安装 1.软件下载:http://sourceforge.net/project/showfiles.php?group_id=4664 2.软件安装: ./configure -- ...

  9. cscope配置和使用

    , cscope安装 软件下载:http://sourceforge.net/project/showfiles.php?group_id=4664 软件安装: ./configure --with- ...

随机推荐

  1. phpstudy apache 服务无法启动

    1.找到apache路径 3.打开cmd进入bin文件夹 4.输入 httpd.exe  看报的什么错误即可解决 我的这边是httpd.config 里面配置了个项目文件夹路径,这个文件夹被我删了,导 ...

  2. tf.gather和tf.gather_nd、tf.cast、tf.greater

    https://blog.csdn.net/Cyiano/article/details/76087747

  3. servlet的session的生命周期

    谈到javaweb首先想到的就是servlet,说道servlet就会想到servlet的生命周期 说道servlet的生命周期 就绕不过servlet的三个方法init service destro ...

  4. 运行okvis-mono

    ./build/okvis_app_synchronous config/config_fpga_p2_euroc1.yaml ../mav0

  5. LeetCode_415. Add Strings

    415. Add Strings Easy Given two non-negative integers num1 and num2 represented as string, return th ...

  6. [LeetCode] 108. Convert Sorted Array to Binary Search Tree 把有序数组转成二叉搜索树

    Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Fo ...

  7. 阿里云k8s部署zookeeper集群

    1. 阿里云k8s创建有状态应用 StatefulSet ,  选择使用模板创建 可以创建自定义模板 apiVersion: apps/v1 kind: StatefulSet metadata: c ...

  8. Quartus ii 设计中的差分信号在例化时的命名规则

    在Quartus中做设计,如果使用了差分信号的,如DDR的IP中的mem_ck与mem_ck_n,mem_dqs与mem_dqs_n,将其引入输出端口时,对其命名有一定的规则,否则就会出现错误. 如下 ...

  9. DHCP配置实例(含DHCP中继代理)

    https://blog.51cto.com/yuanbin/109759. DHCP配置实例(含DHCP中继代理)   某公司局域网有192.168.1.0/24和192.168.2.0/24这两个 ...

  10. 【原创】C++STL multiset

    资料来源:官方文档 multiset是一个按照特定排序储存元素的容器,多个元素可以有相同的值.元素的值即为其本身的键值.multiset中的值无法修改,可插入删除.常用于实现二叉树. 定义一个mult ...