Vim cscope

/**********************************************************************
 *                            Vim cscope
 * 说明:
 *     之前使用Vim进行代码跟踪,都是通过Vim+ctags,传言中是cscope会相对
 * 更强大,更有效,所以抽点空学习一下。
 *
 *                                    2016-4-10 深圳 南山平山村 曾剑锋
 *********************************************************************/

一、参考资料:
    1. Editor Tips
        http://elinux.org/Editor_Tips
    2. 在Vim中使用cscope
        http://www.cnblogs.com/sunj/archive/2012/03/12/2391610.html
    3. The Vim/Cscope tutorial
        http://cscope.sourceforge.net/cscope_vim_tutorial.html
    4. vi/vim使用进阶: 程序员的利器 – cscope
        http://easwy.com/blog/archives/advanced-vim-skills-cscope/

二、安装cscope
    sudo apt-get install cscope

三、创建Linux kernel cscope ARM库
    make ARCH=arm cscope

四、现象:
    [email protected]:~/kernel$ make ARCH=arm cscope
      GEN     cscope
    [email protected]:~/kernel$ ls cscope.*
    cscope.files  cscope.out  cscope.out.in  cscope.out.po
    [email protected]:~/kernel$ 

五、.vimrc配置
    ......
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    " cscope setting
    """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    if has("cscope")
        set csprg=/usr/bin/cscope
        set csto=1
        set cst
        set nocsverb
        " add any database in current directory
        if filereadable("/home/zengjf/kernel/cscope.out")
            cs add /home/zengjf/kernel/cscope.out
        endif
        set csverb
        set cscopetag
    endif

    nmap <[email protected]>s :cs find s <C-R>=expand("<cword>")<CR><CR>
    nmap <[email protected]>g :cs find g <C-R>=expand("<cword>")<CR><CR>
    nmap <[email protected]>c :cs find c <C-R>=expand("<cword>")<CR><CR>
    nmap <[email protected]>t :cs find t <C-R>=expand("<cword>")<CR><CR>
    nmap <[email protected]>e :cs find e <C-R>=expand("<cword>")<CR><CR>
    nmap <[email protected]>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
    nmap <[email protected]>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
    nmap <[email protected]>d :cs find d <C-R>=expand("<cword>")<CR><CR>
时间: 2024-08-18 21:27:31

Vim cscope的相关文章

Cscope的使用(领略Vim + Cscope的强大魅力)

文章出处:http://blog.csdn.net/dengxiayehu/article/details/6330200 1.Cscope介绍 Cscope是类似于ctags一样的工具,但可以认为她是ctags的增强版,因为她比ctags能够做更多的事.在Vim中,通过cscope的查询,跳转到指定的地方就像跳转到任何标签:她能够保存标签栈,所以通过合适的键盘映射绑定,你能够在函数向后或向前跳转,就像通常使用的tags一样. 首次使用Cscope时,他会根据源文件生成符号数据库.然后在以后的使

vim+cscope简易教程

Cscope具有纯正的Unix血统,它最早是由贝尔实验室为PDP-11计算机开发的,后来成为商用的AT&T Unix发行版的组成部分.直到2000年4月,这个工具才由SCO公司以BSD license开源发行. Cscope的主页在http://cscope.sourceforge.net/,如果你的计算机上没有cscope,你可以在此处下载它,在写本文时,它的最新版本是15.8b.mac中可以用homebrew一键安装. 1.cscope的用法很简单,首先需要为你的代码生成一个cscope数据

Vim + Cscope 阅读 Linux kernel

1. 安装 cscope sudo apt-get install cscope 2. 生成索引文件 cd linux-3.8.13 make xxx-config make cscope 3. 配置vim if has("cscope") set csprg=/usr/local/bin/cscope set csto=0 set cst set nocsverb " add any database in current directory if filereadable

VIM+ctags+cscope用法

使用vim + cscope/ctags,就能够实现Source Insight的功能,可以很方便地查看分析源代码. 关键词: vim, cscope, ctags, tags 1. 查看vim是否支持cscope $ vim --version | grep cscope 2. 编译支持cscope的VIM(--enable-cscope) # USE="bash-completion cscope nls perl python -acl -gpm -minimal -ruby -vim-p

Linux 下阅读源码工具(Vim + ctags+Cscope)

0. 写在前面的废话 开发环境迁移到了Ubuntu下,所有windows下好用的工具都要找个替代品. windows下一直用 souce Insight 来阅读源码,需要在Ubuntu下找个替代品. 上网看了看,貌似Vim + Ctags + Cscope不错,安装来试试 o(∩∩)o 1. 安装 在我用的ubuntu中,这三个软件都不是自带的,需要手动安装,很简单用apt-get命令安装就好了 $ sudo apt-get install vim $ sudo apt-get install

我的vim捣鼓之路

前言 从大二的时候就开始接触Linux了,从而也接触了vi,对的,当时对这些还不太了解,不知道还有个vim,真的觉得入门不简单,网上关于vim对比其他Editor的学习曲线,看了令人生畏.那时候用的也不多,所以一直处于裸奔状态,只会基本的操作,这里推荐我比较喜欢的一个博客网站酷壳中的一篇博文简明vim练级攻略.这篇博文基本上把日常使用vim的90%的命令概括了,裸奔也就够了. 当然,这里推荐一个关于vim的游戏vim大冒险,同样来自酷壳.这个网站里很多博文我都觉得写的不错.写这篇博文的时候又看到

vim配置添加python

" pydiction 补全提示+ "  pythoncomplete vim自带的python补全提示 " pyflakes Python代码检查+ " VimPdb 调试Python程序+ f2打断点116,,119 f3输入a,查看a的值 执行到119 f12查看堆栈 vim配置 1 """""""""""""""

Linux Kernel - Debug Guide (Linux内核调试指南 )

http://blog.csdn.net/blizmax6/article/details/6747601 linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级调试 ***第一部分:基础知识*** 总纲:内核世界的陷阱 源码阅读的陷阱 代码调试的陷阱 原理理解的陷阱 建立调试环境 发行版的选择和安装 安装交叉编译工具 bin工具集的使用 qemu的使用 initrd.img的原理与制作 x86虚拟调试环境的建立 arm虚拟调试环境的建立 arm开发板调试环

linux内核调试指南

linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级调试 ***第一部分:基础知识*** 总纲:内核世界的陷阱 源码阅读的陷阱 代码调试的陷阱 原理理解的陷阱 建立调试环境 发行版的选择和安装 安装交叉编译工具 bin工具集的使用 qemu的使用 initrd.img的原理与制作 x86虚拟调试环境的建立 arm虚拟调试环境的建立 arm开发板调试环境的建立 gdb基础 基本命令 gdb之gui gdb技巧 gdb宏 汇编基础--X86篇 用户手册 AT&