2009年12月31日 星期四

Articles about cscope+vim+ctags+taglist

http://cscope.sourceforge.net/cscope_vim_tutorial.html
http://blog.verycd.com/yoyopub/showentry=22855
http://adrianhuang.blogspot.com/2007/09/trace-code-gvimctagscscope.html
http://blog.chhsu.org/2009/03/multi-projects-of-vim-using-cscope.html

  • Install Ctags
$sudo apt-get install exuberant-ctags
  • Install Cscope
$sudo apt-get install cscope
  • Make Sure Your Vim Support Cscope
$ vim --version | grep cscope
  • Download Cscope Plugin
$ mkdir ~/.vim/pluging
$cd ~/.vim/plugin
$ wget http://cscope.sourceforge.net/cscope_maps.vim
  • Install Taglist

Download tagliast from http://vim-taglist.sourceforge.net/download.html.
Follow the installation steps from http://vim-taglist.sourceforge.net/installation.html
Add the following line into your .vimrc will help you to open taglist and switch between tag and editor window.

filetype on
nnoremap < silent > < f2 > :TlistToggle < cr >
nnoremap < silent > < f3 > :wincmd p < cr >


  • Generate DB & test


#!/bin/bash
CSCOPE_FILE=cscope.out
if [ -n "$1" ]; then
echo "Source code directory: " $1
echo "Create file map : " $CSCOPE_FILE
find $1 -name "*.h" -o -name "*.c" -o -name "*.cpp" > $CSCOPE_FILE
cscope -bkq -i $CSCOPE_FILE
# cscope -Rbkq
ctags -R
else
echo "Please key-in path of project"
fi

$cd source-code
$
cscope
  • Other IDEs
Other IDE includes Anjuta or Source Navigator. You can try it.





沒有留言:

張貼留言