安装

# 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. signal(SIGPIPE, SIG_IGN)(转)

    signal(SIGPIPE, SIG_IGN) 当服务器close一个连接时,若client端接着发数据.根据TCP 协议的规定,会收到一个RST响应,client再往这个服务器发送数据时,系统会发 ...

  2. odoo开发笔记 -- 异常处理in resolve_deps field = model

    场景描述: 更新代码,重启服务服务后,odoo后台报错,提示关键字:in resolve_deps field = model._fields[fname]  KeyError: 'entry_id' ...

  3. Sword 第三方库介绍二

    /* uuid生成 */ #include <stdio.h> #include <stdlib.h> /* calloc()函数头文件 */ #include <ass ...

  4. Linux共享文件夹映射到Windows磁盘

    摘自:https://www.jianshu.com/p/4a06121450e5 1.1方案背景 本方案就是在解决磁盘不足的问题而产生的,利用映射盘的原理将Linux共享文件夹映射到Windows磁 ...

  5. 570. Managers with at Least 5 Direct Reports 至少有5个直接汇报员工的经理

    The Employee table holds all employees including their managers. Every employee has an Id, and there ...

  6. chrome/firefox如何设置很色背景

    firefox 菜单栏设置黑色 自带黑色主题,直接Enabled 页面背景设置黑色 下载扩展Extensions:Dark Reader chrome 菜单栏设置黑色 下载主题Theme:Just b ...

  7. 【C/C++开发】多线程编程中的join函数

    多线程编程中的join函数 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 # coding: utf-8 # 测试多线程中join的 ...

  8. 第2/7Beta冲刺

    1.团队成员 成员姓名 成员学号 秦裕航 201731062432(组长) 刘东 201731062227 张旭 201731062129 王伟 201731062214 2.SCRU部分 2.1各成 ...

  9. redis示例

    1. 引入redis相关包 <!-- redis 相关包--> <dependency> <groupId>org.springframework.data< ...

  10. Netty 基本原理

    转载. https://blog.csdn.net/qq_27641935/article/details/86543578 之前在看rocketmq源码时,发现底层用了Netty,顺便学习了一下,网 ...