【linux】——cscope
2016-02-16 15:20
489 查看
cscope是一款linux下的软件,其功能主要是用在阅读代码,堪称Windows下的Source Insight,但是配合vim使用,效率无与伦比。如需了解其具体使用,请先安装vim,然后在终端执行vim命令,并在命令行执行 :help cs 。以下提供测试过的配置。以下是 ~/.vimrc 中的配置。
有了以上配置,使用方法如下:
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!
set nu set shiftwidth=4 set tabstop=4 set softtabstop=4 set autoindent 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!
相关文章推荐
- 使用密钥验证方式登录linux系统
- 解决虚拟机SSH失败或ifconfig无IP
- Linux下Gcc生成和使用静态库和动态库详解
- CentOS6.x升级MySQL版本号5.1到5.6
- linux下怎样用ctags查看内核源码
- OSV的初体验
- linux内核模块和驱动程序的编写
- linux FTP服务管理
- linux用户及组管理
- Linux常用命令之二
- 我和osv 的奇遇
- Linux C/C++编程手册
- Linux命令学习
- 如何将linux一个程序作为一个服务
- [经验分享] CentOS 6.4x64安装部署zabbix-2.4.5 [复制链接]
- linux命令笔记
- 提示错误:arm-linux-gcc: Command not found
- linux开发调试工具---GDB的使用
- linux开发调试工具---GDB的使用
- linux开发调试工具---GDB的使用