Search code examples
filevimprojectctags

automatically set vim ctags based on working directory


I want to automatically set vim tags based on what project i am currently working on. For example given directory /home/user/project of this structure:

├── src
│   ├── main/...
│   └── test/...
├── tags

I want vim to automatically detect that it is in this directory or one of it's subdirectories and run command

set tags=/home/user/project/tags

to set proper tags.

Is this even possible? Is this even a good idea or am i overcomplicating things and there is a better solution?


Solution

  • I was actually looking for an answer for a long time and found it within 30 mins of posting this question eh.

    set tags=tags;/
    

    solves the problem