Install cscope
sudo apt-get install cscope
Generate cscope.files
LNX=/home/jing/data/road/linux/linus
cd /
find $LNX \
-path "$LNX/arch/*" ! -path "$LNX/arch/x86*" -prune -o \
-path "$LNX/Documentation*" -prune -o \
-path "$LNX/scripts*" -prune -o \
-path "$LNX/drivers*" -prune -o \
-name "*.[chxsS]" -print >$LNX/cscope.files
Generate the Cscope database
cscope -b -q -k
Copy the following text to .vimrc
if has("cscope")
set csprg=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
" mapping
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>
endif
Script to generate tags:
#!/bin/bash
LNX=.
ctags -R \
--exclude=arch/alpha \
--exclude=arch/arm \
--exclude=arch/avr32 \
--exclude=arch/blackfin \
--exclude=arch/c6x \
--exclude=arch/cris \
--exclude=arch/frv \
--exclude=arch/h8300 \
--exclude=arch/hexagon \
--exclude=arch/ia64 \
--exclude=arch/m32r \
--exclude=arch/m68k \
--exclude=arch/microblaze \
--exclude=arch/mips \
--exclude=arch/mn10300 \
--exclude=arch/openrisc \
--exclude=arch/parisc \
--exclude=arch/powerpc \
--exclude=arch/s390 \
--exclude=arch/score \
--exclude=arch/sh \
--exclude=arch/sparc \
--exclude=arch/tile \
--exclude=arch/um \
--exclude=arch/unicore32 \
--exclude=arch/xtensa \
--exclude=Documentation \
--exclude=scripts \
--exclude=drivers \
$LNX
分享到:
相关推荐
linux-tools:vim73 cscope ctags .vimrc
自己的vim配置文件, 内含: 1. _vimrc 2. plugin: TagList, SuperTab, OmniCppComplete, Code_Complete 3. tags for glibc, C++(stl,stream), Unix98 system, glib-2.0 4. ftplugin for Pro*C/C++
vim+ctags+cscope一键安装(使用)
代码的话需要用cscope和ctags的组合,可以达到类似sourceinsight的效果。这次上传的是cscope.exe和ctags.exe。这个是编译好的版本,在windows下直接用,非常方便。 请放在vim的目录下, 并且将这个目录设置在环境变量...
window下使用vim查看源码的好用插件,RAR里面有ctags,cscope,taglist.vim,cscope_maps.vim
linux下面vim+ctags+cscope的使用方法,功能非常强大 linux下面vim+ctags+cscope的使用方法,功能非常强大
代码的话需要用cscope和ctags的组合, 可以达到类似sourceinsight的效果。这次上传的是cscope.exe和ctags.exe。这个是编译好的版本,在windows下直接用。不需要cygwin.dll的参与 我在vim6 vim7都用了很久, 非常方便...
vim的经典插件cscope,号称超频的ctags,此版本为linux版本
vim配置文件,包含taglist cscope nerdtree 等配置
用vim的插件搭建一个类似sourceinsight的vi,同时加了一些vim及脚本,只需一条命令,就可安装完ctagslist,cscope等插件,达到sourceinsight的效果。
有人推荐直接下载一个windows下的vim安装包,或者有人推荐使用source insight,notpad++, sublime, ultraedit 或其他IDE工具等等,但是我尝试了使用这些工具查看代码以后,感觉都不习惯,后来才发现自己是个linux中毒...
vim plug taglist cscope,vim plug ubuntu
自己的vim配置文件 1. .vimrc 2. plugins: TagList, SuperTab, OmniCppComplete, Code_Complete DoxygenToolkit, proc 3. c89, GNU libc, C++(stl,stream), IEEE Std 1003.1-2008, glib-2.0 的tags文件 4. ftplugin ...
windows 环境的ctags和cscope还有DoxygenToolkit.vim minibufexpl.vim Tabular.vim taglist.vim visualmark.vim 插件工具
代码阅读,vim插件使用,根据自己指定的目录生成ctags cscope等索引文件,shell脚本,仅供参考。
进入工程/ #CSPOSE #gvim . 即可使用
linux下使用 vim + cscope 查看代码是我整理的linux下用VIM实现source insight
vim 中Ctags的安装和使用 『插件介绍』 Ctags工具是用来遍历源代码文件生成tags文件,这些tags文件能被编辑器或其它工具用来快速查找定位源代码中的符号(tag/symbol),如变量名,函数名等。比如,tags文件就是...