I want to have my tags file generated from gutentags/ctags to be in the .git folder, because I am working on a project with other people where I don't want to edit the .gitignore file. So, I have these 2 lines in my vimrc

10 set tags^=.git/tags;
11 let g:gutentags_ctags_tagfile = '.git/tags'

However, the problem with this is that all the paths from this are still generated with respect to my root folder, so when vim tries to look for the tag it will throw the error .git/root/folder/path/file.js does not exist. Somehow I need to be able to have gutentags generate this tag file with respect to my .git directory.

New contributor
Davis Owen is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 4
    Not exactly what you want... But you can create a local gitignore file in .git/info/exclude so you don't need to add it to everyone's .gitignore. See gitignore's docs for that. – filbranden Sep 10 at 23:33
  • Does adding the following to your vimrc fix it? g:gutentags_ctags_extra_args = ['--tag-relative=no'] – Rich Sep 12 at 8:52

Your Answer

Davis Owen is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.