ludovicchabant / vim-gutentags

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

Gutentags overwrites/removes external tags in previously existing tags file #310

Closed drdavella closed 2 years ago

drdavella commented 2 years ago

Describe the bug My project had a tags file that I had already generated prior to using gutentags. When I originally generated the tags file, I included source code from an external source tree that I also need to navigate. For example, from within my project, I ran ctags -R ./src /path/to/external/src. However, immediately after using gutentags for the first time, none of the tags for the external project are present anymore. It seems like gutentags modified the original tags file without respecting the external tags.

This isn't a huge deal because I was able to regenerate the original tags file. But I would like to be able to use gutentags, and it is not compatible with this setup.

Steps to reproduce

  1. Create tags file with tags from external project (e.g. ctags -R ./my-src /path/to/external/project)
  2. Run vim with gutentags plugin
  3. Try to navigate to tag corresponding to definition in external project

Share your setup

ludovicchabant commented 2 years ago

You can do let g:gutentags_generate_on_new = 0; in your Vim config and gutentags won't regenerate the tags file when Vim opens a file in your project.