Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim tags - symbolic link

Tags:

vim

ctags

I have a project as follows:

/dir 
   dir1
   dir2 -> symbolic-link to /otherdir
       file1
   tags *
  • I want vim to use THIS tags file which includes tags for files in dir1 and dir2. When I edit file1, VIM cannot find the correct tags file.

I have the following setup in .vimrc:

set tags=tags;/

Is there a way to keep this file structure without explicitly telling VIM the absolute path to tags?

like image 785
ajpyles Avatar asked Oct 28 '25 03:10

ajpyles


1 Answers

You can append to the same ctags other tags, so for example if you want to ctag everything inside dir1 you would execute:

ctags -R *

and if you want to add some other tags from dir two:

ctags -R -a ~/path/to/dir2/*

-a is for appending.

Now what I do to always have my ctags no matter where I open my vim, is to add this line in my .vimrc:

set tags+=./tags;$HOME

this will look for tags in the current directory and will go down recursively to your home folder, if you would like it to search until the root folder or less just change $HOME for / or /path/to/root/project/

like image 108
Hassek Avatar answered Oct 30 '25 23:10

Hassek