kalashnikov
5/16/2014 - 12:55 PM

Ruby script to create file for ctags and cscope. Save files to invoke folder.

Ruby script to create file for ctags and cscope. Save files to invoke folder.

%x[rm ~/.filelist] if File.exist?("/home/kalaexj/.filelist")
%x[rm tags] if File.exist?("tags")
%x[rm cscope.out] if File.exist?("cscope.out")

%x[find . -regex '.*/*\.h' >> /home/kalaexj/.filelist]
%x[find . -regex '.*/*\.c' >> /home/kalaexj/.filelist]
%x[find . -regex '.*/*\.cpp' >> /home/kalaexj/.filelist]
%x[ctags -R -L /home/kalaexj/.filelist -h ".h.c.cpp"]
%x[cscope -b -i /home/kalaexj/.filelist]

#
#  Please do following setting
# 
## Add 'set tags=./tags,tags;' to .vimrc
## Add 'export CSCOPE_DB="cscope.out"' to .zshrc/.bashrc
## Add 'setenv CSCOPE_DB "cscope.out"' to .cshrc
## Download cscope_maps.vim to ~/.vim/plugin/