Origin url : http://vim.wikia.com/wiki/Autoloading_Cscope_Database


$ cscope -i <cscope files> 한 output database file 을 ~/.vimrc 에서

if filereadable("cscope.out") cs add cscope.out

endif


방식으로 추가하면 cscope.out 이 있는 directory 에서 vi /path/to/source/file 의 형식으로 open 해야 database file이 loading 된다.


대형 프로젝트에서 directory를 이동하며 source를 보는데, source trace 를 위해 project 최상위 directory(cscope.out file 이 위치하는)로 이동하는 번거러움을 없애기 위해 ~/.vimrc 에 script 를 찾아냈다.


~/.vimrc 에 위의 내용을 복사해서 붙이면 어느 path 에서나 cscope.out 을 찾아 loading 한다.


'Development Tip' 카테고리의 다른 글

Tips for VIM  (0) 2013.02.21
Use gerrit with git push command.  (0) 2013.02.20
Google Site Tool : File repository  (0) 2012.10.29
Ubuntu Console mode booting  (1) 2012.08.31
switch remote/branch by repo  (0) 2012.08.30

대형 project일 경우, 모두 다 보는 것도 아니고 원하는 file만 등록하여 tagging 을 하는 것이 더 좋을 수도 있다. (ctags와 cscope을 하는데 시간도 많이 걸리고..)

원하는 file을 cscope.files 로 만든 다음, 
$ find <path> <type or name> -print > cscope.files
$ ctags -L cscope.files
$ cscope -I cscope.files

example)
$ find ./abc -name "*.[chS]" -print > cscope.files
$ find ./cdb -name "*.[chS]" -print >> cscope.files #추가할 경우
$ ctags -L cscope.files
$ cscope -I cscope.files

위와 같이 하면, 원하는 file만 등록하여 trace 할 수 있다. 



'Development Tip' 카테고리의 다른 글

switch remote/branch by repo  (0) 2012.08.30
redmine tip  (0) 2012.03.26
Ubuntu 11.10 application : Terminator  (0) 2012.02.20
Android git mirror site  (0) 2011.09.30
Per-process Namespace  (0) 2011.03.16

+ Recent posts