I'm using CTags and the vim-easytags plugin.

I have a Python project and a C project.

In the root of the Python project, I did

ctags -R .

And all was good. I could jump back and forth with tags in the Python project.

However, there's some keywords that exist in my other project (for instance, the variable mode exists in both). If i C-] those tags, it opens a source file from the C project and finds that tag, erroneously.

Why is CTags getting the idea to include that project in it's searches and how do I tell ctags to only pay attention to python files for python projects and C source/header files for C projects?

  • I'm not sure what your directory structure looks like, but if you do ctags -R in a parent directory of both the C project and the Python project, both will get added. I would also try giving it an absolute path to make sure you know what you're passing it.
    – Tumbler41
    Commented Dec 15, 2016 at 17:41
  • They're in totally different directories Commented Dec 15, 2016 at 18:26
  • One is in /media/share/python-prog and the other is in /home/user/FW Commented Dec 15, 2016 at 18:27
  • Do you have a different tags file for each project? If you :chdir <project root>, then you will use the tags file located at <project root>/tags. You can give us some more information about where the tags files are located? Commented Dec 16, 2016 at 6:43
  • There are two tags files. One for each project. The tags files are located in the project root directory. I launch vim from the root directory and am using NerdTREE to move around. Commented Dec 16, 2016 at 22:43


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.