zoukankan      html  css  js  c++  java
  • cscope usage

    1) Reference:

    Linux 平台下阅读源码的工具链

    程序员的利器 – cscope

    2) cscope help:

    :help cscope

    :help cscope-suggestions

    :cs help

    3) Generate index files:

    find fullpath/of/your/project –type f > cscope.files

    cscope -bq

    4) cscope command:

    add  : Add a new database             (Usage: add file|dir [pre-path] [flags])

    find : Query for a pattern            (Usage: find c|d|e|f|g|i|s|t name)       

    c: Find functions calling this function       

    d: Find functions called by this function       

    e: Find this egrep pattern       

    f: Find this file       

    g: Find this definition       

    i: Find files #including this file       

    s: Find this C symbol       

    t: Find assignments to

    5) Add cscope setting in .vimrc:

    if has("cscope")     
    
      set csprg=/usr/local/bin/cscope     
    
      set csto=0     
    
      set cst     
    
      set nocsverb     
    
      " add any database in current directory     
    
      if filereadable("cscope.out")         
    
        cs add cscope.out     
    
      " else add database pointed to by environment     
    
      elseif $CSCOPE_DB != ""         
    
        cs add $CSCOPE_DB     
    
    endif     
    
    set csverb endif
    
    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>
    
    " Using 'CTRL-spacebar' then a search type makes the vim window 
    
    " split horizontally, with search result displayed in 
    
    " the new window.
    
    nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR> 
    
    nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> 
    
    nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
    
    " Hitting CTRL-space *twice* before the search type does a vertical 
    
    " split instead of a horizontal one
    
    nmap <C-Space><C-Space>s     :vert scs find s <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space><C-Space>g     :vert scs find g <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space><C-Space>c     :vert scs find c <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space><C-Space>t     :vert scs find t <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space><C-Space>e     :vert scs find e <C-R>=expand("<cword>")<CR><CR> 
    
    nmap <C-Space><C-Space>i     :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR> 
    
    nmap <C-Space><C-Space>d     :vert scs find d <C-R>=expand("<cword>")<CR><CR>
  • 相关阅读:
    证明一下拉普拉斯的《概率分析论》观点
    Android实现小圆点显示未读功能
    命名 —— 函数的命名
    node.js 之爬虫
    ubuntu安装 tensorflow GPU
    古文(诗词文)—— 结构模式与复用
    Win10安装Ubuntu16.04 双系统
    python使用wget下载网络文件
    文字检测与识别资源
    10大深度学习架构:计算机视觉优秀从业者必备
  • 原文地址:https://www.cnblogs.com/tanghuimin0713/p/5992498.html
Copyright © 2011-2022 走看看