Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use different tag files for different directories of a same workspace #337

Open
rameshsanth opened this issue Nov 20, 2022 · 1 comment

Comments

@rameshsanth
Copy link

The project I work is huge with plenty of directories & source files (C/C++/Python). My work involves a single module only on few files in a specific directory.
Currently gutentags is maintaining a single tags file in workspace root and updates it every time i modify files in a sub directory (my-module). As a result the ctags runs several gigs and takes a long time to finish, slowing down my vim experience.

I want gutentags to maintain the 2 tags file.

  • One in the workspace root that gets created just once
  • Second tags file for the directory I change the files (my-module). This file gets updated if i save files.

Can gutentags be configured to work like this ?

I can setup tags paths to include both tags file in vim.

Here is an example of the workspace I'm talking about.

workspace root
   + **tags**   << Update only once
   + linux / inc
   +         src
   +         .
   +         .
   +
   + mod1 / src
   + mod2 / src
   + my-module / inc
   +           src
   +           **tags**  <<< Update often when write to files
@ludovicchabant
Copy link
Owner

You could add some custom marker inside my-module, which you then add to g:gutentags_project_root. This would let gutentags treat your module as a separate project, and create a unique tag file for it. Alternatively you could define a custom project root finder (see g:gutentags_project_root_finder) that checks for your module, and calls gutentags#default_get_project_root as a fallback.

You might need some other custom tweaks to set tags to be both your module's tag file and the root workspace tag file -- by default, gutentags would only set one tag file per "project".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants