diff autoload/gutentags/cscope.vim @ 136:286e5b3095d0

Allow restricting tag generation to files listed by custom commands This adds a new setting, g:gutentags_file_list_command, which specifies command(s) to use to list files for which tags should be generated, instead of recursively examining all files within the project root. This is useful in projects using source control to restrict tag generation to only files tracked in the repository. This setting is conceptually similar to CtrlP's ctrlp_user_command option. This implements the feature requested in https://github.com/ludovicchabant/vim-gutentags/issues/90
author Stephen Kent <smkent@smkent.net>
date Fri, 22 Jul 2016 19:25:05 -0700
parents 99b95da1bed7
children e59321cbaff7
line wrap: on
line diff
--- a/autoload/gutentags/cscope.vim	Fri Jul 22 19:25:01 2016 -0700
+++ b/autoload/gutentags/cscope.vim	Fri Jul 22 19:25:05 2016 -0700
@@ -55,6 +55,11 @@
     let l:cmd .= ' -e ' . g:gutentags_cscope_executable
     let l:cmd .= ' -p ' . a:proj_dir
     let l:cmd .= ' -f ' . a:tags_file
+    let l:file_list_cmd =
+        \ gutentags#get_project_file_list_cmd(l:proj_dir)
+    if !empty(l:file_list_cmd)
+        let l:cmd .= ' -L "' . l:file_list_cmd . '"'
+    endif
     let l:cmd .= ' '
     let l:cmd .= gutentags#get_execute_cmd_suffix()