diff doc/gutentags.txt @ 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 a6ef1c860d07
children 851aec42057d
line wrap: on
line diff
--- a/doc/gutentags.txt	Fri Jul 22 19:25:01 2016 -0700
+++ b/doc/gutentags.txt	Fri Jul 22 19:25:05 2016 -0700
@@ -417,6 +417,40 @@
                         See |gutentags_ctags_executable_{filetype}| for more
                         information.
 
+                                            *gutentags_file_list_command*
+g:gutentags_file_list_command
+                        Specifies command(s) to use to list files for which
+                        tags should be generated, instead of recursively
+                        examining all files within the project root. When
+                        invoked, file list commands will execute in the
+                        project root directory.
+
+                        This setting is useful in projects using source
+                        control to restrict tag generation to only files
+                        tracked in the repository.
+
+                        This variable may be set in one of two ways. If
+                        set as a |String|, the specified command will be used to
+                        list files for all projects. For example: >
+
+                         let g:gutentags_file_list_command = 'find . -type f'
+<
+                        If set as a |Dictionary|, this variable should be set
+                        as a mapping of project root markers to the desired
+                        file list command for that root marker. (See
+                        |gutentags_project_root| for how Gutentags uses root
+                        markerts to locate the project.) For example: >
+
+                         let g:gutentags_file_list_command = {
+                             \ 'markers': {
+                                 \ '.git': 'git ls-files',
+                                 \ '.hg': 'hg locate',
+                                 \ },
+                             \ }
+<
+                        Note: If a custom ctags executable is specified, it
+                        must support the '-L' command line option in order to
+                        read the list of files to be examined.
 
 =============================================================================
 5. Project Settings                             *gutentags-project-settings*