zoukankan      html  css  js  c++  java
  • 【linux】——cscope

      cscope是一款linux下的软件,其功能主要是用在阅读代码,堪称Windows下的Source Insight,但是配合vim使用,效率无与伦比。如需了解其具体使用,请先安装vim,然后在终端执行vim命令,并在命令行执行  :help cs 。以下提供测试过的配置。以下是 ~/.vimrc 中的配置。

    set nu
    set shiftwidth=4
    set tabstop=4
    set softtabstop=4
    set autoindent
    set expandtab  nmap
    <F2>s :cs find s <C-R>=expand("<cword>")<CR><CR> nmap <F2>g :cs find g <C-R>=expand("<cword>")<CR><CR> nmap <F2>d :cs find d <C-R>=expand("<cword>")<CR><CR> nmap <F2>c :cs find c <C-R>=expand("<cword>")<CR><CR> nmap <F2>t :cs find t <C-R>=expand("<cword>")<CR><CR> nmap <F2>e :cs find e <C-R>=expand("<cword>")<CR><CR> nmap <F2>f :cs find f <C-R>=expand("<cword>")<CR><CR> nmap <F2>i :cs find i <C-R>=expand("<cword>")<CR><CR> colorscheme desert if has("cscope") set csprg=/usr/local/bin/cscope set csto=0 set cst set nocsverb set cscopequickfix=s-,c-,d-,i-,t-,e- " 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

      有了以上配置,使用方法如下:

      F2 + s    Find this C symbol

      F2 + g    Find this definition

      F2 + d    Find functions called by this function

      F2 + c    Find functions calling this function

      F2 + t    Find this text string

      F2 + e    Find this egrep pattern

      F2 + f    Find this file

      F2 + i    Find files #including this file

    让代码在键盘上飞起来吧!

    end!

  • 相关阅读:
    有个表叫杨表(上)
    Codeforces Round #698 (Div. 2) 题解 全部6题
    Leetcode 821. 字符的最短距离
    gitbook mermaid不能渲染问题
    adb命令启动app及查找系统版本号
    git库使用
    excle转html方法
    gitbook插入视频
    xcode使用技巧
    在 Mac 上的“自动操作”工作流程中使用 Shell 脚本操作
  • 原文地址:https://www.cnblogs.com/ngnetboy/p/5192850.html
Copyright © 2011-2022 走看看