" if compiled with --enable-cscope if has("cscope") if exists("g:loaded_cscope_plus") || &cp finish endif let g:loaded_cscope_plus = 1.0 " cat Makefile | grep '\-I\/' | tr '[:space:]' '\n' | grep '\-I/' | sort -u | tr '\n' ' ' " build tags database with shift+F8 or alt+F8 to ignore /usr/include " --c++-kinds=+p : Adds prototypes in the database for C/C++ files. " --fields=+iaS : Adds inheritance (i), access (a) and function " signatures (S) information. " --extra=+q : Adds context to the tag name. Note: Without this " option, the script cannot get class members. command! CtagsBuild \ :!echo 'building ctags database...' ; \ ctags --fields=+iaS --extra=+q --totals -R --c++-kinds=+p && \ echo 'adding system headers...' ; \ find -exec gcc -M '{}' \; 2>&- | tr '[:space:]' '\n' | grep '^/.*' | sort -u | \ ctags --c-kinds=+px --c++-kinds=+px --fields=+iaS --extra=+q -aL- command! CtagsKernelBuild \ :!echo 'building ctags database in kernel mode...' ; \ ctags --fields=+iaS --extra=+q --totals -R --c++-kinds=+p command! CscopeBuild \ :!echo 'building cscope database...' ; \ cscope -bR command! CscopeKernelBuild \ :!echo 'building cscope database in kernel mode...' ; \ cscope -bkR if has("cscope") map :CtagsBuild:CscopeBuild:cscope reset:cscope add cscope.out map :CtagsKernelBuild:CscopeKernelBuild:cscope reset:cscope add cscope.out else map :CtagsBuild map :CtagsKernelBuild endif set tags+=./tags " in file directory set tags+=tags " in current directory "for when programming in build dir set tags+=../tags endif