I am not the first one to post this issue here:
Vim: Difficulty setting up ctags. Source in subdirectories don't see tags file in project root
What does a semicolon mean in the tags option
But I am running into the following errors:
E433: No tags file
E426: tag not found
in spite of following the solution suggested in the first link above, which suits my context better.
I have a root directory /workspace/vinod which has all the git repositories that I work with.
I have a simple script in this directory, to run the ctags command recursively on any chosen repository as follows:
#!/bin/bash
CTAGS='ctags -R --tag-relative=yes --extra=+fq --verbose=yes'
read -rp "Enter repo: " repo
cd "$repo" || exit
eval "$CTAGS" || exit
After running this script for a chosen repo, I can see that the tags file is generated inside the top level directory of the repo (or repo root). The repo mostly has .cpp and .h files.
Now, I change directory to a sub-directory inside the repo, open a .cpp file and try to use ctrl + ] to go to the definition of a class, and that's when I hit the errors mentioned above.
I have tried this in multiple files within different sub-directories with the same result.
As recommended in the first link above, my .vimrc inside my home has the following:
set tags=tags;/
Can someone point out what am I missing here?
TIA