zoukankan      html  css  js  c++  java
  • Vim+Cscope

    1、安装Cscope

    sudo apt-get install cscope

    2、在/etc/vim/vimrc文件中加入以下内容

    "enable the cscope in vim
    if filereadable("cscope.out")
        cs add cscope.out
    endif
    3、进入想要看的文件夹目录: 例/home/linx/kernel/linux-3.6.3/drivers/char
    
    
    cd kernel/linux-3.6.3/drivers/char/

    4、建立索引

    cscope -Rbq
    #-R            Recurse directories for files.
    #-b            Build the cross-reference only.
    #-q            Build an inverted index for quick symbol searching.

    5、打开想要查看的文件: 例 misc.c

    vim misc.c

    6、使用底行添加路径

    :cs add ~/kernel/linux-3.6.3/drivers/char/cscope.out ~/kernel/linux-3.6.3/drivers/char 

    7、索引: 例 static LIST_HEAD(misc_list);

    :cs find s LIST_HEAD

    8、cscope强化:在/etc/vim/vimrc中加入如下内容

    "use the Ctrl+Shift+\ and [sgctefid] shorted for the code cs find [sgctefid]
    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>

    9、now, enjoy it.

  • 相关阅读:
    大数据应用期末总评
    分布式文件系统HDFS 练习
    安装Hadoop
    爬虫综合大作业
    爬取全部的校园新闻
    理解爬虫原理
    中文词频统计与词云生成
    复合数据类型,英文词频统计
    字符串操作、文件操作
    了解大数据的特点、来源与数据呈现方式
  • 原文地址:https://www.cnblogs.com/plinx/p/2810156.html
Copyright © 2011-2022 走看看