comparison 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
comparison
equal deleted inserted replaced
135:4c9e2de7d46a 136:286e5b3095d0
415 This means, for example, that you can use 415 This means, for example, that you can use
416 `g:gutentags_ctags_executable_ruby` out of the box. 416 `g:gutentags_ctags_executable_ruby` out of the box.
417 See |gutentags_ctags_executable_{filetype}| for more 417 See |gutentags_ctags_executable_{filetype}| for more
418 information. 418 information.
419 419
420 *gutentags_file_list_command*
421 g:gutentags_file_list_command
422 Specifies command(s) to use to list files for which
423 tags should be generated, instead of recursively
424 examining all files within the project root. When
425 invoked, file list commands will execute in the
426 project root directory.
427
428 This setting is useful in projects using source
429 control to restrict tag generation to only files
430 tracked in the repository.
431
432 This variable may be set in one of two ways. If
433 set as a |String|, the specified command will be used to
434 list files for all projects. For example: >
435
436 let g:gutentags_file_list_command = 'find . -type f'
437 <
438 If set as a |Dictionary|, this variable should be set
439 as a mapping of project root markers to the desired
440 file list command for that root marker. (See
441 |gutentags_project_root| for how Gutentags uses root
442 markerts to locate the project.) For example: >
443
444 let g:gutentags_file_list_command = {
445 \ 'markers': {
446 \ '.git': 'git ls-files',
447 \ '.hg': 'hg locate',
448 \ },
449 \ }
450 <
451 Note: If a custom ctags executable is specified, it
452 must support the '-L' command line option in order to
453 read the list of files to be examined.
420 454
421 ============================================================================= 455 =============================================================================
422 5. Project Settings *gutentags-project-settings* 456 5. Project Settings *gutentags-project-settings*
423 457
424 Gutentags can be customized to some extent on a per-project basis with the 458 Gutentags can be customized to some extent on a per-project basis with the