Skip to content

Instantly share code, notes, and snippets.

@kalashnikov
Last active August 29, 2015 14:01
Show Gist options
  • Save kalashnikov/8bf515e0c2d6ce5e58b3 to your computer and use it in GitHub Desktop.
Save kalashnikov/8bf515e0c2d6ce5e58b3 to your computer and use it in GitHub Desktop.
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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment