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.

  • 相关阅读:
    laravel打印SQL语句
    php扩展打开不起作用的原因, php数字显示2147483647的原因
    opacity与rgba
    package.json中devDependencies与dependencies的区别
    FileReader读取文件
    Vue双向绑定原理详解
    Vue2入门路线及资源
    gulp入门实践
    浏览器版本识别
    this用法
  • 原文地址:https://www.cnblogs.com/plinx/p/2810156.html
Copyright © 2011-2022 走看看