Development Tip
Autoloading Cscope Database(cscope.out file)
Lots2Talk
2013. 2. 6. 16:23
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 한다.