Search Results for 'vi + cscope'


1 POSTS

  1. 2009/06/09 VIM & CSCOPE configuration for kernel development

Installing vim

Ubuntu is not serving vim full packages for default. So, if you need to use advanced features of vim, just type like following

sudo apt-get install vim

Man pages for development

Hey, M$ users. You can even use reference library like MSDN in vim as well. Just install man pages for development and press shift+k on symbol in vim. Then, you’ll see.

sudo apt-get install manpages-dev

 

Installing cscope

And even use symbol search feature in vim also.

sudo apt-get install cscope

 

Attaching cscope to vim

Just add following lines in your .vimrc which is stored in your home directory.

 

set csprg=/usr/bin/cscope

if filereadable("./cscope.out")

cs add cscope.out

else

cs add "your project cscope.out"

endif

set csverb

 

Script for building cscope db

If your project is not supporting cscope through Make, then you can make a script on your own and locate it in your /usr/local/bin directory with executable permission. And execute that script in your top directory of your project. BTW, kernel project just supports cscope through Makefile. You can just issue “make cscope ARCH=…”

#!/bin/sh

rm -rf cscope.*

find . \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.s' -o -name '*.S' \) -print > cscope.files

cscope -i cscope.files

Enjoy your vim&cscope life.

Cheers,

크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : , , ,