I have multiple projects (folders), and each of them has its corresponding tags generated.
I found every time I launch vim it only links to my first tags file (:set tags?
), I need to manually set the proper tags for each project.
Is there a way to configure vim so every time I launch a file in a specific project that tags gets set?
For example:
- If I launch any file
vim ~/ProjectA/src/main.cpp
will settags=~/ProjectA/tags
- similary
vim ~/ProjectB/include/header.h
will settags=~/ProjectB/tags
Thanks
:cd
there. I almost always start vim from the project root and rarely:cd
away from there.tags
contains./tags
ortags
; you can do fancier things (:h file-searching
). Andtagfiles()
for showing what's actually used. The reason is, after changing directories, vim should be able to look in the new pwd for tags (well,./tags
looks in the directory of the current file).