ludovicchabant / vim-gutentags

A Vim plugin that manages your tag files
https://bolt80.com/gutentags/
MIT License
2.3k stars 175 forks source link

per-project source file config #285

Open tckmn opened 4 years ago

tckmn commented 4 years ago

I have a project where I only want to generate tags for a specific directory (src). This can be accomplished in one of two ways:

However, neither of these are currently possible with gutentags, as ctags $PROJECT_ROOT is hardcoded here.

Could some mechanism be added to tell ctags to not run on an entire project? (I am unsure of the best way to implement this while maintaining the reasonable default of indexing the whole project -- perhaps if an -L option is found in .gutctags then the CTAGS_ARGS_LAST argument should not be passed, though this seems slightly brittle/hacky.)

ludovicchabant commented 4 years ago

A clunky but workable way would be to specify --exclude= entries for everything except src inside the project's .gutctags?

Another option is to simply tell Gutentags that the project root is inside src. You can do that with a combination of g:gutentags_project_root, g:gutentags_exclude_project_root, and, if needed, by writing a custom g:gutentags_project_root_finder.