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.

  • 相关阅读:
    关于jquery判断对象是否为空
    php设计模式学习之观察者模式
    php设计模式学习之单例模式
    Nginx+phpfastcgi下flush输出问题
    php设计模式学习之工厂模式
    centos设置ssh免密码登陆
    关于yii2自带验证码功能不显示问题
    html原样输出html代码
    centos7安装iptables
    centos下配置nginx支持php
  • 原文地址:https://www.cnblogs.com/plinx/p/2810156.html
Copyright © 2011-2022 走看看