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.

  • 相关阅读:
    线段树【加强】
    ATM(BZOJ 1179)
    Trick or Treat on the Farm
    欧拉回路 HDU
    无序字母对(luogu 1314)
    MooFest
    Snowflake Snow Snowflakes(POJ 3349)
    Firetruck(UVA 208)
    B进制星球(luogu 1604)
    遍历一个树的所有子节点,画出该树,深度不定,广度不定,适用于任何树,深度优先算法
  • 原文地址:https://www.cnblogs.com/plinx/p/2810156.html
Copyright © 2011-2022 走看看